@microsoft/teams-js 2.10.0-beta.3 → 2.10.0-beta.4
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.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MicrosoftTeams.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,iBAAkB,GAAIH,GACH,iBAAZC,QACdA,QAAwB,eAAID,IAE5BD,EAAqB,eAAIC,GAC1B,CATD,CASGK,MAAM,I,2BCHTJ,EAAQK,WA2IR,SAAoBC,GAQnB,GAPAA,EAAK,IAAMC,KAAKC,UAAY,KAAO,IAClCD,KAAKE,WACJF,KAAKC,UAAY,MAAQ,KAC1BF,EAAK,IACJC,KAAKC,UAAY,MAAQ,KAC1B,IAAMP,EAAOD,QAAQU,SAASH,KAAKI,OAE/BJ,KAAKC,UACT,OAGD,MAAMI,EAAI,UAAYL,KAAKM,MAC3BP,EAAKQ,OAAO,EAAG,EAAGF,EAAG,kBAKrB,IAAIG,EAAQ,EACRC,EAAQ,EACZV,EAAK,GAAGW,QAAQ,eAAeC,IAChB,OAAVA,IAGJH,IACc,OAAVG,IAGHF,EAAQD,GACT,IAGDT,EAAKQ,OAAOE,EAAO,EAAGJ,EACvB,EA3KAZ,EAAQmB,KA6LR,SAAcC,GACb,IACKA,EACHpB,EAAQqB,QAAQC,QAAQ,QAASF,GAEjCpB,EAAQqB,QAAQE,WAAW,QAE7B,CAAE,MAAOC,GAGT,CACD,EAvMAxB,EAAQyB,KA+MR,WACC,IAAIC,EACJ,IACCA,EAAI1B,EAAQqB,QAAQM,QAAQ,QAC7B,CAAE,MAAOH,GAGT,EAGKE,GAAwB,oBAAZE,SAA2B,QAASA,UACpDF,EAAIE,QAAQC,IAAIC,OAGjB,OAAOJ,CACR,EA7NA1B,EAAQQ,UAyGR,WAI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AAYpyB,EAAc68B,EAAWO,MACvC,CACD,CAhRD,CAAiB1F,KAAAA,GAAO,I","sources":["webpack://microsoftTeams/webpack/universalModuleDefinition","webpack://microsoftTeams/../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js","webpack://microsoftTeams/../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js","webpack://microsoftTeams/../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js","webpack://microsoftTeams/webpack/bootstrap","webpack://microsoftTeams/webpack/runtime/define property getters","webpack://microsoftTeams/webpack/runtime/hasOwnProperty shorthand","webpack://microsoftTeams/webpack/runtime/make namespace object","webpack://microsoftTeams/./src/internal/constants.ts","webpack://microsoftTeams/./src/internal/globalVars.ts","webpack://microsoftTeams/./src/internal/telemetry.ts","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/native.js","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/rng.js","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/stringify.js","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/v4.js","webpack://microsoftTeams/./src/public/interfaces.ts","webpack://microsoftTeams/./src/public/constants.ts","webpack://microsoftTeams/./src/internal/utils.ts","webpack://microsoftTeams/./src/public/runtime.ts","webpack://microsoftTeams/./src/public/authentication.ts","webpack://microsoftTeams/./src/public/dialog.ts","webpack://microsoftTeams/./src/public/menus.ts","webpack://microsoftTeams/./src/public/teamsAPIs.ts","webpack://microsoftTeams/./src/public/app.ts","webpack://microsoftTeams/./src/public/pages.ts","webpack://microsoftTeams/./src/public/version.ts","webpack://microsoftTeams/./src/internal/internalAPIs.ts","webpack://microsoftTeams/./src/internal/handlers.ts","webpack://microsoftTeams/./src/internal/communication.ts","webpack://microsoftTeams/./src/private/logs.ts","webpack://microsoftTeams/./src/private/interfaces.ts","webpack://microsoftTeams/./src/private/conversations.ts","webpack://microsoftTeams/./src/private/privateAPIs.ts","webpack://microsoftTeams/./src/internal/deepLinkConstants.ts","webpack://microsoftTeams/./src/public/appInstallDialog.ts","webpack://microsoftTeams/./src/internal/deepLinkUtilities.ts","webpack://microsoftTeams/./src/public/media.ts","webpack://microsoftTeams/./src/public/barCode.ts","webpack://microsoftTeams/./src/public/chat.ts","webpack://microsoftTeams/./src/public/geoLocation.ts","webpack://microsoftTeams/./src/internal/mediaUtil.ts","webpack://microsoftTeams/./src/public/adaptiveCards.ts","webpack://microsoftTeams/./src/public/appWindow.ts","webpack://microsoftTeams/./src/public/location.ts","webpack://microsoftTeams/./src/public/meeting.ts","webpack://microsoftTeams/./src/public/monetization.ts","webpack://microsoftTeams/./src/public/calendar.ts","webpack://microsoftTeams/./src/public/mail.ts","webpack://microsoftTeams/./src/public/people.ts","webpack://microsoftTeams/./src/public/profile.ts","webpack://microsoftTeams/./src/internal/profileUtil.ts","webpack://microsoftTeams/./src/public/video.ts","webpack://microsoftTeams/./src/public/search.ts","webpack://microsoftTeams/./src/public/sharing.ts","webpack://microsoftTeams/./src/public/stageView.ts","webpack://microsoftTeams/./src/public/webStorage.ts","webpack://microsoftTeams/./src/public/call.ts","webpack://microsoftTeams/./src/public/appInitialization.ts","webpack://microsoftTeams/./src/public/settings.ts","webpack://microsoftTeams/./src/public/publicAPIs.ts","webpack://microsoftTeams/./src/public/navigation.ts","webpack://microsoftTeams/./src/public/tasks.ts","webpack://microsoftTeams/./src/public/liveShareHost.ts","webpack://microsoftTeams/./src/private/files.ts","webpack://microsoftTeams/./src/private/meetingRoom.ts","webpack://microsoftTeams/./src/private/notifications.ts","webpack://microsoftTeams/./src/private/remoteCamera.ts","webpack://microsoftTeams/./src/private/appEntity.ts","webpack://microsoftTeams/./src/private/teams.ts","webpack://microsoftTeams/./src/private/videoEx.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"microsoftTeams\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"microsoftTeams\"] = factory();\n\telse\n\t\troot[\"microsoftTeams\"] = factory();\n})(self, () => {\nreturn ","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * @hidden\n * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.\n * 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.\n * Mobile clients are passing versions, hence will be applicable to web and desktop clients only.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const defaultSDKVersionForCompatCheck = '2.0.1';\n\n/**\n * @hidden\n * This is the client version when selectMedia API - VideoAndImage is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const videoAndImageMediaAPISupportVersion = '2.0.2';\n\n/**\n * @hidden\n * This is the client version when selectMedia API - Video with non-full screen mode is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const nonFullScreenVideoModeAPISupportVersion = '2.0.3';\n\n/**\n * @hidden\n * This is the client version when selectMedia API - ImageOutputFormats is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const imageOutputFormatsAPISupportVersion = '2.0.4';\n\n/**\n * @hidden\n * Minimum required client supported version for {@link getUserJoinedTeams} to be supported on {@link HostClientType.android}\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const getUserJoinedTeamsSupportedAndroidClientVersion = '2.0.1';\n\n/**\n * @hidden\n * This is the client version when location APIs (getLocation and showLocation) are supported.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const locationAPIsRequiredVersion = '1.9.0';\n\n/**\n * @hidden\n * This is the client version when permisisons are supported\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const permissionsAPIsRequiredVersion = '2.0.1';\n\n/**\n * @hidden\n * This is the client version when people picker API is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const peoplePickerRequiredVersion = '2.0.0';\n\n/**\n * @hidden\n * This is the client version when captureImage API is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const captureImageMobileSupportVersion = '1.7.0';\n\n/**\n * @hidden\n * This is the client version when media APIs are supported on all three platforms ios, android and web.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const mediaAPISupportVersion = '1.8.0';\n\n/**\n * @hidden\n * This is the client version when getMedia API is supported via Callbacks on all three platforms ios, android and web.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const getMediaCallbackSupportVersion = '2.0.0';\n\n/**\n * @hidden\n * This is the client version when scanBarCode API is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const scanBarCodeAPIMobileSupportVersion = '1.9.0';\n\n/**\n * @hidden\n * List of supported Host origins\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const validOrigins = [\n 'teams.microsoft.com',\n 'teams.microsoft.us',\n 'gov.teams.microsoft.us',\n 'dod.teams.microsoft.us',\n 'int.teams.microsoft.com',\n 'teams.live.com',\n 'devspaces.skype.com',\n 'ssauth.skype.com',\n 'local.teams.live.com', // local development\n 'local.teams.live.com:8080', // local development\n 'local.teams.office.com', // local development\n 'local.teams.office.com:8080', // local development\n 'msft.spoppe.com',\n '*.sharepoint.com',\n '*.sharepoint-df.com',\n '*.sharepointonline.com',\n 'outlook.office.com',\n 'outlook-sdf.office.com',\n 'outlook.office365.com',\n 'outlook-sdf.office365.com',\n 'outlook.live.com',\n 'outlook-sdf.live.com',\n '*.teams.microsoft.com',\n '*.www.office.com',\n 'www.office.com',\n 'word.office.com',\n 'excel.office.com',\n 'powerpoint.office.com',\n 'www.officeppe.com',\n '*.www.microsoft365.com',\n 'www.microsoft365.com',\n];\n\n/**\n * @hidden\n * USer specified message origins should satisfy this test\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const userOriginUrlValidationRegExp = /^https:\\/\\//;\n\n/**\n * @hidden\n * The protocol used for deep links into Teams\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const teamsDeepLinkProtocol = 'https';\n\n/**\n * @hidden\n * The host used for deep links into Teams\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const teamsDeepLinkHost = 'teams.microsoft.com';\n\n/** @hidden */\nexport const errorLibraryNotInitialized = 'The library has not yet been initialized';\n\n/** @hidden */\nexport const errorRuntimeNotInitialized = 'The runtime has not yet been initialized';\n\n/** @hidden */\nexport const errorRuntimeNotSupported = 'The runtime version is not supported';\n","import { FrameContexts } from '../public';\nexport class GlobalVars {\n public static initializeCalled = false;\n public static initializeCompleted = false;\n public static additionalValidOrigins: string[] = [];\n public static initializePromise: Promise<void>;\n public static isFramelessWindow = false;\n public static frameContext: FrameContexts;\n public static hostClientType: string;\n public static clientSupportedSDKVersion: string;\n public static printCapabilityEnabled = false;\n}\n","import { debug as registerLogger, Debugger } from 'debug';\n\nconst topLevelLogger = registerLogger('teamsJs');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace\n */\nexport function getLogger(namespace: string): Debugger {\n return topLevelLogger.extend(namespace);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","/* eslint-disable @typescript-eslint/no-explicit-any*/\n\nimport { ChannelType, DialogDimension, HostClientType, HostName, TeamType, UserTeamRole } from './constants';\nimport { FrameContexts } from './constants';\n\n/**\n * Represents information about tabs for an app\n */\nexport interface TabInformation {\n teamTabs: TabInstance[];\n}\n\n/**\n * Represents information about a tab instance\n */\nexport interface TabInstance {\n /**\n * The name of the tab\n */\n tabName: string;\n\n /**\n * @internal\n * Limited to Microsoft-internal use\n * @protected\n */\n internalTabInstanceId?: string;\n\n /**\n * Last viewed time of this tab. null means unknown\n */\n lastViewUnixEpochTime?: string;\n\n /**\n * The developer-defined unique ID for the entity this content points to.\n */\n entityId?: string;\n\n /**\n * The Microsoft Teams ID for the channel with which the content is associated.\n */\n channelId?: string;\n\n /**\n * The name for the channel with which the content is associated.\n */\n channelName?: string;\n\n /**\n * Is this tab in a favorite channel?\n */\n channelIsFavorite?: boolean;\n\n /**\n * The Microsoft Teams ID for the team with which the content is associated.\n */\n teamId?: string;\n\n /**\n * The name for the team with which the content is associated.\n */\n teamName?: string;\n\n /**\n * Is this tab in a favorite team?\n */\n teamIsFavorite?: boolean;\n\n /**\n * The Office 365 group ID for the team with which the content is associated.\n * This field is available only when the identity permission is requested in the manifest.\n */\n groupId?: string;\n\n /**\n * Content URL of this tab\n */\n url?: string;\n\n /**\n * Website URL of this tab\n */\n websiteUrl?: string;\n}\n\n/**\n * Indicates information about the tab instance for filtering purposes.\n */\nexport interface TabInstanceParameters {\n /**\n * Flag allowing to select favorite channels only\n */\n favoriteChannelsOnly?: boolean;\n\n /**\n * Flag allowing to select favorite teams only\n */\n favoriteTeamsOnly?: boolean;\n}\n\n/**\n * Represents Team Information\n */\nexport interface TeamInformation {\n /**\n * Id of the team\n */\n teamId: string;\n\n /**\n * Team display name\n */\n teamName: string;\n\n /**\n * Team description\n */\n teamDescription?: string;\n\n /**\n * Thumbnail Uri\n */\n thumbnailUri?: string;\n\n /**\n * The Office 365 group ID for the team with which the content is associated.\n * This field is available only when the identity permission is requested in the manifest.\n */\n groupId?: string;\n\n /**\n * Role of current user in the team\n */\n userTeamRole?: UserTeamRole;\n\n /**\n * The type of the team.\n */\n teamType?: TeamType;\n\n /**\n * The locked status of the team\n */\n isTeamLocked?: boolean;\n\n /**\n * The archived status of the team\n */\n isTeamArchived?: boolean;\n}\n\n/**\n * Represents OS locale info used for formatting date and time data\n */\nexport interface LocaleInfo {\n platform: 'windows' | 'macos';\n regionalFormat: string;\n shortDate: string;\n longDate: string;\n shortTime: string;\n longTime: string;\n}\n\n/**\n * Allowed user file open preferences\n */\nexport enum FileOpenPreference {\n Inline = 'inline',\n Desktop = 'desktop',\n Web = 'web',\n}\n\n/**\n * Possible Action Types\n *\n * @beta\n */\nexport enum ActionObjectType {\n M365Content = 'm365content',\n}\n\n/**\n * Data pertaining to object(s) the action is being performed on\n *\n * @param T The type of action being implemented\n *\n * @beta\n */\nexport interface BaseActionObject<T extends ActionObjectType> {\n type: T;\n}\n\n/**\n * Stores information needed to represent M365 Content stored\n * in OneDrive or Sharepoint\n *\n * @beta\n */\nexport interface M365ContentAction extends BaseActionObject<ActionObjectType.M365Content> {\n /**\n * Only office content IDs are passed to the app. Apps should use these ids\n * to query the Microsoft graph for more details.\n */\n itemId: string;\n secondaryId?: SecondaryId;\n}\n\n/**\n * Contains information on what Graph item is being queried\n *\n * @beta\n */\nexport interface SecondaryId {\n name: SecondaryM365ContentIdName;\n value: string;\n}\n\n/**\n * These correspond with field names in the MSGraph\n *\n * @beta\n */\nexport enum SecondaryM365ContentIdName {\n DriveId = 'driveId',\n GroupId = 'groupId',\n SiteId = 'siteId',\n UserId = 'userId',\n}\n\n/**\n * Information common to all actions\n *\n * @beta\n */\nexport interface ActionInfo {\n /**\n * Maps to the action id supplied inside the manifest\n */\n actionId: string;\n /**\n * Array of corresponding action objects\n */\n actionObjects: BaseActionObject<ActionObjectType>[];\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use the {@link app.Context} interface and its updated properties instead.\n *\n * @remarks\n * For more details about the updated {@link app.Context} interface, visit the\n * [Teams JavaScript client SDK](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/using-teams-client-sdk#updates-to-the-context-interface)\n * overview article.\n *\n * Represents the structure of the received context message.\n */\nexport interface Context {\n /**\n * @deprecated\n * As of 2.0.0, please use {@link ActionInfo | app.Context.actionInfo} instead\n *\n * Common information applicable to all content actions\n */\n actionInfo?: ActionInfo;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.groupId | app.Context.team.groupId} instead\n *\n * The Office 365 group ID for the team with which the content is associated.\n * This field is available only when the identity permission is requested in the manifest.\n */\n groupId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.internalId | app.Context.team.internalId} instead\n *\n * The Microsoft Teams ID for the team with which the content is associated.\n */\n teamId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.displayName | app.Context.team.displayName} instead\n *\n * The name for the team with which the content is associated.\n */\n teamName?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.id | app.Context.channel.id} instead\n *\n * The Microsoft Teams ID for the channel with which the content is associated.\n */\n channelId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.displayName | app.Context.channel.displayName} instead\n *\n * The name for the channel with which the content is associated.\n */\n channelName?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.membershipType | app.Context.channel.membershipType} instead\n *\n * The type of the channel with which the content is associated.\n */\n channelType?: ChannelType;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.PageInfo.id | app.Context.page.id} instead\n *\n * The developer-defined unique ID for the entity this content points to.\n */\n entityId: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.PageInfo.subPageId | app.Context.page.subPageId} instead\n *\n * The developer-defined unique ID for the sub-entity this content points to.\n * This field should be used to restore to a specific state within an entity,\n * such as scrolling to or activating a specific piece of content.\n */\n subEntityId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.locale | app.Context.app.locale} instead\n *\n * The current locale that the user has configured for the app formatted as\n * languageId-countryId (for example, en-us).\n */\n locale: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.osLocaleInfo | app.Context.app.osLocaleInfo} instead\n *\n * More detailed locale info from the user's OS if available. Can be used together with\n * the @microsoft/globe NPM package to ensure your app respects the user's OS date and\n * time format configuration\n */\n osLocaleInfo?: LocaleInfo;\n\n /**\n * @deprecated\n *\n * As of 2.0.0, please use {@link app.UserInfo.loginHint | app.Context.user.loginHint} or\n * {@link app.UserInfo.userPrincipalName | app.Context.user.userPrincipalName} instead.\n * The UPN of the current user.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n upn?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TenantInfo.id | app.Context.user.tenant.id} instead\n *\n * The Azure AD tenant ID of the current user.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n tid?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.theme | app.Context.app.theme} instead\n *\n * The current UI theme.\n */\n theme?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.PageInfo.isFullScreen | app.Context.page.isFullScreen} instead\n *\n * Indication whether the tab is in full-screen mode.\n */\n isFullScreen?: boolean;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.type | app.Context.team.type} instead\n *\n * The type of the team.\n */\n teamType?: TeamType;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.SharePointSiteInfo.teamSiteUrl | app.Context.sharePointSite.teamSiteUrl} instead\n *\n * The root SharePoint site associated with the team.\n */\n teamSiteUrl?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.SharePointSiteInfo.teamSiteDomain | app.Context.sharePointSite.teamSiteDomain} instead\n *\n * The domain of the root SharePoint site associated with the team.\n */\n teamSiteDomain?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.SharePointSiteInfo.teamSitePath | app.Context.sharePointSite.teamSitePath} instead\n *\n * The relative path to the SharePoint site associated with the team.\n */\n teamSitePath?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.ownerTenantId | app.Context.channel.ownerTenantId} instead\n *\n * The tenant ID of the host team.\n */\n hostTeamTenantId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.ownerGroupId | app.Context.channel.ownerGroupId} instead\n *\n * The AAD group ID of the host team.\n */\n hostTeamGroupId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.relativeUrl | app.Context.channel.relativeUrl} instead\n *\n * The relative path to the SharePoint folder associated with the channel.\n */\n channelRelativeUrl?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppHostInfo.sessionId | app.Context.app.host.sessionId} instead\n *\n * Unique ID for the current Teams session for use in correlating telemetry data.\n */\n sessionId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.userRole | app.Context.team.userRole} instead\n *\n * The user's role in the team.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to the user's role, and never as proof of her role.\n */\n userTeamRole?: UserTeamRole;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChatInfo.id | app.Context.chat.id} instead\n *\n * The Microsoft Teams ID for the chat with which the content is associated.\n */\n chatId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.loginHint | app.Context.user.loginHint} instead\n *\n * A value suitable for use as a login_hint when authenticating with Azure AD.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n loginHint?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.userPrincipalName | app.Context.user.userPrincipalName} instead\n *\n * The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users).\n * Because a malicious party run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n userPrincipalName?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.id | app.Context.user.id} instead\n *\n * The Azure AD object id of the current user.\n * Because a malicious party run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n userObjectId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.isArchived | app.Context.team.isArchived} instead\n *\n * Indicates whether team is archived.\n * Apps should use this as a signal to prevent any changes to content associated with archived teams.\n */\n isTeamArchived?: boolean;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppHostInfo.name | app.Context.app.host.name} instead\n *\n * The name of the host client. Possible values are: Office, Orange, Outlook, Teams\n */\n hostName?: HostName;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppHostInfo.clientType | app.Context.app.host.clientType} instead\n *\n * The type of the host client. Possible values are : android, ios, web, desktop, rigel(deprecated, use teamsRoomsWindows instead),\n * surfaceHub, teamsRoomsWindows, teamsRoomsAndroid, teamsPhones, teamsDisplays\n */\n hostClientType?: HostClientType;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.PageInfo.frameContext | app.Context.page.frameContext} instead\n *\n * The context where tab url is loaded (content, task, setting, remove, sidePanel)\n */\n frameContext?: FrameContexts;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.Context | app.Context.sharepoint} instead\n *\n * SharePoint context. This is only available when hosted in SharePoint.\n */\n sharepoint?: any;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TenantInfo.teamsSku | app.Context.tenant.teamsSku} instead\n *\n * The type of license for the current users tenant.\n */\n tenantSKU?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.licenseType | app.Context.user.licenseType} instead\n *\n * The license type for the current user.\n */\n userLicenseType?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.parentMessageId | app.Context.app.parentMessageId} instead\n *\n * The ID of the parent message from which this task module was launched.\n * This is only available in task modules launched from bot cards.\n */\n parentMessageId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppHostInfo.ringId | app.Context.app.host.ringId} instead\n *\n * Current ring ID\n */\n ringId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.sessionId | app.Context.app.sessionId} instead\n *\n * Unique ID for the current session for use in correlating telemetry data.\n */\n appSessionId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.appLaunchId | app.Context.app.appLaunchId} instead\n *\n * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data``\n */\n appLaunchId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.isCallingAllowed | app.Context.user.isCallingAllowed} instead\n *\n * Represents whether calling is allowed for the current logged in User\n */\n isCallingAllowed?: boolean;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.isPSTNCallingAllowed | app.Context.user.isPSTNCallingAllowed} instead\n *\n * Represents whether PSTN calling is allowed for the current logged in User\n */\n isPSTNCallingAllowed?: boolean;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.MeetingInfo.id | app.Context.meeting.id} instead\n *\n * Meeting Id used by tab when running in meeting context\n */\n meetingId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.defaultOneNoteSectionId | app.Context.channel.defaultOneNoteSectionId} instead\n *\n * The OneNote section ID that is linked to the channel.\n */\n defaultOneNoteSectionId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.PageInfo.isMultiWindow | app.Context.page.isMultiWindow} instead\n *\n * Indication whether the tab is in a pop out window\n */\n isMultiWindow?: boolean;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.iconPositionVertical | app.Context.app.iconPositionVertical} instead\n *\n * Personal app icon y coordinate position\n */\n appIconPosition?: number;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.PageInfo.sourceOrigin | app.Context.page.sourceOrigin} instead\n *\n * Source origin from where the tab is opened\n */\n sourceOrigin?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.userClickTime | app.Context.app.userClickTime} instead\n *\n * Time when the user clicked on the tab\n */\n userClickTime?: number;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.templateId | app.Context.team.templateId} instead\n *\n * Team Template ID if there was a Team Template associated with the creation of the team.\n */\n teamTemplateId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.userFileOpenPreference | app.Context.app.userFileOpenPreference} instead\n *\n * Where the user prefers the file to be opened from by default during file open\n */\n userFileOpenPreference?: FileOpenPreference;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.displayName | app.Context.user.displayName} instead\n *\n * The address book name of the current user.\n */\n userDisplayName?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.SharePointSiteInfo.teamSiteId | app.Context.sharePointSite.teamSiteId} instead\n *\n * Teamsite ID, aka sharepoint site id.\n */\n teamSiteId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.SharePointSiteInfo.mySiteDomain | app.Context.sharePointSite.mySiteDomain} instead\n *\n * The SharePoint my site domain associated with the user.\n */\n mySiteDomain?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.SharePointSiteInfo.mySitePath | app.Context.sharePointSite.mySitePath} instead\n *\n * The SharePoint relative path to the current users mysite\n */\n mySitePath?: string;\n}\n\nexport interface ShareDeepLinkParameters {\n /**\n * The developer-defined unique ID for the sub-page to which this deep link points in the current page.\n * This field should be used to restore to a specific state within a page, such as scrolling to or activating a specific piece of content.\n */\n subPageId: string;\n\n /**\n * The label for the sub-page that should be displayed when the deep link is rendered in a client.\n */\n subPageLabel: string;\n\n /**\n * The fallback URL to which to navigate the user if the client cannot render the page.\n * This URL should lead directly to the sub-entity.\n */\n subPageWebUrl?: string;\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link ShareDeepLinkParameters} instead.\n */\nexport interface DeepLinkParameters {\n /**\n * The developer-defined unique ID for the sub-entity to which this deep link points in the current entity.\n * This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.\n */\n subEntityId: string;\n\n /**\n * The label for the sub-entity that should be displayed when the deep link is rendered in a client.\n */\n subEntityLabel: string;\n\n /**\n * The fallback URL to which to navigate the user if the client cannot render the page.\n * This URL should lead directly to the sub-entity.\n */\n subEntityWebUrl?: string;\n}\n\n/**\n * @hidden\n * Shared Dialog Properties\n */\nexport interface BaseDialogInfo {\n /*\n * The requested size of the dialog\n */\n size: DialogSize;\n\n /**\n * Title of the dialog module.\n */\n title?: string;\n}\n\n/**\n * Data structure to describe dialog information needed to open an Adaptive Card-based dialog.\n */\nexport interface AdaptiveCardDialogInfo extends BaseDialogInfo {\n /**\n * JSON defining an Adaptive Card.\n */\n card: string;\n}\n\n/**\n * Data structure to describe dialog information needed to open a bot-based Adaptive Card-based dialog.\n */\nexport interface BotAdaptiveCardDialogInfo extends AdaptiveCardDialogInfo {\n /**\n * Specifies a bot ID to send the result of the user's interaction with the dialog module.\n * The bot will receive a task/complete invoke event with a JSON object\n * in the event payload.\n */\n completionBotId: string;\n}\n\n/**\n * Data structure to represent the size of a dialog\n */\nexport interface DialogSize {\n /**\n * The requested height of the webview/iframe.\n */\n height: DialogDimension | number;\n\n /**\n * The requested width of the webview/iframe.\n */\n width: DialogDimension | number;\n}\n\n/**\n * Data structure to describe dialog information needed to open a url-based dialog.\n */\nexport interface UrlDialogInfo extends BaseDialogInfo {\n /**\n * The url to be rendered in the webview/iframe.\n *\n * @remarks\n * The domain of the url must match at least one of the\n * valid domains specified in the [validDomains block](https://learn.microsoft.com/microsoftteams/platform/resources/schema/manifest-schema#validdomains) of the app manifest\n */\n url: string;\n\n /**\n * If client doesnt support the URL, the URL that needs to be opened in the browser.\n */\n fallbackUrl?: string;\n}\n\n/**\n * Data structure to describe dialog information needed to open a bot based dialog.\n */\nexport interface BotUrlDialogInfo extends UrlDialogInfo {\n /**\n * Specifies a bot ID to send the result of the user's interaction with the task module.\n * The bot will receive a task/complete invoke event with a JSON object\n * in the event payload.\n */\n completionBotId: string;\n}\n\n/**\n * Data structure to describe dialog information\n */\nexport interface DialogInfo {\n /**\n * The url to be rendered in the webview/iframe.\n *\n * @remarks\n * The domain of the url must match at least one of the\n * valid domains specified in the validDomains block of the manifest\n */\n url?: string;\n\n /**\n * JSON defining an adaptive card.\n */\n card?: string;\n\n /**\n * The requested height of the webview/iframe.\n */\n height?: DialogDimension | number;\n\n /**\n * The requested width of the webview/iframe.\n */\n width?: DialogDimension | number;\n\n /**\n * Title of the task module.\n */\n title?: string;\n\n /**\n * If client doesnt support the URL, the URL that needs to be opened in the browser.\n */\n fallbackUrl?: string;\n\n /**\n * Specifies a bot ID to send the result of the user's interaction with the task module.\n * If specified, the bot will receive a task/complete invoke event with a JSON object\n * in the event payload.\n */\n completionBotId?: string;\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link DialogInfo} instead.\n */\nexport type TaskInfo = DialogInfo;\n\nexport interface DialogSize {\n height: DialogDimension | number;\n width: DialogDimension | number;\n}\n/**\n * @beta\n * Data structure to be used with the {@link teamsCore.registerOnLoadHandler teamsCore.registerOnLoadHandler(handler: (context: LoadContext) => void): void} to pass the context to the app.\n */\nexport interface LoadContext {\n /**\n * The entity that is requested to be loaded\n */\n entityId: string;\n\n /**\n * The content URL that is requested to be loaded\n */\n contentUrl: string;\n}\n\nexport interface FrameInfo {\n /**\n * The current URL that needs to be used in the iframe if the tab is reloaded\n */\n contentUrl: string;\n\n /**\n * The current URL that needs to be used for opening the website when the user clicks on 'Go to website'\n */\n websiteUrl: string;\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link FrameInfo} instead.\n */\nexport type FrameContext = FrameInfo;\n\nexport interface SdkError {\n /**\n error code\n */\n errorCode: ErrorCode;\n /**\n Optional description for the error. This may contain useful information for web-app developers.\n This string will not be localized and is not for end-user consumption. \n App should not depend on the string content. The exact value may change. This is only for debugging purposes.\n */\n message?: string;\n}\n\nexport enum ErrorCode {\n /**\n * API not supported in the current platform.\n */\n NOT_SUPPORTED_ON_PLATFORM = 100,\n /**\n * Internal error encountered while performing the required operation.\n */\n INTERNAL_ERROR = 500,\n /**\n * API is not supported in the current context\n */\n NOT_SUPPORTED_IN_CURRENT_CONTEXT = 501,\n /**\n Permissions denied by user\n */\n PERMISSION_DENIED = 1000,\n /**\n * Network issue\n */\n NETWORK_ERROR = 2000,\n /**\n * Underlying hardware doesn't support the capability\n */\n NO_HW_SUPPORT = 3000,\n /**\n * One or more arguments are invalid\n */\n INVALID_ARGUMENTS = 4000,\n /**\n * User is not authorized for this operation\n */\n UNAUTHORIZED_USER_OPERATION = 5000,\n /**\n * Could not complete the operation due to insufficient resources\n */\n INSUFFICIENT_RESOURCES = 6000,\n /**\n * Platform throttled the request because of API was invoked too frequently\n */\n THROTTLE = 7000,\n /**\n * User aborted the operation\n */\n USER_ABORT = 8000,\n /**\n * Could not complete the operation in the given time interval\n */\n OPERATION_TIMED_OUT = 8001,\n /**\n * Platform code is old and doesn't implement this API\n */\n OLD_PLATFORM = 9000,\n /**\n * The file specified was not found on the given location\n */\n FILE_NOT_FOUND = 404,\n /**\n * The return value is too big and has exceeded our size boundries\n */\n SIZE_EXCEEDED = 10000,\n}\n\n/** @hidden */\nexport enum DevicePermission {\n GeoLocation = 'geolocation',\n Media = 'media',\n}\n\n/** @hidden */\nexport interface HostVersionsInfo {\n adaptiveCardSchemaVersion?: AdaptiveCardVersion;\n}\n\n/**\n * Represents the major and minor versions of the Adaptive Card schema in the current host\n */\nexport interface AdaptiveCardVersion {\n majorVersion: number;\n minorVersion: number;\n}\n","export enum HostClientType {\n desktop = 'desktop',\n web = 'web',\n android = 'android',\n ios = 'ios',\n ipados = 'ipados',\n /**\n * @deprecated\n * As of 2.0.0, please use {@link teamsRoomsWindows} instead.\n */\n rigel = 'rigel',\n surfaceHub = 'surfaceHub',\n teamsRoomsWindows = 'teamsRoomsWindows',\n teamsRoomsAndroid = 'teamsRoomsAndroid',\n teamsPhones = 'teamsPhones',\n teamsDisplays = 'teamsDisplays',\n}\n\nexport enum HostName {\n /**\n * Office.com and Office Windows App\n */\n office = 'Office',\n\n /**\n * For \"desktop\" specifically, this refers to the new, pre-release version of Outlook for Windows.\n * Also used on other platforms that map to a single Outlook client.\n */\n outlook = 'Outlook',\n\n /**\n * Outlook for Windows: the classic, native, desktop client\n */\n outlookWin32 = 'OutlookWin32',\n\n /**\n * Microsoft-internal test Host\n */\n orange = 'Orange',\n\n /**\n * Teams\n */\n teams = 'Teams',\n\n /**\n * Modern Teams\n */\n teamsModern = 'TeamsModern',\n}\n\n// Ensure these declarations stay in sync with the framework.\nexport enum FrameContexts {\n settings = 'settings',\n content = 'content',\n authentication = 'authentication',\n remove = 'remove',\n task = 'task',\n sidePanel = 'sidePanel',\n stage = 'stage',\n meetingStage = 'meetingStage',\n}\n\n/**\n * Indicates the team type, currently used to distinguish between different team\n * types in Office 365 for Education (team types 1, 2, 3, and 4).\n */\nexport enum TeamType {\n Standard = 0,\n Edu = 1,\n Class = 2,\n Plc = 3,\n Staff = 4,\n}\n\n/**\n * Indicates the various types of roles of a user in a team.\n */\nexport enum UserTeamRole {\n Admin = 0,\n User = 1,\n Guest = 2,\n}\n\n/**\n * Dialog module dimension enum\n */\nexport enum DialogDimension {\n Large = 'large',\n Medium = 'medium',\n Small = 'small',\n}\n\nimport { AdaptiveCardVersion, ErrorCode, SdkError } from './interfaces';\n/**\n * @deprecated\n * As of 2.0.0, please use {@link DialogDimension} instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport import TaskModuleDimension = DialogDimension;\n\n/**\n * The type of the channel with which the content is associated.\n */\nexport enum ChannelType {\n Regular = 'Regular',\n Private = 'Private',\n Shared = 'Shared',\n}\n\nexport const errorNotSupportedOnPlatform: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\n\n/**\n * @hidden\n *\n * Minimum Adaptive Card version supported by the host.\n */\nexport const minAdaptiveCardVersion: AdaptiveCardVersion = { majorVersion: 1, minorVersion: 5 };\n","/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport * as uuid from 'uuid';\n\nimport { GlobalVars } from '../internal/globalVars';\nimport { minAdaptiveCardVersion } from '../public/constants';\nimport { AdaptiveCardVersion, SdkError } from '../public/interfaces';\nimport { pages } from '../public/pages';\nimport { validOrigins } from './constants';\n\n/**\n * @param pattern - reference pattern\n * @param host - candidate string\n * @returns returns true if host matches pre-know valid pattern\n *\n * @example\n * validateHostAgainstPattern('*.teams.microsoft.com', 'subdomain.teams.microsoft.com') returns true\n * validateHostAgainstPattern('teams.microsoft.com', 'team.microsoft.com') returns false\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction validateHostAgainstPattern(pattern: string, host: string): boolean {\n if (pattern.substring(0, 2) === '*.') {\n const suffix = pattern.substring(1);\n if (\n host.length > suffix.length &&\n host.split('.').length === suffix.split('.').length &&\n host.substring(host.length - suffix.length) === suffix\n ) {\n return true;\n }\n } else if (pattern === host) {\n return true;\n }\n return false;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateOrigin(messageOrigin: URL): boolean {\n // Check whether the url is in the pre-known allowlist or supplied by user\n if (messageOrigin.protocol !== 'https:') {\n return false;\n }\n const messageOriginHost = messageOrigin.host;\n\n if (validOrigins.some((pattern) => validateHostAgainstPattern(pattern, messageOriginHost))) {\n return true;\n }\n\n for (const domainOrPattern of GlobalVars.additionalValidOrigins) {\n const pattern = domainOrPattern.substring(0, 8) === 'https://' ? domainOrPattern.substring(8) : domainOrPattern;\n if (validateHostAgainstPattern(pattern, messageOriginHost)) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function getGenericOnCompleteHandler(errorMessage?: string): (success: boolean, reason?: string) => void {\n return (success: boolean, reason: string): void => {\n if (!success) {\n throw new Error(errorMessage ? errorMessage : reason);\n }\n };\n}\n\n/**\n * @hidden\n * Compares SDK versions.\n *\n * @param v1 - first version\n * @param v2 - second version\n * @returns NaN in case inputs are not in right format\n * -1 if v1 < v2\n * 1 if v1 > v2\n * 0 otherwise\n * @example\n * compareSDKVersions('1.2', '1.2.0') returns 0\n * compareSDKVersions('1.2a', '1.2b') returns NaN\n * compareSDKVersions('1.2', '1.3') returns -1\n * compareSDKVersions('2.0', '1.3.2') returns 1\n * compareSDKVersions('2.0', 2.0) returns NaN\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function compareSDKVersions(v1: string, v2: string): number {\n if (typeof v1 !== 'string' || typeof v2 !== 'string') {\n return NaN;\n }\n\n const v1parts = v1.split('.');\n const v2parts = v2.split('.');\n\n function isValidPart(x: string): boolean {\n // input has to have one or more digits\n // For ex - returns true for '11', false for '1a1', false for 'a', false for '2b'\n return /^\\d+$/.test(x);\n }\n\n if (!v1parts.every(isValidPart) || !v2parts.every(isValidPart)) {\n return NaN;\n }\n\n // Make length of both parts equal\n while (v1parts.length < v2parts.length) {\n v1parts.push('0');\n }\n while (v2parts.length < v1parts.length) {\n v2parts.push('0');\n }\n\n for (let i = 0; i < v1parts.length; ++i) {\n if (Number(v1parts[i]) == Number(v2parts[i])) {\n continue;\n } else if (Number(v1parts[i]) > Number(v2parts[i])) {\n return 1;\n } else {\n return -1;\n }\n }\n return 0;\n}\n\n/**\n * @hidden\n * Generates a GUID\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function generateGUID(): string {\n return uuid.v4();\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function deepFreeze<T extends object>(obj: T): T {\n Object.keys(obj).forEach((prop) => {\n if (typeof obj[prop] === 'object') {\n deepFreeze(obj[prop]);\n }\n });\n return Object.freeze(obj);\n}\n\n/**\n * @hidden\n * The following type definitions will be used in the\n * utility functions below, which help in transforming the\n * promises to support callbacks for backward compatibility\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport type ErrorResultCallback<T> = (err?: SdkError, result?: T) => void;\nexport type ErrorResultNullCallback<T> = (err: SdkError | null, result: T | null) => void;\nexport type ErrorBooleanResultCallback = (err?: SdkError, result?: boolean) => void;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type InputFunction<T> = (...args: any[]) => Promise<T>;\nexport type ResultCallback<T> = (result?: T) => void;\nexport type SdkErrorCallback = ResultCallback<SdkError | null>;\n\n/**\n * This utility function is used when the result of the promise is same as the result in the callback.\n * @param funcHelper\n * @param callback\n * @param args\n * @returns\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callCallbackWithErrorOrResultFromPromiseAndReturnPromise<T>(\n funcHelper: InputFunction<T>,\n callback?: ErrorResultCallback<T>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n): Promise<T> {\n const p = funcHelper(...args);\n p.then((result: T) => {\n if (callback) {\n callback(undefined, result);\n }\n }).catch((e: SdkError) => {\n if (callback) {\n callback(e);\n }\n });\n return p;\n}\n\n/**\n * This utility function is used when the return type of the promise is usually void and\n * the result in the callback is a boolean type (true for success and false for error)\n * @param funcHelper\n * @param callback\n * @param args\n * @returns\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callCallbackWithErrorOrBooleanFromPromiseAndReturnPromise<T>(\n funcHelper: InputFunction<T>,\n callback?: ErrorBooleanResultCallback,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n): Promise<T> {\n const p = funcHelper(...args);\n p.then(() => {\n if (callback) {\n callback(undefined, true);\n }\n }).catch((e: SdkError) => {\n if (callback) {\n callback(e, false);\n }\n });\n return p;\n}\n\n/**\n * This utility function is called when the callback has only Error/SdkError as the primary argument.\n * @param funcHelper\n * @param callback\n * @param args\n * @returns\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callCallbackWithSdkErrorFromPromiseAndReturnPromise<T>(\n funcHelper: InputFunction<T>,\n callback?: SdkErrorCallback,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n): Promise<T> {\n const p = funcHelper(...args);\n p.then(() => {\n if (callback) {\n callback(null);\n }\n }).catch((e: SdkError) => {\n if (callback) {\n callback(e);\n }\n });\n return p;\n}\n\n/**\n * This utility function is used when the result of the promise is same as the result in the callback.\n * @param funcHelper\n * @param callback\n * @param args\n * @returns\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise<T>(\n funcHelper: InputFunction<T>,\n callback?: ErrorResultNullCallback<T>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n): Promise<T> {\n const p = funcHelper(...args);\n p.then((result: T) => {\n if (callback) {\n callback(null, result);\n }\n }).catch((e: SdkError) => {\n if (callback) {\n callback(e, null);\n }\n });\n return p;\n}\n\n/**\n * A helper function to add a timeout to an asynchronous operation.\n *\n * @param action Action to wrap the timeout around\n * @param timeoutInMs Timeout period in milliseconds\n * @param timeoutError Error to reject the promise with if timeout elapses before the action completed\n * @returns A promise which resolves to the result of provided action or rejects with a provided timeout error\n * if the initial action didn't complete within provided timeout.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function runWithTimeout<TResult, TError>(\n action: () => Promise<TResult>,\n timeoutInMs: number,\n timeoutError: TError,\n): Promise<TResult> {\n return new Promise((resolve, reject) => {\n const timeoutHandle = setTimeout(reject, timeoutInMs, timeoutError);\n action()\n .then((result) => {\n clearTimeout(timeoutHandle);\n resolve(result);\n })\n .catch((error) => {\n clearTimeout(timeoutHandle);\n reject(error);\n });\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function createTeamsAppLink(params: pages.NavigateToAppParams): string {\n const url = new URL(\n 'https://teams.microsoft.com/l/entity/' +\n encodeURIComponent(params.appId) +\n '/' +\n encodeURIComponent(params.pageId),\n );\n\n if (params.webUrl) {\n url.searchParams.append('webUrl', params.webUrl);\n }\n if (params.channelId || params.subPageId) {\n url.searchParams.append('context', JSON.stringify({ channelId: params.channelId, subEntityId: params.subPageId }));\n }\n return url.toString();\n}\n\n/**\n * @hidden\n * Checks if the Adaptive Card schema version is supported by the host.\n * @param hostAdaptiveCardSchemaVersion Host's supported Adaptive Card version in the runtime.\n *\n * @returns true if the Adaptive Card Version is not supported and false if it is supported.\n */\nexport function isHostAdaptiveCardSchemaVersionUnsupported(\n hostAdaptiveCardSchemaVersion: AdaptiveCardVersion,\n): boolean {\n const versionCheck = compareSDKVersions(\n `${hostAdaptiveCardSchemaVersion.majorVersion}.${hostAdaptiveCardSchemaVersion.minorVersion}`,\n `${minAdaptiveCardVersion.majorVersion}.${minAdaptiveCardVersion.minorVersion}`,\n );\n if (versionCheck >= 0) {\n return false;\n } else {\n return true;\n }\n}\n","/* eslint-disable @typescript-eslint/ban-types */\n\nimport { errorRuntimeNotInitialized, errorRuntimeNotSupported } from '../internal/constants';\nimport { GlobalVars } from '../internal/globalVars';\nimport { getLogger } from '../internal/telemetry';\nimport { compareSDKVersions, deepFreeze } from '../internal/utils';\nimport { HostClientType } from './constants';\nimport { HostVersionsInfo } from './interfaces';\n\nconst runtimeLogger = getLogger('runtime');\n\nexport interface IBaseRuntime {\n readonly apiVersion: number;\n readonly hostVersionsInfo?: HostVersionsInfo;\n readonly isLegacyTeams?: boolean;\n readonly supports?: {};\n}\n\n/**\n * Latest runtime interface version\n */\nexport type Runtime = IRuntimeV2;\n\nexport const latestRuntimeApiVersion = 2;\n\nfunction isLatestRuntimeVersion(runtime: IBaseRuntime): runtime is Runtime {\n return runtime.apiVersion === latestRuntimeApiVersion;\n}\n\ninterface IRuntimeV1 extends IBaseRuntime {\n readonly apiVersion: 1;\n readonly isLegacyTeams?: boolean;\n readonly supports: {\n readonly appEntity?: {};\n readonly appInstallDialog?: {};\n readonly barCode?: {};\n readonly calendar?: {};\n readonly call?: {};\n readonly chat?: {};\n readonly conversations?: {};\n readonly dialog?: {\n readonly bot?: {};\n readonly update?: {};\n };\n readonly geoLocation?: {\n readonly map?: {};\n };\n readonly location?: {};\n readonly logs?: {};\n readonly mail?: {};\n readonly meetingRoom?: {};\n readonly menus?: {};\n readonly monetization?: {};\n readonly notifications?: {};\n readonly pages?: {\n readonly appButton?: {};\n readonly backStack?: {};\n readonly config?: {};\n readonly currentApp?: {};\n readonly fullTrust?: {};\n readonly tabs?: {};\n };\n readonly people?: {};\n readonly permissions?: {};\n readonly profile?: {};\n readonly remoteCamera?: {};\n readonly search?: {};\n readonly sharing?: {};\n readonly stageView?: {};\n readonly teams?: {\n readonly fullTrust?: {\n readonly joinedTeams?: {};\n };\n };\n readonly teamsCore?: {};\n readonly video?: {};\n readonly webStorage?: {};\n };\n}\n\ninterface IRuntimeV2 extends IBaseRuntime {\n readonly apiVersion: 2;\n readonly hostVersionsInfo?: HostVersionsInfo;\n readonly isLegacyTeams?: boolean;\n readonly supports: {\n readonly appEntity?: {};\n readonly appInstallDialog?: {};\n readonly barCode?: {};\n readonly calendar?: {};\n readonly call?: {};\n readonly chat?: {};\n readonly conversations?: {};\n readonly dialog?: {\n readonly card?: {\n readonly bot?: {};\n };\n readonly url?: {\n readonly bot?: {};\n };\n readonly update?: {};\n };\n readonly geoLocation?: {\n readonly map?: {};\n };\n readonly location?: {};\n readonly logs?: {};\n readonly mail?: {};\n readonly meetingRoom?: {};\n readonly menus?: {};\n readonly monetization?: {};\n readonly notifications?: {};\n readonly pages?: {\n readonly appButton?: {};\n readonly backStack?: {};\n readonly config?: {};\n readonly currentApp?: {};\n readonly fullTrust?: {};\n readonly tabs?: {};\n };\n readonly people?: {};\n readonly permissions?: {};\n readonly profile?: {};\n readonly remoteCamera?: {};\n readonly search?: {};\n readonly sharing?: {};\n readonly stageView?: {};\n readonly teams?: {\n readonly fullTrust?: {\n readonly joinedTeams?: {};\n };\n };\n readonly teamsCore?: {};\n readonly video?: {\n readonly mediaStream?: {};\n };\n readonly webStorage?: {};\n };\n}\n// Constant used to set the runtime configuration\nconst _uninitializedRuntime: UninitializedRuntime = {\n apiVersion: -1,\n supports: {},\n};\n\ninterface UninitializedRuntime extends IBaseRuntime {\n readonly apiVersion: -1;\n readonly supports: {};\n}\n\n/**\n * @hidden\n * Ensures that the runtime has been initialized\n\n * @returns True if the runtime has been initialized\n * @throws Error if the runtime has not been initialized\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isRuntimeInitialized(runtime: IBaseRuntime): runtime is Runtime {\n if (isLatestRuntimeVersion(runtime)) {\n return true;\n } else if (runtime.apiVersion === -1) {\n throw new Error(errorRuntimeNotInitialized);\n } else {\n throw new Error(errorRuntimeNotSupported);\n }\n}\n\nexport let runtime: Runtime | UninitializedRuntime = _uninitializedRuntime;\n\nexport const teamsRuntimeConfig: Runtime = {\n apiVersion: 2,\n hostVersionsInfo: undefined,\n isLegacyTeams: true,\n supports: {\n appInstallDialog: {},\n appEntity: {},\n call: {},\n chat: {},\n conversations: {},\n dialog: {\n url: {\n bot: {},\n },\n update: {},\n },\n logs: {},\n meetingRoom: {},\n menus: {},\n monetization: {},\n notifications: {},\n pages: {\n appButton: {},\n tabs: {},\n config: {},\n backStack: {},\n fullTrust: {},\n },\n remoteCamera: {},\n stageView: {},\n teams: {\n fullTrust: {},\n },\n teamsCore: {},\n video: {},\n },\n};\n\ninterface ICapabilityReqs {\n readonly capability: object;\n readonly hostClientTypes: Array<string>;\n}\n\nexport const v1HostClientTypes = [\n HostClientType.desktop,\n HostClientType.web,\n HostClientType.android,\n HostClientType.ios,\n HostClientType.rigel,\n HostClientType.surfaceHub,\n HostClientType.teamsRoomsWindows,\n HostClientType.teamsRoomsAndroid,\n HostClientType.teamsPhones,\n HostClientType.teamsDisplays,\n];\n\n/**\n * @hidden\n * `upgradeToNextVersion` transforms runtime of version `versionToUpgradeFrom` to the next higher version\n *\n * @internal\n * Limited to Microsoft-internal use\n */\ninterface IRuntimeUpgrade {\n versionToUpgradeFrom: number;\n upgradeToNextVersion: (previousVersionRuntime: IBaseRuntime) => IBaseRuntime;\n}\n\n/**\n * @hidden\n * Uses upgradeChain to transform an outdated runtime object to the latest format.\n * @param outdatedRuntime - The runtime object to be upgraded\n * @returns The upgraded runtime object\n * @throws Error if the runtime object could not be upgraded to the latest version\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function fastForwardRuntime(outdatedRuntime: IBaseRuntime): Runtime {\n let runtime = outdatedRuntime;\n if (runtime.apiVersion < latestRuntimeApiVersion) {\n upgradeChain.forEach((upgrade) => {\n if (runtime.apiVersion === upgrade.versionToUpgradeFrom) {\n runtime = upgrade.upgradeToNextVersion(runtime);\n }\n });\n }\n if (isLatestRuntimeVersion(runtime)) {\n return runtime;\n } else {\n throw new Error('Received a runtime that could not be upgraded to the latest version');\n }\n}\n\n/**\n * @hidden\n * List of transformations required to upgrade a runtime object from a previous version to the next higher version.\n * This list must be ordered from lowest version to highest version\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const upgradeChain: IRuntimeUpgrade[] = [\n // This upgrade has been included for testing, it may be removed when there is a real upgrade implemented\n {\n versionToUpgradeFrom: 1,\n upgradeToNextVersion: (previousVersionRuntime: IRuntimeV1): IRuntimeV2 => {\n return {\n apiVersion: 2,\n hostVersionsInfo: undefined,\n isLegacyTeams: previousVersionRuntime.isLegacyTeams,\n supports: {\n ...previousVersionRuntime.supports,\n dialog: previousVersionRuntime.supports.dialog\n ? {\n card: undefined,\n url: previousVersionRuntime.supports.dialog,\n update: previousVersionRuntime.supports.dialog?.update,\n }\n : undefined,\n },\n };\n },\n },\n];\n\nexport const versionConstants: Record<string, Array<ICapabilityReqs>> = {\n '1.9.0': [\n {\n capability: { location: {} },\n hostClientTypes: v1HostClientTypes,\n },\n ],\n '2.0.0': [\n {\n capability: { people: {} },\n hostClientTypes: v1HostClientTypes,\n },\n {\n capability: { sharing: {} },\n hostClientTypes: [HostClientType.desktop, HostClientType.web],\n },\n ],\n '2.0.1': [\n {\n capability: { teams: { fullTrust: { joinedTeams: {} } } },\n hostClientTypes: [\n HostClientType.android,\n HostClientType.desktop,\n HostClientType.ios,\n HostClientType.teamsRoomsAndroid,\n HostClientType.teamsPhones,\n HostClientType.teamsDisplays,\n HostClientType.web,\n ],\n },\n {\n capability: { webStorage: {} },\n hostClientTypes: [HostClientType.desktop],\n },\n ],\n '2.0.5': [\n {\n capability: { webStorage: {} },\n hostClientTypes: [HostClientType.android, HostClientType.desktop, HostClientType.ios],\n },\n ],\n};\n\nconst generateBackCompatRuntimeConfigLogger = runtimeLogger.extend('generateBackCompatRuntimeConfig');\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * Generates and returns a runtime configuration for host clients which are not on the latest host SDK version\n * and do not provide their own runtime config. Their supported capabilities are based on the highest\n * client SDK version that they can support.\n *\n * @param highestSupportedVersion - The highest client SDK version that the host client can support.\n * @returns runtime which describes the APIs supported by the legacy host client.\n */\nexport function generateBackCompatRuntimeConfig(highestSupportedVersion: string): Runtime {\n generateBackCompatRuntimeConfigLogger('generating back compat runtime config for %s', highestSupportedVersion);\n\n let newSupports = { ...teamsRuntimeConfig.supports };\n\n generateBackCompatRuntimeConfigLogger(\n 'Supported capabilities in config before updating based on highestSupportedVersion: %o',\n newSupports,\n );\n\n Object.keys(versionConstants).forEach((versionNumber) => {\n if (compareSDKVersions(highestSupportedVersion, versionNumber) >= 0) {\n versionConstants[versionNumber].forEach((capabilityReqs) => {\n if (capabilityReqs.hostClientTypes.includes(GlobalVars.hostClientType)) {\n newSupports = {\n ...newSupports,\n ...capabilityReqs.capability,\n };\n }\n });\n }\n });\n\n const backCompatRuntimeConfig: Runtime = {\n apiVersion: 2,\n isLegacyTeams: true,\n supports: newSupports,\n };\n\n generateBackCompatRuntimeConfigLogger(\n 'Runtime config after updating based on highestSupportedVersion: %o',\n backCompatRuntimeConfig,\n );\n\n return backCompatRuntimeConfig;\n}\n\nconst applyRuntimeConfigLogger = runtimeLogger.extend('applyRuntimeConfig');\nexport function applyRuntimeConfig(runtimeConfig: IBaseRuntime): void {\n // Some hosts that have not adopted runtime versioning send a string for apiVersion, so we should handle those as v1 inputs\n if (typeof runtimeConfig.apiVersion === 'string') {\n applyRuntimeConfigLogger('Trying to apply runtime with string apiVersion, processing as v1: %o', runtimeConfig);\n runtimeConfig = {\n ...runtimeConfig,\n apiVersion: 1,\n };\n }\n applyRuntimeConfigLogger('Fast-forwarding runtime %o', runtimeConfig);\n const ffRuntimeConfig = fastForwardRuntime(runtimeConfig);\n applyRuntimeConfigLogger('Applying runtime %o', ffRuntimeConfig);\n runtime = deepFreeze(ffRuntimeConfig);\n}\n\nexport function setUnitializedRuntime(): void {\n runtime = deepFreeze(_uninitializedRuntime);\n}\n\n/**\n * @hidden\n * Constant used to set minimum runtime configuration\n * while un-initializing an app in unit test case.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const _minRuntimeConfigToUninitialize: Runtime = {\n apiVersion: 2,\n supports: {\n pages: {\n appButton: {},\n tabs: {},\n config: {},\n backStack: {},\n fullTrust: {},\n },\n teamsCore: {},\n logs: {},\n },\n};\n","import {\n Communication,\n sendMessageEventToChild,\n sendMessageToParent,\n sendMessageToParentAsync,\n waitForMessageQueue,\n} from '../internal/communication';\nimport { GlobalVars } from '../internal/globalVars';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitializeCalled, ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts, HostClientType } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to interact with the authentication-specific part of the SDK.\n *\n * This object is used for starting or completing authentication flows.\n */\nexport namespace authentication {\n let authHandlers: { success: (string) => void; fail: (string) => void } | undefined;\n let authWindowMonitor: number | undefined;\n\n /**\n * @hidden\n * @internal\n * Limited to Microsoft-internal use; automatically called when library is initialized\n */\n export function initialize(): void {\n registerHandler('authentication.authenticate.success', handleSuccess, false);\n registerHandler('authentication.authenticate.failure', handleFailure, false);\n }\n\n let authParams: AuthenticateParameters | undefined;\n /**\n * @deprecated\n * As of 2.0.0, this function has been deprecated in favor of a Promise-based pattern using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>}\n *\n * Registers handlers to be called with the result of an authentication flow triggered using {@link authentication.authenticate authentication.authenticate(authenticateParameters?: AuthenticateParameters): void}\n *\n * @param authenticateParameters - Configuration for authentication flow pop-up result communication\n */\n export function registerAuthenticationHandlers(authenticateParameters: AuthenticateParameters): void {\n authParams = authenticateParameters;\n }\n\n /**\n * Initiates an authentication flow which requires a new window.\n * There are two primary uses for this function:\n * 1. When your app needs to authenticate using a 3rd-party identity provider (not Azure Active Directory)\n * 2. When your app needs to show authentication UI that is blocked from being shown in an iframe (e.g., Azure Active Directory consent prompts)\n *\n * For more details, see [Enable authentication using third-party OAuth provider](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/auth-flow-tab)\n *\n * This function is *not* needed for \"standard\" Azure SSO usage. Using {@link getAuthToken} is usually sufficient in that case. For more, see\n * [Enable SSO for tab apps](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/tab-sso-overview))\n *\n * @remarks\n * The authentication flow must start and end from the same domain, otherwise success and failure messages won't be returned to the window that initiated the call.\n * The [Teams authentication flow](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/auth-flow-tab) starts and ends at an endpoint on\n * your own service (with a redirect round-trip to the 3rd party identity provider in the middle).\n *\n * @param authenticateParameters - Parameters describing the authentication window used for executing the authentication flow\n *\n * @returns `Promise` that will be fulfilled with the result from the authentication pop-up, if successful. The string in this result is provided in the parameter\n * passed by your app when it calls {@link notifySuccess} in the pop-up window after returning from the identity provider redirect.\n *\n * @throws `Error` if the authentication request fails or is canceled by the user. This error is provided in the parameter passed by your app when it calls\n * {@link notifyFailure} in the pop-up window after returning from the identity provider redirect. However, in some cases it can also be provided by\n * the infrastructure depending on the failure (e.g., a user cancelation)\n *\n */\n export function authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise<string>;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} instead.\n *\n * The documentation for {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} applies\n * to this function.\n * The one difference is that instead of the result being returned via the `Promise`, the result is returned to the callback functions provided in the\n * `authenticateParameters` parameter.\n *\n * @param authenticateParameters - Parameters describing the authentication window used for executing the authentication flow and callbacks used for indicating the result\n *\n */\n export function authenticate(authenticateParameters?: AuthenticateParameters): void;\n export function authenticate(authenticateParameters?: AuthenticateParameters): Promise<string> {\n const isDifferentParamsInCall: boolean = authenticateParameters !== undefined;\n const authenticateParams: AuthenticateParameters | undefined = isDifferentParamsInCall\n ? authenticateParameters\n : authParams;\n if (!authenticateParams) {\n throw new Error('No parameters are provided for authentication');\n }\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n return authenticateHelper(authenticateParams)\n .then((value: string) => {\n try {\n if (authenticateParams && authenticateParams.successCallback) {\n authenticateParams.successCallback(value);\n return '';\n }\n return value;\n } finally {\n if (!isDifferentParamsInCall) {\n authParams = null;\n }\n }\n })\n .catch((err: Error) => {\n try {\n if (authenticateParams && authenticateParams.failureCallback) {\n authenticateParams.failureCallback(err.message);\n return '';\n }\n throw err;\n } finally {\n if (!isDifferentParamsInCall) {\n authParams = null;\n }\n }\n });\n }\n\n function authenticateHelper(authenticateParameters: AuthenticateParameters): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n if (\n GlobalVars.hostClientType === HostClientType.desktop ||\n GlobalVars.hostClientType === HostClientType.android ||\n GlobalVars.hostClientType === HostClientType.ios ||\n GlobalVars.hostClientType === HostClientType.rigel ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsWindows ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||\n GlobalVars.hostClientType === HostClientType.teamsPhones ||\n GlobalVars.hostClientType === HostClientType.teamsDisplays\n ) {\n // Convert any relative URLs into absolute URLs before sending them over to the parent window.\n const link = document.createElement('a');\n link.href = authenticateParameters.url;\n // Ask the parent window to open an authentication window with the parameters provided by the caller.\n resolve(\n sendMessageToParentAsync<[boolean, string]>('authentication.authenticate', [\n link.href,\n authenticateParameters.width,\n authenticateParameters.height,\n authenticateParameters.isExternal,\n ]).then(([success, response]: [boolean, string]) => {\n if (success) {\n return response;\n } else {\n throw new Error(response);\n }\n }),\n );\n } else {\n // Open an authentication window with the parameters provided by the caller.\n authHandlers = {\n success: resolve,\n fail: reject,\n };\n openAuthenticationWindow(authenticateParameters);\n }\n });\n }\n\n /**\n * Requests an Azure AD token to be issued on behalf of your app in an SSO flow.\n * The token is acquired from the cache if it is not expired. Otherwise a request is sent to Azure AD to\n * obtain a new token.\n * This function is used to enable SSO scenarios. See [Enable SSO for tab apps](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/tab-sso-overview)\n * for more details.\n *\n * @param authTokenRequest - An optional set of values that configure the token request.\n *\n * @returns `Promise` that will be resolved with the token, if successful.\n *\n * @throws `Error` if the request fails in some way\n */\n export function getAuthToken(authTokenRequest?: AuthTokenRequestParameters): Promise<string>;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link authentication.getAuthToken authentication.getAuthToken(authTokenRequest: AuthTokenRequestParameters): Promise\\<string\\>} instead.\n *\n * The documentation {@link authentication.getAuthToken authentication.getAuthToken(authTokenRequest: AuthTokenRequestParameters): Promise\\<string\\>} applies to this\n * function as well. The one difference when using this function is that the result is provided in the callbacks in the `authTokenRequest` parameter\n * instead of as a `Promise`.\n *\n * @param authTokenRequest - An optional set of values that configure the token request.\n * It contains callbacks to call in case of success/failure\n */\n export function getAuthToken(authTokenRequest?: AuthTokenRequest): void;\n export function getAuthToken(authTokenRequest?: AuthTokenRequest): Promise<string> {\n ensureInitializeCalled();\n return getAuthTokenHelper(authTokenRequest)\n .then((value: string) => {\n if (authTokenRequest && authTokenRequest.successCallback) {\n authTokenRequest.successCallback(value);\n return '';\n }\n return value;\n })\n .catch((err: Error) => {\n if (authTokenRequest && authTokenRequest.failureCallback) {\n authTokenRequest.failureCallback(err.message);\n return '';\n }\n throw err;\n });\n }\n\n function getAuthTokenHelper(authTokenRequest?: AuthTokenRequest): Promise<string> {\n return new Promise<[boolean, string]>((resolve) => {\n resolve(\n sendMessageToParentAsync('authentication.getAuthToken', [\n authTokenRequest?.resources,\n authTokenRequest?.claims,\n authTokenRequest?.silent,\n ]),\n );\n }).then(([success, result]: [boolean, string]) => {\n if (success) {\n return result;\n } else {\n throw new Error(result);\n }\n });\n }\n\n /**\n * @hidden\n * Requests the decoded Azure AD user identity on behalf of the app.\n *\n * @returns Promise that resolves with the {@link UserProfile}.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getUser(): Promise<UserProfile>;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link authentication.getUser authentication.getUser(): Promise\\<UserProfile\\>} instead.\n *\n * @hidden\n * Requests the decoded Azure AD user identity on behalf of the app.\n *\n * @param userRequest - It passes success/failure callbacks in the userRequest object(deprecated)\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getUser(userRequest: UserRequest): void;\n export function getUser(userRequest?: UserRequest): Promise<UserProfile> {\n ensureInitializeCalled();\n return getUserHelper()\n .then((value: UserProfile) => {\n if (userRequest && userRequest.successCallback) {\n userRequest.successCallback(value);\n return null;\n }\n return value;\n })\n .catch((err: Error) => {\n if (userRequest && userRequest.failureCallback) {\n userRequest.failureCallback(err.message);\n return null;\n }\n throw err;\n });\n }\n\n function getUserHelper(): Promise<UserProfile> {\n return new Promise<[boolean, UserProfile | string]>((resolve) => {\n resolve(sendMessageToParentAsync('authentication.getUser'));\n }).then(([success, result]: [boolean, UserProfile | string]) => {\n if (success) {\n return result as UserProfile;\n } else {\n throw new Error(result as string);\n }\n });\n }\n\n function closeAuthenticationWindow(): void {\n // Stop monitoring the authentication window\n stopAuthenticationWindowMonitor();\n // Try to close the authentication window and clear all properties associated with it\n try {\n if (Communication.childWindow) {\n Communication.childWindow.close();\n }\n } finally {\n Communication.childWindow = null;\n Communication.childOrigin = null;\n }\n }\n\n function openAuthenticationWindow(authenticateParameters: AuthenticateParameters): void {\n // Close the previously opened window if we have one\n closeAuthenticationWindow();\n // Start with a sensible default size\n let width = authenticateParameters.width || 600;\n let height = authenticateParameters.height || 400;\n // Ensure that the new window is always smaller than our app's window so that it never fully covers up our app\n width = Math.min(width, Communication.currentWindow.outerWidth - 400);\n height = Math.min(height, Communication.currentWindow.outerHeight - 200);\n // Convert any relative URLs into absolute URLs before sending them over to the parent window\n const link = document.createElement('a');\n link.href = authenticateParameters.url.replace('{oauthRedirectMethod}', 'web');\n // We are running in the browser, so we need to center the new window ourselves\n let left: number =\n typeof Communication.currentWindow.screenLeft !== 'undefined'\n ? Communication.currentWindow.screenLeft\n : Communication.currentWindow.screenX;\n let top: number =\n typeof Communication.currentWindow.screenTop !== 'undefined'\n ? Communication.currentWindow.screenTop\n : Communication.currentWindow.screenY;\n left += Communication.currentWindow.outerWidth / 2 - width / 2;\n top += Communication.currentWindow.outerHeight / 2 - height / 2;\n // Open a child window with a desired set of standard browser features\n Communication.childWindow = Communication.currentWindow.open(\n link.href,\n '_blank',\n 'toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top=' +\n top +\n ', left=' +\n left +\n ', width=' +\n width +\n ', height=' +\n height,\n );\n if (Communication.childWindow) {\n // Start monitoring the authentication window so that we can detect if it gets closed before the flow completes\n startAuthenticationWindowMonitor();\n } else {\n // If we failed to open the window, fail the authentication flow\n handleFailure('FailedToOpenWindow');\n }\n }\n\n function stopAuthenticationWindowMonitor(): void {\n if (authWindowMonitor) {\n clearInterval(authWindowMonitor);\n authWindowMonitor = 0;\n }\n removeHandler('initialize');\n removeHandler('navigateCrossDomain');\n }\n\n function startAuthenticationWindowMonitor(): void {\n // Stop the previous window monitor if one is running\n stopAuthenticationWindowMonitor();\n // Create an interval loop that\n // - Notifies the caller of failure if it detects that the authentication window is closed\n // - Keeps pinging the authentication window while it is open to re-establish\n // contact with any pages along the authentication flow that need to communicate\n // with us\n authWindowMonitor = Communication.currentWindow.setInterval(() => {\n if (!Communication.childWindow || Communication.childWindow.closed) {\n handleFailure('CancelledByUser');\n } else {\n const savedChildOrigin = Communication.childOrigin;\n try {\n Communication.childOrigin = '*';\n sendMessageEventToChild('ping');\n } finally {\n Communication.childOrigin = savedChildOrigin;\n }\n }\n }, 100);\n // Set up an initialize-message handler that gives the authentication window its frame context\n registerHandler('initialize', () => {\n return [FrameContexts.authentication, GlobalVars.hostClientType];\n });\n // Set up a navigateCrossDomain message handler that blocks cross-domain re-navigation attempts\n // in the authentication window. We could at some point choose to implement this method via a call to\n // authenticationWindow.location.href = url; however, we would first need to figure out how to\n // validate the URL against the tab's list of valid domains.\n registerHandler('navigateCrossDomain', () => {\n return false;\n });\n }\n\n /**\n * When using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>}, the\n * window that was opened to execute the authentication flow should call this method after authentiction to notify the caller of\n * {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} that the\n * authentication request was successful.\n *\n * @remarks\n * This function is usable only from the authentication window.\n * This call causes the authentication window to be closed.\n *\n * @param result - Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives\n * this value in its callback or via the `Promise` return value\n * @param callbackUrl - Specifies the url to redirect back to if the client is Win32 Outlook.\n */\n export function notifySuccess(result?: string, callbackUrl?: string): void {\n redirectIfWin32Outlook(callbackUrl, 'result', result);\n ensureInitialized(runtime, FrameContexts.authentication);\n sendMessageToParent('authentication.authenticate.success', [result]);\n // Wait for the message to be sent before closing the window\n waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));\n }\n\n /**\n * When using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>}, the\n * window that was opened to execute the authentication flow should call this method after authentiction to notify the caller of\n * {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} that the\n * authentication request failed.\n\n *\n * @remarks\n * This function is usable only on the authentication window.\n * This call causes the authentication window to be closed.\n *\n * @param result - Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives\n * this value in its callback or via the `Promise` return value\n * @param callbackUrl - Specifies the url to redirect back to if the client is Win32 Outlook.\n */\n export function notifyFailure(reason?: string, callbackUrl?: string): void {\n redirectIfWin32Outlook(callbackUrl, 'reason', reason);\n ensureInitialized(runtime, FrameContexts.authentication);\n sendMessageToParent('authentication.authenticate.failure', [reason]);\n // Wait for the message to be sent before closing the window\n waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));\n }\n\n function handleSuccess(result?: string): void {\n try {\n if (authHandlers) {\n authHandlers.success(result);\n }\n } finally {\n authHandlers = null;\n closeAuthenticationWindow();\n }\n }\n\n function handleFailure(reason?: string): void {\n try {\n if (authHandlers) {\n authHandlers.fail(new Error(reason));\n }\n } finally {\n authHandlers = null;\n closeAuthenticationWindow();\n }\n }\n\n /**\n * Validates that the callbackUrl param is a valid connector url, appends the result/reason and authSuccess/authFailure as URL fragments and redirects the window\n * @param callbackUrl - the connectors url to redirect to\n * @param key - \"result\" in case of success and \"reason\" in case of failure\n * @param value - the value of the passed result/reason parameter\n */\n function redirectIfWin32Outlook(callbackUrl?: string, key?: string, value?: string): void {\n if (callbackUrl) {\n const link = document.createElement('a');\n link.href = decodeURIComponent(callbackUrl);\n if (\n link.host &&\n link.host !== window.location.host &&\n link.host === 'outlook.office.com' &&\n link.search.indexOf('client_type=Win32_Outlook') > -1\n ) {\n if (key && key === 'result') {\n if (value) {\n link.href = updateUrlParameter(link.href, 'result', value);\n }\n Communication.currentWindow.location.assign(updateUrlParameter(link.href, 'authSuccess', ''));\n }\n if (key && key === 'reason') {\n if (value) {\n link.href = updateUrlParameter(link.href, 'reason', value);\n }\n Communication.currentWindow.location.assign(updateUrlParameter(link.href, 'authFailure', ''));\n }\n }\n }\n }\n\n /**\n * Appends either result or reason as a fragment to the 'callbackUrl'\n * @param uri - the url to modify\n * @param key - the fragment key\n * @param value - the fragment value\n */\n function updateUrlParameter(uri: string, key: string, value: string): string {\n const i = uri.indexOf('#');\n let hash = i === -1 ? '#' : uri.substr(i);\n hash = hash + '&' + key + (value !== '' ? '=' + value : '');\n uri = i === -1 ? uri : uri.substr(0, i);\n return uri + hash;\n }\n\n /**\n * @deprecated\n * As of 2.0.0, this interface has been deprecated in favor of leveraging the `Promise` returned from {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>}\n *-------------------------\n * Used in {@link AuthenticateParameters} and {@link AuthTokenRequest}\n */\n export interface LegacyCallBacks {\n /**\n * @deprecated\n * As of 2.0.0, this property has been deprecated in favor of a Promise-based pattern.\n *\n * A function that is called if the request succeeds.\n */\n successCallback?: (result: string) => void;\n /**\n * @deprecated\n * As of 2.0.0, this property has been deprecated in favor of a Promise-based pattern.\n *\n * A function that is called if the request fails, with the reason for the failure.\n */\n failureCallback?: (reason: string) => void;\n }\n\n /**\n * Describes the authentication pop-up parameters\n */\n export interface AuthenticatePopUpParameters {\n /**\n * The URL for the authentication pop-up.\n */\n url: string;\n /**\n * The preferred width for the pop-up. This value can be ignored if outside the acceptable bounds.\n */\n width?: number;\n /**\n * The preferred height for the pop-up. This value can be ignored if outside the acceptable bounds.\n */\n height?: number;\n /**\n * Some identity providers restrict their authentication pages from being displayed in embedded browsers (e.g., a web view inside of a native application)\n * If the identity provider you are using prevents embedded browser usage, this flag should be set to `true` to enable the authentication page specified in\n * the {@link url} property to be opened in an external browser.\n * If this flag is `false`, the page will be opened directly within the current hosting application.\n *\n * This flag is ignored when the host for the application is a web app (as opposed to a native application) as the behavior is unnecessary in a web-only\n * environment without an embedded browser.\n */\n isExternal?: boolean;\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} and\n * the associated {@link AuthenticatePopUpParameters} instead.\n *\n * @see {@link LegacyCallBacks}\n */\n export type AuthenticateParameters = AuthenticatePopUpParameters & LegacyCallBacks;\n\n /**\n * Describes authentication token request parameters\n */\n export interface AuthTokenRequestParameters {\n /**\n * @hidden\n * @internal\n * An list of resources for which to acquire the access token; only for internal Microsoft usage\n */\n resources?: string[];\n /**\n * An optional list of claims which to pass to AAD when requesting the access token.\n */\n claims?: string[];\n /**\n * An optional flag indicating whether to attempt the token acquisition silently or allow a prompt to be shown.\n */\n silent?: boolean;\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link AuthTokenRequestParameters} instead.\n */\n export type AuthTokenRequest = AuthTokenRequestParameters & LegacyCallBacks;\n\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface UserProfile {\n /**\n * @hidden\n * The intended recipient of the token. The application that receives the token must verify that the audience\n * value is correct and reject any tokens intended for a different audience.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n aud: string;\n /**\n * @hidden\n * Identifies how the subject of the token was authenticated.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n amr: string[];\n /**\n * @hidden\n * Stores the time at which the token was issued. It is often used to measure token freshness.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n iat: number;\n /**\n * @hidden\n * Identifies the security token service (STS) that constructs and returns the token. In the tokens that Azure AD\n * returns, the issuer is sts.windows.net. The GUID in the issuer claim value is the tenant ID of the Azure AD\n * directory. The tenant ID is an immutable and reliable identifier of the directory.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n iss: string;\n /**\n * @hidden\n * Provides the last name, surname, or family name of the user as defined in the Azure AD user object.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n family_name: string;\n /**\n * @hidden\n * Provides the first or \"given\" name of the user, as set on the Azure AD user object.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n given_name: string;\n /**\n * @hidden\n * Provides a human-readable value that identifies the subject of the token. This value is not guaranteed to\n * be unique within a tenant and is designed to be used only for display purposes.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n unique_name: string;\n /**\n * @hidden\n * Contains a unique identifier of an object in Azure AD. This value is immutable and cannot be reassigned or\n * reused. Use the object ID to identify an object in queries to Azure AD.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n oid: string;\n /**\n * @hidden\n * Identifies the principal about which the token asserts information, such as the user of an application.\n * This value is immutable and cannot be reassigned or reused, so it can be used to perform authorization\n * checks safely. Because the subject is always present in the tokens the Azure AD issues, we recommended\n * using this value in a general-purpose authorization system.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n sub: string;\n /**\n * @hidden\n * An immutable, non-reusable identifier that identifies the directory tenant that issued the token. You can\n * use this value to access tenant-specific directory resources in a multitenant application. For example,\n * you can use this value to identify the tenant in a call to the Graph API.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n tid: string;\n /**\n * @hidden\n * Defines the end of the time interval within which a token is valid. The service that validates the token\n * should verify that the current date is within the token lifetime; otherwise it should reject the token. The\n * service might allow for up to five minutes beyond the token lifetime to account for any differences in clock\n * time (\"time skew\") between Azure AD and the service.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n exp: number;\n /**\n * @hidden\n * Defines the start of the time interval within which a token is valid. The service that validates the token\n * should verify that the current date is within the token lifetime; otherwise it should reject the token. The\n * service might allow for up to five minutes beyond the token lifetime to account for any differences in clock\n * time (\"time skew\") between Azure AD and the service.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n nbf: number;\n /**\n * @hidden\n * Stores the user name of the user principal.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n upn: string;\n /**\n * @hidden\n * Stores the version number of the token.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n ver: string;\n /**\n * @hidden\n * Stores the data residency of the user.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n dataResidency?: DataResidency;\n }\n\n /**\n * @hidden\n * Limited set of data residencies information exposed to 1P application developers\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum DataResidency {\n /**\n * Public\n */\n Public = 'public',\n\n /**\n * European Union Data Boundary\n */\n EUDB = 'eudb',\n\n /**\n * Other, stored to cover fields that will not be exposed\n */\n Other = 'other',\n }\n\n /**\n * @deprecated\n * As of 2.0.0, this interface has been deprecated in favor of a Promise-based pattern.\n * @hidden\n * Describes the UserRequest. Success callback describes how a successful request is handled.\n * Failure callback describes how a failed request is handled.\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface UserRequest {\n /**\n * A function that is called if the token request succeeds, with the resulting token.\n */\n successCallback?: (user: UserProfile) => void;\n /**\n * A function that is called if the token request fails, with the reason for the failure.\n */\n failureCallback?: (reason: string) => void;\n }\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { sendMessageToParent } from '../internal/communication';\nimport { GlobalVars } from '../internal/globalVars';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { isHostAdaptiveCardSchemaVersionUnsupported } from '../internal/utils';\nimport { DialogDimension, errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport {\n AdaptiveCardDialogInfo,\n BotAdaptiveCardDialogInfo,\n BotUrlDialogInfo,\n DialogInfo,\n DialogSize,\n M365ContentAction,\n TaskInfo,\n UrlDialogInfo,\n} from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * This group of capabilities enables apps to show modal dialogs. There are two primary types of dialogs: URL-based dialogs and [Adaptive Card](https://learn.microsoft.com/adaptive-cards/) dialogs.\n * Both types of dialogs are shown on top of your app, preventing interaction with your app while they are displayed.\n * - URL-based dialogs allow you to specify a URL from which the contents will be shown inside the dialog.\n * - For URL dialogs, use the functions and interfaces in the {@link dialog.url} namespace.\n * - Adaptive Card-based dialogs allow you to provide JSON describing an Adaptive Card that will be shown inside the dialog.\n * - For Adaptive Card dialogs, use the functions and interfaces in the {@link dialog.adaptiveCard} namespace.\n *\n * @remarks Note that dialogs were previously called \"task modules\". While they have been renamed for clarity, the functionality has been maintained.\n * For more details, see [Dialogs](https://learn.microsoft.com/microsoftteams/platform/task-modules-and-cards/what-are-task-modules)\n *\n * @beta\n */\nexport namespace dialog {\n /**\n * Data Structure to represent the SDK response when dialog closes\n *\n * @beta\n */\n export interface ISdkResponse {\n /**\n * Error in case there is a failure before dialog submission\n */\n err?: string;\n\n /**\n * Value provided in the `result` parameter by the dialog when the {@linkcode url.submit} function\n * was called.\n * If the dialog was closed by the user without submitting (e.g., using a control in the corner\n * of the dialog), this value will be `undefined` here.\n */\n result?: string | object;\n }\n\n /**\n * Handler used to receive and process messages sent between a dialog and the app that launched it\n * @beta\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export type PostMessageChannel = (message: any) => void;\n\n /**\n * Handler used for receiving results when a dialog closes, either the value passed by {@linkcode url.submit}\n * or an error if the dialog was closed by the user.\n *\n * @see {@linkcode ISdkResponse}\n *\n * @beta\n */\n export type DialogSubmitHandler = (result: ISdkResponse) => void;\n const storedMessages: string[] = [];\n\n /**\n * @hidden\n * Hide from docs because this function is only used during initialization\n *\n * Adds register handlers for messageForChild upon initialization and only in the tasks FrameContext. {@link FrameContexts.task}\n * Function is called during app initialization\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function initialize(): void {\n registerHandler('messageForChild', handleDialogMessage, false);\n }\n\n function handleDialogMessage(message: string): void {\n if (!GlobalVars.frameContext) {\n // GlobalVars.frameContext is currently not set\n return;\n }\n\n if (GlobalVars.frameContext === FrameContexts.task) {\n storedMessages.push(message);\n } else {\n // Not in task FrameContext, remove 'messageForChild' handler\n removeHandler('messageForChild');\n }\n }\n\n export namespace url {\n /**\n * Allows app to open a url based dialog.\n *\n * @remarks\n * This function cannot be called from inside of a dialog\n *\n * @param urlDialogInfo - An object containing the parameters of the dialog module.\n * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode submit} function or when the user closes the dialog.\n * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.\n *\n * @beta\n */\n export function open(\n urlDialogInfo: UrlDialogInfo,\n submitHandler?: DialogSubmitHandler,\n messageFromChildHandler?: PostMessageChannel,\n ): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (messageFromChildHandler) {\n registerHandler('messageForParent', messageFromChildHandler);\n }\n const dialogInfo: DialogInfo = getDialogInfoFromUrlDialogInfo(urlDialogInfo);\n sendMessageToParent('tasks.startTask', [dialogInfo], (err: string, result: string | object) => {\n submitHandler?.({ err, result });\n removeHandler('messageForParent');\n });\n }\n\n /**\n * Submit the dialog module and close the dialog\n *\n * @remarks\n * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.\n *\n * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it,\n * If this function is called from a dialog while {@link M365ContentAction} is set in the context object by the host, result will be ignored\n *\n * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.\n *\n * @beta\n */\n export function submit(result?: string | object, appIds?: string | string[]): void {\n // FrameContext content should not be here because dialog.submit can be called only from inside of a dialog (FrameContext task)\n // but it's here because Teams mobile incorrectly returns FrameContext.content when calling app.getFrameContext().\n // FrameContexts.content will be removed once the bug is fixed.\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n // Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients\n sendMessageToParent('tasks.completeTask', [result, appIds ? (Array.isArray(appIds) ? appIds : [appIds]) : []]);\n }\n\n /**\n * Send message to the parent from dialog\n *\n * @remarks\n * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.\n *\n * @param message - The message to send to the parent\n *\n * @beta\n */\n export function sendMessageToParentFromDialog(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message: any,\n ): void {\n ensureInitialized(runtime, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n sendMessageToParent('messageForParent', [message]);\n }\n\n /**\n * Send message to the dialog from the parent\n *\n * @param message - The message to send\n *\n * @beta\n */\n export function sendMessageToDialog(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message: any,\n ): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n sendMessageToParent('messageForChild', [message]);\n }\n\n /**\n * Register a listener that will be triggered when a message is received from the app that opened the dialog.\n *\n * @remarks\n * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.\n *\n * @param listener - The listener that will be triggered.\n *\n * @beta\n */\n export function registerOnMessageFromParent(listener: PostMessageChannel): void {\n ensureInitialized(runtime, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n // We need to remove the original 'messageForChild'\n // handler since the original does not allow for post messages.\n // It is replaced by the user specified listener that is passed in.\n removeHandler('messageForChild');\n registerHandler('messageForChild', listener);\n storedMessages.reverse();\n while (storedMessages.length > 0) {\n const message = storedMessages.pop();\n listener(message);\n }\n }\n\n /**\n * Checks if dialog.url module is supported by the host\n *\n * @returns boolean to represent whether dialog.url module is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && (runtime.supports.dialog && runtime.supports.dialog.url) !== undefined;\n }\n\n /**\n * Namespace to open a dialog that sends results to the bot framework\n *\n * @beta\n */\n export namespace bot {\n /**\n * Allows an app to open the dialog module using bot.\n *\n * @param botUrlDialogInfo - An object containing the parameters of the dialog module including completionBotId.\n * @param submitHandler - Handler that triggers when the dialog has been submitted or closed.\n * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.\n *\n * @returns a function that can be used to send messages to the dialog.\n *\n * @beta\n */\n export function open(\n botUrlDialogInfo: BotUrlDialogInfo,\n submitHandler?: DialogSubmitHandler,\n messageFromChildHandler?: PostMessageChannel,\n ): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (messageFromChildHandler) {\n registerHandler('messageForParent', messageFromChildHandler);\n }\n const dialogInfo: DialogInfo = getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo);\n\n sendMessageToParent('tasks.startTask', [dialogInfo], (err: string, result: string | object) => {\n submitHandler?.({ err, result });\n removeHandler('messageForParent');\n });\n }\n\n /**\n * Checks if dialog.url.bot capability is supported by the host\n *\n * @returns boolean to represent whether dialog.url.bot is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return (\n ensureInitialized(runtime) &&\n (runtime.supports.dialog && runtime.supports.dialog.url && runtime.supports.dialog.url.bot) !== undefined\n );\n }\n }\n\n /**\n * @hidden\n *\n * Convert UrlDialogInfo to DialogInfo to send the information to host in {@linkcode open} API.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getDialogInfoFromUrlDialogInfo(urlDialogInfo: UrlDialogInfo): DialogInfo {\n const dialogInfo: DialogInfo = {\n url: urlDialogInfo.url,\n height: urlDialogInfo.size ? urlDialogInfo.size.height : DialogDimension.Small,\n width: urlDialogInfo.size ? urlDialogInfo.size.width : DialogDimension.Small,\n title: urlDialogInfo.title,\n fallbackUrl: urlDialogInfo.fallbackUrl,\n };\n return dialogInfo;\n }\n\n /**\n * @hidden\n *\n * Convert BotUrlDialogInfo to DialogInfo to send the information to host in {@linkcode bot.open} API.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo: BotUrlDialogInfo): DialogInfo {\n const dialogInfo: DialogInfo = getDialogInfoFromUrlDialogInfo(botUrlDialogInfo);\n dialogInfo.completionBotId = botUrlDialogInfo.completionBotId;\n return dialogInfo;\n }\n }\n\n /**\n * This function currently serves no purpose and should not be used. All functionality that used\n * to be covered by this method is now in subcapabilities and those isSupported methods should be\n * used directly.\n *\n * @hidden\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.dialog ? true : false;\n }\n\n /**\n * Namespace to update the dialog\n *\n * @beta\n */\n export namespace update {\n /**\n * Update dimensions - height/width of a dialog.\n *\n * @param dimensions - An object containing width and height properties.\n *\n * @beta\n */\n export function resize(dimensions: DialogSize): void {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.task,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('tasks.updateTask', [dimensions]);\n }\n\n /**\n * Checks if dialog.update capability is supported by the host\n * @returns boolean to represent whether dialog.update capabilty is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.dialog\n ? runtime.supports.dialog.update\n ? true\n : false\n : false;\n }\n }\n\n /**\n * Subcapability for interacting with adaptive card dialogs\n * @beta\n */\n export namespace adaptiveCard {\n /**\n * Allows app to open an adaptive card based dialog.\n *\n * @remarks\n * This function cannot be called from inside of a dialog\n *\n * @param adaptiveCardDialogInfo - An object containing the parameters of the dialog module {@link AdaptiveCardDialogInfo}.\n * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode url.submit} function or when the user closes the dialog.\n *\n * @beta\n */\n export function open(adaptiveCardDialogInfo: AdaptiveCardDialogInfo, submitHandler?: DialogSubmitHandler): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const dialogInfo: DialogInfo = getDialogInfoFromAdaptiveCardDialogInfo(adaptiveCardDialogInfo);\n sendMessageToParent('tasks.startTask', [dialogInfo], (err: string, result: string | object) => {\n submitHandler?.({ err, result });\n });\n }\n\n /**\n * Checks if dialog.adaptiveCard module is supported by the host\n *\n * @returns boolean to represent whether dialog.adaptiveCard module is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n const isAdaptiveCardVersionSupported =\n runtime.hostVersionsInfo &&\n runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&\n !isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);\n return (\n ensureInitialized(runtime) &&\n (isAdaptiveCardVersionSupported && runtime.supports.dialog && runtime.supports.dialog.card) !== undefined\n );\n }\n\n /**\n * Namespace for interaction with adaptive card dialogs that need to communicate with the bot framework\n *\n * @beta\n */\n export namespace bot {\n /**\n * Allows an app to open an adaptive card-based dialog module using bot.\n *\n * @param botAdaptiveCardDialogInfo - An object containing the parameters of the dialog module including completionBotId.\n * @param submitHandler - Handler that triggers when the dialog has been submitted or closed.\n *\n * @beta\n */\n export function open(\n botAdaptiveCardDialogInfo: BotAdaptiveCardDialogInfo,\n submitHandler?: DialogSubmitHandler,\n ): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n const dialogInfo: DialogInfo = getDialogInfoFromBotAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo);\n\n sendMessageToParent('tasks.startTask', [dialogInfo], (err: string, result: string | object) => {\n submitHandler?.({ err, result });\n });\n }\n\n /**\n * Checks if dialog.adaptiveCard.bot capability is supported by the host\n *\n * @returns boolean to represent whether dialog.adaptiveCard.bot is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n const isAdaptiveCardVersionSupported =\n runtime.hostVersionsInfo &&\n runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&\n !isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);\n return (\n ensureInitialized(runtime) &&\n (isAdaptiveCardVersionSupported &&\n runtime.supports.dialog &&\n runtime.supports.dialog.card &&\n runtime.supports.dialog.card.bot) !== undefined\n );\n }\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Convert AdaptiveCardDialogInfo to DialogInfo to send the information to host in {@linkcode adaptiveCard.open} API.\n *\n * @internal\n */\n export function getDialogInfoFromAdaptiveCardDialogInfo(\n adaptiveCardDialogInfo: AdaptiveCardDialogInfo,\n ): DialogInfo {\n const dialogInfo: DialogInfo = {\n card: adaptiveCardDialogInfo.card,\n height: adaptiveCardDialogInfo.size ? adaptiveCardDialogInfo.size.height : DialogDimension.Small,\n width: adaptiveCardDialogInfo.size ? adaptiveCardDialogInfo.size.width : DialogDimension.Small,\n title: adaptiveCardDialogInfo.title,\n };\n return dialogInfo;\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Convert BotAdaptiveCardDialogInfo to DialogInfo to send the information to host in {@linkcode adaptiveCard.open} API.\n *\n * @internal\n */\n export function getDialogInfoFromBotAdaptiveCardDialogInfo(\n botAdaptiveCardDialogInfo: BotAdaptiveCardDialogInfo,\n ): DialogInfo {\n const dialogInfo: DialogInfo = getDialogInfoFromAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo);\n dialogInfo.completionBotId = botAdaptiveCardDialogInfo.completionBotId;\n return dialogInfo;\n }\n\n /**\n * @hidden\n * Converts {@link TaskInfo} to {@link AdaptiveCardDialogInfo}\n * @param taskInfo - TaskInfo object to convert\n * @returns - converted AdaptiveCardDialogInfo\n */\n export function getAdaptiveCardDialogInfoFromTaskInfo(taskInfo: TaskInfo): AdaptiveCardDialogInfo {\n // eslint-disable-next-line strict-null-checks/all\n const adaptiveCardDialogInfo: AdaptiveCardDialogInfo = {\n card: taskInfo.card,\n size: {\n height: taskInfo.height ? taskInfo.height : DialogDimension.Small,\n width: taskInfo.width ? taskInfo.width : DialogDimension.Small,\n },\n title: taskInfo.title,\n };\n\n return adaptiveCardDialogInfo;\n }\n\n /**\n * @hidden\n * Converts {@link TaskInfo} to {@link BotAdaptiveCardDialogInfo}\n * @param taskInfo - TaskInfo object to convert\n * @returns - converted BotAdaptiveCardDialogInfo\n */\n export function getBotAdaptiveCardDialogInfoFromTaskInfo(taskInfo: TaskInfo): BotAdaptiveCardDialogInfo {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const botAdaptiveCardDialogInfo: BotAdaptiveCardDialogInfo = {\n card: taskInfo.card,\n size: {\n height: taskInfo.height ? taskInfo.height : DialogDimension.Small,\n width: taskInfo.width ? taskInfo.width : DialogDimension.Small,\n },\n title: taskInfo.title,\n completionBotId: taskInfo.completionBotId,\n };\n\n return botAdaptiveCardDialogInfo;\n }\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { runtime } from '../public/runtime';\nimport { errorNotSupportedOnPlatform } from './constants';\n\n/**\n * Namespace to interact with the menu-specific part of the SDK.\n * This object is used to show View Configuration, Action Menu and Navigation Bar Menu.\n */\nexport namespace menus {\n /**\n * @hidden\n * Represents information about item in View Configuration.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface ViewConfiguration {\n /**\n * @hidden\n * Unique identifier of view.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n id: string;\n /**\n * @hidden\n * Display title of the view.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n /**\n * @hidden\n * Additional information for accessibility.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n contentDescription?: string;\n }\n\n /**\n * Defines how a menu item should appear in the NavBar.\n */\n export enum DisplayMode {\n /**\n * Only place this item in the NavBar if there's room for it.\n * If there's no room, item is shown in the overflow menu.\n */\n ifRoom = 0,\n /**\n * Never place this item in the NavBar.\n * The item would always be shown in NavBar's overflow menu.\n */\n overflowOnly = 1,\n }\n\n /**\n * @hidden\n * Represents information about menu item for Action Menu and Navigation Bar Menu.\n */\n export class MenuItem {\n /**\n * @hidden\n * Unique identifier for the menu item.\n */\n public id: string;\n /**\n * @hidden\n * Display title of the menu item.\n */\n public title: string;\n /**\n * @hidden\n * Display icon of the menu item. The icon value must be a string having SVG icon content.\n */\n public icon: string;\n /**\n * @hidden\n * Selected state display icon of the menu item. The icon value must be a string having SVG icon content.\n */\n public iconSelected?: string;\n /**\n * @hidden\n * Additional information for accessibility.\n */\n public contentDescription?: string;\n /**\n * @hidden\n * State of the menu item\n */\n public enabled = true;\n /**\n * @hidden\n * Interface to show list of items on selection of menu item.\n */\n public viewData?: ViewData;\n /**\n * @hidden\n * Whether the menu item is selected or not\n */\n public selected = false;\n /**\n * The Display Mode of the menu item.\n * Default Behaviour would be DisplayMode.ifRoom if null.\n * Refer {@link DisplayMode}\n */\n public displayMode?: DisplayMode;\n }\n\n /**\n * @hidden\n * Represents information about view to show on Navigation Bar Menu item selection\n */\n export interface ViewData {\n /**\n * @hidden\n * Display header title of the item list.\n */\n listTitle?: string;\n /**\n * @hidden\n * Type of the menu item.\n */\n listType: MenuListType;\n /**\n * @hidden\n * Array of MenuItem. Icon value will be required for all items in the list.\n */\n listItems: MenuItem[];\n }\n\n /**\n * @hidden\n * Represents information about type of list to display in Navigation Bar Menu.\n */\n export enum MenuListType {\n dropDown = 'dropDown',\n popOver = 'popOver',\n }\n let navBarMenuItemPressHandler: ((id: string) => boolean) | undefined;\n let actionMenuItemPressHandler: ((id: string) => boolean) | undefined;\n let viewConfigItemPressHandler: ((id: string) => boolean) | undefined;\n\n export function initialize(): void {\n registerHandler('navBarMenuItemPress', handleNavBarMenuItemPress, false);\n registerHandler('actionMenuItemPress', handleActionMenuItemPress, false);\n registerHandler('setModuleView', handleViewConfigItemPress, false);\n }\n\n /**\n * @hidden\n * Registers list of view configurations and it's handler.\n * Handler is responsible for listening selection of View Configuration.\n *\n * @param viewConfig - List of view configurations. Minimum 1 value is required.\n * @param handler - The handler to invoke when the user selects view configuration.\n */\n export function setUpViews(viewConfig: ViewConfiguration[], handler: (id: string) => boolean): void {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n viewConfigItemPressHandler = handler;\n sendMessageToParent('setUpViews', [viewConfig]);\n }\n\n function handleViewConfigItemPress(id: string): void {\n if (!viewConfigItemPressHandler || !viewConfigItemPressHandler(id)) {\n ensureInitialized(runtime);\n sendMessageToParent('viewConfigItemPress', [id]);\n }\n }\n\n /**\n * @hidden\n * Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.\n *\n * @param items List of MenuItems for Navigation Bar Menu.\n * @param handler The handler to invoke when the user selects menu item.\n */\n export function setNavBarMenu(items: MenuItem[], handler: (id: string) => boolean): void {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n navBarMenuItemPressHandler = handler;\n sendMessageToParent('setNavBarMenu', [items]);\n }\n\n function handleNavBarMenuItemPress(id: string): void {\n if (!navBarMenuItemPressHandler || !navBarMenuItemPressHandler(id)) {\n ensureInitialized(runtime);\n sendMessageToParent('handleNavBarMenuItemPress', [id]);\n }\n }\n\n export interface ActionMenuParameters {\n /**\n * @hidden\n * Display title for Action Menu\n */\n title: string;\n /**\n * @hidden\n * List of MenuItems for Action Menu\n */\n items: MenuItem[];\n }\n\n /**\n * @hidden\n * Used to show Action Menu.\n *\n * @param params - Parameters for Menu Parameters\n * @param handler - The handler to invoke when the user selects menu item.\n */\n export function showActionMenu(params: ActionMenuParameters, handler: (id: string) => boolean): void {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n actionMenuItemPressHandler = handler;\n sendMessageToParent('showActionMenu', [params]);\n }\n\n function handleActionMenuItemPress(id: string): void {\n if (!actionMenuItemPressHandler || !actionMenuItemPressHandler(id)) {\n ensureInitialized(runtime);\n sendMessageToParent('handleActionMenuItemPress', [id]);\n }\n }\n\n /**\n * Checks if the menus capability is supported by the host\n * @returns boolean to represent whether the menus capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.menus ? true : false;\n }\n}\n","import { GlobalVars } from '../internal/globalVars';\nimport * as Handlers from '../internal/handlers'; // Conflict with some names\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform } from './constants';\nimport { LoadContext } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Namespace containing the set of APIs that support Teams-specific functionalities.\n */\n\nexport namespace teamsCore {\n /**\n * Enable print capability to support printing page using Ctrl+P and cmd+P\n */\n export function enablePrintCapability(): void {\n if (!GlobalVars.printCapabilityEnabled) {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n GlobalVars.printCapabilityEnabled = true;\n // adding ctrl+P and cmd+P handler\n document.addEventListener('keydown', (event: KeyboardEvent) => {\n if ((event.ctrlKey || event.metaKey) && event.keyCode === 80) {\n print();\n event.cancelBubble = true;\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n });\n }\n }\n\n /**\n * default print handler\n */\n export function print(): void {\n if (typeof window !== 'undefined') {\n window.print();\n } else {\n // This codepath only exists to enable compilation in a server-side redered environment. In standard usage, the window object should never be undefined so this code path should never run.\n // If this error has actually been thrown, something has gone very wrong and it is a bug\n throw new Error('window object undefined at print call');\n }\n }\n\n /**\n * Registers a handler to be called when the page has been requested to load.\n *\n * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)\n * for a more detailed explanation about using this API.\n *\n * @param handler - The handler to invoke when the page is loaded.\n *\n * @beta\n */\n export function registerOnLoadHandler(handler: (context: LoadContext) => void): void {\n registerOnLoadHandlerHelper(handler, () => {\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerOnLoadHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param handler - The handler to invoke when the page is loaded.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerOnLoadHandlerHelper(\n handler: (context: LoadContext) => void,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime);\n\n if (handler && versionSpecificHelper) {\n versionSpecificHelper();\n }\n\n Handlers.registerOnLoadHandler(handler);\n }\n\n /**\n * Registers a handler to be called before the page is unloaded.\n *\n * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)\n * for a more detailed explanation about using this API.\n *\n * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should\n * invoke the readyToUnload function provided to it once it's ready to be unloaded.\n *\n * @beta\n */\n export function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void {\n registerBeforeUnloadHandlerHelper(handler, () => {\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerBeforeUnloadHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param handler - - The handler to invoke before the page is unloaded. If this handler returns true the page should\n * invoke the readyToUnload function provided to it once it's ready to be unloaded.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerBeforeUnloadHandlerHelper(\n handler: (readyToUnload: () => void) => boolean,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime);\n if (handler && versionSpecificHelper) {\n versionSpecificHelper();\n }\n Handlers.registerBeforeUnloadHandler(handler);\n }\n\n /**\n * Checks if teamsCore capability is supported by the host\n *\n * @returns boolean to represent whether the teamsCore capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.teamsCore ? true : false;\n }\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport {\n Communication,\n initializeCommunication,\n sendAndHandleStatusAndReason as send,\n sendAndUnwrap,\n sendMessageToParent,\n uninitializeCommunication,\n} from '../internal/communication';\nimport { defaultSDKVersionForCompatCheck } from '../internal/constants';\nimport { GlobalVars } from '../internal/globalVars';\nimport * as Handlers from '../internal/handlers'; // Conflict with some names\nimport { ensureInitializeCalled, ensureInitialized, processAdditionalValidOrigins } from '../internal/internalAPIs';\nimport { getLogger } from '../internal/telemetry';\nimport { compareSDKVersions, runWithTimeout } from '../internal/utils';\nimport { logs } from '../private/logs';\nimport { authentication } from './authentication';\nimport { ChannelType, FrameContexts, HostClientType, HostName, TeamType, UserTeamRole } from './constants';\nimport { dialog } from './dialog';\nimport { ActionInfo, Context as LegacyContext, FileOpenPreference, LocaleInfo } from './interfaces';\nimport { menus } from './menus';\nimport { pages } from './pages';\nimport { applyRuntimeConfig, generateBackCompatRuntimeConfig, IBaseRuntime, runtime } from './runtime';\nimport { teamsCore } from './teamsAPIs';\nimport { version } from './version';\n\n/**\n * Namespace to interact with app initialization and lifecycle.\n */\nexport namespace app {\n const appLogger = getLogger('app');\n\n // ::::::::::::::::::::::: MicrosoftTeams client SDK public API ::::::::::::::::::::\n\n export const Messages = {\n AppLoaded: 'appInitialization.appLoaded',\n Success: 'appInitialization.success',\n Failure: 'appInitialization.failure',\n ExpectedFailure: 'appInitialization.expectedFailure',\n };\n\n /**\n * Describes errors that caused app initialization to fail\n */\n export enum FailedReason {\n /**\n * Authentication failed\n */\n AuthFailed = 'AuthFailed',\n /**\n * The application timed out\n */\n Timeout = 'Timeout',\n /**\n * The app failed for a different reason\n */\n Other = 'Other',\n }\n\n /**\n * Describes expected errors that occurred during an otherwise successful\n * app initialization\n */\n export enum ExpectedFailureReason {\n /**\n * There was a permission error\n */\n PermissionError = 'PermissionError',\n /**\n * The item was not found\n */\n NotFound = 'NotFound',\n /**\n * The network is currently throttled\n */\n Throttling = 'Throttling',\n /**\n * The application is currently offline\n */\n Offline = 'Offline',\n /**\n * The app failed for a different reason\n */\n Other = 'Other',\n }\n\n /**\n * Represents the failed request sent during a failed app initialization.\n */\n export interface IFailedRequest {\n /**\n * The reason for the failure\n */\n reason: FailedReason;\n /**\n * This property is currently unused.\n */\n message?: string;\n }\n\n /**\n * Represents the failure request sent during an erroneous app initialization.\n */\n export interface IExpectedFailureRequest {\n /**\n * The reason for the failure\n */\n reason: ExpectedFailureReason;\n /**\n * A message that describes the failure\n */\n message?: string;\n }\n\n /**\n * Represents application information.\n */\n export interface AppInfo {\n /**\n * The current locale that the user has configured for the app formatted as\n * languageId-countryId (for example, en-us).\n */\n locale: string;\n\n /**\n * The current UI theme of the host. Possible values: \"default\", \"dark\", or \"contrast\".\n */\n theme: string;\n\n /**\n * Unique ID for the current session for use in correlating telemetry data.\n */\n sessionId: string;\n\n /**\n * Info of the host\n */\n host: AppHostInfo;\n\n /**\n * More detailed locale info from the user's OS if available. Can be used together with\n * the @microsoft/globe NPM package to ensure your app respects the user's OS date and\n * time format configuration\n */\n osLocaleInfo?: LocaleInfo;\n /**\n * Personal app icon y coordinate position\n */\n iconPositionVertical?: number;\n\n /**\n * Time when the user clicked on the tab\n */\n userClickTime?: number;\n\n /**\n * The ID of the parent message from which this task module was launched.\n * This is only available in task modules launched from bot cards.\n */\n parentMessageId?: string;\n\n /**\n * Where the user prefers the file to be opened from by default during file open\n */\n userFileOpenPreference?: FileOpenPreference;\n\n /**\n * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data.\n */\n appLaunchId?: string;\n }\n\n /**\n * Represents information about the application's host.\n */\n export interface AppHostInfo {\n /**\n * Identifies which host is running your app\n */\n name: HostName;\n\n /**\n * The client type on which the host is running\n */\n clientType: HostClientType;\n\n /**\n * Unique ID for the current Host session for use in correlating telemetry data.\n */\n sessionId: string;\n\n /**\n * Current ring ID\n */\n ringId?: string;\n }\n\n /**\n * Represents Channel information.\n */\n export interface ChannelInfo {\n /**\n * The Microsoft Teams ID for the channel with which the content is associated.\n */\n id: string;\n\n /**\n * The name for the channel with which the content is associated.\n */\n displayName?: string;\n\n /**\n * The relative path to the SharePoint folder associated with the channel.\n */\n relativeUrl?: string;\n\n /**\n * The type of the channel with which the content is associated.\n */\n membershipType?: ChannelType;\n\n /**\n * The OneNote section ID that is linked to the channel.\n */\n defaultOneNoteSectionId?: string;\n\n /**\n * The tenant ID of the team which owns the channel.\n */\n ownerTenantId?: string;\n\n /**\n * The AAD group ID of the team which owns the channel.\n */\n ownerGroupId?: string;\n }\n\n /**\n * Represents Chat information.\n */\n export interface ChatInfo {\n /**\n * The Microsoft Teams ID for the chat with which the content is associated.\n */\n id: string;\n }\n\n /**\n * Represents Meeting information.\n */\n export interface MeetingInfo {\n /**\n * Meeting Id used by tab when running in meeting context\n */\n id: string;\n }\n\n /**\n * Represents Page information.\n */\n export interface PageInfo {\n /**\n * The developer-defined unique ID for the page this content points to.\n */\n id: string;\n\n /**\n * The context where page url is loaded (content, task, setting, remove, sidePanel)\n */\n frameContext: FrameContexts;\n\n /**\n * The developer-defined unique ID for the sub-page this content points to.\n * This field should be used to restore to a specific state within a page,\n * such as scrolling to or activating a specific piece of content.\n */\n subPageId?: string;\n\n /**\n * Indication whether the page is in full-screen mode.\n */\n isFullScreen?: boolean;\n\n /**\n * Indication whether the page is in a pop out window\n */\n isMultiWindow?: boolean;\n\n /**\n * Source origin from where the page is opened\n */\n sourceOrigin?: string;\n }\n\n /**\n * Represents Team information.\n */\n export interface TeamInfo {\n /**\n * The Microsoft Teams ID for the team with which the content is associated.\n */\n internalId: string;\n\n /**\n * The name for the team with which the content is associated.\n */\n displayName?: string;\n\n /**\n * The type of the team.\n */\n type?: TeamType;\n\n /**\n * The Office 365 group ID for the team with which the content is associated.\n * This field is available only when the identity permission is requested in the manifest.\n */\n groupId?: string;\n\n /**\n * Indicates whether team is archived.\n * Apps should use this as a signal to prevent any changes to content associated with archived teams.\n */\n isArchived?: boolean;\n\n /**\n * Team Template ID if there was a Team Template associated with the creation of the team.\n */\n templateId?: string;\n\n /**\n * The user's role in the team.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to the user's role, and never as proof of her role.\n */\n userRole?: UserTeamRole;\n }\n\n /**\n * Represents User information.\n */\n export interface UserInfo {\n /**\n * The Azure AD object id of the current user.\n * Because a malicious party run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n id: string;\n\n /**\n * The address book name of the current user.\n */\n displayName?: string;\n\n /**\n * Represents whether calling is allowed for the current logged in User\n */\n isCallingAllowed?: boolean;\n\n /**\n * Represents whether PSTN calling is allowed for the current logged in User\n */\n isPSTNCallingAllowed?: boolean;\n\n /**\n * The license type for the current user. Possible values are:\n * \"Unknown\", \"Teacher\", \"Student\", \"Free\", \"SmbBusinessVoice\", \"SmbNonVoice\", \"FrontlineWorker\", \"Anonymous\"\n */\n licenseType?: string;\n\n /**\n * A value suitable for use as a login_hint when authenticating with Azure AD.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n loginHint?: string;\n\n /**\n * The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users).\n * Because a malicious party run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n userPrincipalName?: string;\n\n /**\n * The tenant related info of the current user.\n */\n tenant?: TenantInfo;\n }\n\n /**\n * Represents Tenant information.\n */\n export interface TenantInfo {\n /**\n * The Azure AD tenant ID of the current user.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n id: string;\n\n /**\n * The type of license for the current users tenant.\n */\n teamsSku?: string;\n }\n\n export interface SharePointSiteInfo {\n /**\n * The root SharePoint site associated with the team.\n */\n teamSiteUrl?: string;\n\n /**\n * The domain of the root SharePoint site associated with the team.\n */\n teamSiteDomain?: string;\n\n /**\n * The relative path to the SharePoint site associated with the team.\n */\n teamSitePath?: string;\n\n /**\n * Teamsite ID, aka sharepoint site id.\n */\n teamSiteId?: string;\n\n /**\n * The SharePoint my site domain associated with the user.\n */\n mySiteDomain?: string;\n\n /**\n * The SharePoint relative path to the current users mysite\n */\n mySitePath?: string;\n }\n\n /**\n * Represents structure of the received context message.\n */\n export interface Context {\n /**\n * Content Action Info\n *\n * @beta\n */\n actionInfo?: ActionInfo;\n /**\n * Properties about the current session for your app\n */\n app: AppInfo;\n\n /**\n * Info about the current page context hosting your app\n */\n page: PageInfo;\n\n /**\n * Info about the currently logged in user running the app.\n * If the current user is not logged in/authenticated (e.g. a meeting app running for an anonymously-joined partcipant) this will be `undefined`.\n */\n user?: UserInfo;\n\n /**\n * When running in the context of a Teams channel, provides information about the channel, else `undefined`\n */\n channel?: ChannelInfo;\n\n /**\n * When running in the context of a Teams chat, provides information about the chat, else `undefined`\n */\n chat?: ChatInfo;\n\n /**\n * When running in the context of a Teams meeting, provides information about the meeting, else `undefined`\n */\n meeting?: MeetingInfo;\n\n /**\n * When hosted in SharePoint, this is the [SharePoint PageContext](https://learn.microsoft.com/javascript/api/sp-page-context/pagecontext?view=sp-typescript-latest), else `undefined`\n */\n sharepoint?: any;\n\n /**\n * When running in Teams for an organization with a tenant, provides information about the SharePoint site associated with the team.\n * Will be `undefined` when not running in Teams for an organization with a tenant.\n */\n sharePointSite?: SharePointSiteInfo;\n\n /**\n * When running in Teams, provides information about the Team context in which your app is running.\n * Will be `undefined` when not running in Teams.\n */\n team?: TeamInfo;\n }\n\n /**\n * Checks whether the Teams client SDK has been initialized.\n * @returns whether the Teams client SDK has been initialized.\n */\n export function isInitialized(): boolean {\n return GlobalVars.initializeCompleted;\n }\n\n /**\n * Gets the Frame Context that the App is running in. See {@link FrameContexts} for the list of possible values.\n * @returns the Frame Context.\n */\n export function getFrameContext(): FrameContexts {\n return GlobalVars.frameContext;\n }\n\n /**\n * Number of milliseconds we'll give the initialization call to return before timing it out\n */\n const initializationTimeoutInMs = 5000;\n\n /**\n * Initializes the library.\n *\n * @remarks\n * Initialize must have completed successfully (as determined by the resolved Promise) before any other library calls are made\n *\n * @param validMessageOrigins - Optionally specify a list of cross frame message origins. They must have\n * https: protocol otherwise they will be ignored. Example: https://www.example.com\n * @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out\n */\n export function initialize(validMessageOrigins?: string[]): Promise<void> {\n if (!inServerSideRenderingEnvironment()) {\n return runWithTimeout(\n () => initializeHelper(validMessageOrigins),\n initializationTimeoutInMs,\n new Error('SDK initialization timed out.'),\n );\n } else {\n const initializeLogger = appLogger.extend('initialize');\n // This log statement should NEVER actually be written. This code path exists only to enable compilation in server-side rendering environments.\n // If you EVER see this statement in ANY log file, something has gone horribly wrong and a bug needs to be filed.\n initializeLogger('window object undefined at initialization');\n return Promise.resolve();\n }\n }\n\n const initializeHelperLogger = appLogger.extend('initializeHelper');\n function initializeHelper(validMessageOrigins?: string[]): Promise<void> {\n return new Promise<void>((resolve) => {\n // Independent components might not know whether the SDK is initialized so might call it to be safe.\n // Just no-op if that happens to make it easier to use.\n if (!GlobalVars.initializeCalled) {\n GlobalVars.initializeCalled = true;\n\n Handlers.initializeHandlers();\n GlobalVars.initializePromise = initializeCommunication(validMessageOrigins).then(\n ({ context, clientType, runtimeConfig, clientSupportedSDKVersion = defaultSDKVersionForCompatCheck }) => {\n GlobalVars.frameContext = context;\n GlobalVars.hostClientType = clientType;\n GlobalVars.clientSupportedSDKVersion = clientSupportedSDKVersion;\n // Temporary workaround while the Host is updated with the new argument order.\n // For now, we might receive any of these possibilities:\n // - `runtimeConfig` in `runtimeConfig` and `clientSupportedSDKVersion` in `clientSupportedSDKVersion`.\n // - `runtimeConfig` in `clientSupportedSDKVersion` and `clientSupportedSDKVersion` in `runtimeConfig`.\n // - `clientSupportedSDKVersion` in `runtimeConfig` and no `clientSupportedSDKVersion`.\n // This code supports any of these possibilities\n\n // Teams AppHost won't provide this runtime config\n // so we assume that if we don't have it, we must be running in Teams.\n // After Teams updates its client code, we can remove this default code.\n try {\n initializeHelperLogger('Parsing %s', runtimeConfig);\n const givenRuntimeConfig: IBaseRuntime | null = JSON.parse(runtimeConfig);\n initializeHelperLogger('Checking if %o is a valid runtime object', givenRuntimeConfig ?? 'null');\n // Check that givenRuntimeConfig is a valid instance of IBaseRuntime\n if (!givenRuntimeConfig || !givenRuntimeConfig.apiVersion) {\n throw new Error('Received runtime config is invalid');\n }\n runtimeConfig && applyRuntimeConfig(givenRuntimeConfig);\n } catch (e) {\n if (e instanceof SyntaxError) {\n try {\n initializeHelperLogger('Attempting to parse %s as an SDK version', runtimeConfig);\n // if the given runtime config was actually meant to be a SDK version, store it as such.\n // TODO: This is a temporary workaround to allow Teams to store clientSupportedSDKVersion even when\n // it doesn't provide the runtimeConfig. After Teams updates its client code, we should\n // remove this feature.\n if (!isNaN(compareSDKVersions(runtimeConfig, defaultSDKVersionForCompatCheck))) {\n GlobalVars.clientSupportedSDKVersion = runtimeConfig;\n }\n const givenRuntimeConfig: IBaseRuntime | null = JSON.parse(clientSupportedSDKVersion);\n initializeHelperLogger('givenRuntimeConfig parsed to %o', givenRuntimeConfig ?? 'null');\n\n if (!givenRuntimeConfig) {\n throw new Error(\n 'givenRuntimeConfig string was successfully parsed. However, it parsed to value of null',\n );\n } else {\n applyRuntimeConfig(givenRuntimeConfig);\n }\n } catch (e) {\n if (e instanceof SyntaxError) {\n applyRuntimeConfig(generateBackCompatRuntimeConfig(GlobalVars.clientSupportedSDKVersion));\n } else {\n throw e;\n }\n }\n } else {\n // If it's any error that's not a JSON parsing error, we want the program to fail.\n throw e;\n }\n }\n\n GlobalVars.initializeCompleted = true;\n },\n );\n\n authentication.initialize();\n menus.initialize();\n pages.config.initialize();\n dialog.initialize();\n }\n\n // Handle additional valid message origins if specified\n if (Array.isArray(validMessageOrigins)) {\n processAdditionalValidOrigins(validMessageOrigins);\n }\n\n resolve(GlobalVars.initializePromise);\n });\n }\n\n /**\n * @hidden\n * Undocumented function used to set a mock window for unit tests\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function _initialize(hostWindow: any): void {\n Communication.currentWindow = hostWindow;\n }\n\n /**\n * @hidden\n * Undocumented function used to clear state between unit tests\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function _uninitialize(): void {\n if (!GlobalVars.initializeCalled) {\n return;\n }\n\n if (GlobalVars.frameContext) {\n /* eslint-disable strict-null-checks/all */ /* Fix tracked by 5730662 */\n registerOnThemeChangeHandler(null);\n pages.backStack.registerBackButtonHandler(null);\n pages.registerFullScreenHandler(null);\n teamsCore.registerBeforeUnloadHandler(null);\n teamsCore.registerOnLoadHandler(null);\n logs.registerGetLogHandler(null); /* Fix tracked by 5730662 */\n /* eslint-enable strict-null-checks/all */\n }\n\n if (GlobalVars.frameContext === FrameContexts.settings) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n pages.config.registerOnSaveHandler(null);\n }\n\n if (GlobalVars.frameContext === FrameContexts.remove) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n pages.config.registerOnRemoveHandler(null);\n }\n\n GlobalVars.initializeCalled = false;\n GlobalVars.initializeCompleted = false;\n GlobalVars.initializePromise = null;\n GlobalVars.additionalValidOrigins = [];\n GlobalVars.frameContext = null;\n GlobalVars.hostClientType = null;\n GlobalVars.isFramelessWindow = false;\n\n uninitializeCommunication();\n }\n\n /**\n * Retrieves the current context the frame is running in.\n *\n * @returns Promise that will resolve with the {@link app.Context} object.\n */\n export function getContext(): Promise<app.Context> {\n return new Promise<LegacyContext>((resolve) => {\n ensureInitializeCalled();\n resolve(sendAndUnwrap('getContext'));\n }).then((legacyContext) => transformLegacyContextToAppContext(legacyContext)); // converts globalcontext to app.context\n }\n\n /**\n * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.\n */\n export function notifyAppLoaded(): void {\n ensureInitializeCalled();\n sendMessageToParent(Messages.AppLoaded, [version]);\n }\n\n /**\n * Notifies the frame that app initialization is successful and is ready for user interaction.\n */\n export function notifySuccess(): void {\n ensureInitializeCalled();\n sendMessageToParent(Messages.Success, [version]);\n }\n\n /**\n * Notifies the frame that app initialization has failed and to show an error page in its place.\n *\n * @param appInitializationFailedRequest - The failure request containing the reason for why the app failed\n * during initialization as well as an optional message.\n */\n export function notifyFailure(appInitializationFailedRequest: IFailedRequest): void {\n ensureInitializeCalled();\n sendMessageToParent(Messages.Failure, [\n appInitializationFailedRequest.reason,\n appInitializationFailedRequest.message,\n ]);\n }\n\n /**\n * Notifies the frame that app initialized with some expected errors.\n *\n * @param expectedFailureRequest - The expected failure request containing the reason and an optional message\n */\n export function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void {\n ensureInitializeCalled();\n sendMessageToParent(Messages.ExpectedFailure, [expectedFailureRequest.reason, expectedFailureRequest.message]);\n }\n\n /**\n * Registers a handler for theme changes.\n *\n * @remarks\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the user changes their theme.\n */\n export function registerOnThemeChangeHandler(handler: (theme: string) => void): void {\n // allow for registration cleanup even when not called initialize\n handler && ensureInitializeCalled();\n Handlers.registerOnThemeChangeHandler(handler);\n }\n\n /**\n * open link API.\n *\n * @param deepLink - deep link.\n * @returns Promise that will be fulfilled when the operation has completed\n */\n export function openLink(deepLink: string): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n resolve(send('executeDeepLink', deepLink));\n });\n }\n}\n\n/**\n * @hidden\n * Transforms the Legacy Context object received from Messages to the structured app.Context object\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction transformLegacyContextToAppContext(legacyContext: LegacyContext): app.Context {\n const context: app.Context = {\n actionInfo: legacyContext.actionInfo,\n app: {\n locale: legacyContext.locale,\n sessionId: legacyContext.appSessionId ? legacyContext.appSessionId : '',\n theme: legacyContext.theme ? legacyContext.theme : 'default',\n iconPositionVertical: legacyContext.appIconPosition,\n osLocaleInfo: legacyContext.osLocaleInfo,\n parentMessageId: legacyContext.parentMessageId,\n userClickTime: legacyContext.userClickTime,\n userFileOpenPreference: legacyContext.userFileOpenPreference,\n host: {\n name: legacyContext.hostName ? legacyContext.hostName : HostName.teams,\n clientType: legacyContext.hostClientType ? legacyContext.hostClientType : HostClientType.web,\n sessionId: legacyContext.sessionId ? legacyContext.sessionId : '',\n ringId: legacyContext.ringId,\n },\n appLaunchId: legacyContext.appLaunchId,\n },\n page: {\n id: legacyContext.entityId,\n frameContext: legacyContext.frameContext ? legacyContext.frameContext : GlobalVars.frameContext,\n subPageId: legacyContext.subEntityId,\n isFullScreen: legacyContext.isFullScreen,\n isMultiWindow: legacyContext.isMultiWindow,\n sourceOrigin: legacyContext.sourceOrigin,\n },\n user: {\n id: legacyContext.userObjectId,\n displayName: legacyContext.userDisplayName,\n isCallingAllowed: legacyContext.isCallingAllowed,\n isPSTNCallingAllowed: legacyContext.isPSTNCallingAllowed,\n licenseType: legacyContext.userLicenseType,\n loginHint: legacyContext.loginHint,\n userPrincipalName: legacyContext.userPrincipalName,\n tenant: legacyContext.tid\n ? {\n id: legacyContext.tid,\n teamsSku: legacyContext.tenantSKU,\n }\n : undefined,\n },\n channel: legacyContext.channelId\n ? {\n id: legacyContext.channelId,\n displayName: legacyContext.channelName,\n relativeUrl: legacyContext.channelRelativeUrl,\n membershipType: legacyContext.channelType,\n defaultOneNoteSectionId: legacyContext.defaultOneNoteSectionId,\n ownerGroupId: legacyContext.hostTeamGroupId,\n ownerTenantId: legacyContext.hostTeamTenantId,\n }\n : undefined,\n chat: legacyContext.chatId\n ? {\n id: legacyContext.chatId,\n }\n : undefined,\n meeting: legacyContext.meetingId\n ? {\n id: legacyContext.meetingId,\n }\n : undefined,\n sharepoint: legacyContext.sharepoint,\n team: legacyContext.teamId\n ? {\n internalId: legacyContext.teamId,\n displayName: legacyContext.teamName,\n type: legacyContext.teamType,\n groupId: legacyContext.groupId,\n templateId: legacyContext.teamTemplateId,\n isArchived: legacyContext.isTeamArchived,\n userRole: legacyContext.userTeamRole,\n }\n : undefined,\n sharePointSite:\n legacyContext.teamSiteUrl ||\n legacyContext.teamSiteDomain ||\n legacyContext.teamSitePath ||\n legacyContext.mySitePath ||\n legacyContext.mySiteDomain\n ? {\n teamSiteUrl: legacyContext.teamSiteUrl,\n teamSiteDomain: legacyContext.teamSiteDomain,\n teamSitePath: legacyContext.teamSitePath,\n teamSiteId: legacyContext.teamSiteId,\n mySitePath: legacyContext.mySitePath,\n mySiteDomain: legacyContext.mySiteDomain,\n }\n : undefined,\n };\n\n return context;\n}\n\nfunction inServerSideRenderingEnvironment(): boolean {\n return typeof window === 'undefined';\n}\n","import {\n Communication,\n sendAndHandleSdkError,\n sendAndHandleStatusAndReason as send,\n sendAndHandleStatusAndReasonWithDefaultError as sendAndDefaultError,\n sendAndUnwrap,\n sendMessageEventToChild,\n sendMessageToParent,\n} from '../internal/communication';\nimport { registerHandler, registerHandlerHelper } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { createTeamsAppLink } from '../internal/utils';\nimport { app } from './app';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { FrameInfo, ShareDeepLinkParameters, TabInformation, TabInstance, TabInstanceParameters } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Navigation-specific part of the SDK.\n */\nexport namespace pages {\n /**\n * Return focus to the host. Will move focus forward or backward based on where the application container falls in\n * the F6/tab order in the host.\n * On mobile hosts or hosts where there is no keyboard interaction or UI notion of \"focus\" this function has no\n * effect and will be a no-op when called.\n * @param navigateForward - Determines the direction to focus in host.\n */\n export function returnFocus(navigateForward?: boolean): void {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('returnFocus', [navigateForward]);\n }\n\n /**\n * @hidden\n *\n * Registers a handler for specifying focus when it passes from the host to the application.\n * On mobile hosts or hosts where there is no UI notion of \"focus\" the handler registered with\n * this function will never be called.\n *\n * @param handler - The handler for placing focus within the application.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void {\n registerHandlerHelper('focusEnter', handler, [], () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * Sets/Updates the current frame with new information\n *\n * @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the\n * user clicks 'Go To Website'\n */\n export function setCurrentFrame(frameInfo: FrameInfo): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('setFrameContext', [frameInfo]);\n }\n\n /**\n * Initializes the library with context information for the frame\n *\n * @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the\n * user clicks 'Go To Website'\n * @param callback - An optional callback that is executed once the application has finished initialization.\n * @param validMessageOrigins - An optional list of cross-frame message origins. They must have\n * https: protocol otherwise they will be ignored. Example: https:www.example.com\n */\n export function initializeWithFrameContext(\n frameInfo: FrameInfo,\n callback?: () => void,\n validMessageOrigins?: string[],\n ): void {\n app.initialize(validMessageOrigins).then(() => callback && callback());\n setCurrentFrame(frameInfo);\n }\n\n /**\n * Defines the configuration of the current or desired instance\n */\n export interface InstanceConfig {\n /**\n * A suggested display name for the new content.\n * In the settings for an existing instance being updated, this call has no effect.\n */\n suggestedDisplayName?: string;\n /**\n * Sets the URL to use for the content of this instance.\n */\n contentUrl: string;\n /**\n * Sets the URL for the removal configuration experience.\n */\n removeUrl?: string;\n /**\n * Sets the URL to use for the external link to view the underlying resource in a browser.\n */\n websiteUrl?: string;\n /**\n * The developer-defined unique ID for the entity to which this content points.\n */\n entityId?: string;\n }\n\n /**\n * Gets the config for the current instance.\n * @returns Promise that resolves with the {@link InstanceConfig} object.\n */\n export function getConfig(): Promise<InstanceConfig> {\n return new Promise<InstanceConfig>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.sidePanel,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndUnwrap('settings.getSettings'));\n });\n }\n\n /**\n * Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the\n * valid domains specified in the validDomains block of the manifest; otherwise, an exception will be\n * thrown. This function needs to be used only when navigating the frame to a URL in a different domain\n * than the current one in a way that keeps the application informed of the change and allows the SDK to\n * continue working.\n * @param url - The URL to navigate the frame to.\n * @returns Promise that resolves when the navigation has completed.\n */\n export function navigateCrossDomain(url: string): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const errorMessage =\n 'Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.';\n resolve(sendAndDefaultError('navigateCrossDomain', errorMessage, url));\n });\n }\n\n /**\n * Navigate to the given application ID and page ID, with optional parameters for a WebURL (if the application\n * cannot be navigated to, such as if it is not installed), Channel ID (for applications installed as a channel tab),\n * and sub-page ID (for navigating to specific content within the page). This is equivalent to navigating to\n * a deep link with the above data, but does not require the application to build a URL or worry about different\n * deep link formats for different hosts.\n * @param params - Parameters for the navigation\n * @returns a promise that will resolve if the navigation was successful\n */\n export function navigateToApp(params: NavigateToAppParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (runtime.isLegacyTeams) {\n resolve(send('executeDeepLink', createTeamsAppLink(params)));\n } else {\n resolve(send('pages.navigateToApp', params));\n }\n });\n }\n\n /**\n * Shares a deep link that a user can use to navigate back to a specific state in this page.\n * Please note that this method does yet work on mobile hosts.\n *\n * @param deepLinkParameters - ID and label for the link and fallback URL.\n */\n export function shareDeepLink(deepLinkParameters: ShareDeepLinkParameters): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('shareDeepLink', [\n deepLinkParameters.subPageId,\n deepLinkParameters.subPageLabel,\n deepLinkParameters.subPageWebUrl,\n ]);\n }\n\n /**\n * Registers a handler for changes from or to full-screen view for a tab.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * On hosts where there is no support for making an app full screen, the handler registered\n * with this function will never be called.\n * @param handler - The handler to invoke when the user toggles full-screen view for a tab.\n */\n export function registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void {\n registerHandlerHelper('fullScreenChange', handler, [], () => {\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * Checks if the pages capability is supported by the host\n * @returns boolean to represent whether the appEntity capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages ? true : false;\n }\n\n /**\n * Parameters for the NavigateToApp API\n */\n export interface NavigateToAppParams {\n /**\n * ID of the application to navigate to\n */\n appId: string;\n\n /**\n * Developer-defined ID of the Page to navigate to within the application (Formerly EntityID)\n */\n pageId: string;\n\n /**\n * Optional URL to open if the navigation cannot be completed within the host\n */\n webUrl?: string;\n\n /**\n * Optional developer-defined ID describing the content to navigate to within the Page. This will be passed\n * back to the application via the Context object.\n */\n subPageId?: string;\n\n /**\n * Optional ID of the Teams Channel where the application should be opened\n */\n channelId?: string;\n }\n\n /**\n * Provides APIs for querying and navigating between contextual tabs of an application. Unlike personal tabs,\n * contextual tabs are pages associated with a specific context, such as channel or chat.\n */\n export namespace tabs {\n /**\n * Navigates the hosted application to the specified tab instance.\n * @param tabInstance - The destination tab instance.\n * @returns Promise that resolves when the navigation has completed.\n */\n export function navigateToTab(tabInstance: TabInstance): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const errorMessage = 'Invalid internalTabInstanceId and/or channelId were/was provided';\n resolve(sendAndDefaultError('navigateToTab', errorMessage, tabInstance));\n });\n }\n /**\n * Retrieves application tabs for the current user.\n * If no TabInstanceParameters are passed, the application defaults to favorite teams and favorite channels.\n * @param tabInstanceParameters - An optional set of flags that specify whether to scope call to favorite teams or channels.\n * @returns Promise that resolves with the {@link TabInformation}. Contains information for the user's tabs that are owned by this application {@link TabInstance}.\n */\n export function getTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise<TabInformation> {\n return new Promise<TabInformation>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(sendAndUnwrap('getTabInstances', tabInstanceParameters));\n });\n }\n\n /**\n * Retrieves the most recently used application tabs for the current user.\n * @param tabInstanceParameters - An optional set of flags. Note this is currently ignored and kept for future use.\n * @returns Promise that resolves with the {@link TabInformation}. Contains information for the users' most recently used tabs {@link TabInstance}.\n */\n export function getMruTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise<TabInformation> {\n return new Promise<TabInformation>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(sendAndUnwrap('getMruTabInstances', tabInstanceParameters));\n });\n }\n\n /**\n * Checks if the pages.tab capability is supported by the host\n * @returns boolean to represent whether the pages.tab capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.tabs\n ? true\n : false\n : false;\n }\n }\n /**\n * Provides APIs to interact with the configuration-specific part of the SDK.\n * This object is usable only on the configuration frame.\n */\n export namespace config {\n let saveHandler: undefined | ((evt: SaveEvent) => void);\n let removeHandler: undefined | ((evt: RemoveEvent) => void);\n\n /**\n * @hidden\n * Hide from docs because this function is only used during initialization\n *\n * Adds register handlers for settings.save and settings.remove upon initialization. Function is called in {@link app.initializeHelper}\n * @internal\n * Limited to Microsoft-internal use\n */\n export function initialize(): void {\n registerHandler('settings.save', handleSave, false);\n registerHandler('settings.remove', handleRemove, false);\n }\n\n /**\n * Sets the validity state for the configuration.\n * The initial value is false, so the user cannot save the configuration until this is called with true.\n * @param validityState - Indicates whether the save or remove button is enabled for the user.\n */\n export function setValidityState(validityState: boolean): void {\n ensureInitialized(runtime, FrameContexts.settings, FrameContexts.remove);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('settings.setValidityState', [validityState]);\n }\n\n /**\n * Sets the configuration for the current instance.\n * This is an asynchronous operation; calls to getConfig are not guaranteed to reflect the changed state.\n * @param instanceConfig - The desired configuration for this instance.\n * @returns Promise that resolves when the operation has completed.\n */\n export function setConfig(instanceConfig: InstanceConfig): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(send('settings.setSettings', instanceConfig));\n });\n }\n\n /**\n * Registers a handler for when the user attempts to save the configuration. This handler should be used\n * to create or update the underlying resource powering the content.\n * The object passed to the handler must be used to notify whether to proceed with the save.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when the user selects the Save button.\n */\n export function registerOnSaveHandler(handler: (evt: SaveEvent) => void): void {\n registerOnSaveHandlerHelper(handler, () => {\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerOnSaveHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param handler - The handler to invoke when the user selects the Save button.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerOnSaveHandlerHelper(\n handler: (evt: SaveEvent) => void,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime, FrameContexts.settings);\n if (versionSpecificHelper) {\n versionSpecificHelper();\n }\n saveHandler = handler;\n handler && sendMessageToParent('registerHandler', ['save']);\n }\n\n /**\n * Registers a handler for user attempts to remove content. This handler should be used\n * to remove the underlying resource powering the content.\n * The object passed to the handler must be used to indicate whether to proceed with the removal.\n * Only one handler may be registered at a time. Subsequent registrations will override the first.\n * @param handler - The handler to invoke when the user selects the Remove button.\n */\n export function registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void {\n registerOnRemoveHandlerHelper(handler, () => {\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerOnRemoveHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param handler - The handler to invoke when the user selects the Remove button.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerOnRemoveHandlerHelper(\n handler: (evt: RemoveEvent) => void,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime, FrameContexts.remove, FrameContexts.settings);\n if (versionSpecificHelper) {\n versionSpecificHelper();\n }\n removeHandler = handler;\n handler && sendMessageToParent('registerHandler', ['remove']);\n }\n\n function handleSave(result?: SaveParameters): void {\n const saveEvent = new SaveEventImpl(result);\n if (saveHandler) {\n saveHandler(saveEvent);\n } else if (Communication.childWindow) {\n sendMessageEventToChild('settings.save', [result]);\n } else {\n // If no handler is registered, we assume success.\n saveEvent.notifySuccess();\n }\n }\n\n /**\n * Registers a handler for when the tab configuration is changed by the user\n * @param handler - The handler to invoke when the user clicks on Settings.\n */\n export function registerChangeConfigHandler(handler: () => void): void {\n registerHandlerHelper('changeSettings', handler, [FrameContexts.content], () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * Describes the results of the settings.save event. Includes result, notifySuccess, and notifyFailure\n * to indicate the return object (result) and the status of whether the settings.save call succeeded or not and why.\n */\n export interface SaveEvent {\n /**\n * Object containing properties passed as arguments to the settings.save event.\n */\n result: SaveParameters;\n /**\n * Indicates that the underlying resource has been created and the config can be saved.\n */\n notifySuccess(): void;\n /**\n * Indicates that creation of the underlying resource failed and that the config cannot be saved.\n * @param reason - Specifies a reason for the failure. If provided, this string is displayed to the user; otherwise a generic error is displayed.\n */\n notifyFailure(reason?: string): void;\n }\n\n /**\n * Describes the results of the settings.remove event. Includes notifySuccess, and notifyFailure\n * to indicate the status of whether the settings.save call succeeded or not and why.\n */\n export interface RemoveEvent {\n /**\n * Indicates that the underlying resource has been removed and the content can be removed.\n */\n notifySuccess(): void;\n /**\n * Indicates that removal of the underlying resource failed and that the content cannot be removed.\n * @param reason - Specifies a reason for the failure. If provided, this string is displayed to the user; otherwise a generic error is displayed.\n */\n notifyFailure(reason?: string): void;\n }\n\n /**\n * Parameters used in the settings.save event\n */\n export interface SaveParameters {\n /**\n * Connector's webhook Url returned as arguments to settings.save event as part of user clicking on Save\n */\n webhookUrl?: string;\n }\n\n /**\n * @hidden\n * Hide from docs, since this class is not directly used.\n */\n class SaveEventImpl implements SaveEvent {\n public notified = false;\n public result: SaveParameters;\n public constructor(result?: SaveParameters) {\n this.result = result ? result : {};\n }\n public notifySuccess(): void {\n this.ensureNotNotified();\n sendMessageToParent('settings.save.success');\n this.notified = true;\n }\n public notifyFailure(reason?: string): void {\n this.ensureNotNotified();\n sendMessageToParent('settings.save.failure', [reason]);\n this.notified = true;\n }\n private ensureNotNotified(): void {\n if (this.notified) {\n throw new Error('The SaveEvent may only notify success or failure once.');\n }\n }\n }\n\n function handleRemove(): void {\n const removeEvent = new RemoveEventImpl();\n if (removeHandler) {\n removeHandler(removeEvent);\n } else if (Communication.childWindow) {\n sendMessageEventToChild('settings.remove', []);\n } else {\n // If no handler is registered, we assume success.\n removeEvent.notifySuccess();\n }\n }\n\n /**\n * @hidden\n * Hide from docs, since this class is not directly used.\n */\n class RemoveEventImpl implements RemoveEvent {\n public notified = false;\n\n public notifySuccess(): void {\n this.ensureNotNotified();\n sendMessageToParent('settings.remove.success');\n this.notified = true;\n }\n\n public notifyFailure(reason?: string): void {\n this.ensureNotNotified();\n sendMessageToParent('settings.remove.failure', [reason]);\n this.notified = true;\n }\n\n private ensureNotNotified(): void {\n if (this.notified) {\n throw new Error('The removeEvent may only notify success or failure once.');\n }\n }\n }\n\n /**\n * Checks if the pages.config capability is supported by the host\n * @returns boolean to represent whether the pages.config capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.config\n ? true\n : false\n : false;\n }\n }\n\n /**\n * Provides APIs for handling the user's navigational history.\n */\n export namespace backStack {\n let backButtonPressHandler: (() => boolean) | undefined;\n\n export function _initialize(): void {\n registerHandler('backButtonPress', handleBackButtonPress, false);\n }\n\n /**\n * Navigates back in the hosted application. See {@link pages.backStack.registerBackButtonHandler} for notes on usage.\n * @returns Promise that resolves when the navigation has completed.\n */\n export function navigateBack(): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const errorMessage = 'Back navigation is not supported in the current client or context.';\n resolve(sendAndDefaultError('navigateBack', errorMessage));\n });\n }\n\n /**\n * Registers a handler for user presses of the host client's back button. Experiences that maintain an internal\n * navigation stack should use this handler to navigate the user back within their frame. If an application finds\n * that after running its back button handler it cannot handle the event it should call the navigateBack\n * method to ask the host client to handle it instead.\n * @param handler - The handler to invoke when the user presses the host client's back button.\n */\n export function registerBackButtonHandler(handler: () => boolean): void {\n registerBackButtonHandlerHelper(handler, () => {\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerBackButtonHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param handler - The handler to invoke when the user presses the host client's back button.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerBackButtonHandlerHelper(handler: () => boolean, versionSpecificHelper?: () => void): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime);\n if (versionSpecificHelper) {\n versionSpecificHelper();\n }\n backButtonPressHandler = handler;\n handler && sendMessageToParent('registerHandler', ['backButton']);\n }\n\n function handleBackButtonPress(): void {\n if (!backButtonPressHandler || !backButtonPressHandler()) {\n if (Communication.childWindow) {\n // If the current window did not handle it let the child window\n sendMessageEventToChild('backButtonPress', []);\n } else {\n navigateBack();\n }\n }\n }\n\n /**\n * Checks if the pages.backStack capability is supported by the host\n * @returns boolean to represent whether the pages.backStack capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.backStack\n ? true\n : false\n : false;\n }\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n * Provides APIs to interact with the full-trust part of the SDK. Limited to 1P applications\n */\n export namespace fullTrust {\n /**\n * @hidden\n * Hide from docs\n * ------\n * Place the tab into full-screen mode.\n */\n export function enterFullscreen(): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('enterFullscreen', []);\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n * Reverts the tab into normal-screen mode.\n */\n export function exitFullscreen(): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('exitFullscreen', []);\n }\n /**\n * @hidden\n *\n * Checks if the pages.fullTrust capability is supported by the host\n * @returns boolean to represent whether the pages.fullTrust capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.fullTrust\n ? true\n : false\n : false;\n }\n }\n\n /**\n * Provides APIs to interact with the app button part of the SDK.\n */\n export namespace appButton {\n /**\n * Registers a handler for clicking the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when the personal app button is clicked in the app bar.\n */\n export function onClick(handler: () => void): void {\n registerHandlerHelper('appButtonClick', handler, [FrameContexts.content], () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * Registers a handler for entering hover of the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.\n */\n export function onHoverEnter(handler: () => void): void {\n registerHandlerHelper('appButtonHoverEnter', handler, [FrameContexts.content], () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * Registers a handler for exiting hover of the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.\n */\n export function onHoverLeave(handler: () => void): void {\n registerHandlerHelper('appButtonHoverLeave', handler, [FrameContexts.content], () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * Checks if pages.appButton capability is supported by the host\n * @returns boolean to represent whether the pages.appButton capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.appButton\n ? true\n : false\n : false;\n }\n }\n\n /**\n * Provides functions for navigating without needing to specify your application ID.\n *\n * @beta\n */\n export namespace currentApp {\n /**\n * Parameters for the NavigateWithinApp\n *\n * @beta\n */\n export interface NavigateWithinAppParams {\n /**\n * The developer-defined unique ID for the page defined in the manifest or when first configuring\n * the page. (Known as {@linkcode Context.entityId} prior to TeamsJS v.2.0.0)\n */\n pageId: string;\n\n /**\n * Optional developer-defined unique ID describing the content to navigate to within the page. This\n * can be retrieved from the Context object {@link app.PageInfo.subPageId | app.Context.page.subPageId}\n */\n subPageId?: string;\n }\n\n /**\n * Navigate within the currently running application with page ID, and sub-page ID (for navigating to\n * specific content within the page).\n * @param params - Parameters for the navigation\n * @returns a promise that will resolve if the navigation was successful\n *\n * @beta\n */\n export function navigateTo(params: NavigateWithinAppParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError('pages.currentApp.navigateTo', params));\n });\n }\n\n /**\n * Navigate to the currently running application's first static page defined in the application\n * manifest.\n * @beta\n */\n export function navigateToDefaultPage(): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError('pages.currentApp.navigateToDefaultPage'));\n });\n }\n\n /**\n * Checks if pages.currentApp capability is supported by the host\n * @returns boolean to represent whether the pages.currentApp capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.currentApp\n ? true\n : false\n : false;\n }\n }\n}\n","// This assignment is replaced at build time by a webpack plugin (or Jest during unit tests) which ensures the value matches the version set in the package version\ndeclare const PACKAGE_VERSION = 'ERROR: This value should be replaced by webpack!';\nexport const version = PACKAGE_VERSION;\n","import { HostClientType } from '../public/constants';\nimport { ErrorCode, SdkError } from '../public/interfaces';\nimport { IBaseRuntime, isRuntimeInitialized, Runtime } from '../public/runtime';\nimport {\n defaultSDKVersionForCompatCheck,\n errorLibraryNotInitialized,\n userOriginUrlValidationRegExp,\n} from './constants';\nimport { GlobalVars } from './globalVars';\nimport { getLogger } from './telemetry';\nimport { compareSDKVersions } from './utils';\n\nconst internalLogger = getLogger('internal');\nconst ensureInitializeCalledLogger = internalLogger.extend('ensureInitializeCalled');\nconst ensureInitializedLogger = internalLogger.extend('ensureInitialized');\n\n/**\n * Ensures `initialize` was called. This function does NOT verify that a response from Host was received and initialization completed.\n *\n * `ensureInitializeCalled` should only be used for APIs which:\n * - work in all FrameContexts\n * - are part of a required Capability\n * - are suspected to be used directly after calling `initialize`, potentially without awaiting the `initialize` call itself\n *\n * For most APIs {@link ensureInitialized} is the right validation function to use instead.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function ensureInitializeCalled(): void {\n if (!GlobalVars.initializeCalled) {\n ensureInitializeCalledLogger(errorLibraryNotInitialized);\n throw new Error(errorLibraryNotInitialized);\n }\n}\n\n/**\n * Ensures `initialize` was called and response from Host was received and processed and that `runtime` is initialized.\n * If expected FrameContexts are provided, it also validates that the current FrameContext matches one of the expected ones.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function ensureInitialized(runtime: IBaseRuntime, ...expectedFrameContexts: string[]): runtime is Runtime {\n // This global var can potentially be removed in the future if we use the initialization status of the runtime object as our source of truth\n if (!GlobalVars.initializeCompleted) {\n ensureInitializedLogger(\n '%s. initializeCalled: %s',\n errorLibraryNotInitialized,\n GlobalVars.initializeCalled.toString(),\n );\n throw new Error(errorLibraryNotInitialized);\n }\n\n if (expectedFrameContexts && expectedFrameContexts.length > 0) {\n let found = false;\n for (let i = 0; i < expectedFrameContexts.length; i++) {\n if (expectedFrameContexts[i] === GlobalVars.frameContext) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n throw new Error(\n `This call is only allowed in following contexts: ${JSON.stringify(expectedFrameContexts)}. ` +\n `Current context: \"${GlobalVars.frameContext}\".`,\n );\n }\n }\n return isRuntimeInitialized(runtime);\n}\n\n/**\n * @hidden\n * Checks whether the platform has knowledge of this API by doing a comparison\n * on API required version and platform supported version of the SDK\n *\n * @param requiredVersion - SDK version required by the API\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isCurrentSDKVersionAtLeast(requiredVersion: string = defaultSDKVersionForCompatCheck): boolean {\n const value = compareSDKVersions(GlobalVars.clientSupportedSDKVersion, requiredVersion);\n if (isNaN(value)) {\n return false;\n }\n return value >= 0;\n}\n\n/**\n * @hidden\n * Helper function to identify if host client is either android or ios\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isHostClientMobile(): boolean {\n return GlobalVars.hostClientType == HostClientType.android || GlobalVars.hostClientType == HostClientType.ios;\n}\n\n/**\n * @hidden\n * Helper function which indicates if current API is supported on mobile or not.\n * @throws SdkError if host client is not android/ios or if the requiredVersion is not\n * supported by platform or not. Null is returned in case of success.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function throwExceptionIfMobileApiIsNotSupported(\n requiredVersion: string = defaultSDKVersionForCompatCheck,\n): void {\n if (!isHostClientMobile()) {\n const notSupportedError: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\n throw notSupportedError;\n } else if (!isCurrentSDKVersionAtLeast(requiredVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n throw oldPlatformError;\n }\n}\n\n/**\n * @hidden\n * Processes the valid origins specifuied by the user, de-duplicates and converts them into a regexp\n * which is used later for message source/origin validation\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function processAdditionalValidOrigins(validMessageOrigins: string[]): void {\n let combinedOriginUrls = GlobalVars.additionalValidOrigins.concat(\n validMessageOrigins.filter((_origin: string) => {\n return typeof _origin === 'string' && userOriginUrlValidationRegExp.test(_origin);\n }),\n );\n const dedupUrls: { [url: string]: boolean } = {};\n combinedOriginUrls = combinedOriginUrls.filter((_originUrl) => {\n if (dedupUrls[_originUrl]) {\n return false;\n }\n dedupUrls[_originUrl] = true;\n return true;\n });\n GlobalVars.additionalValidOrigins = combinedOriginUrls;\n}\n","/* eslint-disable @typescript-eslint/ban-types */\n\nimport { FrameContexts, LoadContext } from '../public';\nimport { pages } from '../public/pages';\nimport { runtime } from '../public/runtime';\nimport { Communication, sendMessageEventToChild, sendMessageToParent } from './communication';\nimport { ensureInitialized } from './internalAPIs';\nimport { getLogger } from './telemetry';\n\nconst handlersLogger = getLogger('handlers');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nclass HandlersPrivate {\n public static handlers: {\n [func: string]: Function;\n } = {};\n public static themeChangeHandler: (theme: string) => void;\n public static loadHandler: (context: LoadContext) => void;\n public static beforeUnloadHandler: (readyToUnload: () => void) => boolean;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function initializeHandlers(): void {\n // ::::::::::::::::::::MicrosoftTeams SDK Internal :::::::::::::::::\n HandlersPrivate.handlers['themeChange'] = handleThemeChange;\n HandlersPrivate.handlers['load'] = handleLoad;\n HandlersPrivate.handlers['beforeUnload'] = handleBeforeUnload;\n pages.backStack._initialize();\n}\n\nconst callHandlerLogger = handlersLogger.extend('callHandler');\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callHandler(name: string, args?: unknown[]): [true, unknown] | [false, undefined] {\n const handler = HandlersPrivate.handlers[name];\n if (handler) {\n callHandlerLogger('Invoking the registered handler for message %s with arguments %o', name, args);\n const result = handler.apply(this, args);\n return [true, result];\n } else if (Communication.childWindow) {\n sendMessageEventToChild(name, [args]);\n return [false, undefined];\n } else {\n callHandlerLogger('Handler for action message %s not found.', name);\n return [false, undefined];\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerHandler(name: string, handler: Function, sendMessage = true, args: unknown[] = []): void {\n if (handler) {\n HandlersPrivate.handlers[name] = handler;\n sendMessage && sendMessageToParent('registerHandler', [name, ...args]);\n } else {\n delete HandlersPrivate.handlers[name];\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function removeHandler(name: string): void {\n delete HandlersPrivate.handlers[name];\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function doesHandlerExist(name: string): boolean {\n return HandlersPrivate.handlers[name] != null;\n}\n\n/**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of register*Handler APIs\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param name - The name of the handler to register.\n * @param handler - The handler to invoke.\n * @param contexts - The context within which it is valid to register this handler.\n * @param registrationHelper - The helper function containing logic pertaining to a specific version of the API.\n */\nexport function registerHandlerHelper(\n name: string,\n handler: Function,\n contexts: FrameContexts[],\n registrationHelper?: () => void,\n): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime, ...contexts);\n if (registrationHelper) {\n registrationHelper();\n }\n\n registerHandler(name, handler);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerOnThemeChangeHandler(handler: (theme: string) => void): void {\n HandlersPrivate.themeChangeHandler = handler;\n handler && sendMessageToParent('registerHandler', ['themeChange']);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function handleThemeChange(theme: string): void {\n if (HandlersPrivate.themeChangeHandler) {\n HandlersPrivate.themeChangeHandler(theme);\n }\n\n if (Communication.childWindow) {\n sendMessageEventToChild('themeChange', [theme]);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerOnLoadHandler(handler: (context: LoadContext) => void): void {\n HandlersPrivate.loadHandler = handler;\n handler && sendMessageToParent('registerHandler', ['load']);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction handleLoad(context: LoadContext): void {\n if (HandlersPrivate.loadHandler) {\n HandlersPrivate.loadHandler(context);\n }\n\n if (Communication.childWindow) {\n sendMessageEventToChild('load', [context]);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void {\n HandlersPrivate.beforeUnloadHandler = handler;\n handler && sendMessageToParent('registerHandler', ['beforeUnload']);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction handleBeforeUnload(): void {\n const readyToUnload = (): void => {\n sendMessageToParent('readyToUnload', []);\n };\n\n if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {\n if (Communication.childWindow) {\n sendMessageEventToChild('beforeUnload');\n } else {\n readyToUnload();\n }\n }\n}\n","/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { FrameContexts } from '../public/constants';\nimport { SdkError } from '../public/interfaces';\nimport { latestRuntimeApiVersion } from '../public/runtime';\nimport { version } from '../public/version';\nimport { GlobalVars } from './globalVars';\nimport { callHandler } from './handlers';\nimport { DOMMessageEvent, ExtendedWindow, MessageRequest, MessageResponse } from './interfaces';\nimport { getLogger } from './telemetry';\nimport { validateOrigin } from './utils';\n\nconst communicationLogger = getLogger('communication');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport class Communication {\n public static currentWindow: Window | any;\n public static parentOrigin: string;\n public static parentWindow: Window | any;\n public static childWindow: Window;\n public static childOrigin: string;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nclass CommunicationPrivate {\n public static parentMessageQueue: MessageRequest[] = [];\n public static childMessageQueue: MessageRequest[] = [];\n public static nextMessageId = 0;\n public static callbacks: {\n [id: number]: Function; // (arg1, arg2, ...etc) => void\n } = {};\n public static promiseCallbacks: {\n [id: number]: Function; // (args[]) => void\n } = {};\n public static messageListener: Function;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\ninterface InitializeResponse {\n context: FrameContexts;\n clientType: string;\n runtimeConfig: string;\n clientSupportedSDKVersion: string;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function initializeCommunication(validMessageOrigins: string[] | undefined): Promise<InitializeResponse> {\n // Listen for messages post to our window\n CommunicationPrivate.messageListener = (evt: DOMMessageEvent): void => processMessage(evt);\n\n // If we are in an iframe, our parent window is the one hosting us (i.e., window.parent); otherwise,\n // it's the window that opened us (i.e., window.opener)\n Communication.currentWindow = Communication.currentWindow || window;\n Communication.parentWindow =\n Communication.currentWindow.parent !== Communication.currentWindow.self\n ? Communication.currentWindow.parent\n : Communication.currentWindow.opener;\n\n // Listen to messages from the parent or child frame.\n // Frameless windows will only receive this event from child frames and if validMessageOrigins is passed.\n if (Communication.parentWindow || validMessageOrigins) {\n Communication.currentWindow.addEventListener('message', CommunicationPrivate.messageListener, false);\n }\n\n if (!Communication.parentWindow) {\n const extendedWindow = Communication.currentWindow as unknown as ExtendedWindow;\n if (extendedWindow.nativeInterface) {\n GlobalVars.isFramelessWindow = true;\n extendedWindow.onNativeMessage = handleParentMessage;\n } else {\n // at this point we weren't able to find a parent to talk to, no way initialization will succeed\n return Promise.reject(new Error('Initialization Failed. No Parent window found.'));\n }\n }\n\n try {\n // Send the initialized message to any origin, because at this point we most likely don't know the origin\n // of the parent window, and this message contains no data that could pose a security risk.\n Communication.parentOrigin = '*';\n return sendMessageToParentAsync<[FrameContexts, string, string, string]>('initialize', [\n version,\n latestRuntimeApiVersion,\n ]).then(\n ([context, clientType, runtimeConfig, clientSupportedSDKVersion]: [FrameContexts, string, string, string]) => {\n return { context, clientType, runtimeConfig, clientSupportedSDKVersion };\n },\n );\n } finally {\n Communication.parentOrigin = null;\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function uninitializeCommunication(): void {\n if (Communication.currentWindow) {\n Communication.currentWindow.removeEventListener('message', CommunicationPrivate.messageListener, false);\n }\n\n Communication.currentWindow = null;\n Communication.parentWindow = null;\n Communication.parentOrigin = null;\n Communication.childWindow = null;\n Communication.childOrigin = null;\n CommunicationPrivate.parentMessageQueue = [];\n CommunicationPrivate.childMessageQueue = [];\n CommunicationPrivate.nextMessageId = 0;\n CommunicationPrivate.callbacks = {};\n CommunicationPrivate.promiseCallbacks = {};\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendAndUnwrap<T>(actionName: string, ...args: any[]): Promise<T> {\n return sendMessageToParentAsync(actionName, args).then(([result]: [T]) => result);\n}\n\nexport function sendAndHandleStatusAndReason(actionName: string, ...args: any[]): Promise<void> {\n return sendMessageToParentAsync(actionName, args).then(([status, reason]: [boolean, string]) => {\n if (!status) {\n throw new Error(reason);\n }\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendAndHandleStatusAndReasonWithDefaultError(\n actionName: string,\n defaultError: string,\n ...args: any[]\n): Promise<void> {\n return sendMessageToParentAsync(actionName, args).then(([status, reason]: [boolean, string]) => {\n if (!status) {\n throw new Error(reason ? reason : defaultError);\n }\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendAndHandleSdkError<T>(actionName: string, ...args: any[]): Promise<T> {\n return sendMessageToParentAsync(actionName, args).then(([error, result]: [SdkError, T]) => {\n if (error) {\n throw error;\n }\n return result;\n });\n}\n\n/**\n * @hidden\n * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageToParentAsync<T>(actionName: string, args: any[] = undefined): Promise<T> {\n return new Promise((resolve) => {\n const request = sendMessageToParentHelper(actionName, args);\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(waitForResponse<T>(request.id));\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction waitForResponse<T>(requestId: number): Promise<T> {\n return new Promise<T>((resolve) => {\n CommunicationPrivate.promiseCallbacks[requestId] = resolve;\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageToParent(actionName: string, callback?: Function): void;\n\n/**\n * @hidden\n * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageToParent(actionName: string, args: any[], callback?: Function): void;\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageToParent(actionName: string, argsOrCallback?: any[] | Function, callback?: Function): void {\n let args: any[] | undefined;\n if (argsOrCallback instanceof Function) {\n callback = argsOrCallback;\n } else if (argsOrCallback instanceof Array) {\n args = argsOrCallback;\n }\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const request = sendMessageToParentHelper(actionName, args);\n if (callback) {\n CommunicationPrivate.callbacks[request.id] = callback;\n }\n}\n\nconst sendMessageToParentHelperLogger = communicationLogger.extend('sendMessageToParentHelper');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction sendMessageToParentHelper(actionName: string, args: any[]): MessageRequest {\n const logger = sendMessageToParentHelperLogger;\n\n const targetWindow = Communication.parentWindow;\n const request = createMessageRequest(actionName, args);\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n logger('Message %i information: %o', request.id, { actionName, args });\n\n if (GlobalVars.isFramelessWindow) {\n if (Communication.currentWindow && Communication.currentWindow.nativeInterface) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n logger('Sending message %i to parent via framelessPostMessage interface', request.id);\n (Communication.currentWindow as ExtendedWindow).nativeInterface.framelessPostMessage(JSON.stringify(request));\n }\n } else {\n const targetOrigin = getTargetOrigin(targetWindow);\n\n // If the target window isn't closed and we already know its origin, send the message right away; otherwise,\n // queue the message and send it after the origin is established\n if (targetWindow && targetOrigin) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n logger('Sending message %i to parent via postMessage', request.id);\n targetWindow.postMessage(request, targetOrigin);\n } else {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n logger('Adding message %i to parent message queue', request.id);\n getTargetMessageQueue(targetWindow).push(request);\n }\n }\n return request;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction processMessage(evt: DOMMessageEvent): void {\n // Process only if we received a valid message\n if (!evt || !evt.data || typeof evt.data !== 'object') {\n return;\n }\n\n // Process only if the message is coming from a different window and a valid origin\n // valid origins are either a pre-known\n const messageSource = evt.source || (evt.originalEvent && evt.originalEvent.source);\n const messageOrigin = evt.origin || (evt.originalEvent && evt.originalEvent.origin);\n if (!shouldProcessMessage(messageSource, messageOrigin)) {\n return;\n }\n\n // Update our parent and child relationships based on this message\n updateRelationships(messageSource, messageOrigin);\n\n // Handle the message\n if (messageSource === Communication.parentWindow) {\n handleParentMessage(evt);\n } else if (messageSource === Communication.childWindow) {\n handleChildMessage(evt);\n }\n}\n\n/**\n * @hidden\n * Validates the message source and origin, if it should be processed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction shouldProcessMessage(messageSource: Window, messageOrigin: string): boolean {\n // Process if message source is a different window and if origin is either in\n // Teams' pre-known whitelist or supplied as valid origin by user during initialization\n if (Communication.currentWindow && messageSource === Communication.currentWindow) {\n return false;\n } else if (\n Communication.currentWindow &&\n Communication.currentWindow.location &&\n messageOrigin &&\n messageOrigin === Communication.currentWindow.location.origin\n ) {\n return true;\n } else {\n return validateOrigin(new URL(messageOrigin));\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction updateRelationships(messageSource: Window, messageOrigin: string): void {\n // Determine whether the source of the message is our parent or child and update our\n // window and origin pointer accordingly\n // For frameless windows (i.e mobile), there is no parent frame, so the message must be from the child.\n if (\n !GlobalVars.isFramelessWindow &&\n (!Communication.parentWindow || Communication.parentWindow.closed || messageSource === Communication.parentWindow)\n ) {\n Communication.parentWindow = messageSource;\n Communication.parentOrigin = messageOrigin;\n } else if (\n !Communication.childWindow ||\n Communication.childWindow.closed ||\n messageSource === Communication.childWindow\n ) {\n Communication.childWindow = messageSource;\n Communication.childOrigin = messageOrigin;\n }\n\n // Clean up pointers to closed parent and child windows\n if (Communication.parentWindow && Communication.parentWindow.closed) {\n Communication.parentWindow = null;\n Communication.parentOrigin = null;\n }\n if (Communication.childWindow && Communication.childWindow.closed) {\n Communication.childWindow = null;\n Communication.childOrigin = null;\n }\n\n // If we have any messages in our queue, send them now\n flushMessageQueue(Communication.parentWindow);\n flushMessageQueue(Communication.childWindow);\n}\n\nconst handleParentMessageLogger = communicationLogger.extend('handleParentMessage');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction handleParentMessage(evt: DOMMessageEvent): void {\n const logger = handleParentMessageLogger;\n\n if ('id' in evt.data && typeof evt.data.id === 'number') {\n // Call any associated Communication.callbacks\n const message = evt.data as MessageResponse;\n const callback = CommunicationPrivate.callbacks[message.id];\n logger('Received a response from parent for message %i', message.id);\n if (callback) {\n logger('Invoking the registered callback for message %i with arguments %o', message.id, message.args);\n callback.apply(null, [...message.args, message.isPartialResponse]);\n\n // Remove the callback to ensure that the callback is called only once and to free up memory if response is a complete response\n if (!isPartialResponse(evt)) {\n logger('Removing registered callback for message %i', message.id);\n delete CommunicationPrivate.callbacks[message.id];\n }\n }\n const promiseCallback = CommunicationPrivate.promiseCallbacks[message.id];\n if (promiseCallback) {\n logger('Invoking the registered promise callback for message %i with arguments %o', message.id, message.args);\n promiseCallback(message.args);\n\n logger('Removing registered promise callback for message %i', message.id);\n delete CommunicationPrivate.promiseCallbacks[message.id];\n }\n } else if ('func' in evt.data && typeof evt.data.func === 'string') {\n // Delegate the request to the proper handler\n const message = evt.data as MessageRequest;\n logger('Received an action message %s from parent', message.func);\n callHandler(message.func, message.args);\n } else {\n logger('Received an unknown message: %O', evt);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction isPartialResponse(evt: DOMMessageEvent): boolean {\n return evt.data.isPartialResponse === true;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction handleChildMessage(evt: DOMMessageEvent): void {\n if ('id' in evt.data && 'func' in evt.data) {\n // Try to delegate the request to the proper handler, if defined\n const message = evt.data as MessageRequest;\n const [called, result] = callHandler(message.func, message.args);\n if (called && typeof result !== 'undefined') {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n sendMessageResponseToChild(message.id, Array.isArray(result) ? result : [result]);\n } else {\n // No handler, proxy to parent\n sendMessageToParent(message.func, message.args, (...args: any[]): void => {\n if (Communication.childWindow) {\n const isPartialResponse = args.pop();\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n sendMessageResponseToChild(message.id, args, isPartialResponse);\n }\n });\n }\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction getTargetMessageQueue(targetWindow: Window): MessageRequest[] {\n return targetWindow === Communication.parentWindow\n ? CommunicationPrivate.parentMessageQueue\n : targetWindow === Communication.childWindow\n ? CommunicationPrivate.childMessageQueue\n : [];\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction getTargetOrigin(targetWindow: Window): string {\n return targetWindow === Communication.parentWindow\n ? Communication.parentOrigin\n : targetWindow === Communication.childWindow\n ? Communication.childOrigin\n : null;\n}\n\nconst flushMessageQueueLogger = communicationLogger.extend('flushMessageQueue');\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction flushMessageQueue(targetWindow: Window | any): void {\n const targetOrigin = getTargetOrigin(targetWindow);\n const targetMessageQueue = getTargetMessageQueue(targetWindow);\n const target = targetWindow == Communication.parentWindow ? 'parent' : 'child';\n while (targetWindow && targetOrigin && targetMessageQueue.length > 0) {\n const request = targetMessageQueue.shift();\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n flushMessageQueueLogger('Flushing message %i from ' + target + ' message queue via postMessage.', request.id);\n targetWindow.postMessage(request, targetOrigin);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function waitForMessageQueue(targetWindow: Window, callback: () => void): void {\n const messageQueueMonitor = Communication.currentWindow.setInterval(() => {\n if (getTargetMessageQueue(targetWindow).length === 0) {\n clearInterval(messageQueueMonitor);\n callback();\n }\n }, 100);\n}\n\n/**\n * @hidden\n * Send a response to child for a message request that was from child\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction sendMessageResponseToChild(id: number, args?: any[], isPartialResponse?: boolean): void {\n const targetWindow = Communication.childWindow;\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const response = createMessageResponse(id, args, isPartialResponse);\n const targetOrigin = getTargetOrigin(targetWindow);\n if (targetWindow && targetOrigin) {\n targetWindow.postMessage(response, targetOrigin);\n }\n}\n\n/**\n * @hidden\n * Send a custom message object that can be sent to child window,\n * instead of a response message to a child\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageEventToChild(actionName: string, args?: any[]): void {\n const targetWindow = Communication.childWindow;\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const customEvent = createMessageEvent(actionName, args);\n const targetOrigin = getTargetOrigin(targetWindow);\n\n // If the target window isn't closed and we already know its origin, send the message right away; otherwise,\n // queue the message and send it after the origin is established\n if (targetWindow && targetOrigin) {\n targetWindow.postMessage(customEvent, targetOrigin);\n } else {\n getTargetMessageQueue(targetWindow).push(customEvent);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction createMessageRequest(func: string, args: any[]): MessageRequest {\n return {\n id: CommunicationPrivate.nextMessageId++,\n func: func,\n timestamp: Date.now(),\n args: args || [],\n };\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction createMessageResponse(id: number, args: any[], isPartialResponse: boolean): MessageResponse {\n return {\n id: id,\n args: args || [],\n isPartialResponse,\n };\n}\n\n/**\n * @hidden\n * Creates a message object without any id, used for custom actions being sent to child frame/window\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction createMessageEvent(func: string, args: any[]): MessageRequest {\n return {\n func: func,\n args: args || [],\n };\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform } from '../public/constants';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n * Namespace to interact with the logging part of the SDK.\n * This object is used to send the app logs on demand to the host client\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace logs {\n /**\n * @hidden\n *\n * Registers a handler for getting app log\n *\n * @param handler - The handler to invoke to get the app log\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerGetLogHandler(handler: () => string): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime);\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (handler) {\n registerHandler('log.request', () => {\n const log: string = handler();\n sendMessageToParent('log.receive', [log]);\n });\n } else {\n removeHandler('log.request');\n }\n }\n\n /**\n * @hidden\n *\n * Checks if the logs capability is supported by the host\n * @returns boolean to represent whether the logs capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.logs ? true : false;\n }\n}\n","import { FileOpenPreference, TeamInformation } from '../public/interfaces';\n\n/**\n * @hidden\n *\n * Information about all members in a chat\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface ChatMembersInformation {\n members: ThreadMember[];\n}\n\n/**\n * @hidden\n *\n * Information about a chat member\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface ThreadMember {\n /**\n * @hidden\n * The member's user principal name in the current tenant.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n upn: string;\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport enum NotificationTypes {\n fileDownloadStart = 'fileDownloadStart',\n fileDownloadComplete = 'fileDownloadComplete',\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface ShowNotificationParameters {\n message: string;\n notificationType: NotificationTypes;\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport enum ViewerActionTypes {\n view = 'view',\n edit = 'edit',\n editNew = 'editNew',\n}\n\n/**\n * @hidden\n *\n * User setting changes that can be subscribed to\n */\nexport enum UserSettingTypes {\n /**\n * @hidden\n * Use this key to subscribe to changes in user's file open preference\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n fileOpenPreference = 'fileOpenPreference',\n /**\n * @hidden\n * Use this key to subscribe to theme changes\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n theme = 'theme',\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface FilePreviewParameters {\n /**\n * @hidden\n * The developer-defined unique ID for the file.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n entityId?: string;\n\n /**\n * @hidden\n * The display name of the file.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title?: string;\n\n /**\n * @hidden\n * An optional description of the file.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n description?: string;\n\n /**\n * @hidden\n * The file extension; e.g. pptx, docx, etc.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n type: string;\n\n /**\n * @hidden\n * A url to the source of the file, used to open the content in the user's default browser\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n objectUrl: string;\n\n /**\n * @hidden\n * Optional; an alternate self-authenticating url used to preview the file in Mobile clients and offer it for download by the user\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n downloadUrl?: string;\n\n /**\n * @hidden\n * Optional; an alternate url optimized for previewing the file in web and desktop clients\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n webPreviewUrl?: string;\n\n /**\n * @hidden\n * Optional; an alternate url that allows editing of the file in web and desktop clients\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n webEditUrl?: string;\n\n /**\n * @hidden\n * Optional; the base url of the site where the file is hosted\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n baseUrl?: string;\n\n /**\n * @hidden\n * Deprecated; prefer using {@linkcode viewerAction} instead\n * Optional; indicates whether the file should be opened in edit mode\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n editFile?: boolean;\n\n /**\n * @hidden\n * Optional; the developer-defined unique ID for the sub-entity to return to when the file stage closes.\n * This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n subEntityId?: string;\n\n /**\n * @hidden\n * Optional; indicates the mode in which file should be opened. Takes precedence over edit mode.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n viewerAction?: ViewerActionTypes;\n\n /**\n * @hidden\n * Optional; indicates how user prefers to open the file\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n fileOpenPreference?: FileOpenPreference;\n\n /**\n * @hidden\n * Optional; id required to enable conversation button in files. Will be channel id in case file is shared in a channel or the chat id in p2p chat case.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n conversationId?: string;\n}\n\n/**\n * @hidden\n *\n * Query parameters used when fetching team information\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface TeamInstanceParameters {\n /**\n * @hidden\n * Flag allowing to select favorite teams only\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n favoriteTeamsOnly?: boolean;\n}\n\n/**\n * @hidden\n *\n * Information on userJoined Teams\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface UserJoinedTeamsInformation {\n /**\n * @hidden\n * List of team information\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n userJoinedTeams: TeamInformation[];\n}\n","import {\n sendAndHandleStatusAndReason as sendAndHandleError,\n sendAndUnwrap,\n sendMessageToParent,\n} from '../internal/communication';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { ChatMembersInformation } from './interfaces';\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface OpenConversationRequest {\n /**\n * @hidden\n * The Id of the subEntity where the conversation is taking place\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n subEntityId: string;\n\n /**\n * @hidden\n * The title of the conversation\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n\n /**\n * @hidden\n * The Id of the conversation. This is optional and should be specified whenever a previous conversation about a specific sub-entity has already been started before\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n conversationId?: string;\n\n /**\n * @hidden\n * The Id of the channel. This is optional and should be specified whenever a conversation is started or opened in a personal app scope\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n channelId?: string;\n\n /**\n * @hidden\n * The entity Id of the tab\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n entityId: string;\n\n /**\n * @hidden\n * A function that is called once the conversation Id has been created\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n onStartConversation?: (conversationResponse: ConversationResponse) => void;\n\n /**\n * @hidden\n * A function that is called if the pane is closed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n onCloseConversation?: (conversationResponse: ConversationResponse) => void;\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface ConversationResponse {\n /**\n * @hidden\n *\n * Limited to Microsoft-internal use\n * The Id of the subEntity where the conversation is taking place\n */\n subEntityId: string;\n\n /**\n * @hidden\n * The Id of the conversation. This is optional and should be specified whenever a previous conversation about a specific sub-entity has already been started before\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n conversationId?: string;\n\n /**\n * @hidden\n * The Id of the channel. This is optional and should be specified whenever a conversation is started or opened in a personal app scope\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n channelId?: string;\n\n /**\n * @hidden\n * The entity Id of the tab\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n entityId?: string;\n}\n\n/**\n * @hidden\n * Namespace to interact with the conversational subEntities inside the tab\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace conversations {\n /**\n * @hidden\n * Hide from docs\n * --------------\n * Allows the user to start or continue a conversation with each subentity inside the tab\n *\n * @returns Promise resolved upon completion\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openConversation(openConversationRequest: OpenConversationRequest): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const sendPromise = sendAndHandleError('conversations.openConversation', {\n title: openConversationRequest.title,\n subEntityId: openConversationRequest.subEntityId,\n conversationId: openConversationRequest.conversationId,\n channelId: openConversationRequest.channelId,\n entityId: openConversationRequest.entityId,\n });\n if (openConversationRequest.onStartConversation) {\n registerHandler(\n 'startConversation',\n (subEntityId: string, conversationId: string, channelId: string, entityId: string) =>\n openConversationRequest.onStartConversation({\n subEntityId,\n conversationId,\n channelId,\n entityId,\n }),\n );\n }\n if (openConversationRequest.onCloseConversation) {\n registerHandler(\n 'closeConversation',\n (subEntityId: string, conversationId?: string, channelId?: string, entityId?: string) =>\n openConversationRequest.onCloseConversation({\n subEntityId,\n conversationId,\n channelId,\n entityId,\n }),\n );\n }\n resolve(sendPromise);\n });\n }\n\n /**\n * @hidden\n *\n * Allows the user to close the conversation in the right pane\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function closeConversation(): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('conversations.closeConversation');\n removeHandler('startConversation');\n removeHandler('closeConversation');\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n * Allows retrieval of information for all chat members.\n * NOTE: This value should be used only as a hint as to who the members are\n * and never as proof of membership in case your app is being hosted by a malicious party.\n *\n * @returns Promise resolved with information on all chat members\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getChatMembers(): Promise<ChatMembersInformation> {\n return new Promise<ChatMembersInformation>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndUnwrap('getChatMembers'));\n });\n }\n\n /**\n * Checks if the conversations capability is supported by the host\n * @returns boolean to represent whether conversations capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.conversations ? true : false;\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { Communication, sendMessageEventToChild, sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { FilePreviewParameters, UserSettingTypes } from './interfaces';\n\n/**\n * @hidden\n * Upload a custom App manifest directly to both team and personal scopes.\n * This method works just for the first party Apps.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function uploadCustomApp(manifestBlob: Blob, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(runtime);\n\n sendMessageToParent('uploadCustomApp', [manifestBlob], onComplete ? onComplete : getGenericOnCompleteHandler());\n}\n\n/**\n * @hidden\n * Sends a custom action MessageRequest to host or parent window\n *\n * @param actionName - Specifies name of the custom action to be sent\n * @param args - Specifies additional arguments passed to the action\n * @param callback - Optionally specify a callback to receive response parameters from the parent\n * @returns id of sent message\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendCustomMessage(actionName: string, args?: any[], callback?: (...args: any[]) => void): void {\n ensureInitialized(runtime);\n\n sendMessageToParent(actionName, args, callback);\n}\n\n/**\n * @hidden\n * Sends a custom action MessageEvent to a child iframe/window, only if you are not using auth popup.\n * Otherwise it will go to the auth popup (which becomes the child)\n *\n * @param actionName - Specifies name of the custom action to be sent\n * @param args - Specifies additional arguments passed to the action\n * @returns id of sent message\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendCustomEvent(actionName: string, args?: any[]): void {\n ensureInitialized(runtime);\n\n //validate childWindow\n if (!Communication.childWindow) {\n throw new Error('The child window has not yet been initialized or is not present');\n }\n sendMessageEventToChild(actionName, args);\n}\n\n/**\n * @hidden\n * Adds a handler for an action sent by a child window or parent window\n *\n * @param actionName - Specifies name of the action message to handle\n * @param customHandler - The callback to invoke when the action message is received. The return value is sent to the child\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerCustomHandler(actionName: string, customHandler: (...args: any[]) => any[]): void {\n ensureInitialized(runtime);\n registerHandler(actionName, (...args: any[]) => {\n return customHandler.apply(this, args);\n });\n}\n\n/**\n * @hidden\n * register a handler to be called when a user setting changes. The changed setting type & value is provided in the callback.\n *\n * @param settingTypes - List of user setting changes to subscribe\n * @param handler - When a subscribed setting is updated this handler is called\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerUserSettingsChangeHandler(\n settingTypes: UserSettingTypes[],\n handler: (settingType: UserSettingTypes, value: any) => void,\n): void {\n ensureInitialized(runtime);\n\n registerHandler('userSettingsChange', handler, true, [settingTypes]);\n}\n\n/**\n * @hidden\n * Opens a client-friendly preview of the specified file.\n *\n * @param file - The file to preview.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function openFilePreview(filePreviewParameters: FilePreviewParameters): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n const params = [\n filePreviewParameters.entityId,\n filePreviewParameters.title,\n filePreviewParameters.description,\n filePreviewParameters.type,\n filePreviewParameters.objectUrl,\n filePreviewParameters.downloadUrl,\n filePreviewParameters.webPreviewUrl,\n filePreviewParameters.webEditUrl,\n filePreviewParameters.baseUrl,\n filePreviewParameters.editFile,\n filePreviewParameters.subEntityId,\n filePreviewParameters.viewerAction,\n filePreviewParameters.fileOpenPreference,\n filePreviewParameters.conversationId,\n ];\n\n sendMessageToParent('openFilePreview', params);\n}\n","/**\n * App install dialog constants\n */\nexport const teamsDeepLinkUrlPathForAppInstall = '/l/app/';\n\n/**\n * Calendar constants\n */\nexport const teamsDeepLinkUrlPathForCalendar = '/l/meeting/new';\nexport const teamsDeepLinkAttendeesUrlParameterName = 'attendees';\nexport const teamsDeepLinkStartTimeUrlParameterName = 'startTime';\nexport const teamsDeepLinkEndTimeUrlParameterName = 'endTime';\nexport const teamsDeepLinkSubjectUrlParameterName = 'subject';\nexport const teamsDeepLinkContentUrlParameterName = 'content';\n\n/**\n * Call constants\n */\nexport const teamsDeepLinkUrlPathForCall = '/l/call/0/0';\nexport const teamsDeepLinkSourceUrlParameterName = 'source';\nexport const teamsDeepLinkWithVideoUrlParameterName = 'withVideo';\n\n/**\n * Chat constants\n */\nexport const teamsDeepLinkUrlPathForChat = '/l/chat/0/0';\nexport const teamsDeepLinkUsersUrlParameterName = 'users';\nexport const teamsDeepLinkTopicUrlParameterName = 'topicName';\nexport const teamsDeepLinkMessageUrlParameterName = 'message';\n","import { sendMessageToParent } from '../internal/communication';\nimport { sendAndHandleStatusAndReason as sendAndHandleError } from '../internal/communication';\nimport { createTeamsDeepLinkForAppInstallDialog } from '../internal/deepLinkUtilities';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\nexport namespace appInstallDialog {\n export interface OpenAppInstallDialogParams {\n appId: string;\n }\n\n export function openAppInstallDialog(openAPPInstallDialogParams: OpenAppInstallDialogParams): Promise<void> {\n return new Promise((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleError(\n 'executeDeepLink',\n createTeamsDeepLinkForAppInstallDialog(openAPPInstallDialogParams.appId),\n ),\n );\n } else {\n sendMessageToParent('appInstallDialog.openAppInstallDialog', [openAPPInstallDialogParams]);\n resolve();\n }\n });\n }\n\n /**\n * Checks if the appInstallDialog capability is supported by the host\n * @returns boolean to represent whether the appInstallDialog capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.appInstallDialog ? true : false;\n }\n}\n","import { teamsDeepLinkHost, teamsDeepLinkProtocol } from './constants';\nimport {\n teamsDeepLinkAttendeesUrlParameterName,\n teamsDeepLinkContentUrlParameterName,\n teamsDeepLinkEndTimeUrlParameterName,\n teamsDeepLinkMessageUrlParameterName,\n teamsDeepLinkSourceUrlParameterName,\n teamsDeepLinkStartTimeUrlParameterName,\n teamsDeepLinkSubjectUrlParameterName,\n teamsDeepLinkTopicUrlParameterName,\n teamsDeepLinkUrlPathForAppInstall,\n teamsDeepLinkUrlPathForCalendar,\n teamsDeepLinkUrlPathForCall,\n teamsDeepLinkUrlPathForChat,\n teamsDeepLinkUsersUrlParameterName,\n teamsDeepLinkWithVideoUrlParameterName,\n} from './deepLinkConstants';\n\nexport function createTeamsDeepLinkForChat(users: string[], topic?: string, message?: string): string {\n if (users.length === 0) {\n throw new Error('Must have at least one user when creating a chat deep link');\n }\n\n const usersSearchParameter =\n `${teamsDeepLinkUsersUrlParameterName}=` + users.map((user) => encodeURIComponent(user)).join(',');\n const topicSearchParameter =\n topic === undefined ? '' : `&${teamsDeepLinkTopicUrlParameterName}=${encodeURIComponent(topic)}`;\n const messageSearchParameter =\n message === undefined ? '' : `&${teamsDeepLinkMessageUrlParameterName}=${encodeURIComponent(message)}`;\n\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForChat}?${usersSearchParameter}${topicSearchParameter}${messageSearchParameter}`;\n}\n\nexport function createTeamsDeepLinkForCall(targets: string[], withVideo?: boolean, source?: string): string {\n if (targets.length === 0) {\n throw new Error('Must have at least one target when creating a call deep link');\n }\n const usersSearchParameter =\n `${teamsDeepLinkUsersUrlParameterName}=` + targets.map((user) => encodeURIComponent(user)).join(',');\n const withVideoSearchParameter =\n withVideo === undefined ? '' : `&${teamsDeepLinkWithVideoUrlParameterName}=${encodeURIComponent(withVideo)}`;\n const sourceSearchParameter =\n source === undefined ? '' : `&${teamsDeepLinkSourceUrlParameterName}=${encodeURIComponent(source)}`;\n\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForCall}?${usersSearchParameter}${withVideoSearchParameter}${sourceSearchParameter}`;\n}\n\nexport function createTeamsDeepLinkForCalendar(\n attendees?: string[],\n startTime?: string,\n endTime?: string,\n subject?: string,\n content?: string,\n): string {\n const attendeeSearchParameter =\n attendees === undefined\n ? ''\n : `${teamsDeepLinkAttendeesUrlParameterName}=` +\n attendees.map((attendee) => encodeURIComponent(attendee)).join(',');\n const startTimeSearchParameter =\n startTime === undefined ? '' : `&${teamsDeepLinkStartTimeUrlParameterName}=${encodeURIComponent(startTime)}`;\n const endTimeSearchParameter =\n endTime === undefined ? '' : `&${teamsDeepLinkEndTimeUrlParameterName}=${encodeURIComponent(endTime)}`;\n const subjectSearchParameter =\n subject === undefined ? '' : `&${teamsDeepLinkSubjectUrlParameterName}=${encodeURIComponent(subject)}`;\n const contentSearchParameter =\n content === undefined ? '' : `&${teamsDeepLinkContentUrlParameterName}=${encodeURIComponent(content)}`;\n\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForCalendar}?${attendeeSearchParameter}${startTimeSearchParameter}${endTimeSearchParameter}${subjectSearchParameter}${contentSearchParameter}`;\n}\n\nexport function createTeamsDeepLinkForAppInstallDialog(appId: string): string {\n if (!appId) {\n throw new Error('App ID must be set when creating an app install dialog deep link');\n }\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForAppInstall}${encodeURIComponent(\n appId,\n )}`;\n}\n","/* eslint-disable @typescript-eslint/explicit-member-accessibility */\n\nimport { sendMessageToParent } from '../internal/communication';\nimport {\n captureImageMobileSupportVersion,\n getMediaCallbackSupportVersion,\n mediaAPISupportVersion,\n nonFullScreenVideoModeAPISupportVersion,\n scanBarCodeAPIMobileSupportVersion,\n} from '../internal/constants';\nimport { GlobalVars } from '../internal/globalVars';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport {\n ensureInitialized,\n isCurrentSDKVersionAtLeast,\n throwExceptionIfMobileApiIsNotSupported,\n} from '../internal/internalAPIs';\nimport {\n createFile,\n decodeAttachment,\n isVideoControllerRegistered,\n throwExceptionIfMediaCallIsNotSupportedOnMobile,\n validateGetMediaInputs,\n validateScanBarCodeInput,\n validateSelectMediaInputs,\n validateViewImagesInput,\n} from '../internal/mediaUtil';\nimport { generateGUID } from '../internal/utils';\nimport { FrameContexts, HostClientType } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\nexport namespace media {\n /**\n * Enum for file formats supported\n */\n export enum FileFormat {\n Base64 = 'base64',\n ID = 'id',\n }\n\n /**\n * File object that can be used to represent image or video or audio\n */\n export class File {\n /**\n * Content of the file. When format is Base64, this is the base64 content\n * When format is ID, this is id mapping to the URI\n * When format is base64 and app needs to use this directly in HTML tags, it should convert this to dataUrl.\n */\n public content: string;\n\n /**\n * Format of the content\n */\n public format: FileFormat;\n\n /**\n * Size of the file in KB\n */\n public size: number;\n\n /**\n * MIME type. This can be used for constructing a dataUrl, if needed.\n */\n public mimeType: string;\n\n /**\n * Optional: Name of the file\n */\n public name?: string;\n }\n\n /**\n * Launch camera, capture image or choose image from gallery and return the images as a File[] object to the callback.\n *\n * @params callback - Callback will be called with an @see SdkError if there are any.\n * If error is null or undefined, the callback will be called with a collection of @see File objects\n * @remarks\n * Note: Currently we support getting one File through this API, i.e. the file arrays size will be one.\n * Note: For desktop, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.\n *\n */\n export function captureImage(callback: (error: SdkError, files: File[]) => void): void {\n if (!callback) {\n throw new Error('[captureImage] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n if (!GlobalVars.isFramelessWindow) {\n const notSupportedError: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(notSupportedError, undefined);\n return;\n }\n\n if (!isCurrentSDKVersionAtLeast(captureImageMobileSupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(oldPlatformError, undefined);\n return;\n }\n\n sendMessageToParent('captureImage', callback);\n }\n\n /**\n * Media object returned by the select Media API\n */\n export class Media extends File {\n constructor(that: Media = null) {\n super();\n if (that) {\n this.content = that.content;\n this.format = that.format;\n this.mimeType = that.mimeType;\n this.name = that.name;\n this.preview = that.preview;\n this.size = that.size;\n }\n }\n\n /**\n * A preview of the file which is a lightweight representation.\n * In case of images this will be a thumbnail/compressed image in base64 encoding.\n */\n public preview: string;\n\n /**\n * Gets the media in chunks irrespective of size, these chunks are assembled and sent back to the webapp as file/blob\n * @param callback - callback is called with the @see SdkError if there is an error\n * If error is null or undefined, the callback will be called with @see Blob.\n */\n public getMedia(callback: (error: SdkError, blob: Blob) => void): void {\n if (!callback) {\n throw new Error('[get Media] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(oldPlatformError, null);\n return;\n }\n if (!validateGetMediaInputs(this.mimeType, this.format, this.content)) {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(invalidInput, null);\n return;\n }\n // Call the new get media implementation via callbacks if the client version is greater than or equal to '2.0.0'\n if (isCurrentSDKVersionAtLeast(getMediaCallbackSupportVersion)) {\n this.getMediaViaCallback(callback);\n } else {\n this.getMediaViaHandler(callback);\n }\n }\n\n private getMediaViaCallback(callback: (error: SdkError, blob: Blob) => void): void {\n const helper: MediaHelper = {\n mediaMimeType: this.mimeType,\n assembleAttachment: [],\n };\n const localUriId = [this.content];\n function handleGetMediaCallbackRequest(mediaResult: MediaResult): void {\n if (callback) {\n if (mediaResult && mediaResult.error) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(mediaResult.error, null);\n } else {\n if (mediaResult && mediaResult.mediaChunk) {\n // If the chunksequence number is less than equal to 0 implies EOF\n // create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number\n if (mediaResult.mediaChunk.chunkSequence <= 0) {\n const file = createFile(helper.assembleAttachment, helper.mediaMimeType);\n callback(mediaResult.error, file);\n } else {\n // Keep pushing chunks into assemble attachment\n const assemble: AssembleAttachment = decodeAttachment(mediaResult.mediaChunk, helper.mediaMimeType);\n helper.assembleAttachment.push(assemble);\n }\n } else {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, null);\n }\n }\n }\n }\n sendMessageToParent('getMedia', localUriId, handleGetMediaCallbackRequest);\n }\n\n private getMediaViaHandler(callback: (error: SdkError, blob: Blob) => void): void {\n const actionName = generateGUID();\n const helper: MediaHelper = {\n mediaMimeType: this.mimeType,\n assembleAttachment: [],\n };\n const params = [actionName, this.content];\n this.content && callback && sendMessageToParent('getMedia', params);\n function handleGetMediaRequest(response: string): void {\n if (callback) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const mediaResult: MediaResult = JSON.parse(response);\n if (mediaResult.error) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(mediaResult.error, null);\n removeHandler('getMedia' + actionName);\n } else {\n if (mediaResult.mediaChunk) {\n // If the chunksequence number is less than equal to 0 implies EOF\n // create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number\n if (mediaResult.mediaChunk.chunkSequence <= 0) {\n const file = createFile(helper.assembleAttachment, helper.mediaMimeType);\n callback(mediaResult.error, file);\n removeHandler('getMedia' + actionName);\n } else {\n // Keep pushing chunks into assemble attachment\n const assemble: AssembleAttachment = decodeAttachment(mediaResult.mediaChunk, helper.mediaMimeType);\n helper.assembleAttachment.push(assemble);\n }\n } else {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, null);\n removeHandler('getMedia' + actionName);\n }\n }\n }\n }\n\n registerHandler('getMedia' + actionName, handleGetMediaRequest);\n }\n }\n\n /**\n * Input parameter supplied to the select Media API\n */\n export interface MediaInputs {\n /**\n * Only one media type can be selected at a time\n */\n mediaType: MediaType;\n\n /**\n * max limit of media allowed to be selected in one go, current max limit is 10 set by office lens.\n */\n maxMediaCount: number;\n\n /**\n * Additional properties for customization of select media - Image in mobile devices\n */\n imageProps?: ImageProps;\n\n /**\n * Additional properties for customization of select media - Video in mobile devices\n */\n videoProps?: VideoProps;\n\n /**\n * Additional properties for customization of select media - VideoAndImage in mobile devices\n */\n videoAndImageProps?: VideoAndImageProps;\n\n /**\n * Additional properties for audio capture flows.\n */\n audioProps?: AudioProps;\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * All properties common to Image and Video Props\n */\n interface MediaProps {\n /**\n * @hidden\n * Optional; Lets the developer specify the media source, more than one can be specified.\n * Default value is both camera and gallery\n */\n sources?: Source[];\n\n /**\n * @hidden\n * Optional; Specify in which mode the camera will be opened.\n * Default value is Photo\n */\n startMode?: CameraStartMode;\n\n /**\n * @hidden\n * Optional; indicate if user is allowed to move between front and back camera\n * Default value is true\n */\n cameraSwitcher?: boolean;\n }\n\n /**\n * All properties in ImageProps are optional and have default values in the platform\n */\n export interface ImageProps extends MediaProps {\n /**\n * Optional; indicate if inking on the selected Image is allowed or not\n * Default value is true\n */\n ink?: boolean;\n\n /**\n * Optional; indicate if putting text stickers on the selected Image is allowed or not\n * Default value is true\n */\n textSticker?: boolean;\n\n /**\n * Optional; indicate if image filtering mode is enabled on the selected image\n * Default value is false\n */\n enableFilter?: boolean;\n\n /**\n * Optional; Lets the developer specify the image output formats, more than one can be specified.\n * Default value is Image.\n */\n imageOutputFormats?: ImageOutputFormats[];\n }\n\n /**\n * All properties in VideoProps are optional and have default values in the platform\n */\n export interface VideoProps extends MediaProps {\n /**\n * Optional; the maximum duration in seconds after which the recording should terminate automatically.\n * Default value is defined by the platform serving the API.\n */\n maxDuration?: number;\n\n /**\n * Optional; to determine if the video capturing flow needs to be launched\n * in Full Screen Mode (Lens implementation) or PictureInPicture Mode (Native implementation).\n * Default value is true, indicating video will always launch in Full Screen Mode via lens.\n */\n isFullScreenMode?: boolean;\n\n /**\n * Optional; controls the visibility of stop button in PictureInPicture Mode.\n * Default value is true, indicating the user will be able to stop the video.\n */\n isStopButtonVisible?: boolean;\n\n /**\n * Optional; setting VideoController will register your app to listen to the lifecycle events during the video capture flow.\n * Your app can also dynamically control the experience while capturing the video by notifying the host client.\n */\n videoController?: VideoController;\n }\n\n /**\n * All properties in VideoAndImageProps are optional and have default values in the platform\n */\n export interface VideoAndImageProps extends ImageProps, VideoProps {}\n\n /**\n * All properties in AudioProps are optional and have default values in the platform\n */\n export interface AudioProps {\n /**\n * Optional; the maximum duration in minutes after which the recording should terminate automatically\n * Default value is defined by the platform serving the API.\n */\n maxDuration?: number;\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Base class which holds the callback and notifies events to the host client\n */\n abstract class MediaController<T> {\n protected controllerCallback: T;\n\n public constructor(controllerCallback?: T) {\n this.controllerCallback = controllerCallback;\n }\n\n protected abstract getMediaType(): MediaType;\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * This function will be implemented by the respective media class which holds the logic\n * of specific events that needs to be notified to the app.\n * @param mediaEvent indicates the event signed by the host client to the app\n */\n protected abstract notifyEventToApp(mediaEvent: MediaControllerEvent): void;\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Function to notify the host client to programatically control the experience\n * @param mediaEvent indicates what the event that needs to be signaled to the host client\n * Optional; @param callback is used to send app if host client has successfully handled the notification event or not\n */\n protected notifyEventToHost(mediaEvent: MediaControllerEvent, callback?: (err?: SdkError) => void): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n try {\n throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);\n } catch (err) {\n if (callback) {\n callback(err);\n }\n return;\n }\n\n const params: MediaControllerParam = { mediaType: this.getMediaType(), mediaControllerEvent: mediaEvent };\n sendMessageToParent('media.controller', [params], (err?: SdkError) => {\n if (callback) {\n callback(err);\n }\n });\n }\n\n /**\n * Function to programatically stop the ongoing media event\n * Optional; @param callback is used to send app if host client has successfully stopped the event or not\n */\n public stop(callback?: (err?: SdkError) => void): void {\n this.notifyEventToHost(MediaControllerEvent.StopRecording, callback);\n }\n }\n\n /**\n * Callback which will register your app to listen to lifecycle events during the video capture flow\n */\n export interface VideoControllerCallback {\n onRecordingStarted?(): void;\n }\n\n /**\n * VideoController class is used to communicate between the app and the host client during the video capture flow\n */\n export class VideoController extends MediaController<VideoControllerCallback> {\n protected getMediaType(): MediaType {\n return MediaType.Video;\n }\n\n public notifyEventToApp(mediaEvent: MediaControllerEvent): void {\n if (!this.controllerCallback) {\n // Early return as app has not registered with the callback\n return;\n }\n\n switch (mediaEvent) {\n case MediaControllerEvent.StartRecording:\n if (this.controllerCallback.onRecordingStarted) {\n this.controllerCallback.onRecordingStarted();\n break;\n }\n }\n }\n }\n\n /**\n * @beta\n * Events which are used to communicate between the app and the host client during the media recording flow\n */\n export enum MediaControllerEvent {\n StartRecording = 1,\n StopRecording = 2,\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Interface with relevant info to send communication from the app to the host client\n */\n interface MediaControllerParam {\n /**\n * List of team information\n */\n mediaType: media.MediaType;\n\n /**\n * List of team information\n */\n mediaControllerEvent: MediaControllerEvent;\n }\n\n /**\n * The modes in which camera can be launched in select Media API\n */\n export enum CameraStartMode {\n Photo = 1,\n Document = 2,\n Whiteboard = 3,\n BusinessCard = 4,\n }\n\n /**\n * Specifies the image source\n */\n export enum Source {\n Camera = 1,\n Gallery = 2,\n }\n\n /**\n * Specifies the type of Media\n */\n export enum MediaType {\n Image = 1,\n Video = 2,\n VideoAndImage = 3,\n Audio = 4,\n }\n\n /**\n * Input for view images API\n */\n export interface ImageUri {\n value: string;\n type: ImageUriType;\n }\n\n /**\n * ID contains a mapping for content uri on platform's side, URL is generic\n */\n export enum ImageUriType {\n ID = 1,\n URL = 2,\n }\n\n /**\n * Specifies the image output formats.\n */\n export enum ImageOutputFormats {\n IMAGE = 1,\n PDF = 2,\n }\n\n /**\n * Media chunks an output of getMedia API from platform\n */\n export interface MediaChunk {\n /**\n * Base 64 data for the requested uri\n */\n chunk: string;\n\n /**\n * chunk sequence number\n */\n chunkSequence: number;\n }\n\n /**\n * Output of getMedia API from platform\n */\n export interface MediaResult {\n /**\n * error encountered in getMedia API\n */\n error: SdkError;\n\n /**\n * Media chunk which will be assemebled and converted into a blob\n */\n mediaChunk: MediaChunk;\n }\n\n /**\n * Helper object to assembled media chunks\n */\n export interface AssembleAttachment {\n sequence: number;\n file: Blob;\n }\n\n /**\n * Helper class for assembling media\n */\n interface MediaHelper {\n mediaMimeType: string;\n assembleAttachment: AssembleAttachment[];\n }\n\n /**\n * Select an attachment using camera/gallery\n *\n * @param mediaInputs - The input params to customize the media to be selected\n * @param callback - The callback to invoke after fetching the media\n */\n export function selectMedia(\n mediaInputs: MediaInputs,\n callback: (error: SdkError, attachments: Media[]) => void,\n ): void {\n if (!callback) {\n throw new Error('[select Media] Callback cannot be null');\n }\n\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(oldPlatformError, null);\n return;\n }\n\n try {\n throwExceptionIfMediaCallIsNotSupportedOnMobile(mediaInputs);\n } catch (err) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(err, null);\n return;\n }\n\n if (!validateSelectMediaInputs(mediaInputs)) {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(invalidInput, null);\n return;\n }\n\n const params = [mediaInputs];\n // What comes back from native as attachments would just be objects and will be missing getMedia method on them\n sendMessageToParent(\n 'selectMedia',\n params,\n (err: SdkError, localAttachments?: Media[], mediaEvent?: MediaControllerEvent) => {\n // MediaControllerEvent response is used to notify the app about events and is a partial response to selectMedia\n if (mediaEvent) {\n if (isVideoControllerRegistered(mediaInputs)) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n mediaInputs.videoProps.videoController.notifyEventToApp(mediaEvent);\n }\n return;\n }\n\n // Media Attachments are final response to selectMedia\n if (!localAttachments) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(err, null);\n return;\n }\n\n const mediaArray: Media[] = [];\n for (const attachment of localAttachments) {\n mediaArray.push(new Media(attachment));\n }\n callback(err, mediaArray);\n },\n );\n }\n\n /**\n * View images using native image viewer\n *\n * @param uriList - list of URIs for images to be viewed - can be content URI or server URL. Supports up to 10 Images in a single call\n * @param callback - returns back error if encountered, returns null in case of success\n */\n export function viewImages(uriList: ImageUri[], callback: (error?: SdkError) => void): void {\n if (!callback) {\n throw new Error('[view images] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n callback(oldPlatformError);\n return;\n }\n if (!validateViewImagesInput(uriList)) {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n callback(invalidInput);\n return;\n }\n\n const params = [uriList];\n sendMessageToParent('viewImages', params, callback);\n }\n\n /**\n * Barcode configuration supplied to scanBarCode API to customize barcode scanning experience in mobile\n * All properties in BarCodeConfig are optional and have default values in the platform\n */\n export interface BarCodeConfig {\n /**\n * Optional; Lets the developer specify the scan timeout interval in seconds\n * Default value is 30 seconds and max allowed value is 60 seconds\n */\n timeOutIntervalInSec?: number;\n }\n\n /**\n * @deprecated\n * As of 2.1.0, please use {@link barCode.scanBarCode barCode.scanBarCode(config?: BarCodeConfig): Promise\\<string\\>} instead.\n\n * Scan Barcode/QRcode using camera\n *\n * @remarks\n * Note: For desktop and web, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.\n *\n * @param callback - callback to invoke after scanning the barcode\n * @param config - optional input configuration to customize the barcode scanning experience\n */\n export function scanBarCode(callback: (error: SdkError, decodedText: string) => void, config?: BarCodeConfig): void {\n if (!callback) {\n throw new Error('[media.scanBarCode] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n if (\n GlobalVars.hostClientType === HostClientType.desktop ||\n GlobalVars.hostClientType === HostClientType.web ||\n GlobalVars.hostClientType === HostClientType.rigel ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsWindows ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||\n GlobalVars.hostClientType === HostClientType.teamsPhones ||\n GlobalVars.hostClientType === HostClientType.teamsDisplays\n ) {\n const notSupportedError: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(notSupportedError, null);\n return;\n }\n\n if (!isCurrentSDKVersionAtLeast(scanBarCodeAPIMobileSupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(oldPlatformError, null);\n return;\n }\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n if (!validateScanBarCodeInput(config)) {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(invalidInput, null);\n return;\n }\n\n sendMessageToParent('media.scanBarCode', [config], callback);\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { validateScanBarCodeInput } from '../internal/mediaUtil';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { DevicePermission, ErrorCode } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to interact with the barcode scanning-specific part of the SDK.\n *\n * @beta\n */\nexport namespace barCode {\n /**\n * Data structure to customize the barcode scanning experience in scanBarCode API.\n * All properties in BarCodeConfig are optional and have default values in the platform\n *\n * @beta\n */\n export interface BarCodeConfig {\n /**\n * Optional; designates the scan timeout interval in seconds.\n * Default value is 30 seconds, max allowed value is 60 seconds.\n */\n timeOutIntervalInSec?: number;\n }\n\n /**\n * Scan Barcode or QRcode using camera\n *\n * @param barCodeConfig - input configuration to customize the barcode scanning experience\n *\n * @returns a scanned code\n *\n * @beta\n */\n export function scanBarCode(barCodeConfig: BarCodeConfig): Promise<string> {\n return new Promise<string>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (!validateScanBarCodeInput(barCodeConfig)) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n\n resolve(sendAndHandleSdkError('media.scanBarCode', barCodeConfig));\n });\n }\n\n /**\n * Checks whether or not media has user permission\n *\n * @returns true if the user has granted the app permission to media information, false otherwise\n *\n * @beta\n */\n export function hasPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.Media;\n\n return new Promise<boolean>((resolve) => {\n resolve(sendAndHandleSdkError('permissions.has', permissions));\n });\n }\n\n /**\n * Requests user permission for media\n *\n * @returns true if the user has granted the app permission to the media, false otherwise\n *\n * @beta\n */\n export function requestPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.Media;\n\n return new Promise<boolean>((resolve) => {\n resolve(sendAndHandleSdkError('permissions.request', permissions));\n });\n }\n\n /**\n * Checks if barCode capability is supported by the host\n * @returns boolean to represent whether the barCode capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.barCode && runtime.supports.permissions ? true : false;\n }\n}\n","import { sendAndHandleStatusAndReason as sendAndHandleError } from '../internal/communication';\nimport { createTeamsDeepLinkForChat } from '../internal/deepLinkUtilities';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\n\n/**\n * Describes information needed to start a chat\n *\n * @beta\n */\ninterface OpenChatRequest {\n /**\n * An optional message used when initiating chat\n */\n message?: string;\n}\n\n/**\n * Used when starting a chat with one person\n *\n * @see OpenGroupChatRequest for use when a chat with more than one person\n *\n * @beta\n */\nexport interface OpenSingleChatRequest extends OpenChatRequest {\n /**\n * The Azure Active Directory UPN (e-mail address) of the user to chat with\n */\n user: string;\n}\n\n/**\n * Used when starting a chat with more than one person\n *\n * @see OpenSingleChatRequest for use in a chat with only one person\n *\n * @beta\n */\nexport interface OpenGroupChatRequest extends OpenChatRequest {\n /**\n * Array containing Azure Active Directory UPNs (e-mail addresss) of users to open chat with\n */\n users: string[];\n /**\n * The display name of a conversation for 3 or more users (chats with fewer than three users will ignore this field)\n */\n topic?: string;\n}\n\n/**\n * Contains functionality to start chat with others\n *\n * @beta\n */\nexport namespace chat {\n /**\n * Allows the user to open a chat with a single user and allows\n * for the user to specify the message they wish to send.\n *\n * @param openChatRequest: {@link OpenSingleChatRequest}- a request object that contains a user's email as well as an optional message parameter.\n *\n * @returns Promise resolved upon completion\n *\n * @beta\n */\n export function openChat(openChatRequest: OpenSingleChatRequest): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleError(\n 'executeDeepLink',\n createTeamsDeepLinkForChat([openChatRequest.user], undefined /*topic*/, openChatRequest.message),\n ),\n );\n } else {\n const sendPromise = sendAndHandleError('chat.openChat', {\n members: openChatRequest.user,\n message: openChatRequest.message,\n });\n resolve(sendPromise);\n }\n });\n }\n /**\n * Allows the user to create a chat with multiple users (2+) and allows\n * for the user to specify a message and name the topic of the conversation. If\n * only 1 user is provided into users array default back to origin openChat.\n *\n * @param openChatRequest: {@link OpenGroupChatRequest} - a request object that contains a list of user emails as well as optional parameters for message and topic (display name for the group chat).\n *\n * @returns Promise resolved upon completion\n *\n * @beta\n */\n export function openGroupChat(openChatRequest: OpenGroupChatRequest): Promise<void> {\n return new Promise<void>((resolve) => {\n if (openChatRequest.users.length < 1) {\n throw Error('OpenGroupChat Failed: No users specified');\n }\n if (openChatRequest.users.length === 1) {\n const chatRequest: OpenSingleChatRequest = {\n user: openChatRequest.users[0],\n message: openChatRequest.message,\n };\n openChat(chatRequest);\n } else {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleError(\n 'executeDeepLink',\n createTeamsDeepLinkForChat(openChatRequest.users, openChatRequest.topic, openChatRequest.message),\n ),\n );\n } else {\n const sendPromise = sendAndHandleError('chat.openChat', {\n members: openChatRequest.users,\n message: openChatRequest.message,\n topic: openChatRequest.topic,\n });\n resolve(sendPromise);\n }\n }\n });\n }\n\n /**\n * Checks if the chat capability is supported by the host\n * @returns boolean to represent whether the chat capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.chat ? true : false;\n }\n}\n","import { sendAndHandleSdkError as sendAndHandleError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { DevicePermission, ErrorCode } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to interact with the geoLocation module-specific part of the SDK. This is the newer version of location module.\n *\n * @beta\n */\nexport namespace geoLocation {\n /**\n * Data struture to represent the location information\n *\n * @beta\n */\n export interface Location {\n /**\n Latitude of the location\n */\n latitude: number;\n /**\n Longitude of the location\n */\n longitude: number;\n /**\n Accuracy describes the maximum distance in meters from the captured coordinates to the possible actual location\n @remarks\n This property is only in scope for mobile\n */\n accuracy?: number;\n /**\n Time stamp when the location was captured\n */\n timestamp?: number;\n }\n /**\n * Fetches current user coordinates\n * @returns Promise that will resolve with {@link geoLocation.Location} object or reject with an error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function getCurrentLocation(): Promise<Location> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n return sendAndHandleError('location.getLocation', { allowChooseLocation: false, showMap: false });\n }\n\n /**\n * Checks whether or not location has user permission\n *\n * @returns Promise that will resolve with true if the user had granted the app permission to location information, or with false otherwise,\n * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function hasPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.GeoLocation;\n\n return new Promise<boolean>((resolve) => {\n resolve(sendAndHandleError('permissions.has', permissions));\n });\n }\n\n /**\n * Requests user permission for location\n *\n * @returns true if the user consented permission for location, false otherwise\n * @returns Promise that will resolve with true if the user consented permission for location, or with false otherwise,\n * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function requestPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.GeoLocation;\n\n return new Promise<boolean>((resolve) => {\n resolve(sendAndHandleError('permissions.request', permissions));\n });\n }\n\n /**\n * Checks if geoLocation capability is supported by the host\n * @returns boolean to represent whether geoLocation is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.geoLocation && runtime.supports.permissions ? true : false;\n }\n\n /**\n * Namespace to interact with the location on map module-specific part of the SDK.\n *\n * @beta\n */\n export namespace map {\n /**\n * Allows user to choose location on map\n *\n * @returns Promise that will resolve with {@link geoLocation.Location} object chosen by the user or reject with an error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function chooseLocation(): Promise<Location> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n return sendAndHandleError('location.getLocation', { allowChooseLocation: true, showMap: true });\n }\n\n /**\n * Shows the location on map corresponding to the given coordinates\n *\n * @param location - Location to be shown on the map\n * @returns Promise that resolves when the location dialog has been closed or reject with an error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function showLocation(location: Location): Promise<void> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (!location) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n return sendAndHandleError('location.showLocation', location);\n }\n\n /**\n * Checks if geoLocation.map capability is supported by the host\n * @returns boolean to represent whether geoLocation.map is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) &&\n runtime.supports.geoLocation &&\n runtime.supports.geoLocation.map &&\n runtime.supports.permissions\n ? true\n : false;\n }\n }\n}\n","import { media } from '../public/media';\nimport { people } from '../public/people';\nimport {\n imageOutputFormatsAPISupportVersion,\n nonFullScreenVideoModeAPISupportVersion,\n videoAndImageMediaAPISupportVersion,\n} from './constants';\nimport { throwExceptionIfMobileApiIsNotSupported } from './internalAPIs';\n\n/**\n * @hidden\n * Helper function to create a blob from media chunks based on their sequence\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function createFile(assembleAttachment: media.AssembleAttachment[], mimeType: string): Blob {\n if (assembleAttachment == null || mimeType == null || assembleAttachment.length <= 0) {\n return null;\n }\n let file: Blob | undefined;\n let sequence = 1;\n assembleAttachment.sort((a, b) => (a.sequence > b.sequence ? 1 : -1));\n assembleAttachment.forEach((item) => {\n if (item.sequence == sequence) {\n if (file) {\n file = new Blob([file, item.file], { type: mimeType });\n } else {\n file = new Blob([item.file], { type: mimeType });\n }\n sequence++;\n }\n });\n return file;\n}\n\n/**\n * @hidden\n * Helper function to convert Media chunks into another object type which can be later assemebled\n * Converts base 64 encoded string to byte array and then into an array of blobs\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function decodeAttachment(attachment: media.MediaChunk, mimeType: string): media.AssembleAttachment {\n if (attachment == null || mimeType == null) {\n return null;\n }\n const decoded = atob(attachment.chunk);\n const byteNumbers = new Array(decoded.length);\n for (let i = 0; i < decoded.length; i++) {\n byteNumbers[i] = decoded.charCodeAt(i);\n }\n const byteArray = new Uint8Array(byteNumbers);\n const blob: Blob = new Blob([byteArray], { type: mimeType });\n const assemble: media.AssembleAttachment = {\n sequence: attachment.chunkSequence,\n file: blob,\n };\n return assemble;\n}\n\n/**\n * @hidden\n * Function throws an SdkError if the media call is not supported on current mobile version, else undefined.\n *\n * @throws an SdkError if the media call is not supported\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function throwExceptionIfMediaCallIsNotSupportedOnMobile(mediaInputs: media.MediaInputs): void {\n if (isMediaCallForVideoAndImageInputs(mediaInputs)) {\n throwExceptionIfMobileApiIsNotSupported(videoAndImageMediaAPISupportVersion);\n } else if (isMediaCallForNonFullScreenVideoMode(mediaInputs)) {\n throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);\n } else if (isMediaCallForImageOutputFormats(mediaInputs)) {\n throwExceptionIfMobileApiIsNotSupported(imageOutputFormatsAPISupportVersion);\n }\n}\n\n/**\n * @hidden\n * Function returns true if the app has registered to listen to video controller events, else false.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isVideoControllerRegistered(mediaInputs: media.MediaInputs): boolean {\n if (\n mediaInputs.mediaType == media.MediaType.Video &&\n mediaInputs.videoProps &&\n mediaInputs.videoProps.videoController\n ) {\n return true;\n }\n return false;\n}\n\n/**\n * @hidden\n * Returns true if the mediaInput params are valid and false otherwise\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateSelectMediaInputs(mediaInputs: media.MediaInputs): boolean {\n if (mediaInputs == null || mediaInputs.maxMediaCount > 10) {\n return false;\n }\n return true;\n}\n\n/**\n * @hidden\n * Returns true if the mediaInput params are called for mediatype Image and contains Image outputs formats, false otherwise\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isMediaCallForImageOutputFormats(mediaInputs: media.MediaInputs): boolean {\n if (mediaInputs?.mediaType == media.MediaType.Image && mediaInputs?.imageProps?.imageOutputFormats) {\n return true;\n }\n return false;\n}\n\n/**\n * @hidden\n * Returns true if the mediaInput params are called for mediatype VideoAndImage and false otherwise\n *\n * @internal\n */\nexport function isMediaCallForVideoAndImageInputs(mediaInputs: media.MediaInputs): boolean {\n if (mediaInputs && (mediaInputs.mediaType == media.MediaType.VideoAndImage || mediaInputs.videoAndImageProps)) {\n return true;\n }\n return false;\n}\n\n/**\n * @hidden\n * Returns true if the mediaInput params are called for non-full screen video mode and false otherwise\n *\n * @internal\n */\nexport function isMediaCallForNonFullScreenVideoMode(mediaInputs: media.MediaInputs): boolean {\n if (\n mediaInputs &&\n mediaInputs.mediaType == media.MediaType.Video &&\n mediaInputs.videoProps &&\n !mediaInputs.videoProps.isFullScreenMode\n ) {\n return true;\n }\n return false;\n}\n\n/**\n * @hidden\n * Returns true if the get Media params are valid and false otherwise\n *\n * @internal\n */\nexport function validateGetMediaInputs(mimeType: string, format: media.FileFormat, content: string): boolean {\n if (mimeType == null || format == null || format != media.FileFormat.ID || content == null) {\n return false;\n }\n return true;\n}\n\n/**\n * @hidden\n * Returns true if the view images param is valid and false otherwise\n *\n * @internal\n */\nexport function validateViewImagesInput(uriList: media.ImageUri[]): boolean {\n if (uriList == null || uriList.length <= 0 || uriList.length > 10) {\n return false;\n }\n return true;\n}\n\n/**\n * @hidden\n * Returns true if the scan barcode param is valid and false otherwise\n *\n * @internal\n */\nexport function validateScanBarCodeInput(barCodeConfig: media.BarCodeConfig): boolean {\n if (barCodeConfig) {\n if (\n barCodeConfig.timeOutIntervalInSec === null ||\n barCodeConfig.timeOutIntervalInSec <= 0 ||\n barCodeConfig.timeOutIntervalInSec > 60\n ) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * @hidden\n * Returns true if the people picker params are valid and false otherwise\n *\n * @internal\n */\nexport function validatePeoplePickerInput(peoplePickerInputs: people.PeoplePickerInputs): boolean {\n if (peoplePickerInputs) {\n if (peoplePickerInputs.title) {\n if (typeof peoplePickerInputs.title !== 'string') {\n return false;\n }\n }\n\n if (peoplePickerInputs.setSelected) {\n if (typeof peoplePickerInputs.setSelected !== 'object') {\n return false;\n }\n }\n\n if (peoplePickerInputs.openOrgWideSearchInChatOrChannel) {\n if (typeof peoplePickerInputs.openOrgWideSearchInChatOrChannel !== 'boolean') {\n return false;\n }\n }\n if (peoplePickerInputs.singleSelect) {\n if (typeof peoplePickerInputs.singleSelect !== 'boolean') {\n return false;\n }\n }\n }\n return true;\n}\n","import { AdaptiveCardVersion } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * @returns The {@linkcode AdaptiveCardVersion} representing the Adaptive Card schema\n * version supported by the host, or undefined if the host does not support Adaptive Cards\n */\nexport function getAdaptiveCardSchemaVersion(): AdaptiveCardVersion | undefined {\n if (!runtime.hostVersionsInfo) {\n return undefined;\n } else {\n return runtime.hostVersionsInfo.adaptiveCardSchemaVersion;\n }\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\n\nimport { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\nexport interface IAppWindow {\n /**\n * Send a message to the AppWindow.\n *\n * @param message - The message to send\n * @param onComplete - The callback to know if the postMessage has been success/failed.\n */\n postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;\n\n /**\n * Add a listener that will be called when an event is received from this AppWindow.\n *\n * @param type - The event to listen to. Currently the only supported type is 'message'.\n * @param listener - The listener that will be called\n */\n addEventListener(type: string, listener: Function): void;\n}\n\nexport class ChildAppWindow implements IAppWindow {\n /**\n * Send a message to the ChildAppWindow.\n *\n * @param message - The message to send\n * @param onComplete - The callback to know if the postMessage has been success/failed.\n */\n public postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(runtime);\n sendMessageToParent('messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());\n }\n /**\n * Add a listener that will be called when an event is received from the ChildAppWindow.\n *\n * @param type - The event to listen to. Currently the only supported type is 'message'.\n * @param listener - The listener that will be called\n */\n public addEventListener(type: string, listener: (message: any) => void): void {\n ensureInitialized(runtime);\n if (type === 'message') {\n registerHandler('messageForParent', listener);\n }\n }\n}\n\nexport class ParentAppWindow implements IAppWindow {\n private static _instance: ParentAppWindow;\n public static get Instance(): IAppWindow {\n // Do you need arguments? Make it a regular method instead.\n return this._instance || (this._instance = new this());\n }\n\n /**\n * Send a message to the ParentAppWindow.\n *\n * @param message - The message to send\n * @param onComplete - The callback to know if the postMessage has been success/failed.\n */\n public postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(runtime, FrameContexts.task);\n sendMessageToParent('messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());\n }\n\n /**\n * Add a listener that will be called when an event is received from the ParentAppWindow.\n *\n * @param type - The event to listen to. Currently the only supported type is 'message'.\n * @param listener - The listener that will be called\n */\n public addEventListener(type: string, listener: (message: any) => void): void {\n ensureInitialized(runtime, FrameContexts.task);\n if (type === 'message') {\n registerHandler('messageForChild', listener);\n }\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { locationAPIsRequiredVersion } from '../internal/constants';\nimport { ensureInitialized, isCurrentSDKVersionAtLeast } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * @deprecated\n * As of 2.1.0, please use geoLocation namespace.\n *\n * Namespace to interact with the location module-specific part of the SDK.\n */\nexport namespace location {\n /**\n * @deprecated\n * Data Structure to set the location properties in getLocation call.\n */\n export interface LocationProps {\n /**\n whether user can alter location or not\n if false, user will be shown current location \n and wouldn't be allowed to alter it\n */\n allowChooseLocation: boolean;\n /**\n whether selected location should be shown to user on map or not.\n If allowChooseLocation is true, this parameter will be ignored by platform.\n If allowChooseLocation is false, and this parameter is not provided, default \n value will be false.\n */\n showMap?: boolean;\n }\n\n /**\n * @deprecated\n * Data struture to represent the location information\n */\n export interface Location {\n /**\n Latitude of the location\n */\n latitude: number;\n /**\n Longitude of the location\n */\n longitude: number;\n /**\n Accuracy of the coordinates captured\n */\n accuracy?: number;\n /**\n Time stamp when the location was captured\n */\n timestamp?: number;\n }\n\n /**\n * @deprecated\n * As of 2.1.0, please use one of the following functions:\n * - {@link geoLocation.getCurrentLocation geoLocation.getCurrentLocation(): Promise\\<Location\\>} to get the current location.\n * - {@link geoLocation.map.chooseLocation geoLocation.map.chooseLocation(): Promise\\<Location\\>} to choose location on map.\n *\n * Fetches user location\n * @param props {@link LocationProps} - Specifying how the location request is handled\n * @param callback - Callback to invoke when current user location is fetched\n */\n export function getLocation(props: LocationProps, callback: (error: SdkError, location: Location) => void): void {\n if (!callback) {\n throw new Error('[location.getLocation] Callback cannot be null');\n }\n\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {\n throw { errorCode: ErrorCode.OLD_PLATFORM };\n }\n if (!props) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('location.getLocation', [props], callback);\n }\n\n /**\n * @deprecated\n * As of 2.1.0, please use {@link geoLocation.map.showLocation geoLocation.map.showLocation(location: Location): Promise\\<void\\>} instead.\n *\n * Shows the location on map corresponding to the given coordinates\n *\n * @param location - Location to be shown on the map\n * @param callback - Callback to invoke when the location is opened on map\n */\n export function showLocation(location: Location, callback: (error: SdkError, status: boolean) => void): void {\n if (!callback) {\n throw new Error('[location.showLocation] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {\n throw { errorCode: ErrorCode.OLD_PLATFORM };\n }\n if (!location) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n sendMessageToParent('location.showLocation', [location], callback);\n }\n\n /**\n * @deprecated\n * As of 2.1.0, please use geoLocation namespace, and use {@link geoLocation.isSupported geoLocation.isSupported: boolean} to check if geoLocation is supported.\n *\n * Checks if Location capability is supported by the host\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @returns boolean to represent whether Location is supported\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.location ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { doesHandlerExist, registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts } from './constants';\nimport { SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\nexport namespace meeting {\n /**\n * @hidden\n * Data structure to represent meeting details\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IMeetingDetailsResponse {\n /**\n * @hidden\n * details object\n */\n details: IMeetingDetails | ICallDetails;\n\n /**\n * @hidden\n * conversation object\n */\n conversation: IConversation;\n\n /**\n * @hidden\n * organizer object\n */\n organizer: IOrganizer;\n }\n\n /**\n * @hidden\n * Hide from docs\n * Base data structure to represent a meeting or call detail\n */\n export interface IMeetingOrCallDetailsBase<T> {\n /**\n * @hidden\n * Scheduled start time of the meeting or start time of the call\n */\n scheduledStartTime: string;\n\n /**\n * @hidden\n * url to join the current meeting or call\n */\n joinUrl?: string;\n\n /**\n * @hidden\n * type of the meeting or call\n */\n type?: T;\n }\n\n /**\n * @hidden\n * Hide from docs\n * Data structure to represent call details\n */\n export type ICallDetails = IMeetingOrCallDetailsBase<CallType>;\n\n /**\n * @hidden\n * Hide from docs\n * Data structure to represent meeting details.\n */\n export interface IMeetingDetails extends IMeetingOrCallDetailsBase<MeetingType> {\n /**\n * @hidden\n * Scheduled end time of the meeting\n */\n scheduledEndTime: string;\n\n /**\n * @hidden\n * meeting title name of the meeting\n */\n title?: string;\n }\n\n /**\n * @hidden\n * Data structure to represent a conversation object.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IConversation {\n /**\n * @hidden\n * conversation id of the meeting\n */\n id: string;\n }\n\n /**\n * @hidden\n * Data structure to represent an organizer object.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IOrganizer {\n /**\n * @hidden\n * organizer id of the meeting\n */\n id?: string;\n /**\n * @hidden\n * tenant id of the meeting\n */\n tenantId?: string;\n }\n\n export interface LiveStreamState {\n /**\n * indicates whether meeting is streaming\n */\n isStreaming: boolean;\n\n /**\n * error object in case there is a failure\n */\n error?: {\n /** error code from the streaming service, e.g. IngestionFailure */\n code: string;\n /** detailed error message string */\n message?: string;\n };\n }\n\n export interface IAppContentStageSharingCapabilities {\n /**\n * indicates whether app has permission to share contents to meeting stage\n */\n doesAppHaveSharePermission: boolean;\n }\n\n export interface IAppContentStageSharingState {\n /**\n * indicates whether app is currently being shared to stage\n */\n isAppSharing: boolean;\n }\n\n /**\n * Property bag for the speakingState changed event\n *\n */\n export interface ISpeakingState {\n /**\n * Indicates whether one or more participants in a meeting are speaking, or\n * if no participants are speaking\n */\n isSpeakingDetected: boolean;\n\n /**\n * error object in case there is a failure\n */\n error?: SdkError;\n }\n\n /**\n * Property bag for the meeting reaction received event\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface MeetingReactionReceivedEventData {\n /**\n * Indicates the type of meeting reaction received\n *\n * @hidden\n * Hide from docs.\n */\n meetingReactionType?: MeetingReactionType;\n /**\n * error object in case there is a failure\n *\n * @hidden\n * Hide from docs.\n */\n error?: SdkError;\n }\n\n /**\n * Interface for raiseHandState properties\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface IRaiseHandState {\n /** Indicates whether the selfParticipant's hand is raised or not\n *\n * @hidden\n * Hide from docs.\n */\n\n isHandRaised: boolean;\n }\n\n /**\n * Property bag for the raiseHandState changed event\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface RaiseHandStateChangedEventData {\n /**\n * entire raiseHandState object for the selfParticipant\n *\n * @hidden\n * Hide from docs.\n */\n raiseHandState: IRaiseHandState;\n\n /**\n * error object in case there is a failure\n *\n * @hidden\n * Hide from docs.\n */\n error?: SdkError;\n }\n\n /**\n * Interface for mic state change\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface MicState {\n /**\n * Indicates the mute status of the mic\n */\n isMicMuted: boolean;\n }\n\n /**\n * Reasons for the app's microphone state to change\n */\n enum MicStateChangeReason {\n HostInitiated,\n AppInitiated,\n AppDeclinedToChange,\n AppFailedToChange,\n }\n\n /**\n * Interface for RequestAppAudioHandling properties\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface RequestAppAudioHandlingParams {\n /**\n * Indicates whether the app is requesting to start handling audio, or if\n * it's giving audio back to the host\n */\n isAppHandlingAudio: boolean;\n /**\n * Callback for the host to tell the app to change its microphone state\n * @param micState The microphone state for the app to use\n * @returns A promise with the updated microphone state\n */\n micMuteStateChangedCallback: (micState: MicState) => Promise<MicState>;\n }\n\n /**\n * Different types of meeting reactions that can be sent/received\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export enum MeetingReactionType {\n like = 'like',\n heart = 'heart',\n laugh = 'laugh',\n surprised = 'surprised',\n applause = 'applause',\n }\n\n export enum MeetingType {\n Unknown = 'Unknown',\n Adhoc = 'Adhoc',\n Scheduled = 'Scheduled',\n Recurring = 'Recurring',\n Broadcast = 'Broadcast',\n MeetNow = 'MeetNow',\n }\n\n export enum CallType {\n OneOnOneCall = 'oneOnOneCall',\n GroupCall = 'groupCall',\n }\n\n /**\n * Allows an app to get the incoming audio speaker setting for the meeting user\n *\n * @param callback - Callback contains 2 parameters, error and result.\n *\n * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful\n * result can either contain the true/false value, incase of a successful fetch or null when the fetching fails\n * result: True means incoming audio is muted and false means incoming audio is unmuted\n */\n export function getIncomingClientAudioState(\n callback: (error: SdkError | null, result: boolean | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[get incoming client audio state] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('getIncomingClientAudioState', callback);\n }\n\n /**\n * Allows an app to toggle the incoming audio speaker setting for the meeting user from mute to unmute or vice-versa\n *\n * @param callback - Callback contains 2 parameters, error and result.\n * error can either contain an error of type SdkError, incase of an error, or null when toggle is successful\n * result can either contain the true/false value, incase of a successful toggle or null when the toggling fails\n * result: True means incoming audio is muted and false means incoming audio is unmuted\n */\n export function toggleIncomingClientAudio(callback: (error: SdkError | null, result: boolean | null) => void): void {\n if (!callback) {\n throw new Error('[toggle incoming client audio] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('toggleIncomingClientAudio', callback);\n }\n\n /**\n * @hidden\n * Allows an app to get the meeting details for the meeting\n *\n * @param callback - Callback contains 2 parameters, error and meetingDetailsResponse.\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\n * result can either contain a IMeetingDetailsResponse value, in case of a successful get or null when the get fails\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getMeetingDetails(\n callback: (error: SdkError | null, meetingDetails: IMeetingDetailsResponse | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[get meeting details] Callback cannot be null');\n }\n ensureInitialized(\n runtime,\n FrameContexts.sidePanel,\n FrameContexts.meetingStage,\n FrameContexts.settings,\n FrameContexts.content,\n );\n sendMessageToParent('meeting.getMeetingDetails', callback);\n }\n\n /**\n * @hidden\n * Allows an app to get the authentication token for the anonymous or guest user in the meeting\n *\n * @param callback - Callback contains 2 parameters, error and authenticationTokenOfAnonymousUser.\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\n * authenticationTokenOfAnonymousUser can either contain a string value, incase of a successful get or null when the get fails\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getAuthenticationTokenForAnonymousUser(\n callback: (error: SdkError | null, authenticationTokenOfAnonymousUser: string | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[get Authentication Token For AnonymousUser] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.task);\n sendMessageToParent('meeting.getAuthenticationTokenForAnonymousUser', callback);\n }\n\n /**\n * Allows an app to get the state of the live stream in the current meeting\n *\n * @param callback - Callback contains 2 parameters: error and liveStreamState.\n * error can either contain an error of type SdkError, in case of an error, or null when get is successful\n * liveStreamState can either contain a LiveStreamState value, or null when operation fails\n */\n export function getLiveStreamState(\n callback: (error: SdkError | null, liveStreamState: LiveStreamState | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[get live stream state] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n sendMessageToParent('meeting.getLiveStreamState', callback);\n }\n\n /**\n * Allows an app to request the live streaming be started at the given streaming url\n *\n * @remarks\n * Use getLiveStreamState or registerLiveStreamChangedHandler to get updates on the live stream state\n *\n * @param streamUrl - the url to the stream resource\n * @param streamKey - the key to the stream resource\n * @param callback - Callback contains error parameter which can be of type SdkError in case of an error, or null when operation is successful\n */\n export function requestStartLiveStreaming(\n callback: (error: SdkError | null) => void,\n streamUrl: string,\n streamKey?: string,\n ): void {\n if (!callback) {\n throw new Error('[request start live streaming] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n sendMessageToParent('meeting.requestStartLiveStreaming', [streamUrl, streamKey], callback);\n }\n\n /**\n * Allows an app to request the live streaming be stopped at the given streaming url\n *\n * @remarks\n * Use getLiveStreamState or registerLiveStreamChangedHandler to get updates on the live stream state\n *\n * @param callback - Callback contains error parameter which can be of type SdkError in case of an error, or null when operation is successful\n */\n export function requestStopLiveStreaming(callback: (error: SdkError | null) => void): void {\n if (!callback) {\n throw new Error('[request stop live streaming] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n sendMessageToParent('meeting.requestStopLiveStreaming', callback);\n }\n\n /**\n * Registers a handler for changes to the live stream.\n *\n * @remarks\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the live stream state changes\n */\n export function registerLiveStreamChangedHandler(handler: (liveStreamState: LiveStreamState) => void): void {\n if (!handler) {\n throw new Error('[register live stream changed handler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n registerHandler('meeting.liveStreamChanged', handler);\n }\n\n /**\n * Allows an app to share contents in the meeting\n *\n * @param callback - Callback contains 2 parameters, error and result.\n * error can either contain an error of type SdkError, incase of an error, or null when share is successful\n * result can either contain a true value, incase of a successful share or null when the share fails\n * @param appContentUrl - is the input URL which needs to be shared on to the stage\n */\n export function shareAppContentToStage(\n callback: (error: SdkError | null, result: boolean | null) => void,\n appContentUrl: string,\n ): void {\n if (!callback) {\n throw new Error('[share app content to stage] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('meeting.shareAppContentToStage', [appContentUrl], callback);\n }\n\n /**\n * Provides information related app's in-meeting sharing capabilities\n *\n * @param callback - Callback contains 2 parameters, error and result.\n * error can either contain an error of type SdkError (error indication), or null (non-error indication)\n * appContentStageSharingCapabilities can either contain an IAppContentStageSharingCapabilities object\n * (indication of successful retrieval), or null (indication of failed retrieval)\n */\n export function getAppContentStageSharingCapabilities(\n callback: (\n error: SdkError | null,\n appContentStageSharingCapabilities: IAppContentStageSharingCapabilities | null,\n ) => void,\n ): void {\n if (!callback) {\n throw new Error('[get app content stage sharing capabilities] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('meeting.getAppContentStageSharingCapabilities', callback);\n }\n\n /**\n * @hidden\n * Hide from docs.\n * Terminates current stage sharing session in meeting\n *\n * @param callback - Callback contains 2 parameters, error and result.\n * error can either contain an error of type SdkError (error indication), or null (non-error indication)\n * result can either contain a true boolean value (successful termination), or null (unsuccessful fetch)\n */\n export function stopSharingAppContentToStage(\n callback: (error: SdkError | null, result: boolean | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[stop sharing app content to stage] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('meeting.stopSharingAppContentToStage', callback);\n }\n\n /**\n * Provides information related to current stage sharing state for app\n *\n * @param callback - Callback contains 2 parameters, error and result.\n * error can either contain an error of type SdkError (error indication), or null (non-error indication)\n * appContentStageSharingState can either contain an IAppContentStageSharingState object\n * (indication of successful retrieval), or null (indication of failed retrieval)\n */\n export function getAppContentStageSharingState(\n callback: (error: SdkError | null, appContentStageSharingState: IAppContentStageSharingState | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[get app content stage sharing state] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('meeting.getAppContentStageSharingState', callback);\n }\n\n /**\n * Registers a handler for changes to paticipant speaking states. This API returns {@link ISpeakingState}, which will have isSpeakingDetected\n * and/or an error object. If any participant is speaking, isSpeakingDetected will be true. If no participants are speaking, isSpeakingDetected\n * will be false. Default value is false. Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler The handler to invoke when the speaking state of any participant changes (start/stop speaking).\n */\n export function registerSpeakingStateChangeHandler(handler: (speakingState: ISpeakingState) => void): void {\n if (!handler) {\n throw new Error('[registerSpeakingStateChangeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n registerHandler('meeting.speakingStateChanged', handler);\n }\n\n /**\n * Registers a handler for changes to the selfParticipant's (current user's) raiseHandState. If the selfParticipant raises their hand, isHandRaised\n * will be true. By default and if the selfParticipant hand is lowered, isHandRaised will be false. This API will return {@link RaiseHandStateChangedEventData}\n * that will have the raiseHandState or an error object. Only one handler can be registered at a time. A subsequent registration\n * replaces an existing registration.\n *\n * @param handler The handler to invoke when the selfParticipant's (current user's) raiseHandState changes.\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function registerRaiseHandStateChangedHandler(\n handler: (eventData: RaiseHandStateChangedEventData) => void,\n ): void {\n if (!handler) {\n throw new Error('[registerRaiseHandStateChangedHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n registerHandler('meeting.raiseHandStateChanged', handler);\n }\n\n /**\n * Registers a handler for receiving meeting reactions. When the selfParticipant (current user) successfully sends a meeting reaction and it is being rendered on the UI, the meetingReactionType will be populated. Only one handler can be registered\n * at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler The handler to invoke when the selfParticipant (current user) successfully sends a meeting reaction\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function registerMeetingReactionReceivedHandler(\n handler: (eventData: MeetingReactionReceivedEventData) => void,\n ): void {\n if (!handler) {\n throw new Error('[registerMeetingReactionReceivedHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n registerHandler('meeting.meetingReactionReceived', handler);\n }\n\n /**\n * Nested namespace for functions to control behavior of the app share button\n *\n * @beta\n */\n export namespace appShareButton {\n /**\n * Property bag for the setVisibilityInfo\n *\n * @beta\n */\n export interface ShareInformation {\n /**\n * boolean flag to set show or hide app share button\n */\n isVisible: boolean;\n\n /**\n * optional string contentUrl, which will override contentUrl coming from Manifest\n */\n contentUrl?: string;\n }\n /**\n * By default app share button will be hidden and this API will govern the visibility of it.\n *\n * This function can be used to hide/show app share button in meeting,\n * along with contentUrl (overrides contentUrl populated in app manifest)\n * @throws standard Invalid Url error\n * @param shareInformation has two elements, one isVisible boolean flag and another\n * optional string contentUrl, which will override contentUrl coming from Manifest\n * @beta\n */\n export function setOptions(shareInformation: ShareInformation): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (shareInformation.contentUrl) {\n new URL(shareInformation.contentUrl);\n }\n sendMessageToParent('meeting.appShareButton.setOptions', [shareInformation]);\n }\n }\n\n /**\n * Have the app handle audio (mic & speaker) and turn off host audio.\n *\n * When {@link RequestAppAudioHandlingParams.isAppHandlingAudio} is true, the host will switch to audioless mode\n * Registers for mic mute status change events, which are events that the app can receive from the host asking the app to\n * mute or unmute the microphone.\n *\n * When {@link RequestAppAudioHandlingParams.isAppHandlingAudio} is false, the host will switch out of audioless mode\n * Unregisters the mic mute status change events so the app will no longer receive these events\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n * @throws Error if {@link RequestAppAudioHandlingParams.micMuteStateChangedCallback} parameter is not defined\n *\n * @param requestAppAudioHandlingParams - {@link RequestAppAudioHandlingParams} object with values for the audio switchover\n * @param callback - Callback with one parameter, the result\n * can either be true (the host is now in audioless mode) or false (the host is not in audioless mode)\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function requestAppAudioHandling(\n requestAppAudioHandlingParams: RequestAppAudioHandlingParams,\n callback: (isHostAudioless: boolean) => void,\n ): void {\n if (!callback) {\n throw new Error('[requestAppAudioHandling] Callback response cannot be null');\n }\n if (!requestAppAudioHandlingParams.micMuteStateChangedCallback) {\n throw new Error('[requestAppAudioHandling] Callback Mic mute state handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n\n if (requestAppAudioHandlingParams.isAppHandlingAudio) {\n startAppAudioHandling(requestAppAudioHandlingParams, callback);\n } else {\n stopAppAudioHandling(requestAppAudioHandlingParams, callback);\n }\n }\n\n function startAppAudioHandling(\n requestAppAudioHandlingParams: RequestAppAudioHandlingParams,\n callback: (isHostAudioless: boolean) => void,\n ): void {\n const callbackInternalRequest = (error: SdkError | null, isHostAudioless: boolean | null): void => {\n if (error && isHostAudioless != null) {\n throw new Error('[requestAppAudioHandling] Callback response - both parameters cannot be set');\n }\n if (error) {\n throw new Error(`[requestAppAudioHandling] Callback response - SDK error ${error.errorCode} ${error.message}`);\n }\n if (typeof isHostAudioless !== 'boolean') {\n throw new Error('[requestAppAudioHandling] Callback response - isHostAudioless must be a boolean');\n }\n\n const micStateChangedCallback = async (micState: MicState): Promise<void> => {\n try {\n const newMicState = await requestAppAudioHandlingParams.micMuteStateChangedCallback(micState);\n\n const micStateDidUpdate = newMicState.isMicMuted === micState.isMicMuted;\n setMicStateWithReason(\n newMicState,\n micStateDidUpdate ? MicStateChangeReason.HostInitiated : MicStateChangeReason.AppDeclinedToChange,\n );\n } catch {\n setMicStateWithReason(micState, MicStateChangeReason.AppFailedToChange);\n }\n };\n registerHandler('meeting.micStateChanged', micStateChangedCallback);\n\n callback(isHostAudioless);\n };\n sendMessageToParent(\n 'meeting.requestAppAudioHandling',\n [requestAppAudioHandlingParams.isAppHandlingAudio],\n callbackInternalRequest,\n );\n }\n\n function stopAppAudioHandling(\n requestAppAudioHandlingParams: RequestAppAudioHandlingParams,\n callback: (isHostAudioless: boolean) => void,\n ): void {\n const callbackInternalStop = (error: SdkError | null, isHostAudioless: boolean | null): void => {\n if (error && isHostAudioless != null) {\n throw new Error('[requestAppAudioHandling] Callback response - both parameters cannot be set');\n }\n if (error) {\n throw new Error(`[requestAppAudioHandling] Callback response - SDK error ${error.errorCode} ${error.message}`);\n }\n if (typeof isHostAudioless !== 'boolean') {\n throw new Error('[requestAppAudioHandling] Callback response - isHostAudioless must be a boolean');\n }\n\n if (doesHandlerExist('meeting.micStateChanged')) {\n removeHandler('meeting.micStateChanged');\n }\n\n callback(isHostAudioless);\n };\n\n sendMessageToParent(\n 'meeting.requestAppAudioHandling',\n [requestAppAudioHandlingParams.isAppHandlingAudio],\n callbackInternalStop,\n );\n }\n\n /**\n * Notifies the host that the microphone state has changed in the app.\n * @param micState - The new state that the microphone is in\n * isMicMuted - Boolean to indicate the current mute status of the mic.\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function updateMicState(micState: MicState): void {\n setMicStateWithReason(micState, MicStateChangeReason.AppInitiated);\n }\n\n function setMicStateWithReason(micState: MicState, reason: MicStateChangeReason): void {\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('meeting.updateMicState', [micState, reason]);\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise, InputFunction } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\nexport namespace monetization {\n /**\n * @hidden\n * Data structure to represent a subscription plan.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface PlanInfo {\n /**\n * @hidden\n * plan id\n */\n planId: string;\n /**\n * @hidden\n * term of the plan\n */\n term: string;\n }\n\n /**\n * @hidden\n * Open dialog to start user's purchase experience\n *\n * @param planInfo optional parameter. It contains info of the subscription plan pushed to users.\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\n * @returns Promise that will be resolved when the operation has completed or rejected with SdkError value\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openPurchaseExperience(planInfo?: PlanInfo): Promise<void>;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link monetization.openPurchaseExperience monetization.openPurchaseExperience(planInfo?: PlanInfo): Promise\\<void\\>} instead.\n *\n * @hidden\n * Open dialog to start user's purchase experience\n *\n * @param callback Callback contains 1 parameters, error.\n * @param planInfo optional parameter. It contains info of the subscription plan pushed to users.\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openPurchaseExperience(callback: (error: SdkError | null) => void, planInfo?: PlanInfo): void;\n /**\n * @hidden\n * This function is the overloaded implementation of openPurchaseExperience.\n * Since the method signatures of the v1 callback and v2 promise differ in the type of the first parameter,\n * we need to do an extra check to know the typeof the @param1 to set the proper arguments of the utility function.\n * @param param1\n * @param param2\n * @returns Promise that will be resolved when the operation has completed or rejected with SdkError value\n */\n export function openPurchaseExperience(\n param1: ((error: SdkError | null) => void) | PlanInfo | undefined,\n param2?: PlanInfo,\n ): Promise<void> {\n let callback: ((error: SdkError | null) => void) | undefined;\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n let planInfo: PlanInfo;\n if (typeof param1 === 'function') {\n callback = param1;\n planInfo = param2;\n } else {\n planInfo = param1;\n }\n const wrappedFunction: InputFunction<void> = () => {\n return new Promise<void>((resolve) => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError('monetization.openPurchaseExperience', planInfo));\n });\n };\n\n ensureInitialized(runtime, FrameContexts.content);\n return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(wrappedFunction, callback);\n }\n\n /**\n * @hidden\n *\n * Checks if the monetization capability is supported by the host\n * @returns boolean to represent whether the monetization capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.monetization ? true : false;\n }\n}\n","import { sendAndHandleStatusAndReason as sendAndHandleError } from '../internal/communication';\nimport { createTeamsDeepLinkForCalendar } from '../internal/deepLinkUtilities';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\nexport namespace calendar {\n export function openCalendarItem(openCalendarItemParams: OpenCalendarItemParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n\n if (!openCalendarItemParams.itemId || !openCalendarItemParams.itemId.trim()) {\n throw new Error('Must supply an itemId to openCalendarItem');\n }\n\n resolve(sendAndHandleError('calendar.openCalendarItem', openCalendarItemParams));\n });\n }\n export function composeMeeting(composeMeetingParams: ComposeMeetingParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleError(\n 'executeDeepLink',\n createTeamsDeepLinkForCalendar(\n composeMeetingParams.attendees,\n composeMeetingParams.startTime,\n composeMeetingParams.endTime,\n composeMeetingParams.subject,\n composeMeetingParams.content,\n ),\n ),\n );\n } else {\n resolve(sendAndHandleError('calendar.composeMeeting', composeMeetingParams));\n }\n });\n }\n\n /**\n * Checks if the calendar capability is supported by the host\n * @returns boolean to represent whether the calendar capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.calendar ? true : false;\n }\n\n export interface OpenCalendarItemParams {\n itemId: string;\n }\n\n export interface ComposeMeetingParams {\n attendees?: string[];\n startTime?: string;\n endTime?: string;\n subject?: string;\n content?: string;\n }\n}\n","import { sendAndHandleStatusAndReason as sendAndHandleError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\nexport namespace mail {\n export function openMailItem(openMailItemParams: OpenMailItemParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n\n if (!openMailItemParams.itemId || !openMailItemParams.itemId.trim()) {\n throw new Error('Must supply an itemId to openMailItem');\n }\n\n resolve(sendAndHandleError('mail.openMailItem', openMailItemParams));\n });\n }\n\n export function composeMail(composeMailParams: ComposeMailParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n\n resolve(sendAndHandleError('mail.composeMail', composeMailParams));\n });\n }\n\n /**\n * Checks if the mail capability is supported by the host\n * @returns boolean to represent whether the mail capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.mail ? true : false;\n }\n\n export interface OpenMailItemParams {\n itemId: string;\n }\n\n export enum ComposeMailType {\n New = 'new',\n Reply = 'reply',\n ReplyAll = 'replyAll',\n Forward = 'forward',\n }\n\n /**\n * Foundational interface for all other mail compose interfaces\n * Used for holding the type of mail item being composed\n *\n * @see {@link ComposeMailType}\n */\n interface ComposeMailBase<T extends ComposeMailType> {\n type: T;\n }\n\n /**\n * Parameters supplied when composing a new mail item\n */\n export interface ComposeNewParams extends ComposeMailBase<ComposeMailType.New> {\n /**\n * The To: recipients for the message\n */\n toRecipients?: string[];\n\n /**\n * The Cc: recipients for the message\n */\n ccRecipients?: string[];\n\n /**\n * The Bcc: recipients for the message\n */\n bccRecipients?: string[];\n\n /**\n * The subject of the message\n */\n subject?: string;\n\n /**\n * The body of the message\n */\n message?: string;\n }\n\n /**\n * Parameters supplied when composing a reply to or forward of a message\n *\n * @see {@link ComposeMailType}\n */\n export interface ComposeReplyOrForwardParams<T extends ComposeMailType> extends ComposeMailBase<T> {\n itemid: string;\n }\n\n /**\n * Parameters supplied to {@link composeMail} when composing a new mail item\n *\n * @see {@link ComposeNewParams}\n * @see {@link ComposeReplyOrForwardParams}\n * @see {@link ComposeMailType}\n */\n export type ComposeMailParams =\n | ComposeNewParams\n | ComposeReplyOrForwardParams<ComposeMailType.Reply>\n | ComposeReplyOrForwardParams<ComposeMailType.ReplyAll>\n | ComposeReplyOrForwardParams<ComposeMailType.Forward>;\n}\n","import { sendAndHandleSdkError as sendAndHandleError } from '../internal/communication';\nimport { peoplePickerRequiredVersion } from '../internal/constants';\nimport { ensureInitialized, isCurrentSDKVersionAtLeast } from '../internal/internalAPIs';\nimport { validatePeoplePickerInput } from '../internal/mediaUtil';\nimport { callCallbackWithErrorOrResultFromPromiseAndReturnPromise } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\nexport namespace people {\n /**\n * Launches a people picker and allows the user to select one or more people from the list\n * If the app is added to personal app scope the people picker launched is org wide and if the app is added to a chat/channel, people picker launched is also limited to the members of chat/channel\n \n * @param callback - Returns list of JSON object of type PeoplePickerResult which consists of AAD IDs, display names and emails of the selected users\n * @param peoplePickerInputs - Input parameters to launch customized people picker\n * @returns Promise that will be fulfilled when the operation has completed\n */\n export function selectPeople(peoplePickerInputs?: PeoplePickerInputs): Promise<PeoplePickerResult[]>;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link people.selectPeople people.selectPeople(peoplePickerInputs?: PeoplePickerInputs): Promise\\<PeoplePickerResult[]\\>} instead.\n *\n * Launches a people picker and allows the user to select one or more people from the list\n * If the app is added to personal app scope the people picker launched is org wide and if the app is added to a chat/channel, people picker launched is also limited to the members of chat/channel\n \n * @param callback - Returns list of JSON object of type PeoplePickerResult which consists of AAD IDs, display names and emails of the selected users\n * @param peoplePickerInputs - Input parameters to launch customized people picker\n */\n export function selectPeople(\n callback: (error: SdkError, people: PeoplePickerResult[]) => void,\n peoplePickerInputs?: PeoplePickerInputs,\n ): void;\n /**\n * @hidden\n * This function is the overloaded implementation of selectPeople.\n * Since the method signatures of the v1 callback and v2 promise differ in the type of the first parameter,\n * we need to do an extra check to know the typeof the @param1 to set the proper arguments of the utility function.\n * @param param1\n * @param param2\n * @returns Promise of Array of PeoplePickerResult objects.\n */\n export function selectPeople(\n param1: PeoplePickerInputs | ((error: SdkError, people: PeoplePickerResult[]) => void) | undefined,\n param2?: PeoplePickerInputs,\n ): Promise<PeoplePickerResult[]> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.settings);\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n let callback: (error: SdkError, people: PeoplePickerResult[]) => void;\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n let peoplePickerInputs: PeoplePickerInputs;\n\n if (typeof param1 === 'function') {\n [callback, peoplePickerInputs] = [param1, param2];\n } else {\n peoplePickerInputs = param1;\n }\n\n return callCallbackWithErrorOrResultFromPromiseAndReturnPromise<PeoplePickerResult[]>(\n selectPeopleHelper,\n callback,\n peoplePickerInputs,\n );\n }\n\n function selectPeopleHelper(peoplePickerInputs?: PeoplePickerInputs): Promise<PeoplePickerResult[]> {\n return new Promise<PeoplePickerResult[]>((resolve) => {\n if (!isCurrentSDKVersionAtLeast(peoplePickerRequiredVersion)) {\n throw { errorCode: ErrorCode.OLD_PLATFORM };\n }\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n if (!validatePeoplePickerInput(peoplePickerInputs)) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(sendAndHandleError('people.selectPeople', peoplePickerInputs));\n });\n }\n\n /**\n * Input parameter supplied to the People Picker API\n */\n export interface PeoplePickerInputs {\n /**\n * Optional; Set title for the people picker\n * Default value is \"Select people\" for multiselect and \"Select a person\" for single select\n */\n title?: string;\n\n /**\n * Optional; AAD ids of the users to be pre-populated in the search box of people picker control\n * If single select is enabled this value, only the first user in the list will be pre-populated\n * Default value is null\n */\n setSelected?: string[];\n\n /**\n * Optional; launches the people picker in org wide scope even if the app is added to a chat or channel\n * Default value is false\n */\n openOrgWideSearchInChatOrChannel?: boolean;\n\n /**\n * Optional; launches the people picker for which only 1 person can be selected\n * Default value is false\n */\n singleSelect?: boolean;\n }\n\n /**\n * Output user object of people picker API\n */\n export interface PeoplePickerResult {\n /**\n * user object Id (also known as aad id) of the selected user\n */\n objectId: string;\n\n /**\n * Optional; display name of the selected user\n */\n displayName?: string;\n\n /**\n * Optional; email of the selected user\n */\n email?: string;\n }\n\n /**\n * Checks if the people capability is supported by the host\n * @returns boolean to represent whether the people capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.people ? true : false;\n }\n}\n","import { sendAndHandleSdkError as sendAndHandleError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { validateShowProfileRequest } from '../internal/profileUtil';\nimport { FrameContexts } from './constants';\nimport { ErrorCode } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Namespace for profile related APIs.\n *\n * @beta\n */\nexport namespace profile {\n /**\n * Opens a profile card at a specified position to show profile information about a persona.\n * @param showProfileRequest The parameters to position the card and identify the target user.\n * @returns Promise that will be fulfilled when the operation has completed\n *\n * @beta\n */\n export function showProfile(showProfileRequest: ShowProfileRequest): Promise<void> {\n ensureInitialized(runtime, FrameContexts.content);\n\n return new Promise<void>((resolve) => {\n const [isValid, message] = validateShowProfileRequest(showProfileRequest);\n if (!isValid) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS, message };\n }\n\n // Convert the app provided parameters to the form suitable for postMessage.\n const requestInternal: ShowProfileRequestInternal = {\n modality: showProfileRequest.modality,\n persona: showProfileRequest.persona,\n triggerType: showProfileRequest.triggerType,\n targetRectangle: {\n x: showProfileRequest.targetElementBoundingRect.x,\n y: showProfileRequest.targetElementBoundingRect.y,\n width: showProfileRequest.targetElementBoundingRect.width,\n height: showProfileRequest.targetElementBoundingRect.height,\n },\n };\n\n resolve(sendAndHandleError('profile.showProfile', requestInternal));\n });\n }\n\n /**\n * The type of modalities that are supported when showing a profile.\n * Can be provided as an optional hint with the request and will be\n * respected if the hosting M365 application supports it.\n *\n * @beta\n */\n export type Modality = 'Card' | 'Expanded';\n\n /**\n * The type of the profile trigger.\n * - MouseHover: The user hovered a target.\n * - Press: The target was pressed with either a mouse click or keyboard key press.\n * - AppRequest: The show profile request is happening programmatically, without direct user interaction.\n *\n * @beta\n */\n export type TriggerType = 'MouseHover' | 'Press' | 'AppRequest';\n\n /**\n * The set of identifiers that are supported for resolving the persona.\n *\n * At least one is required, and if multiple are provided then only the highest\n * priority one will be used (AadObjectId > Upn > Smtp).\n *\n * @beta\n */\n export type PersonaIdentifiers = {\n /**\n * The object id in Azure Active Directory.\n *\n * This id is guaranteed to be unique for an object within a tenant,\n * and so if provided will lead to a more performant lookup. It can\n * be resolved via MS Graph (see https://learn.microsoft.com/graph/api/resources/users\n * for examples).\n */\n readonly AadObjectId?: string;\n\n /**\n * The primary SMTP address.\n */\n readonly Smtp?: string;\n\n /**\n * The user principle name.\n */\n readonly Upn?: string;\n };\n\n /**\n * The persona to show the profile for.\n *\n * @beta\n */\n export interface Persona {\n /**\n * The set of identifiers that are supported for resolving the persona.\n */\n identifiers: PersonaIdentifiers;\n\n /**\n * Optional display name override. If not specified the user's display name will be resolved normally.\n */\n displayName?: string;\n }\n\n /**\n * Input parameters provided to the showProfile API.\n *\n * @beta\n */\n export interface ShowProfileRequest {\n /**\n * An optional hint to the hosting M365 application about which modality of the profile you want to show.\n */\n modality?: Modality;\n\n /**\n * The information about the persona to show the profile for.\n */\n persona: Persona;\n\n /**\n * The bounding rectangle of the target.\n */\n targetElementBoundingRect: DOMRect;\n\n /**\n * Specifies which user interaction was used to trigger the API call.\n */\n triggerType: TriggerType;\n }\n\n /**\n * Checks if the profile capability is supported by the host\n * @returns boolean to represent whether the profile capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.profile ? true : false;\n }\n}\n\n/**\n * Internal representation of a DOMRect suitable for sending via postMessage.\n */\nexport type Rectangle = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\n/**\n * @beta\n * @hidden\n * An internal representation of the showProfile parameters suitable for sending via postMessage.\n * The hub expects to receive an object of this type.\n */\nexport interface ShowProfileRequestInternal {\n modality?: profile.Modality;\n persona: profile.Persona;\n targetRectangle: Rectangle;\n triggerType: profile.TriggerType;\n}\n","import { profile } from '../public/profile';\n\n/**\n * @hidden\n * Validates the request parameters\n * @param showProfileRequest The request parameters\n * @returns true if the parameters are valid, false otherwise\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateShowProfileRequest(\n showProfileRequest: profile.ShowProfileRequest,\n): [boolean, string | undefined] {\n if (!showProfileRequest) {\n return [false, 'A request object is required'];\n }\n\n // Validate modality\n if (showProfileRequest.modality && typeof showProfileRequest.modality !== 'string') {\n return [false, 'modality must be a string'];\n }\n\n // Validate targetElementBoundingRect\n if (\n !showProfileRequest.targetElementBoundingRect ||\n typeof showProfileRequest.targetElementBoundingRect !== 'object'\n ) {\n return [false, 'targetElementBoundingRect must be a DOMRect'];\n }\n\n // Validate triggerType\n if (!showProfileRequest.triggerType || typeof showProfileRequest.triggerType !== 'string') {\n return [false, 'triggerType must be a valid string'];\n }\n\n return validatePersona(showProfileRequest.persona);\n}\n\n/**\n * @hidden\n * Validates the persona that is used to resolve the profile target\n * @param persona The persona object\n * @returns true if the persona is valid, false otherwise\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction validatePersona(persona: profile.Persona): [boolean, string | undefined] {\n if (!persona) {\n return [false, 'persona object must be provided'];\n }\n\n if (persona.displayName && typeof persona.displayName !== 'string') {\n return [false, 'displayName must be a string'];\n }\n\n if (!persona.identifiers || typeof persona.identifiers !== 'object') {\n return [false, 'persona identifiers object must be provided'];\n }\n\n if (!persona.identifiers.AadObjectId && !persona.identifiers.Smtp && !persona.identifiers.Upn) {\n return [false, 'at least one valid identifier must be provided'];\n }\n\n if (persona.identifiers.AadObjectId && typeof persona.identifiers.AadObjectId !== 'string') {\n return [false, 'AadObjectId identifier must be a string'];\n }\n\n if (persona.identifiers.Smtp && typeof persona.identifiers.Smtp !== 'string') {\n return [false, 'Smtp identifier must be a string'];\n }\n\n if (persona.identifiers.Upn && typeof persona.identifiers.Upn !== 'string') {\n return [false, 'Upn identifier must be a string'];\n }\n\n return [true, undefined];\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to video extensibility of the SDK\n * @beta\n */\nexport namespace video {\n /**\n * Represents a video frame\n * @beta\n */\n export interface VideoFrameData {\n /**\n * Video frame width\n */\n width: number;\n /**\n * Video frame height\n */\n height: number;\n /**\n * Video frame buffer\n */\n videoFrameBuffer: Uint8ClampedArray;\n /**\n * NV12 luma stride, valid only when video frame format is NV12\n */\n lumaStride?: number;\n /**\n * NV12 chroma stride, valid only when video frame format is NV12\n */\n chromaStride?: number;\n /**\n * RGB stride, valid only when video frame format is RGB\n */\n stride?: number;\n /**\n * The time stamp of the current video frame\n */\n timestamp?: number;\n }\n\n /**\n * Video frame format enum, currently only support NV12\n * @beta\n */\n export enum VideoFrameFormat {\n NV12 = 'NV12',\n }\n\n /**\n * Video frame configuration supplied to the host to customize the generated video frame parameters, like format\n * @beta\n */\n export interface VideoFrameConfig {\n /**\n * Video format\n */\n format: VideoFrameFormat;\n }\n\n /**\n * Video effect change type enum\n * @beta\n */\n export enum EffectChangeType {\n /**\n * Current video effect changed\n */\n EffectChanged = 'EffectChanged',\n /**\n * Disable the video effect\n */\n EffectDisabled = 'EffectDisabled',\n }\n\n /**\n * Video frame call back function definition\n * @beta\n */\n export type VideoFrameCallback = (\n frame: VideoFrameData,\n notifyVideoFrameProcessed: () => void,\n notifyError: (errorMessage: string) => void,\n ) => void;\n\n /**\n * Predefined failure reasons for preparing the selected video effect\n * @beta\n */\n export enum EffectFailureReason {\n /**\n * A wrong effect id is provide.\n * Use this reason when the effect id is not found or empty, this may indicate a mismatch between the app and its manifest or a bug of the host.\n */\n InvalidEffectId = 'InvalidEffectId',\n /**\n * The effect can't be initialized\n */\n InitializationFailure = 'InitializationFailure',\n }\n\n /**\n * Video effect change call back function definition\n * Return a Promise which will be resolved when the effect is prepared, or throw an {@link EffectFailureReason} on error.\n * @beta\n */\n export type VideoEffectCallback = (effectId: string | undefined) => Promise<void>;\n\n /**\n * Register to read the video frames in Permissions section\n * @beta\n * @param frameCallback - The callback to invoke when registerForVideoFrame has completed\n * @param config - VideoFrameConfig to customize generated video frame parameters\n */\n export function registerForVideoFrame(frameCallback: VideoFrameCallback, config: VideoFrameConfig): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n registerHandler(\n 'video.newVideoFrame',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (videoFrame: any) => {\n if (videoFrame) {\n // The host may pass the VideoFrame with the old definition which has `data` instead of `videoFrameBuffer`\n const videoFrameData = {\n ...videoFrame,\n videoFrameBuffer: videoFrame.videoFrameBuffer || videoFrame.data,\n } as VideoFrameData;\n const timestamp = videoFrameData.timestamp;\n frameCallback(\n videoFrameData,\n () => {\n notifyVideoFrameProcessed(timestamp);\n },\n notifyError,\n );\n }\n },\n false,\n );\n sendMessageToParent('video.registerForVideoFrame', [config]);\n }\n\n /**\n * Video extension should call this to notify host that the current selected effect parameter changed.\n * If it's pre-meeting, host will call videoEffectCallback immediately then use the videoEffect.\n * If it's the in-meeting scenario, we will call videoEffectCallback when apply button clicked.\n * @beta\n * @param effectChangeType - the effect change type.\n * @param effectId - Newly selected effect id.\n */\n export function notifySelectedVideoEffectChanged(\n effectChangeType: EffectChangeType,\n effectId: string | undefined,\n ): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('video.videoEffectChanged', [effectChangeType, effectId]);\n }\n\n /**\n * Register a callback to be notified when a new video effect is applied.\n * @beta\n * @param callback - Function to be called when new video effect is applied.\n */\n export function registerForVideoEffect(callback: VideoEffectCallback): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n const effectParameterChangeHandler = (effectId: string | undefined): void => {\n callback(effectId)\n .then(() => {\n sendMessageToParent('video.videoEffectReadiness', [true, effectId]);\n })\n .catch((reason) => {\n const validReason = reason in EffectFailureReason ? reason : EffectFailureReason.InitializationFailure;\n sendMessageToParent('video.videoEffectReadiness', [false, effectId, validReason]);\n });\n };\n\n registerHandler('video.effectParameterChange', effectParameterChangeHandler, false);\n sendMessageToParent('video.registerForVideoEffect');\n }\n\n /**\n * Sending notification to host finished the video frame processing, now host can render this video frame\n * or pass the video frame to next one in video pipeline\n * @beta\n */\n function notifyVideoFrameProcessed(timestamp?: number): void {\n sendMessageToParent('video.videoFrameProcessed', [timestamp]);\n }\n\n /**\n * Sending error notification to host\n * @beta\n * @param errorMessage - The error message that will be sent to the host\n */\n function notifyError(errorMessage: string): void {\n sendMessageToParent('video.notifyError', [errorMessage]);\n }\n\n /**\n * Checks if video capability is supported by the host\n * @beta\n * @returns boolean to represent whether the video capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.video ? true : false;\n }\n\n /**\n * @beta\n * Namespace to get video frames from a media stream.\n * When the host supports this capability, developer should call {@link mediaStream.registerForVideoFrame} to get the video frames instead of {@link registerForVideoFrame} to get the video frames, callback of {@link registerForVideoFrame} will be ignored when the host supports this capability.\n */\n export namespace mediaStream {\n /**\n * @beta\n * Checks if video.mediaStream capability is supported by the host\n * @returns boolean to represent whether the video.medisStream capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && isTextureStreamAvailable() && !!runtime.supports.video?.mediaStream;\n }\n\n function isTextureStreamAvailable(): boolean {\n return (\n typeof window !== 'undefined' &&\n !!(window['chrome']?.webview?.getTextureStream && window['chrome']?.webview?.registerTextureStream)\n );\n }\n\n /**\n * @beta\n * Video frame data extracted from the media stream. More properties may be added in the future.\n */\n export type MediaStreamFrameData = {\n /**\n * The video frame from the media stream.\n */\n videoFrame: VideoFrame;\n };\n\n /**\n * @beta\n * Video effect change call back function definition.\n * The video app should resolve the promise to notify a successfully processed video frame.\n * The video app should reject the promise to notify a failure.\n */\n export type VideoFrameCallback = (receivedVideoFrame: MediaStreamFrameData) => Promise<VideoFrame>;\n\n type MediaStreamInfo = {\n streamId: string;\n };\n\n /**\n * @beta\n * Register to read the video frames from the media stream provided by the host.\n * @param frameCallback - The callback to invoke when recieve a video frame from the media stream.\n * @example\n * ```typescript\n * video.mediaStream.registerForVideoFrame(async (receivedVideoFrame) => {\n * const { videoFrame } = receivedVideoFrame;\n * try {\n * return await processVideoFrame(videoFrame);\n * } catch (error) {\n * throw error;\n * }\n * });\n * ```\n */\n export function registerForVideoFrame(frameCallback: VideoFrameCallback): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n registerHandler('video.startVideoExtensibilityVideoStream', async (mediaStreamInfo: MediaStreamInfo) => {\n // when a new streamId is ready:\n const { streamId } = mediaStreamInfo;\n const videoTrack = await getInputVideoTrack(streamId);\n const generator = createProcessedStreamGenerator(videoTrack, frameCallback);\n // register the video track with processed frames back to the stream:\n typeof window !== 'undefined' && window['chrome']?.webview?.registerTextureStream(streamId, generator);\n });\n\n sendMessageToParent('video.mediaStream.registerForVideoFrame', [\n {\n format: VideoFrameFormat.NV12,\n },\n ]);\n }\n\n /**\n * Get the video track from the media stream gotten from chrome.webview.getTextureStream(streamId).\n */\n async function getInputVideoTrack(streamId: string): Promise<MediaStreamVideoTrack> {\n if (typeof window === 'undefined') {\n throw errorNotSupportedOnPlatform;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chrome = window['chrome'] as any;\n try {\n const mediaStream = await chrome.webview.getTextureStream(streamId);\n const tracks = mediaStream.getVideoTracks();\n if (tracks.length === 0) {\n throw new Error(`No video track in stream ${streamId}`);\n }\n return tracks[0];\n } catch (error) {\n const errorMsg = `Failed to get video track from stream ${streamId}, error: ${error}`;\n notifyError(errorMsg);\n throw new Error(errorMsg);\n }\n }\n\n /**\n * The function to create a processed video track from the original video track.\n * It reads frames from the video track and pipes them to the video frame callback to process the frames.\n * The processed frames are then enqueued to the generator.\n * The generator can be registered back to the media stream so that the host can get the processed frames.\n */\n function createProcessedStreamGenerator(\n videoTrack: MediaStreamVideoTrack,\n videoFrameCallback: VideoFrameCallback,\n ): MediaStreamTrack {\n const processor = new MediaStreamTrackProcessor({ track: videoTrack });\n const source = processor.readable;\n const generator = new MediaStreamTrackGenerator({ kind: 'video' });\n const sink = generator.writable;\n\n source\n .pipeThrough(\n new TransformStream({\n async transform(originalFrame, controller) {\n const timestamp = originalFrame.timestamp;\n if (timestamp !== null) {\n try {\n const frameProcessedByApp = await videoFrameCallback({ videoFrame: originalFrame });\n // the current typescript version(4.6.4) dosn't support webcodecs API fully, we have to do type conversion here.\n const processedFrame = new VideoFrame(frameProcessedByApp as unknown as CanvasImageSource, {\n // we need the timestamp to be unchanged from the oirginal frame, so we explicitly set it here.\n timestamp: timestamp,\n });\n controller.enqueue(processedFrame);\n originalFrame.close();\n frameProcessedByApp.close();\n } catch (error) {\n originalFrame.close();\n notifyError(error);\n }\n } else {\n notifyError('timestamp of the original video frame is null');\n }\n },\n }),\n )\n .pipeTo(sink);\n return generator;\n }\n }\n} //end of video namespace\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * Allows your application to interact with the host M365 application's search box.\n * By integrating your application with the host's search box, users can search\n * your app using the same search box they use elsewhere in Teams, Outlook, or Office.\n *\n * This functionality is in Beta.\n * @beta\n */\nexport namespace search {\n const onChangeHandlerName = 'search.queryChange';\n const onClosedHandlerName = 'search.queryClose';\n const onExecutedHandlerName = 'search.queryExecute';\n\n /**\n * This interface contains information pertaining to the contents of the host M365 application's search box\n *\n * @beta\n */\n export interface SearchQuery {\n /** The current search term in the host search experience */\n searchTerm: string;\n\n /** Timestamp sequence value to ensure messages are processed in correct order / combine them. */\n timestamp: number;\n }\n\n /**\n * This type will store the SearchQuery and allow other logic to be made inside the handler.\n *\n * @beta\n */\n export type SearchQueryHandler = (query: SearchQuery) => void;\n\n /**\n * Allows the caller to register for various events fired by the host search experience.\n * Calling this function indicates that your application intends to plug into the host's search box and handle search events,\n * when the user is actively using your page/tab.\n * \n * The host may visually update its search box, e.g. with the name or icon of your application.\n * \n * Your application should *not* re-render inside of these callbacks, there may be a large number\n * of onChangeHandler calls if the user is typing rapidly in the search box.\n *\n * @param onClosedHandler - This handler will be called when the user exits or cancels their search.\n * Should be used to return your application to its most recent, non-search state. The value of {@link SearchQuery.searchTerm} \n * will be whatever the last query was before ending search. \n * \n * @param onExecuteHandler - The handler will be called when the user executes their \n * search (by pressing Enter for example). Should be used to display the full list of search results. \n * The value of {@link SearchQuery.searchTerm} is the complete query the user entered in the search box.\n *\n * @param onChangeHandler - This optional handler will be called when the user first starts using the\n * host's search box and as the user types their query. Can be used to put your application into a \n * word-wheeling state or to display suggestions as the user is typing. \n * \n * This handler will be called with an empty {@link SearchQuery.searchTerm} when search is beginning, and subsequently,\n * with the current contents of the search box.\n * @example\n * ``` ts\n * search.registerHandlers(\n query => {\n console.log('Update your application to handle the search experience being closed. Last query: ${query.searchTerm}');\n },\n query => {\n console.log(`Update your application to handle an executed search result: ${query.searchTerm}`);\n },\n query => {\n console.log(`Update your application with the changed search query: ${query.searchTerm}`);\n },\n );\n * ```\n *\n * @beta\n */\n export function registerHandlers(\n onClosedHandler: SearchQueryHandler,\n onExecuteHandler: SearchQueryHandler,\n onChangeHandler?: SearchQueryHandler,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n registerHandler(onClosedHandlerName, onClosedHandler);\n registerHandler(onExecutedHandlerName, onExecuteHandler);\n if (onChangeHandler) {\n registerHandler(onChangeHandlerName, onChangeHandler);\n }\n }\n\n /**\n * Allows the caller to unregister for all events fired by the host search experience. Calling\n * this function will cause your app to stop appearing in the set of search scopes in the hosts\n *\n * @beta\n */\n export function unregisterHandlers(): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n // This should let the host know to stop making the app scope show up in the search experience\n // Can also be used to clean up handlers on the host if desired\n sendMessageToParent('search.unregister');\n removeHandler(onChangeHandlerName);\n removeHandler(onClosedHandlerName);\n removeHandler(onExecutedHandlerName);\n }\n\n /**\n * Checks if search capability is supported by the host\n * @returns boolean to represent whether the search capability is supported\n *\n * @throws Error if {@link app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.search ? true : false;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { callCallbackWithSdkErrorFromPromiseAndReturnPromise, InputFunction } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to open a share dialog for web content.\n * For more info, see [Share to Teams from personal app or tab](https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/share-to-teams-from-personal-app-or-tab)\n */\nexport namespace sharing {\n export const SharingAPIMessages = {\n shareWebContent: 'sharing.shareWebContent',\n };\n\n // More types can be added as we expand share capability\n type ContentType = 'URL';\n\n interface IBaseSharedContent {\n type: ContentType;\n }\n\n // More types can be added as we expand share capability\n export type IShareRequestContentType = IURLContent;\n\n export interface IShareRequest<T> {\n content: T[];\n }\n\n export interface IURLContent extends IBaseSharedContent {\n type: 'URL';\n\n /**\n * Required URL\n */\n url: string;\n\n /**\n * Default initial message text\n */\n message?: string;\n\n /**\n * Show URL preview, defaults to true\n */\n preview?: boolean;\n }\n\n /**\n * Feature is under development\n * Opens a share dialog for web content\n *\n * @param shareWebContentRequest - web content info\n * @returns Promise that will be fulfilled when the operation has completed\n */\n export function shareWebContent(shareWebContentRequest: IShareRequest<IShareRequestContentType>): Promise<void>;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link sharing.shareWebContent sharing.shareWebContent(shareWebContentRequest: IShareRequest\\<IShareRequestContentType\\>): Promise\\<void\\>} instead.\n *\n * Feature is under development\n * Opens a share dialog for web content\n *\n * @param shareWebContentRequest - web content info\n * @param callback - optional callback\n */\n export function shareWebContent(\n shareWebContentRequest: IShareRequest<IShareRequestContentType>,\n callback: (err?: SdkError) => void,\n ): void;\n export function shareWebContent(\n shareWebContentRequest: IShareRequest<IShareRequestContentType>,\n callback?: (err?: SdkError) => void,\n ): Promise<void> {\n // validate the given input (synchronous check)\n try {\n validateNonEmptyContent(shareWebContentRequest);\n validateTypeConsistency(shareWebContentRequest);\n validateContentForSupportedTypes(shareWebContentRequest);\n } catch (err) {\n //return the error via callback(v1) or rejected promise(v2)\n const wrappedFunction: InputFunction<void> = () => Promise.reject(err);\n return callCallbackWithSdkErrorFromPromiseAndReturnPromise(wrappedFunction, callback);\n }\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n return callCallbackWithSdkErrorFromPromiseAndReturnPromise(shareWebContentHelper, callback, shareWebContentRequest);\n }\n\n function shareWebContentHelper(shareWebContentRequest: IShareRequest<IShareRequestContentType>): Promise<void> {\n return new Promise<void>((resolve) => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError(SharingAPIMessages.shareWebContent, shareWebContentRequest));\n });\n }\n\n /**\n * Functions for validating the shareRequest input parameter\n */\n function validateNonEmptyContent(shareRequest: IShareRequest<IShareRequestContentType>): void {\n if (!(shareRequest && shareRequest.content && shareRequest.content.length)) {\n const err: SdkError = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'Shared content is missing',\n };\n throw err;\n }\n }\n\n function validateTypeConsistency(shareRequest: IShareRequest<IShareRequestContentType>): void {\n let err: SdkError | undefined;\n if (shareRequest.content.some((item) => !item.type)) {\n err = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'Shared content type cannot be undefined',\n };\n throw err;\n }\n if (shareRequest.content.some((item) => item.type !== shareRequest.content[0].type)) {\n err = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'Shared content must be of the same type',\n };\n throw err;\n }\n }\n\n function validateContentForSupportedTypes(shareRequest: IShareRequest<IShareRequestContentType>): void {\n let err: SdkError | undefined;\n if (shareRequest.content[0].type === 'URL') {\n if (shareRequest.content.some((item) => !item.url)) {\n err = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'URLs are required for URL content types',\n };\n throw err;\n }\n } else {\n err = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'Content type is unsupported',\n };\n throw err;\n }\n }\n\n /**\n * Checks if the sharing capability is supported by the host\n * @returns boolean to represent whether the sharing capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.sharing ? true : false;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to interact with the stage view specific part of the SDK.\n *\n * @beta\n */\nexport namespace stageView {\n /**\n * Parameters to open a stage view.\n */\n export interface StageViewParams {\n /**\n * The ID of the Teams application to be opened.\n */\n appId: string;\n\n /**\n * The URL of the content to display.\n */\n contentUrl: string;\n\n /**\n * The chat or channel ID.\n */\n threadId: string;\n\n /**\n * The title to give the stage view.\n */\n title: string;\n\n /**\n * The Teams application website URL.\n */\n websiteUrl?: string;\n\n /**\n * The entity ID of the Teams application content being opened.\n */\n entityId?: string;\n }\n\n /**\n * @hidden\n * Feature is under development\n *\n * Opens a stage view to display a Teams application\n * @beta\n * @param stageViewParams - The parameters to pass into the stage view.\n * @returns Promise that resolves or rejects with an error once the stage view is closed.\n */\n export function open(stageViewParams: StageViewParams): Promise<void> {\n return new Promise((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!stageViewParams) {\n throw new Error('[stageView.open] Stage view params cannot be null');\n }\n\n resolve(sendAndHandleSdkError('stageView.open', stageViewParams));\n });\n }\n\n /**\n * Checks if stageView capability is supported by the host\n * @beta\n * @returns boolean to represent whether the stageView capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.stageView ? true : false;\n }\n}\n","import { ensureInitialized } from '../internal/internalAPIs';\nimport { runtime } from './runtime';\n\n/**\n * Contains functionality to allow web apps to store data in webview cache\n *\n * @beta\n */\nexport namespace webStorage {\n /**\n * Checks if web storage gets cleared when a user logs out from host client\n *\n * @returns true is web storage gets cleared on logout and false if it does not\n *\n * @beta\n */\n export function isWebStorageClearedOnUserLogOut(): boolean {\n ensureInitialized(runtime);\n return isSupported();\n }\n\n /**\n * Checks if webStorage capability is supported by the host\n * @returns boolean to represent whether the webStorage capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.webStorage ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { sendAndHandleSdkError as sendAndHandleError } from '../internal/communication';\nimport { createTeamsDeepLinkForCall } from '../internal/deepLinkUtilities';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\nexport namespace call {\n export enum CallModalities {\n Unknown = 'unknown',\n Audio = 'audio',\n Video = 'video',\n VideoBasedScreenSharing = 'videoBasedScreenSharing',\n Data = 'data',\n }\n\n export interface StartCallParams {\n /**\n * Comma-separated list of user IDs representing the participants of the call.\n *\n * @remarks\n * Currently the User ID field supports the Azure AD UserPrincipalName,\n * typically an email address, or in case of a PSTN call, it supports a pstn\n * mri 4:<phonenumber>.\n */\n targets: string[];\n /**\n * List of modalities for the call. Defaults to [“audio”].\n */\n requestedModalities?: CallModalities[];\n /**\n * An optional parameter that informs about the source of the deep link\n */\n source?: string;\n }\n\n /**\n * Starts a call with other users\n *\n * @param startCallParams - Parameters for the call\n * @returns If the call is accepted\n */\n export function startCall(startCallParams: StartCallParams): Promise<boolean> {\n return new Promise((resolve) => {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleError(\n 'executeDeepLink',\n createTeamsDeepLinkForCall(\n startCallParams.targets,\n startCallParams.requestedModalities?.includes(CallModalities.Video),\n startCallParams.source,\n ),\n ),\n );\n } else {\n return sendMessageToParent('call.startCall', [startCallParams], resolve);\n }\n });\n }\n\n /**\n * Checks if the call capability is supported by the host\n * @returns boolean to represent whether the call capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.call ? true : false;\n }\n}\n","import { app } from './app';\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link app} namespace instead.\n */\nexport namespace appInitialization {\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.Messages} instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n export import Messages = app.Messages;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.FailedReason} instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n export import FailedReason = app.FailedReason;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ExpectedFailureReason} instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n export import ExpectedFailureReason = app.ExpectedFailureReason;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.IFailedRequest} instead.\n */\n export import IFailedRequest = app.IFailedRequest;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.IExpectedFailureRequest} instead.\n */\n export import IExpectedFailureRequest = app.IExpectedFailureRequest;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.notifyAppLoaded app.notifyAppLoaded(): void} instead.\n *\n * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.\n */\n export function notifyAppLoaded(): void {\n app.notifyAppLoaded();\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.notifySuccess app.notifySuccess(): void} instead.\n *\n * Notifies the frame that app initialization is successful and is ready for user interaction.\n */\n export function notifySuccess(): void {\n app.notifySuccess();\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.notifyFailure app.notifyFailure(appInitializationFailedRequest: IFailedRequest): void} instead.\n *\n * Notifies the frame that app initialization has failed and to show an error page in its place.\n * @param appInitializationFailedRequest - The failure request containing the reason for why the app failed\n * during initialization as well as an optional message.\n */\n export function notifyFailure(appInitializationFailedRequest: IFailedRequest): void {\n app.notifyFailure(appInitializationFailedRequest);\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.notifyExpectedFailure app.notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void} instead.\n *\n * Notifies the frame that app initialized with some expected errors.\n * @param expectedFailureRequest - The expected failure request containing the reason and an optional message\n */\n export function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void {\n app.notifyExpectedFailure(expectedFailureRequest);\n }\n}\n","import { ensureInitialized } from '../internal/internalAPIs';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { FrameContexts } from './constants';\nimport { pages } from './pages';\nimport { runtime } from './runtime';\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config} namespace instead.\n *\n * Namespace to interact with the settings-specific part of the SDK.\n * This object is usable only on the settings frame.\n */\nexport namespace settings {\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.Config} instead.\n * @remarks\n * Renamed to config in pages.Config\n */\n export import Settings = pages.InstanceConfig;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.SaveEvent} instead.\n * @remarks\n * See pages.SaveEvent\n */\n export import SaveEvent = pages.config.SaveEvent;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.RemoveEvent} instead.\n * @remarks\n * See pages.RemoveEvent\n */\n export import RemoveEvent = pages.config.RemoveEvent;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.SaveParameters} instead.\n * @remarks\n * See pages.SaveParameters\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n export import SaveParameters = pages.config.SaveParameters;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.setValidityState pages.config.setValidityState(validityState: boolean): void} instead.\n *\n * Sets the validity state for the settings.\n * The initial value is false, so the user cannot save the settings until this is called with true.\n *\n * @param validityState - Indicates whether the save or remove button is enabled for the user.\n */\n export function setValidityState(validityState: boolean): void {\n pages.config.setValidityState(validityState);\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.getConfig pages.getConfig(): Promise\\<InstanceConfig\\>} instead.\n *\n * Gets the settings for the current instance.\n *\n * @param callback - The callback to invoke when the {@link Settings} object is retrieved.\n */\n export function getSettings(callback: (instanceSettings: Settings) => void): void {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.sidePanel,\n );\n pages.getConfig().then((config: pages.InstanceConfig) => {\n callback(config);\n });\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.setConfig pages.config.setConfig(instanceSettings: Config): Promise\\<void\\>} instead.\n *\n * Sets the settings for the current instance.\n * This is an asynchronous operation; calls to getSettings are not guaranteed to reflect the changed state.\n *\n * @param - Set the desired settings for this instance.\n */\n export function setSettings(\n instanceSettings: Settings,\n onComplete?: (status: boolean, reason?: string) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\n pages.config\n .setConfig(instanceSettings)\n .then(() => {\n onComplete(true);\n })\n .catch((error: Error) => {\n onComplete(false, error.message);\n });\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.registerOnSaveHandler pages.config.registerOnSaveHandler(handler: (evt: SaveEvent) => void): void} instead.\n *\n * Registers a handler for when the user attempts to save the settings. This handler should be used\n * to create or update the underlying resource powering the content.\n * The object passed to the handler must be used to notify whether to proceed with the save.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the user selects the save button.\n */\n export function registerOnSaveHandler(handler: (evt: SaveEvent) => void): void {\n pages.config.registerOnSaveHandlerHelper(handler);\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.registerOnRemoveHandler pages.config.registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void} instead.\n *\n * Registers a handler for user attempts to remove content. This handler should be used\n * to remove the underlying resource powering the content.\n * The object passed to the handler must be used to indicate whether to proceed with the removal.\n * Only one handler may be registered at a time. Subsequent registrations will override the first.\n *\n * @param handler - The handler to invoke when the user selects the remove button.\n */\n export function registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void {\n pages.config.registerOnRemoveHandlerHelper(handler);\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { GlobalVars } from '../internal/globalVars';\nimport { registerHandlerHelper } from '../internal/handlers';\nimport { ensureInitializeCalled, ensureInitialized } from '../internal/internalAPIs';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { app } from './app';\nimport { FrameContexts } from './constants';\nimport {\n Context,\n DeepLinkParameters,\n FrameContext,\n LoadContext,\n TabInformation,\n TabInstanceParameters,\n} from './interfaces';\nimport { pages } from './pages';\nimport { runtime } from './runtime';\nimport { teamsCore } from './teamsAPIs';\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link app.initialize app.initialize(validMessageOrigins?: string[]): Promise\\<void\\>} instead.\n *\n * Initializes the library. This must be called before any other SDK calls\n * but after the frame is loaded successfully.\n * @param callback - Optionally specify a callback to invoke when Teams SDK has successfully initialized\n * @param validMessageOrigins - Optionally specify a list of cross frame message origins. There must have\n * https: protocol otherwise they will be ignored. Example: https://www.example.com\n */\nexport function initialize(callback?: () => void, validMessageOrigins?: string[]): void {\n app.initialize(validMessageOrigins).then(() => {\n if (callback) {\n callback();\n }\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link teamsCore.enablePrintCapability teamsCore.enablePrintCapability(): void} instead.\n *\n * Enable print capability to support printing page using Ctrl+P and cmd+P\n */\nexport function enablePrintCapability(): void {\n teamsCore.enablePrintCapability();\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link teamsCore.print teamsCore.print(): void} instead.\n *\n * Default print handler\n */\nexport function print(): void {\n teamsCore.print();\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link app.getContext app.getContext(): Promise\\<app.Context\\>} instead.\n *\n * Retrieves the current context the frame is running in.\n *\n * @param callback - The callback to invoke when the {@link Context} object is retrieved.\n */\nexport function getContext(callback: (context: Context) => void): void {\n ensureInitializeCalled();\n sendMessageToParent('getContext', (context: Context) => {\n if (!context.frameContext) {\n // Fallback logic for frameContext properties\n context.frameContext = GlobalVars.frameContext;\n }\n callback(context);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link app.registerOnThemeChangeHandler app.registerOnThemeChangeHandler(handler: (theme: string) => void): void} instead.\n *\n * Registers a handler for theme changes.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the user changes their theme.\n */\nexport function registerOnThemeChangeHandler(handler: (theme: string) => void): void {\n app.registerOnThemeChangeHandler(handler);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.registerFullScreenHandler pages.registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void} instead.\n *\n * Registers a handler for changes from or to full-screen view for a tab.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the user toggles full-screen view for a tab.\n */\nexport function registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void {\n registerHandlerHelper('fullScreenChange', handler, []);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.appButton.onClick pages.appButton.onClick(handler: () => void): void} instead.\n *\n * Registers a handler for clicking the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the personal app button is clicked in the app bar.\n */\nexport function registerAppButtonClickHandler(handler: () => void): void {\n registerHandlerHelper('appButtonClick', handler, [FrameContexts.content]);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.appButton.onHoverEnter pages.appButton.onHoverEnter(handler: () => void): void} instead.\n *\n * Registers a handler for entering hover of the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.\n */\nexport function registerAppButtonHoverEnterHandler(handler: () => void): void {\n registerHandlerHelper('appButtonHoverEnter', handler, [FrameContexts.content]);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.appButton.onHoverLeave pages.appButton.onHoverLeave(handler: () => void): void} instead.\n *\n * Registers a handler for exiting hover of the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.\n *\n */\nexport function registerAppButtonHoverLeaveHandler(handler: () => void): void {\n registerHandlerHelper('appButtonHoverLeave', handler, [FrameContexts.content]);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.backStack.registerBackButtonHandler pages.backStack.registerBackButtonHandler(handler: () => boolean): void} instead.\n *\n * Registers a handler for user presses of the Team client's back button. Experiences that maintain an internal\n * navigation stack should use this handler to navigate the user back within their frame. If an app finds\n * that after running its back button handler it cannot handle the event it should call the navigateBack\n * method to ask the Teams client to handle it instead.\n *\n * @param handler - The handler to invoke when the user presses their Team client's back button.\n */\nexport function registerBackButtonHandler(handler: () => boolean): void {\n pages.backStack.registerBackButtonHandlerHelper(handler);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link teamsCore.registerOnLoadHandler teamsCore.registerOnLoadHandler(handler: (context: LoadContext) => void): void} instead.\n *\n * @hidden\n * Registers a handler to be called when the page has been requested to load.\n *\n * @param handler - The handler to invoke when the page is loaded.\n */\nexport function registerOnLoadHandler(handler: (context: LoadContext) => void): void {\n teamsCore.registerOnLoadHandlerHelper(handler);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link teamsCore.registerBeforeUnloadHandler teamsCore.registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void} instead.\n *\n * @hidden\n * Registers a handler to be called before the page is unloaded.\n *\n * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should\n * invoke the readyToUnload function provided to it once it's ready to be unloaded.\n */\nexport function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void {\n teamsCore.registerBeforeUnloadHandlerHelper(handler);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.registerFocusEnterHandler pages.registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void} instead.\n *\n * @hidden\n * Registers a handler when focus needs to be passed from teams to the place of choice on app.\n *\n * @param handler - The handler to invoked by the app when they want the focus to be in the place of their choice.\n */\nexport function registerFocusEnterHandler(handler: (navigateForward: boolean) => boolean): void {\n registerHandlerHelper('focusEnter', handler, []);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.registerChangeConfigHandler pages.config.registerChangeConfigHandler(handler: () => void): void} instead.\n *\n * Registers a handler for when the user reconfigurated tab.\n *\n * @param handler - The handler to invoke when the user click on Settings.\n */\nexport function registerChangeSettingsHandler(handler: () => void): void {\n registerHandlerHelper('changeSettings', handler, [FrameContexts.content]);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.tabs.getTabInstances pages.tabs.getTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise\\<TabInformation\\>} instead.\n *\n * Allows an app to retrieve for this user tabs that are owned by this app.\n * If no TabInstanceParameters are passed, the app defaults to favorite teams and favorite channels.\n *\n * @param callback - The callback to invoke when the {@link TabInstanceParameters} object is retrieved.\n * @param tabInstanceParameters - OPTIONAL Flags that specify whether to scope call to favorite teams or channels.\n */\nexport function getTabInstances(\n callback: (tabInfo: TabInformation) => void,\n tabInstanceParameters?: TabInstanceParameters,\n): void {\n ensureInitialized(runtime);\n pages.tabs.getTabInstances(tabInstanceParameters).then((tabInfo: TabInformation) => {\n callback(tabInfo);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.tabs.getMruTabInstances pages.tabs.getMruTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise\\<TabInformation\\>} instead.\n *\n * Allows an app to retrieve the most recently used tabs for this user.\n *\n * @param callback - The callback to invoke when the {@link TabInformation} object is retrieved.\n * @param tabInstanceParameters - OPTIONAL Ignored, kept for future use\n */\nexport function getMruTabInstances(\n callback: (tabInfo: TabInformation) => void,\n tabInstanceParameters?: TabInstanceParameters,\n): void {\n ensureInitialized(runtime);\n pages.tabs.getMruTabInstances(tabInstanceParameters).then((tabInfo: TabInformation) => {\n callback(tabInfo);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.shareDeepLink pages.shareDeepLink(deepLinkParameters: DeepLinkParameters): void} instead.\n *\n * Shares a deep link that a user can use to navigate back to a specific state in this page.\n *\n * @param deepLinkParameters - ID and label for the link and fallback URL.\n */\nexport function shareDeepLink(deepLinkParameters: DeepLinkParameters): void {\n pages.shareDeepLink({\n subPageId: deepLinkParameters.subEntityId,\n subPageLabel: deepLinkParameters.subEntityLabel,\n subPageWebUrl: deepLinkParameters.subEntityWebUrl,\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link app.openLink app.openLink(deepLink: string): Promise\\<void\\>} instead.\n *\n * Execute deep link API.\n *\n * @param deepLink - deep link.\n */\nexport function executeDeepLink(deepLink: string, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\n app\n .openLink(deepLink)\n .then(() => {\n onComplete(true);\n })\n .catch((err: Error) => {\n onComplete(false, err.message);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.setCurrentFrame pages.setCurrentFrame(frameInfo: FrameInfo): void} instead.\n *\n * Set the current Frame Context\n *\n * @param frameContext - FrameContext information to be set\n */\nexport function setFrameContext(frameContext: FrameContext): void {\n pages.setCurrentFrame(frameContext);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.initializeWithFrameContext pages.initializeWithFrameContext(frameInfo: FrameInfo, callback?: () => void, validMessageOrigins?: string[],): void} instead.\n *\n * Initialize with FrameContext\n *\n * @param frameContext - FrameContext information to be set\n * @param callback - The optional callback to be invoked be invoked after initilizing the frame context\n * @param validMessageOrigins - Optionally specify a list of cross frame message origins.\n * They must have https: protocol otherwise they will be ignored. Example: https:www.example.com\n */\nexport function initializeWithFrameContext(\n frameContext: FrameContext,\n callback?: () => void,\n validMessageOrigins?: string[],\n): void {\n pages.initializeWithFrameContext(frameContext, callback, validMessageOrigins);\n}\n","import { ensureInitialized } from '../internal/internalAPIs';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { FrameContexts } from './constants';\nimport { TabInstance } from './interfaces';\nimport { pages } from './pages';\nimport { runtime } from './runtime';\n/**\n * Navigation specific part of the SDK.\n */\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.returnFocus pages.returnFocus(navigateForward?: boolean): void} instead.\n *\n * Return focus to the main Teams app. Will focus search bar if navigating foward and app bar if navigating back.\n *\n * @param navigateForward - Determines the direction to focus in teams app.\n */\nexport function returnFocus(navigateForward?: boolean): void {\n pages.returnFocus(navigateForward);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.tabs.navigateToTab pages.tabs.navigateToTab(tabInstance: TabInstance): Promise\\<void\\>} instead.\n *\n * Navigates the Microsoft Teams app to the specified tab instance.\n *\n * @param tabInstance - The tab instance to navigate to.\n * @param onComplete - The callback to invoke when the action is complete.\n */\nexport function navigateToTab(tabInstance: TabInstance, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(runtime);\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\n pages.tabs\n .navigateToTab(tabInstance)\n .then(() => {\n onComplete(true);\n })\n .catch((error: Error) => {\n onComplete(false, error.message);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.navigateCrossDomain pages.navigateCrossDomain(url: string): Promise\\<void\\>} instead.\n *\n * Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the\n * valid domains specified in the validDomains block of the manifest; otherwise, an exception will be\n * thrown. This function needs to be used only when navigating the frame to a URL in a different domain\n * than the current one in a way that keeps the app informed of the change and allows the SDK to\n * continue working.\n *\n * @param url - The URL to navigate the frame to.\n * @param onComplete - The callback to invoke when the action is complete.\n */\nexport function navigateCrossDomain(url: string, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\n pages\n .navigateCrossDomain(url)\n .then(() => {\n onComplete(true);\n })\n .catch((error: Error) => {\n onComplete(false, error.message);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.backStack.navigateBack pages.backStack.navigateBack(): Promise\\<void\\>} instead.\n *\n * Navigates back in the Teams client.\n * See registerBackButtonHandler for more information on when it's appropriate to use this method.\n *\n * @param onComplete - The callback to invoke when the action is complete.\n */\nexport function navigateBack(onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(runtime);\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\n pages.backStack\n .navigateBack()\n .then(() => {\n onComplete(true);\n })\n .catch((error: Error) => {\n onComplete(false, error.message);\n });\n}\n","/* eslint-disable @typescript-eslint/ban-types */\n\nimport { sendMessageToParent } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ChildAppWindow, IAppWindow } from './appWindow';\nimport { FrameContexts, TaskModuleDimension } from './constants';\nimport { dialog } from './dialog';\nimport { BotUrlDialogInfo, DialogInfo, DialogSize, TaskInfo, UrlDialogInfo } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link dialog} namespace instead.\n *\n * Namespace to interact with the task module-specific part of the SDK.\n * This object is usable only on the content frame.\n * The tasks namespace will be deprecated. Please use dialog for future developments.\n */\nexport namespace tasks {\n /**\n * @deprecated\n * As of 2.8.0:\n * - For url-based dialogs, please use {@link dialog.url.open dialog.url.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} .\n * - For url-based dialogs with bot interaction, please use {@link dialog.url.bot.open dialog.url.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}\n * - For Adaptive Card-based dialogs:\n * - In Teams, please continue to use this function until the new functions in {@link dialog.adaptiveCard} have been fully implemented. You can tell at runtime when they are implemented in Teams by checking\n * the return value of the {@link dialog.adaptiveCard.isSupported} function. This documentation line will also be removed once they have been fully implemented in Teams.\n * - In all other hosts, please use {@link dialog.adaptiveCard.open dialog.adaptiveCard.open(cardDialogInfo: CardDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}\n *\n * Allows an app to open the task module.\n *\n * @param taskInfo - An object containing the parameters of the task module\n * @param submitHandler - Handler to call when the task module is completed\n */\n export function startTask(\n taskInfo: TaskInfo,\n submitHandler?: (err: string, result: string | object) => void,\n ): IAppWindow {\n const dialogSubmitHandler = submitHandler\n ? /* eslint-disable-next-line strict-null-checks/all */ /* fix tracked by 5730662 */\n (sdkResponse: dialog.ISdkResponse) => submitHandler(sdkResponse.err, sdkResponse.result)\n : undefined;\n if (taskInfo.card === undefined && taskInfo.url === undefined) {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('tasks.startTask', [taskInfo as DialogInfo], submitHandler);\n } else if (taskInfo.card) {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('tasks.startTask', [taskInfo as DialogInfo], submitHandler);\n } else if (taskInfo.completionBotId !== undefined) {\n dialog.url.bot.open(getBotUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);\n } else {\n dialog.url.open(getUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);\n }\n return new ChildAppWindow();\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link dialog.update.resize dialog.update.resize(dimensions: DialogSize): void} instead.\n *\n * Update height/width task info properties.\n *\n * @param taskInfo - An object containing width and height properties\n */\n export function updateTask(taskInfo: TaskInfo): void {\n taskInfo = getDefaultSizeIfNotProvided(taskInfo);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { width, height, ...extra } = taskInfo;\n\n if (Object.keys(extra).length) {\n throw new Error('resize requires a TaskInfo argument containing only width and height');\n }\n dialog.update.resize(taskInfo as DialogSize);\n }\n\n /**\n * @deprecated\n * As of 2.8.0, please use {@link dialog.url.submit} instead.\n *\n * Submit the task module.\n *\n * @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it\n * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.\n */\n export function submitTask(result?: string | object, appIds?: string | string[]): void {\n dialog.url.submit(result, appIds);\n }\n\n /**\n * Converts {@link TaskInfo} to {@link UrlDialogInfo}\n * @param taskInfo - TaskInfo object to convert\n * @returns - Converted UrlDialogInfo object\n */\n function getUrlDialogInfoFromTaskInfo(taskInfo: TaskInfo): UrlDialogInfo {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const urldialogInfo: UrlDialogInfo = {\n url: taskInfo.url,\n size: {\n height: taskInfo.height ? taskInfo.height : TaskModuleDimension.Small,\n width: taskInfo.width ? taskInfo.width : TaskModuleDimension.Small,\n },\n title: taskInfo.title,\n fallbackUrl: taskInfo.fallbackUrl,\n };\n return urldialogInfo;\n }\n\n /**\n * Converts {@link TaskInfo} to {@link BotUrlDialogInfo}\n * @param taskInfo - TaskInfo object to convert\n * @returns - converted BotUrlDialogInfo object\n */\n function getBotUrlDialogInfoFromTaskInfo(taskInfo: TaskInfo): BotUrlDialogInfo {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const botUrldialogInfo: BotUrlDialogInfo = {\n url: taskInfo.url,\n size: {\n height: taskInfo.height ? taskInfo.height : TaskModuleDimension.Small,\n width: taskInfo.width ? taskInfo.width : TaskModuleDimension.Small,\n },\n title: taskInfo.title,\n fallbackUrl: taskInfo.fallbackUrl,\n completionBotId: taskInfo.completionBotId,\n };\n return botUrldialogInfo;\n }\n\n /**\n * Sets the height and width of the {@link TaskInfo} object to the original height and width, if initially specified,\n * otherwise uses the height and width values corresponding to {@link TaskModuleDimension | TaskModuleDimension.Small}\n * @param taskInfo TaskInfo object from which to extract size info, if specified\n * @returns TaskInfo with height and width specified\n */\n export function getDefaultSizeIfNotProvided(taskInfo: TaskInfo): TaskInfo {\n taskInfo.height = taskInfo.height ? taskInfo.height : TaskModuleDimension.Small;\n taskInfo.width = taskInfo.width ? taskInfo.width : TaskModuleDimension.Small;\n return taskInfo;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * @hidden\n * Allowed roles during a meeting.\n *\n * @beta\n */\nexport enum UserMeetingRole {\n guest = 'Guest',\n attendee = 'Attendee',\n presenter = 'Presenter',\n organizer = 'Organizer',\n}\n\n/**\n * @hidden\n * State of the current Live Share sessions backing fluid container.\n *\n * @beta\n */\nexport enum ContainerState {\n /**\n * The call to `LiveShareHost.setContainerId()` successfully created the container mapping\n * for the current Live Share session.\n */\n added = 'Added',\n\n /**\n * A container mapping for the current Live Share Session already exists and should be used\n * when joining the sessions Fluid container.\n */\n alreadyExists = 'AlreadyExists',\n\n /**\n * The call to `LiveShareHost.setContainerId()` failed to create the container mapping due to\n * another client having already set the container ID for the current Live Share session.\n */\n conflict = 'Conflict',\n\n /**\n * A container mapping for the current Live Share session doesn't exist yet.\n */\n notFound = 'NotFound',\n}\n\n/**\n * @hidden\n * Returned from `LiveShareHost.get/setFluidContainerId()` to specify the container mapping for the\n * current Live Share session.\n *\n * @beta\n */\nexport interface IFluidContainerInfo {\n /**\n * State of the containerId mapping.\n */\n containerState: ContainerState;\n\n /**\n * ID of the container to join for the meeting. Undefined if the container hasn't been\n * created yet.\n */\n containerId: string | undefined;\n\n /**\n * If true, the local client should create the container and then save the created containers\n * ID to the mapping service.\n */\n shouldCreate: boolean;\n\n /**\n * If `containerId` is undefined and `shouldCreate` is false, the container isn't ready but\n * another client is creating it. The local client should wait the specified amount of time and\n * then ask for the container info again.\n */\n retryAfter: number;\n}\n\n/**\n * @hidden\n * Returned from `LiveShareHost.getNtpTime()` to specify the global timestamp for the current\n * Live Share session.\n *\n * @beta\n */\nexport interface INtpTimeInfo {\n /**\n * ISO 8601 formatted server time. For example: '2019-09-07T15:50-04:00'\n */\n ntpTime: string;\n\n /**\n * Server time expressed as the number of milliseconds since the ECMAScript epoch.\n */\n ntpTimeInUTC: number;\n}\n\n/**\n * @hidden\n * Returned from `LiveShareHost.getFluidTenantInfo()` to specify the Fluid service to use for the\n * current Live Share session.\n *\n * @beta\n */\nexport interface IFluidTenantInfo {\n /**\n * The Fluid Tenant ID Live Share should use.\n */\n tenantId: string;\n\n /**\n * The Fluid service endpoint Live Share should use.\n */\n serviceEndpoint: string;\n}\n\n/**\n * Live Share host implementation for O365 and Teams clients.\n *\n * @beta\n */\nexport class LiveShareHost {\n /**\n * @hidden\n * Returns the Fluid Tenant connection info for user's current context.\n *\n * @beta\n */\n public getFluidTenantInfo(): Promise<IFluidTenantInfo> {\n return new Promise<IFluidTenantInfo>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n resolve(sendAndHandleSdkError('interactive.getFluidTenantInfo'));\n });\n }\n\n /**\n * @hidden\n * Returns the fluid access token for mapped container Id.\n *\n * @param containerId Fluid's container Id for the request. Undefined for new containers.\n * @returns token for connecting to Fluid's session.\n *\n * @beta\n */\n public getFluidToken(containerId?: string): Promise<string> {\n return new Promise<string>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n // eslint-disable-next-line strict-null-checks/all\n resolve(sendAndHandleSdkError('interactive.getFluidToken', containerId));\n });\n }\n\n /**\n * @hidden\n * Returns the ID of the fluid container associated with the user's current context.\n *\n * @beta\n */\n public getFluidContainerId(): Promise<IFluidContainerInfo> {\n return new Promise<IFluidContainerInfo>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n resolve(sendAndHandleSdkError('interactive.getFluidContainerId'));\n });\n }\n\n /**\n * @hidden\n * Sets the ID of the fluid container associated with the current context.\n *\n * @remarks\n * If this returns false, the client should delete the container they created and then call\n * `getFluidContainerId()` to get the ID of the container being used.\n * @param containerId ID of the fluid container the client created.\n * @returns A data structure with a `containerState` indicating the success or failure of the request.\n *\n * @beta\n */\n public setFluidContainerId(containerId: string): Promise<IFluidContainerInfo> {\n return new Promise<IFluidContainerInfo>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n resolve(sendAndHandleSdkError('interactive.setFluidContainerId', containerId));\n });\n }\n\n /**\n * @hidden\n * Returns the shared clock server's current time.\n *\n * @beta\n */\n public getNtpTime(): Promise<INtpTimeInfo> {\n return new Promise<INtpTimeInfo>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n resolve(sendAndHandleSdkError('interactive.getNtpTime'));\n });\n }\n\n /**\n * @hidden\n * Associates the fluid client ID with a set of user roles.\n *\n * @param clientId The ID for the current user's Fluid client. Changes on reconnects.\n * @returns The roles for the current user.\n *\n * @beta\n */\n public registerClientId(clientId: string): Promise<UserMeetingRole[]> {\n return new Promise<UserMeetingRole[]>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n resolve(sendAndHandleSdkError('interactive.registerClientId', clientId));\n });\n }\n\n /**\n * @hidden\n * Returns the roles associated with a client ID.\n *\n * @param clientId The Client ID the message was received from.\n * @returns The roles for a given client. Returns `undefined` if the client ID hasn't been registered yet.\n *\n * @beta\n */\n public getClientRoles(clientId: string): Promise<UserMeetingRole[] | undefined> {\n return new Promise<UserMeetingRole[] | undefined>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n resolve(sendAndHandleSdkError('interactive.getClientRoles', clientId));\n });\n }\n\n /**\n * Returns a host instance for the client that can be passed to the `LiveShareClient` class.\n *\n * @remarks\n * The application must first be initialized and may only be called from `meetingStage` or `sidePanel` contexts.\n *\n * @beta\n */\n public static create(): LiveShareHost {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n return new LiveShareHost();\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ErrorCode, FileOpenPreference, FrameContexts, SdkError } from '../public';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n *\n * Namespace to interact with the files specific part of the SDK.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace files {\n /**\n * @hidden\n *\n * Cloud storage providers registered with Microsoft Teams\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum CloudStorageProvider {\n Dropbox = 'DROPBOX',\n Box = 'BOX',\n Sharefile = 'SHAREFILE',\n GoogleDrive = 'GOOGLEDRIVE',\n Egnyte = 'EGNYTE',\n SharePoint = 'SharePoint',\n }\n interface IWopiThumbnail {\n size: number;\n url: string;\n }\n\n interface IWopiService {\n name: string;\n description: string;\n thumbnails: IWopiThumbnail[];\n }\n\n /**\n * @hidden\n *\n * External third-party cloud storages providers interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IExternalProvider extends IWopiService {\n providerType: CloudStorageProviderType;\n providerCode: CloudStorageProvider;\n }\n\n /**\n * @hidden\n *\n * Cloud storage provider type enums\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum CloudStorageProviderType {\n Sharepoint = 0,\n WopiIntegration,\n Google,\n OneDrive,\n Recent,\n Aggregate,\n FileSystem, // Used for Downloaded files on Desktop\n Search, // Used by P2P files with OSearch\n AllFiles, // Used by P2P files with AllFiles API\n SharedWithMe,\n }\n\n /**\n * @hidden\n *\n * Cloud storage folder interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageFolder {\n /**\n * @hidden\n * ID of the cloud storage folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n id: string;\n /**\n * @hidden\n * Display Name/Title of the cloud storage folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n /**\n * @hidden\n * ID of the cloud storage folder in the provider\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n folderId: string;\n /**\n * @hidden\n * Type of the cloud storage folder provider integration\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n providerType: CloudStorageProviderType;\n /**\n * @hidden\n * Code of the supported cloud storage folder provider\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n providerCode: CloudStorageProvider;\n /**\n * @hidden\n * Display name of the owner of the cloud storage folder provider\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n ownerDisplayName: string;\n /**\n * @hidden\n * Sharepoint specific siteURL of the folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n siteUrl?: string;\n /**\n * @hidden\n * Sharepoint specific serverRelativeUrl of the folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n serverRelativeUrl?: string;\n /**\n * @hidden\n * Sharepoint specific libraryType of the folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n libraryType?: string;\n /**\n * @hidden\n * Sharepoint specific accessType of the folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n accessType?: string;\n }\n\n /**\n * @hidden\n *\n * Cloud storage item interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageFolderItem {\n /**\n * @hidden\n * ID of the item in the provider\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n id: string;\n /**\n * @hidden\n * Display name/title\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n /**\n * @hidden\n * Key to differentiate files and subdirectory\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n isSubdirectory: boolean;\n /**\n * @hidden\n * File extension\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n type: string;\n /**\n * @hidden\n * Last modifed time of the item\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n lastModifiedTime: string;\n /**\n * @hidden\n * Display size of the items in bytes\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n size: number;\n /**\n * @hidden\n * URL of the file\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n objectUrl: string;\n /**\n * @hidden\n * Temporary access token for the item\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n accessToken?: string;\n }\n\n /**\n * @hidden\n *\n * Files entity user interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IFilesEntityUser {\n /**\n * @hidden\n * User name.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n displayName: string;\n /**\n * @hidden\n * User email.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n email: string;\n\n /**\n * @hidden\n * User MRI.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n mri: string;\n }\n\n /**\n * @hidden\n *\n * Special Document Library enum\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum SpecialDocumentLibraryType {\n ClassMaterials = 'classMaterials',\n }\n\n /**\n * @hidden\n *\n * Document Library Access enum\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum DocumentLibraryAccessType {\n Readonly = 'readonly',\n }\n\n /**\n * @hidden\n *\n * SharePoint file interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface ISharePointFile {\n siteId?: string;\n siteUrl: string;\n objectId: string;\n objectUrl: string;\n openInWindowFileUrl: string;\n title: string;\n isFolder: boolean;\n serverRelativeUrl: string;\n lastModifiedByUser: IFilesEntityUser;\n lastModifiedTime: string;\n sentByUser: IFilesEntityUser;\n createdByUser: IFilesEntityUser;\n createdTime: string;\n size: number;\n type: string;\n spItemUrl?: string;\n libraryType?: SpecialDocumentLibraryType;\n accessType?: DocumentLibraryAccessType;\n etag?: string;\n remoteItem?: string;\n listUrl?: string;\n }\n\n /**\n * @hidden\n *\n * Download status enum\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum FileDownloadStatus {\n Downloaded = 'Downloaded',\n Downloading = 'Downloading',\n Failed = 'Failed',\n }\n\n /**\n * @hidden\n *\n * Download Files interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IFileItem {\n /**\n * @hidden\n * ID of the file metadata\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n objectId?: string;\n /**\n * @hidden\n * Path of the file\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n path?: string;\n /**\n * @hidden\n * Size of the file in bytes\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n sizeInBytes?: number;\n /**\n * @hidden\n * Download status\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n status?: FileDownloadStatus;\n /**\n * @hidden\n * Download timestamp\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n timestamp: Date;\n /**\n * @hidden\n * File name\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n /**\n * @hidden\n * Type of file i.e. the file extension.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n extension: string;\n }\n\n /**\n * @hidden\n * Object used to represent a file\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface File extends Blob {\n /**\n * A number that represents the number of milliseconds since the Unix epoch\n */\n lastModified: number;\n /**\n * Name of the file\n */\n name: string;\n /**\n * A string containing the path of the file relative to the ancestor directory the user selected\n */\n webkitRelativePath?: string;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Actions specific to 3P cloud storage provider file and / or account\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum CloudStorageProviderFileAction {\n Download = 'DOWNLOAD',\n Upload = 'UPLOAD',\n Delete = 'DELETE',\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface for 3P cloud storage provider request content type\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderRequest<T> {\n content: T;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Base interface for 3P cloud storage provider action request content\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderContent {\n providerCode: CloudStorageProvider;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface representing 3P cloud storage provider add new file action.\n * The file extension represents type of file e.g. docx, pptx etc. and need not be prefixed with dot(.)\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderNewFileContent extends CloudStorageProviderContent {\n newFileName: string;\n newFileExtension: string;\n destinationFolder: CloudStorageFolderItem | ISharePointFile;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface representing 3P cloud storage provider rename existing file action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderRenameFileContent extends CloudStorageProviderContent {\n existingFile: CloudStorageFolderItem | ISharePointFile;\n newFile: CloudStorageFolderItem | ISharePointFile;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface representing 3P cloud storage provider delete existing file(s) action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderDeleteFileContent extends CloudStorageProviderContent {\n itemList: CloudStorageFolderItem[] | ISharePointFile[];\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface representing 3P cloud storage provider download existing file(s) action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderDownloadFileContent extends CloudStorageProviderContent {\n itemList: CloudStorageFolderItem[] | ISharePointFile[];\n }\n\n /**\n * @hidden\n * Hide from docs\n * @beta\n *\n * Interface representing 3P cloud storage provider upload existing file(s) action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderUploadFileContent extends CloudStorageProviderContent {\n itemList: File[];\n destinationFolder: CloudStorageFolderItem | ISharePointFile;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Gets a list of cloud storage folders added to the channel\n * @param channelId - ID of the channel whose cloud storage folders should be retrieved\n * @param callback - Callback that will be triggered post folders load\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getCloudStorageFolders(\n channelId: string,\n callback: (error: SdkError, folders: CloudStorageFolder[]) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!channelId || channelId.length === 0) {\n throw new Error('[files.getCloudStorageFolders] channelId name cannot be null or empty');\n }\n if (!callback) {\n throw new Error('[files.getCloudStorageFolders] Callback cannot be null');\n }\n\n sendMessageToParent('files.getCloudStorageFolders', [channelId], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n * Initiates the add cloud storage folder flow\n *\n * @param channelId - ID of the channel to add cloud storage folder\n * @param callback - Callback that will be triggered post add folder flow is compelete\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function addCloudStorageFolder(\n channelId: string,\n callback: (error: SdkError, isFolderAdded: boolean, folders: CloudStorageFolder[]) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!channelId || channelId.length === 0) {\n throw new Error('[files.addCloudStorageFolder] channelId name cannot be null or empty');\n }\n if (!callback) {\n throw new Error('[files.addCloudStorageFolder] Callback cannot be null');\n }\n\n sendMessageToParent('files.addCloudStorageFolder', [channelId], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n *\n * Deletes a cloud storage folder from channel\n *\n * @param channelId - ID of the channel where folder is to be deleted\n * @param folderToDelete - cloud storage folder to be deleted\n * @param callback - Callback that will be triggered post delete\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function deleteCloudStorageFolder(\n channelId: string,\n folderToDelete: CloudStorageFolder,\n callback: (error: SdkError, isFolderDeleted: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!channelId) {\n throw new Error('[files.deleteCloudStorageFolder] channelId name cannot be null or empty');\n }\n if (!folderToDelete) {\n throw new Error('[files.deleteCloudStorageFolder] folderToDelete cannot be null or empty');\n }\n if (!callback) {\n throw new Error('[files.deleteCloudStorageFolder] Callback cannot be null');\n }\n\n sendMessageToParent('files.deleteCloudStorageFolder', [channelId, folderToDelete], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n *\n * Fetches the contents of a Cloud storage folder (CloudStorageFolder) / sub directory\n *\n * @param folder - Cloud storage folder (CloudStorageFolder) / sub directory (CloudStorageFolderItem)\n * @param providerCode - Code of the cloud storage folder provider\n * @param callback - Callback that will be triggered post contents are loaded\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getCloudStorageFolderContents(\n folder: CloudStorageFolder | CloudStorageFolderItem,\n providerCode: CloudStorageProvider,\n callback: (error: SdkError, items: CloudStorageFolderItem[]) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!folder || !providerCode) {\n throw new Error('[files.getCloudStorageFolderContents] folder/providerCode name cannot be null or empty');\n }\n\n if (!callback) {\n throw new Error('[files.getCloudStorageFolderContents] Callback cannot be null');\n }\n\n if ('isSubdirectory' in folder && !folder.isSubdirectory) {\n throw new Error('[files.getCloudStorageFolderContents] provided folder is not a subDirectory');\n }\n\n sendMessageToParent('files.getCloudStorageFolderContents', [folder, providerCode], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n *\n * Open a cloud storage file in Teams\n *\n * @param file - cloud storage file that should be opened\n * @param providerCode - Code of the cloud storage folder provider\n * @param fileOpenPreference - Whether file should be opened in web/inline\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openCloudStorageFile(\n file: CloudStorageFolderItem,\n providerCode: CloudStorageProvider,\n fileOpenPreference?: FileOpenPreference.Web | FileOpenPreference.Inline,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!file || !providerCode) {\n throw new Error('[files.openCloudStorageFile] file/providerCode cannot be null or empty');\n }\n\n if (file.isSubdirectory) {\n throw new Error('[files.openCloudStorageFile] provided file is a subDirectory');\n }\n\n sendMessageToParent('files.openCloudStorageFile', [file, providerCode, fileOpenPreference]);\n }\n\n /**\n * @hidden\n * Allow 1st party apps to call this function to get the external\n * third party cloud storage accounts that the tenant supports\n * @param excludeAddedProviders: return a list of support third party\n * cloud storages that hasn't been added yet.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getExternalProviders(\n excludeAddedProviders = false,\n callback: (error: SdkError, providers: IExternalProvider[]) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw new Error('[files.getExternalProviders] Callback cannot be null');\n }\n\n sendMessageToParent('files.getExternalProviders', [excludeAddedProviders], callback);\n }\n\n /**\n * @hidden\n * Allow 1st party apps to call this function to move files\n * among SharePoint and third party cloud storages.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function copyMoveFiles(\n selectedFiles: CloudStorageFolderItem[] | ISharePointFile[],\n providerCode: CloudStorageProvider,\n destinationFolder: CloudStorageFolderItem | ISharePointFile,\n destinationProviderCode: CloudStorageProvider,\n isMove = false,\n callback: (error?: SdkError) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!selectedFiles || selectedFiles.length === 0) {\n throw new Error('[files.copyMoveFiles] selectedFiles cannot be null or empty');\n }\n if (!providerCode) {\n throw new Error('[files.copyMoveFiles] providerCode cannot be null or empty');\n }\n if (!destinationFolder) {\n throw new Error('[files.copyMoveFiles] destinationFolder cannot be null or empty');\n }\n if (!destinationProviderCode) {\n throw new Error('[files.copyMoveFiles] destinationProviderCode cannot be null or empty');\n }\n if (!callback) {\n throw new Error('[files.copyMoveFiles] callback cannot be null');\n }\n sendMessageToParent(\n 'files.copyMoveFiles',\n [selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n *\n * Gets list of downloads for current user\n * @param callback Callback that will be triggered post downloads load\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getFileDownloads(callback: (error?: SdkError, files?: IFileItem[]) => void): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw new Error('[files.getFileDownloads] Callback cannot be null');\n }\n\n sendMessageToParent('files.getFileDownloads', [], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Open download preference folder if fileObjectId value is undefined else open folder containing the file with id fileObjectId\n * @param fileObjectId - Id of the file whose containing folder should be opened\n * @param callback Callback that will be triggered post open download folder/path\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openDownloadFolder(fileObjectId: string = undefined, callback: (error?: SdkError) => void): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw new Error('[files.openDownloadFolder] Callback cannot be null');\n }\n\n sendMessageToParent('files.openDownloadFolder', [fileObjectId], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates add 3P cloud storage provider flow, where a pop up window opens for user to select required\n * 3P provider from the configured policy supported 3P provider list, following which user authentication\n * for selected 3P provider is performed on success of which the selected 3P provider support is added for user\n * @beta\n *\n * @param callback Callback that will be triggered post add 3P cloud storage provider action.\n * If the error is encountered (and hence passed back), no provider value is sent back.\n * For success scenarios, error value will be passed as null and a valid provider value is sent.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function addCloudStorageProvider(callback: (error?: SdkError, provider?: CloudStorageProvider) => void): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProvider] callback cannot be null');\n }\n\n sendMessageToParent('files.addCloudStorageProvider', [], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates signout of 3P cloud storage provider flow, which will remove the selected\n * 3P cloud storage provider from the list of added providers. No other user input and / or action\n * is required except the 3P cloud storage provider to signout from\n *\n * @param logoutRequest 3P cloud storage provider remove action request content\n * @param callback Callback that will be triggered post signout of 3P cloud storage provider action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function removeCloudStorageProvider(\n logoutRequest: CloudStorageProviderRequest<CloudStorageProviderContent>,\n callback: (error?: SdkError) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.removeCloudStorageProvider] callback cannot be null');\n }\n\n if (!(logoutRequest && logoutRequest.content)) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.removeCloudStorageProvider] 3P cloud storage provider request content is missing',\n );\n }\n\n sendMessageToParent('files.removeCloudStorageProvider', [logoutRequest], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the add 3P cloud storage file flow, which will add a new file for the given 3P provider\n *\n * @param addNewFileRequest 3P cloud storage provider add action request content\n * @param callback Callback that will be triggered post adding a new file flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function addCloudStorageProviderFile(\n addNewFileRequest: CloudStorageProviderRequest<CloudStorageProviderNewFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProviderFile] callback cannot be null');\n }\n\n if (!(addNewFileRequest && addNewFileRequest.content)) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.addCloudStorageProviderFile] 3P cloud storage provider request content is missing',\n );\n }\n\n sendMessageToParent('files.addCloudStorageProviderFile', [addNewFileRequest], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the rename 3P cloud storage file flow, which will rename an existing file in the given 3P provider\n *\n * @param renameFileRequest 3P cloud storage provider rename action request content\n * @param callback Callback that will be triggered post renaming an existing file flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function renameCloudStorageProviderFile(\n renameFileRequest: CloudStorageProviderRequest<CloudStorageProviderRenameFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.renameCloudStorageProviderFile] callback cannot be null');\n }\n\n if (!(renameFileRequest && renameFileRequest.content)) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.renameCloudStorageProviderFile] 3P cloud storage provider request content is missing',\n );\n }\n\n sendMessageToParent('files.renameCloudStorageProviderFile', [renameFileRequest], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the delete 3P cloud storage file(s) / folder (folder has to be empty) flow,\n * which will delete existing file(s) / folder from the given 3P provider\n *\n * @param deleteFileRequest 3P cloud storage provider delete action request content\n * @param callback Callback that will be triggered post deleting existing file(s) flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function deleteCloudStorageProviderFile(\n deleteFileRequest: CloudStorageProviderRequest<CloudStorageProviderDeleteFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.deleteCloudStorageProviderFile] callback cannot be null');\n }\n\n if (\n !(\n deleteFileRequest &&\n deleteFileRequest.content &&\n deleteFileRequest.content.itemList &&\n deleteFileRequest.content.itemList.length > 0\n )\n ) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.deleteCloudStorageProviderFile] 3P cloud storage provider request content details are missing',\n );\n }\n\n sendMessageToParent('files.deleteCloudStorageProviderFile', [deleteFileRequest], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the download 3P cloud storage file(s) flow,\n * which will download existing file(s) from the given 3P provider in the teams client side without sharing any file info in the callback\n *\n * @param downloadFileRequest 3P cloud storage provider download file(s) action request content\n * @param callback Callback that will be triggered post downloading existing file(s) flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function downloadCloudStorageProviderFile(\n downloadFileRequest: CloudStorageProviderRequest<CloudStorageProviderDownloadFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.downloadCloudStorageProviderFile] callback cannot be null',\n );\n }\n\n if (\n !(\n downloadFileRequest &&\n downloadFileRequest.content &&\n downloadFileRequest.content.itemList &&\n downloadFileRequest.content.itemList.length > 0\n )\n ) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.downloadCloudStorageProviderFile] 3P cloud storage provider request content details are missing',\n );\n }\n\n sendMessageToParent('files.downloadCloudStorageProviderFile', [downloadFileRequest], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the upload 3P cloud storage file(s) flow, which will upload file(s) to the given 3P provider\n * @beta\n *\n * @param uploadFileRequest 3P cloud storage provider upload file(s) action request content\n * @param callback Callback that will be triggered post uploading file(s) flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function uploadCloudStorageProviderFile(\n uploadFileRequest: CloudStorageProviderRequest<CloudStorageProviderUploadFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.uploadCloudStorageProviderFile] callback cannot be null');\n }\n\n if (\n !(\n uploadFileRequest &&\n uploadFileRequest.content &&\n uploadFileRequest.content.itemList &&\n uploadFileRequest.content.itemList.length > 0\n )\n ) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.uploadCloudStorageProviderFile] 3P cloud storage provider request content details are missing',\n );\n }\n\n if (!uploadFileRequest.content.destinationFolder) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.uploadCloudStorageProviderFile] Invalid destination folder details',\n );\n }\n\n sendMessageToParent('files.uploadCloudStorageProviderFile', [uploadFileRequest], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Register a handler to be called when a user's 3P cloud storage provider list changes i.e.\n * post adding / removing a 3P provider, list is updated\n *\n * @param handler - When 3P cloud storage provider list is updated this handler is called\n *\n * @internal Limited to Microsoft-internal use\n */\n export function registerCloudStorageProviderListChangeHandler(handler: () => void): void {\n ensureInitialized(runtime);\n\n if (!handler) {\n throw new Error('[registerCloudStorageProviderListChangeHandler] Handler cannot be null');\n }\n\n registerHandler('files.cloudStorageProviderListChange', handler);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Register a handler to be called when a user's 3P cloud storage provider content changes i.e.\n * when file(s) is/are added / renamed / deleted / uploaded, the list of files is updated\n *\n * @param handler - When 3P cloud storage provider content is updated this handler is called\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerCloudStorageProviderContentChangeHandler(handler: () => void): void {\n ensureInitialized(runtime);\n\n if (!handler) {\n throw new Error('[registerCloudStorageProviderContentChangeHandler] Handler cannot be null');\n }\n\n registerHandler('files.cloudStorageProviderContentChange', handler);\n }\n\n function getSdkError(errorCode: ErrorCode, message: string): SdkError {\n const sdkError: SdkError = {\n errorCode: errorCode,\n message: message,\n };\n return sdkError;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform } from '../public/constants';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace meetingRoom {\n /**\n * @hidden\n *\n * Data structure to represent a meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface MeetingRoomInfo {\n /**\n * @hidden\n * Endpoint id of the meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n endpointId: string;\n /**\n * @hidden\n * Device name of the meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n deviceName: string;\n /**\n * @hidden\n * Client type of the meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n clientType: string;\n /**\n * @hidden\n * Client version of the meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n clientVersion: string;\n }\n\n /**\n * @hidden\n * Type of Media control capabilities of a meeting room.\n */\n type MediaControls = 'toggleMute' | 'toggleCamera' | 'toggleCaptions' | 'volume';\n\n /**\n * @hidden\n * Types of Stage Layout control capabilities of a meeting room.\n */\n\n type StageLayoutControls =\n | 'showVideoGallery'\n | 'showContent'\n | 'showVideoGalleryAndContent'\n | 'showLargeGallery'\n | 'showTogether';\n\n /**\n * @hidden\n * Types of Meeting Control capabilities of a meeting room.\n */\n\n type MeetingControls = 'leaveMeeting';\n\n /**\n * @hidden\n * Types of Stage Layout State of a meeting room.\n */\n\n type StageLayoutStates = 'Gallery' | 'Content + gallery' | 'Content' | 'Large gallery' | 'Together mode';\n\n /**\n * @hidden\n * Data structure to represent capabilities of a meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface MeetingRoomCapability {\n /**\n * @hidden\n * Media control capabilities, value can be \"toggleMute\", \"toggleCamera\", \"toggleCaptions\", \"volume\".\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n mediaControls: MediaControls[];\n /**\n * @hidden\n * Main stage layout control capabilities, value can be \"showVideoGallery\", \"showContent\", \"showVideoGalleryAndContent\", \"showLargeGallery\", \"showTogether\".\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n stageLayoutControls: StageLayoutControls[];\n /**\n * @hidden\n * Meeting control capabilities, value can be \"leaveMeeting\".\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n meetingControls: MeetingControls[];\n }\n\n /**\n * @hidden\n * Data structure to represent states of a meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface MeetingRoomState {\n /**\n * @hidden\n * Current mute state, true: mute, false: unmute.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n toggleMute: boolean;\n /**\n * @hidden\n * Current camera state, true: camera on, false: camera off.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n toggleCamera: boolean;\n /**\n * @hidden\n * Current captions state, true: captions on, false: captions off.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n toggleCaptions: boolean;\n /**\n * @hidden\n * Current main stage layout state, value can be one of \"Gallery\", \"Content + gallery\", \"Content\", \"Large gallery\" and \"Together mode\".\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n stageLayout: StageLayoutStates;\n /**\n * @hidden\n * Current leaveMeeting state, true: leave, false: no-op.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n leaveMeeting: boolean;\n }\n\n /**\n * @hidden\n * Fetch the meeting room info that paired with current client.\n *\n * @returns Promise resolved with meeting room info or rejected with SdkError value\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getPairedMeetingRoomInfo(): Promise<MeetingRoomInfo> {\n return new Promise<MeetingRoomInfo>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError('meetingRoom.getPairedMeetingRoomInfo'));\n });\n }\n\n /**\n * @hidden\n * Send a command to paired meeting room.\n *\n * @param commandName The command name.\n * @returns Promise resolved upon completion or rejected with SdkError value\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function sendCommandToPairedMeetingRoom(commandName: string): Promise<void> {\n return new Promise<void>((resolve) => {\n if (!commandName || commandName.length == 0) {\n throw new Error('[meetingRoom.sendCommandToPairedMeetingRoom] Command name cannot be null or empty');\n }\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError('meetingRoom.sendCommandToPairedMeetingRoom', commandName));\n });\n }\n\n /**\n * @hidden\n * Registers a handler for meeting room capabilities update.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler The handler to invoke when the capabilities of meeting room update.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerMeetingRoomCapabilitiesUpdateHandler(\n handler: (capabilities: MeetingRoomCapability) => void,\n ): void {\n if (!handler) {\n throw new Error('[meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler] Handler cannot be null');\n }\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('meetingRoom.meetingRoomCapabilitiesUpdate', (capabilities: MeetingRoomCapability) => {\n ensureInitialized(runtime);\n handler(capabilities);\n });\n }\n\n /**\n * @hidden\n * Hide from docs\n * Registers a handler for meeting room states update.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler The handler to invoke when the states of meeting room update.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerMeetingRoomStatesUpdateHandler(handler: (states: MeetingRoomState) => void): void {\n if (!handler) {\n throw new Error('[meetingRoom.registerMeetingRoomStatesUpdateHandler] Handler cannot be null');\n }\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('meetingRoom.meetingRoomStatesUpdate', (states: MeetingRoomState) => {\n ensureInitialized(runtime);\n handler(states);\n });\n }\n\n /**\n * @hidden\n *\n * Checks if the meetingRoom capability is supported by the host\n * @returns boolean to represent whether the meetingRoom capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.meetingRoom ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { ShowNotificationParameters } from './interfaces';\n\nexport namespace notifications {\n /**\n * @hidden\n * display notification API.\n *\n * @param message - Notification message.\n * @param notificationType - Notification type\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function showNotification(showNotificationParameters: ShowNotificationParameters): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n sendMessageToParent('notifications.showNotification', [showNotificationParameters]);\n }\n\n /**\n * @hidden\n *\n * Checks if the notifications capability is supported by the host\n * @returns boolean to represent whether the notifications capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.notifications ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { SdkError } from '../public/interfaces';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace remoteCamera {\n /**\n * @hidden\n * Data structure to represent patricipant details needed to request control of camera.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface Participant {\n /**\n * @hidden\n * Id of participant.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n id: string;\n /**\n * @hidden\n * Display name of participant.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n displayName?: string;\n /**\n * @hidden\n * Active indicates whether the participant's device is actively being controlled.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n active?: boolean;\n }\n\n /**\n * @hidden\n * Enum used to indicate possible camera control commands.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum ControlCommand {\n Reset = 'Reset',\n ZoomIn = 'ZoomIn',\n ZoomOut = 'ZoomOut',\n PanLeft = 'PanLeft',\n PanRight = 'PanRight',\n TiltUp = 'TiltUp',\n TiltDown = 'TiltDown',\n }\n\n /**\n * @hidden\n * Data structure to indicate the current state of the device.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface DeviceState {\n /**\n * @hidden\n * All operation are available to apply.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n available: boolean;\n /**\n * @hidden\n * Either camera doesnt support to get state or It unable to apply command.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n error: boolean;\n /**\n * @hidden\n * Reset max out or already applied. Client Disable Reset.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n reset: boolean;\n /**\n * @hidden\n * ZoomIn maxed out.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n zoomIn: boolean;\n /**\n * @hidden\n * ZoomOut maxed out.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n zoomOut: boolean;\n /**\n * @hidden\n * PanLeft reached max left.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n panLeft: boolean;\n /**\n * @hidden\n * PanRight reached max right.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n panRight: boolean;\n /**\n * @hidden\n * TiltUp reached top.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n tiltUp: boolean;\n /**\n * @hidden\n * TiltDown reached bottom.\n *\n * @internal Limited to Microsoft-internal use\n */\n tiltDown: boolean;\n }\n\n /**\n * @hidden\n * Enum used to indicate the reason for the error.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum ErrorReason {\n CommandResetError,\n CommandZoomInError,\n CommandZoomOutError,\n CommandPanLeftError,\n CommandPanRightError,\n CommandTiltUpError,\n CommandTiltDownError,\n SendDataError,\n }\n\n /**\n * @hidden\n * Data structure to indicate the status of the current session.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface SessionStatus {\n /**\n * @hidden\n * Whether the far-end user is controlling a device.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n inControl: boolean;\n /**\n * @hidden\n * Reason the control session was terminated.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n terminatedReason?: SessionTerminatedReason;\n }\n\n /**\n * @hidden\n * Enum used to indicate the reason the session was terminated.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum SessionTerminatedReason {\n None,\n ControlDenied,\n ControlNoResponse,\n ControlBusy,\n AckTimeout,\n ControlTerminated,\n ControllerTerminated,\n DataChannelError,\n ControllerCancelled,\n ControlDisabled,\n ControlTerminatedToAllowOtherController,\n }\n\n /**\n * @hidden\n * Fetch a list of the participants with controllable-cameras in a meeting.\n *\n * @param callback - Callback contains 2 parameters, error and participants.\n * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful\n * participants can either contain an array of Participant objects, incase of a successful fetch or null when it fails\n * participants: object that contains an array of participants with controllable-cameras\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getCapableParticipants(\n callback: (error: SdkError | null, participants: Participant[] | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[remoteCamera.getCapableParticipants] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('remoteCamera.getCapableParticipants', callback);\n }\n\n /**\n * @hidden\n * Request control of a participant's camera.\n *\n * @param participant - Participant specifies the participant to send the request for camera control.\n * @param callback - Callback contains 2 parameters, error and requestResponse.\n * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful\n * requestResponse can either contain the true/false value, incase of a successful request or null when it fails\n * requestResponse: True means request was accepted and false means request was denied\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function requestControl(\n participant: Participant,\n callback: (error: SdkError | null, requestResponse: boolean | null) => void,\n ): void {\n if (!participant) {\n throw new Error('[remoteCamera.requestControl] Participant cannot be null');\n }\n if (!callback) {\n throw new Error('[remoteCamera.requestControl] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('remoteCamera.requestControl', [participant], callback);\n }\n\n /**\n * @hidden\n * Send control command to the participant's camera.\n *\n * @param ControlCommand - ControlCommand specifies the command for controling the camera.\n * @param callback - Callback to invoke when the command response returns.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function sendControlCommand(ControlCommand: ControlCommand, callback: (error: SdkError | null) => void): void {\n if (!ControlCommand) {\n throw new Error('[remoteCamera.sendControlCommand] ControlCommand cannot be null');\n }\n if (!callback) {\n throw new Error('[remoteCamera.sendControlCommand] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('remoteCamera.sendControlCommand', [ControlCommand], callback);\n }\n\n /**\n * @hidden\n * Terminate the remote session\n *\n * @param callback - Callback to invoke when the command response returns.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function terminateSession(callback: (error: SdkError | null) => void): void {\n if (!callback) {\n throw new Error('[remoteCamera.terminateSession] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('remoteCamera.terminateSession', callback);\n }\n\n /**\n * @hidden\n * Registers a handler for change in participants with controllable-cameras.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the list of participants with controllable-cameras changes.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerOnCapableParticipantsChangeHandler(\n handler: (participantChange: Participant[]) => void,\n ): void {\n if (!handler) {\n throw new Error('[remoteCamera.registerOnCapableParticipantsChangeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('remoteCamera.capableParticipantsChange', handler);\n }\n\n /**\n * @hidden\n * Registers a handler for error.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when there is an error from the camera handler.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerOnErrorHandler(handler: (error: ErrorReason) => void): void {\n if (!handler) {\n throw new Error('[remoteCamera.registerOnErrorHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('remoteCamera.handlerError', handler);\n }\n\n /**\n * @hidden\n * Registers a handler for device state change.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the controlled device changes state.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerOnDeviceStateChangeHandler(handler: (deviceStateChange: DeviceState) => void): void {\n if (!handler) {\n throw new Error('[remoteCamera.registerOnDeviceStateChangeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('remoteCamera.deviceStateChange', handler);\n }\n\n /**\n * @hidden\n * Registers a handler for session status change.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the current session status changes.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerOnSessionStatusChangeHandler(handler: (sessionStatusChange: SessionStatus) => void): void {\n if (!handler) {\n throw new Error('[remoteCamera.registerOnSessionStatusChangeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('remoteCamera.sessionStatusChange', handler);\n }\n\n /**\n * @hidden\n *\n * Checks if the remoteCamera capability is supported by the host\n * @returns boolean to represent whether the remoteCamera capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.remoteCamera ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts, SdkError } from '../public';\nimport { errorNotSupportedOnPlatform } from '../public/constants';\nimport { runtime } from '../public/runtime';\n/**\n * @hidden\n * Namespace to interact with the application entities specific part of the SDK.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace appEntity {\n /**\n * @hidden\n *\n * Information on an app entity\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface AppEntity {\n /**\n * @hidden\n * ID of the application\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n appId: string;\n\n /**\n * @hidden\n * URL for the application's icon\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n appIconUrl: string;\n\n /**\n * @hidden\n * Content URL for the app entity\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n contentUrl: string;\n\n /**\n * @hidden\n * The display name for the app entity\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n displayName: string;\n\n /**\n * @hidden\n * Website URL for the app entity. It is meant to be opened by the user in a browser.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n websiteUrl: string;\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Open the Tab Gallery and retrieve the app entity\n * @param threadId ID of the thread where the app entity will be created\n * @param categories A list of application categories that will be displayed in the opened tab gallery\n * @param subEntityId An object that will be made available to the application being configured\n * through the Context's subEntityId field.\n * @param callback Callback that will be triggered once the app entity information is available.\n * The callback takes two arguments: an SdkError in case something happened (i.e.\n * no permissions to execute the API) and the app entity configuration, if available\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function selectAppEntity(\n threadId: string,\n categories: string[],\n subEntityId: string,\n callback: (sdkError?: SdkError, appEntity?: AppEntity) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!threadId || threadId.length == 0) {\n throw new Error('[appEntity.selectAppEntity] threadId name cannot be null or empty');\n }\n\n if (!callback) {\n throw new Error('[appEntity.selectAppEntity] Callback cannot be null');\n }\n\n sendMessageToParent('appEntity.selectAppEntity', [threadId, categories, subEntityId], callback);\n }\n\n /**\n * @hidden\n *\n * Checks if the appEntity capability is supported by the host\n * @returns boolean to represent whether the appEntity capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.appEntity ? true : false;\n }\n}\n","import { sendAndUnwrap, sendMessageToParent } from '../internal/communication';\nimport { getUserJoinedTeamsSupportedAndroidClientVersion } from '../internal/constants';\nimport { GlobalVars } from '../internal/globalVars';\nimport { ensureInitialized, isCurrentSDKVersionAtLeast } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts, HostClientType } from '../public/constants';\nimport { ErrorCode, SdkError } from '../public/interfaces';\nimport { runtime } from '../public/runtime';\nimport { TeamInstanceParameters, UserJoinedTeamsInformation } from './interfaces';\n\n/**\n * @hidden\n * Namespace to interact with the `teams` specific part of the SDK.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace teams {\n export enum ChannelType {\n Regular = 0,\n Private = 1,\n Shared = 2,\n }\n\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface ChannelInfo {\n siteUrl: string;\n objectId: string;\n folderRelativeUrl: string;\n displayName: string;\n channelType: ChannelType;\n }\n\n /**\n * @hidden\n * Get a list of channels belong to a Team\n *\n * @param groupId - a team's objectId\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getTeamChannels(groupId: string, callback: (error: SdkError, channels: ChannelInfo[]) => void): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!groupId) {\n throw new Error('[teams.getTeamChannels] groupId cannot be null or empty');\n }\n\n if (!callback) {\n throw new Error('[teams.getTeamChannels] Callback cannot be null');\n }\n\n sendMessageToParent('teams.getTeamChannels', [groupId], callback);\n }\n\n /**\n * @hidden\n * Allow 1st party apps to call this function when they receive migrated errors to inform the Hub/Host to refresh the siteurl\n * when site admin renames siteurl.\n *\n * @param threadId - ID of the thread where the app entity will be created; if threadId is not\n * provided, the threadId from route params will be used.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function refreshSiteUrl(threadId: string, callback: (error: SdkError) => void): void {\n ensureInitialized(runtime);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!threadId) {\n throw new Error('[teams.refreshSiteUrl] threadId cannot be null or empty');\n }\n\n if (!callback) {\n throw new Error('[teams.refreshSiteUrl] Callback cannot be null');\n }\n\n sendMessageToParent('teams.refreshSiteUrl', [threadId], callback);\n }\n\n /**\n * @hidden\n *\n * Checks if teams capability is supported by the host\n * @returns boolean to represent whether the teams capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.teams ? true : false;\n }\n\n /**\n * @hidden\n * @internal\n * Limited to Microsoft-internal use\n */\n export namespace fullTrust {\n /**\n * @hidden\n * @internal\n * Limited to Microsoft-internal use\n */\n export namespace joinedTeams {\n /**\n * @hidden\n * Allows an app to retrieve information of all user joined teams\n *\n * @param teamInstanceParameters - Optional flags that specify whether to scope call to favorite teams\n * @returns Promise that resolves with information about the user joined teams or rejects with an error when the operation has completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getUserJoinedTeams(\n teamInstanceParameters?: TeamInstanceParameters,\n ): Promise<UserJoinedTeamsInformation> {\n return new Promise<UserJoinedTeamsInformation>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (\n (GlobalVars.hostClientType === HostClientType.android ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||\n GlobalVars.hostClientType === HostClientType.teamsPhones ||\n GlobalVars.hostClientType === HostClientType.teamsDisplays) &&\n !isCurrentSDKVersionAtLeast(getUserJoinedTeamsSupportedAndroidClientVersion)\n ) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n throw new Error(JSON.stringify(oldPlatformError));\n }\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(sendAndUnwrap('getUserJoinedTeams', teamInstanceParameters));\n });\n }\n /**\n * @hidden\n *\n * Checks if teams.fullTrust.joinedTeams capability is supported by the host\n * @returns boolean to represent whether the teams.fullTrust.joinedTeams capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.teams\n ? runtime.supports.teams.fullTrust\n ? runtime.supports.teams.fullTrust.joinedTeams\n ? true\n : false\n : false\n : false;\n }\n }\n\n /**\n * @hidden\n * Allows an app to get the configuration setting value\n *\n * @param key - The key for the config setting\n * @returns Promise that resolves with the value for the provided configuration setting or rejects with an error when the operation has completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getConfigSetting(key: string): Promise<string> {\n return new Promise<string>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndUnwrap('getConfigSetting', key));\n });\n }\n\n /**\n * @hidden\n *\n * Checks if teams.fullTrust capability is supported by the host\n * @returns boolean to represent whether the teams.fullTrust capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.teams\n ? runtime.supports.teams.fullTrust\n ? true\n : false\n : false;\n }\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { video } from '../public/video';\n\n/**\n * @hidden\n * Extended video API\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace videoEx {\n /**\n * @hidden\n * Error level when notifying errors to the host, the host will decide what to do acording to the error level.\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum ErrorLevel {\n Fatal = 'fatal',\n Warn = 'warn',\n }\n /**\n * @hidden\n * Video frame configuration supplied to the host to customize the generated video frame parameters\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface VideoFrameConfig extends video.VideoFrameConfig {\n /**\n * @hidden\n * Flag to indicate use camera stream to synthesize video frame or not.\n * Default value is true.\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n requireCameraStream?: boolean;\n /**\n * @hidden\n * Machine learning model to run in the host to do audio inference for you\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n audioInferenceModel?: ArrayBuffer;\n }\n\n /**\n * @hidden\n * Represents a video frame\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface VideoFrame extends video.VideoFrameData {\n /**\n * @hidden\n * The model output if you passed in an {@linkcode VideoFrameConfig.audioInferenceModel}\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n audioInferenceResult?: Uint8Array;\n }\n\n /**\n * @hidden\n * Video frame call back function\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type VideoFrameCallback = (\n frame: VideoFrame,\n notifyVideoFrameProcessed: () => void,\n notifyError: (errorMessage: string) => void,\n ) => void;\n\n /**\n * @hidden\n * Register to process video frames\n * @beta\n *\n * @param frameCallback - The callback to invoke when registerForVideoFrame has completed\n * @param config - VideoFrameConfig to customize generated video frame parameters\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerForVideoFrame(frameCallback: VideoFrameCallback, config: VideoFrameConfig): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n registerHandler(\n 'video.newVideoFrame',\n (videoFrame: VideoFrame) => {\n if (videoFrame) {\n const timestamp = videoFrame.timestamp;\n frameCallback(\n videoFrame,\n () => {\n notifyVideoFrameProcessed(timestamp);\n },\n notifyError,\n );\n }\n },\n false,\n );\n\n sendMessageToParent('video.registerForVideoFrame', [config]);\n }\n\n /**\n * @hidden\n * Video extension should call this to notify host that the current selected effect parameter changed.\n * If it's pre-meeting, host will call videoEffectCallback immediately then use the videoEffect.\n * If it's the in-meeting scenario, we will call videoEffectCallback when apply button clicked.\n * @beta\n * @param effectChangeType - the effect change type.\n * @param effectId - Newly selected effect id. {@linkcode VideoEffectCallBack}\n * @param effectParam Variant for the newly selected effect. {@linkcode VideoEffectCallBack}\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function notifySelectedVideoEffectChanged(\n effectChangeType: video.EffectChangeType,\n effectId: string | undefined,\n effectParam?: string,\n ): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('video.videoEffectChanged', [effectChangeType, effectId, effectParam]);\n }\n\n /**\n * @hidden\n * Video effect change call back function definition\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type VideoEffectCallBack = (effectId: string | undefined, effectParam?: string) => void;\n\n /**\n * @hidden\n * Register the video effect callback, host uses this to notify the video extension the new video effect will by applied\n * @beta\n * @param callback - The VideoEffectCallback to invoke when registerForVideoEffect has completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerForVideoEffect(callback: VideoEffectCallBack): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('video.effectParameterChange', callback, false);\n sendMessageToParent('video.registerForVideoEffect');\n }\n\n /**\n * @hidden\n * Personalized video effect\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface PersonalizedEffect {\n /**\n * Personalized effect id\n */\n id: string;\n /**\n * Display name\n */\n name: string;\n /**\n * Effect type defined by app\n */\n type: string;\n /**\n * Data URI of the thumbnail image content encoded in ASCII format using the base64 scheme\n */\n thumbnail: string;\n }\n\n /**\n * @hidden\n * Send personalized effects to Teams client\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function updatePersonalizedEffects(effects: PersonalizedEffect[]): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!video.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('video.personalizedEffectsChanged', [effects]);\n }\n\n /**\n * @hidden\n *\n * Checks if video capability is supported by the host\n * @beta\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @returns boolean to represent whether the video capability is supported\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n ensureInitialized(runtime);\n return video.isSupported();\n }\n\n /**\n * @hidden\n * Sending notification to host finished the video frame processing, now host can render this video frame\n * or pass the video frame to next one in video pipeline\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n function notifyVideoFrameProcessed(timestamp?: number): void {\n sendMessageToParent('video.videoFrameProcessed', [timestamp]);\n }\n\n /**\n * @hidden\n * Sending error notification to host\n * @beta\n * @param errorMessage - The error message that will be sent to the host\n * @param errorLevel - The error level that will be sent to the host\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n function notifyError(errorMessage: string, errorLevel: ErrorLevel = ErrorLevel.Warn): void {\n sendMessageToParent('video.notifyError', [errorMessage, errorLevel]);\n }\n\n /**\n * @hidden\n * Sending fatal error notification to host. Call this function only when your app meets fatal error and can't continue.\n * The host will stop the video pipeline and terminate this session, and optionally, show an error message to the user.\n * @beta\n * @param errorMessage - The error message that will be sent to the host\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function notifyFatalError(errorMessage: string): void {\n ensureInitialized(runtime);\n if (!video.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n notifyError(errorMessage, ErrorLevel.Fatal);\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","formatArgs","args","this","useColors","namespace","humanize","diff","c","color","splice","index","lastC","replace","match","save","namespaces","storage","setItem","removeItem","error","load","r","getItem","process","env","DEBUG","window","type","__nwjs","navigator","userAgent","toLowerCase","document","documentElement","style","WebkitAppearance","console","firebug","exception","table","parseInt","RegExp","$1","localStorage","localstorage","destroy","warned","warn","colors","log","debug","formatters","j","v","JSON","stringify","message","createDebug","prevTime","namespacesCache","enabledCache","enableOverride","enabled","curr","Number","Date","ms","prev","coerce","unshift","format","formatter","val","call","apply","selectColor","extend","Object","defineProperty","enumerable","configurable","get","set","init","delimiter","newDebug","toNamespace","regexp","toString","substring","length","default","Error","stack","disable","names","map","skips","join","enable","i","split","len","push","slice","name","test","keys","forEach","key","hash","charCodeAt","Math","abs","s","m","h","d","w","y","parse","str","String","exec","n","parseFloat","fmtShort","msAbs","round","fmtLong","plural","isPlural","options","isFinite","long","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","definition","o","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","value","defaultSDKVersionForCompatCheck","videoAndImageMediaAPISupportVersion","nonFullScreenVideoModeAPISupportVersion","imageOutputFormatsAPISupportVersion","getUserJoinedTeamsSupportedAndroidClientVersion","locationAPIsRequiredVersion","peoplePickerRequiredVersion","captureImageMobileSupportVersion","mediaAPISupportVersion","scanBarCodeAPIMobileSupportVersion","validOrigins","userOriginUrlValidationRegExp","teamsDeepLinkProtocol","teamsDeepLinkHost","errorLibraryNotInitialized","errorRuntimeNotInitialized","errorRuntimeNotSupported","initializeCalled","initializeCompleted","additionalValidOrigins","isFramelessWindow","printCapabilityEnabled","topLevelLogger","getLogger","randomUUID","crypto","bind","getRandomValues","rnds8","Uint8Array","rng","byteToHex","unsafeStringify","arr","offset","buf","rnds","random","FileOpenPreference","ActionObjectType","SecondaryM365ContentIdName","ErrorCode","DevicePermission","HostClientType","HostName","FrameContexts","TeamType","UserTeamRole","DialogDimension","ChannelType","TaskModuleDimension","errorNotSupportedOnPlatform","errorCode","NOT_SUPPORTED_ON_PLATFORM","minAdaptiveCardVersion","majorVersion","minorVersion","validateHostAgainstPattern","pattern","host","suffix","validateOrigin","messageOrigin","protocol","messageOriginHost","some","GlobalVars","domainOrPattern","getGenericOnCompleteHandler","errorMessage","success","reason","compareSDKVersions","v1","v2","NaN","v1parts","v2parts","isValidPart","x","every","generateGUID","freeze","callCallbackWithErrorOrResultFromPromiseAndReturnPromise","funcHelper","callback","p","then","result","catch","e","callCallbackWithSdkErrorFromPromiseAndReturnPromise","callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise","runWithTimeout","action","timeoutInMs","timeoutError","Promise","resolve","reject","timeoutHandle","setTimeout","clearTimeout","createTeamsAppLink","params","url","URL","encodeURIComponent","appId","pageId","webUrl","searchParams","append","channelId","subPageId","subEntityId","isHostAdaptiveCardSchemaVersionUnsupported","hostAdaptiveCardSchemaVersion","runtimeLogger","latestRuntimeApiVersion","isLatestRuntimeVersion","runtime","apiVersion","_uninitializedRuntime","supports","isRuntimeInitialized","teamsRuntimeConfig","hostVersionsInfo","isLegacyTeams","appInstallDialog","appEntity","chat","conversations","dialog","bot","update","logs","meetingRoom","menus","monetization","notifications","pages","appButton","tabs","config","backStack","fullTrust","remoteCamera","stageView","teams","teamsCore","video","v1HostClientTypes","desktop","web","android","ios","rigel","surfaceHub","teamsRoomsWindows","teamsRoomsAndroid","teamsPhones","teamsDisplays","fastForwardRuntime","outdatedRuntime","upgradeChain","upgrade","versionToUpgradeFrom","upgradeToNextVersion","previousVersionRuntime","card","versionConstants","capability","location","hostClientTypes","people","sharing","joinedTeams","webStorage","generateBackCompatRuntimeConfigLogger","generateBackCompatRuntimeConfig","highestSupportedVersion","newSupports","versionNumber","capabilityReqs","includes","hostClientType","backCompatRuntimeConfig","applyRuntimeConfigLogger","applyRuntimeConfig","runtimeConfig","ffRuntimeConfig","authentication","app","version","internalLogger","ensureInitializeCalledLogger","ensureInitializedLogger","ensureInitializeCalled","ensureInitialized","expectedFrameContexts","found","frameContext","isCurrentSDKVersionAtLeast","requiredVersion","clientSupportedSDKVersion","isNaN","isHostClientMobile","throwExceptionIfMobileApiIsNotSupported","OLD_PLATFORM","processAdditionalValidOrigins","validMessageOrigins","combinedOriginUrls","concat","filter","_origin","dedupUrls","_originUrl","transformLegacyContextToAppContext","legacyContext","actionInfo","locale","sessionId","appSessionId","theme","iconPositionVertical","appIconPosition","osLocaleInfo","parentMessageId","userClickTime","userFileOpenPreference","hostName","clientType","ringId","appLaunchId","page","id","entityId","isFullScreen","isMultiWindow","sourceOrigin","user","userObjectId","displayName","userDisplayName","isCallingAllowed","isPSTNCallingAllowed","licenseType","userLicenseType","loginHint","userPrincipalName","tenant","tid","teamsSku","tenantSKU","channel","channelName","relativeUrl","channelRelativeUrl","membershipType","channelType","defaultOneNoteSectionId","ownerGroupId","hostTeamGroupId","ownerTenantId","hostTeamTenantId","chatId","meeting","meetingId","sharepoint","team","teamId","internalId","teamName","teamType","groupId","templateId","teamTemplateId","isArchived","isTeamArchived","userRole","userTeamRole","sharePointSite","teamSiteUrl","teamSiteDomain","teamSitePath","mySitePath","mySiteDomain","teamSiteId","inServerSideRenderingEnvironment","authHandlers","authWindowMonitor","authParams","authenticateHelper","authenticateParameters","link","createElement","href","sendMessageToParentAsync","width","height","isExternal","response","fail","openAuthenticationWindow","getAuthTokenHelper","authTokenRequest","resources","claims","silent","getUserHelper","closeAuthenticationWindow","stopAuthenticationWindowMonitor","Communication","childWindow","close","childOrigin","min","currentWindow","outerWidth","outerHeight","left","screenLeft","screenX","top","screenTop","screenY","open","startAuthenticationWindowMonitor","handleFailure","clearInterval","removeHandler","setInterval","closed","savedChildOrigin","sendMessageEventToChild","registerHandler","handleSuccess","redirectIfWin32Outlook","callbackUrl","decodeURIComponent","search","indexOf","updateUrlParameter","assign","uri","substr","initialize","registerAuthenticationHandlers","authenticate","isDifferentParamsInCall","authenticateParams","content","sidePanel","settings","remove","task","stage","meetingStage","successCallback","err","failureCallback","getAuthToken","getUser","userRequest","notifySuccess","sendMessageToParent","waitForMessageQueue","parentWindow","notifyFailure","DataResidency","storedMessages","handleDialogMessage","isSupported","getDialogInfoFromUrlDialogInfo","urlDialogInfo","size","Small","title","fallbackUrl","getDialogInfoFromBotUrlDialogInfo","botUrlDialogInfo","dialogInfo","completionBotId","submitHandler","messageFromChildHandler","submit","appIds","Array","isArray","sendMessageToParentFromDialog","sendMessageToDialog","registerOnMessageFromParent","listener","reverse","pop","resize","dimensions","adaptiveCard","isAdaptiveCardVersionSupported","adaptiveCardSchemaVersion","getDialogInfoFromAdaptiveCardDialogInfo","adaptiveCardDialogInfo","getDialogInfoFromBotAdaptiveCardDialogInfo","botAdaptiveCardDialogInfo","getAdaptiveCardDialogInfoFromTaskInfo","taskInfo","getBotAdaptiveCardDialogInfoFromTaskInfo","DisplayMode","navBarMenuItemPressHandler","actionMenuItemPressHandler","viewConfigItemPressHandler","selected","handleViewConfigItemPress","handleNavBarMenuItemPress","handleActionMenuItemPress","MenuItem","MenuListType","setUpViews","viewConfig","handler","setNavBarMenu","items","showActionMenu","print","registerOnLoadHandlerHelper","versionSpecificHelper","registerBeforeUnloadHandlerHelper","enablePrintCapability","addEventListener","event","ctrlKey","metaKey","keyCode","cancelBubble","preventDefault","stopImmediatePropagation","registerOnLoadHandler","registerBeforeUnloadHandler","appLogger","Messages","AppLoaded","Success","Failure","ExpectedFailure","FailedReason","ExpectedFailureReason","isInitialized","getFrameContext","initializationTimeoutInMs","initializeLogger","initializeHelper","initializeHelperLogger","initializePromise","initializeCommunication","context","givenRuntimeConfig","SyntaxError","registerOnThemeChangeHandler","_initialize","hostWindow","_uninitialize","registerBackButtonHandler","registerFullScreenHandler","registerGetLogHandler","registerOnSaveHandler","registerOnRemoveHandler","uninitializeCommunication","getContext","sendAndUnwrap","notifyAppLoaded","appInitializationFailedRequest","notifyExpectedFailure","expectedFailureRequest","openLink","deepLink","setCurrentFrame","frameInfo","returnFocus","navigateForward","registerFocusEnterHandler","registerHandlerHelper","initializeWithFrameContext","getConfig","navigateCrossDomain","navigateToApp","shareDeepLink","deepLinkParameters","subPageLabel","subPageWebUrl","navigateToTab","tabInstance","getTabInstances","tabInstanceParameters","getMruTabInstances","saveHandler","registerOnSaveHandlerHelper","registerOnRemoveHandlerHelper","handleSave","saveEvent","SaveEventImpl","handleRemove","setValidityState","validityState","setConfig","instanceConfig","registerChangeConfigHandler","notified","ensureNotNotified","removeEvent","RemoveEventImpl","backButtonPressHandler","navigateBack","registerBackButtonHandlerHelper","handleBackButtonPress","enterFullscreen","exitFullscreen","onClick","onHoverEnter","onHoverLeave","currentApp","navigateTo","sendAndHandleSdkError","navigateToDefaultPage","handlersLogger","handlers","initializeHandlers","HandlersPrivate","handleThemeChange","handleLoad","handleBeforeUnload","callHandlerLogger","callHandler","sendMessage","doesHandlerExist","contexts","registrationHelper","themeChangeHandler","loadHandler","beforeUnloadHandler","readyToUnload","communicationLogger","parentMessageQueue","childMessageQueue","nextMessageId","callbacks","promiseCallbacks","CommunicationPrivate","messageListener","evt","processMessage","parent","opener","extendedWindow","nativeInterface","onNativeMessage","handleParentMessage","parentOrigin","removeEventListener","actionName","sendAndHandleStatusAndReason","status","sendAndHandleStatusAndReasonWithDefaultError","defaultError","waitForResponse","sendMessageToParentHelper","requestId","argsOrCallback","Function","request","sendMessageToParentHelperLogger","logger","targetWindow","createMessageRequest","framelessPostMessage","targetOrigin","getTargetOrigin","postMessage","getTargetMessageQueue","data","messageSource","source","originalEvent","origin","shouldProcessMessage","updateRelationships","handleChildMessage","flushMessageQueue","handleParentMessageLogger","isPartialResponse","promiseCallback","func","called","sendMessageResponseToChild","NotificationTypes","ViewerActionTypes","UserSettingTypes","flushMessageQueueLogger","targetMessageQueue","target","shift","messageQueueMonitor","createMessageResponse","customEvent","createMessageEvent","timestamp","now","uploadCustomApp","manifestBlob","onComplete","sendCustomMessage","sendCustomEvent","registerCustomHandler","customHandler","registerUserSettingsChangeHandler","settingTypes","openFilePreview","filePreviewParameters","description","objectUrl","downloadUrl","webPreviewUrl","webEditUrl","baseUrl","editFile","viewerAction","fileOpenPreference","conversationId","openConversation","openConversationRequest","sendPromise","onStartConversation","onCloseConversation","closeConversation","getChatMembers","teamsDeepLinkUrlPathForAppInstall","teamsDeepLinkUrlPathForCalendar","teamsDeepLinkAttendeesUrlParameterName","teamsDeepLinkStartTimeUrlParameterName","teamsDeepLinkEndTimeUrlParameterName","teamsDeepLinkSubjectUrlParameterName","teamsDeepLinkContentUrlParameterName","teamsDeepLinkUrlPathForCall","teamsDeepLinkSourceUrlParameterName","teamsDeepLinkWithVideoUrlParameterName","teamsDeepLinkUrlPathForChat","teamsDeepLinkUsersUrlParameterName","teamsDeepLinkTopicUrlParameterName","teamsDeepLinkMessageUrlParameterName","createTeamsDeepLinkForChat","users","topic","usersSearchParameter","topicSearchParameter","messageSearchParameter","createTeamsDeepLinkForCall","targets","withVideo","withVideoSearchParameter","sourceSearchParameter","createTeamsDeepLinkForCalendar","attendees","startTime","endTime","subject","attendeeSearchParameter","attendee","startTimeSearchParameter","endTimeSearchParameter","subjectSearchParameter","contentSearchParameter","createTeamsDeepLinkForAppInstallDialog","openAppInstallDialog","openAPPInstallDialogParams","media","barCode","geoLocation","createFile","assembleAttachment","mimeType","file","sequence","sort","a","b","item","Blob","decodeAttachment","attachment","decoded","atob","chunk","byteNumbers","byteArray","blob","chunkSequence","throwExceptionIfMediaCallIsNotSupportedOnMobile","mediaInputs","isMediaCallForVideoAndImageInputs","isMediaCallForNonFullScreenVideoMode","isMediaCallForImageOutputFormats","isVideoControllerRegistered","mediaType","MediaType","Video","videoProps","videoController","validateSelectMediaInputs","maxMediaCount","Image","imageProps","imageOutputFormats","VideoAndImage","videoAndImageProps","isFullScreenMode","validateGetMediaInputs","FileFormat","ID","validateViewImagesInput","uriList","validateScanBarCodeInput","barCodeConfig","timeOutIntervalInSec","validatePeoplePickerInput","peoplePickerInputs","setSelected","openOrgWideSearchInChatOrChannel","singleSelect","getAdaptiveCardSchemaVersion","File","captureImage","that","preview","getMedia","getMediaViaCallback","getMediaViaHandler","INVALID_ARGUMENTS","helper","mediaMimeType","mediaResult","mediaChunk","assemble","INTERNAL_ERROR","Media","MediaControllerEvent","getMediaType","notifyEventToApp","mediaEvent","controllerCallback","StartRecording","onRecordingStarted","notifyEventToHost","mediaControllerEvent","stop","StopRecording","VideoController","CameraStartMode","Source","ImageUriType","ImageOutputFormats","selectMedia","localAttachments","mediaArray","invalidInput","oldPlatformError","viewImages","scanBarCode","permissions","hasPermission","requestPermission","openChat","openChatRequest","members","openGroupChat","getCurrentLocation","allowChooseLocation","showMap","GeoLocation","chooseLocation","showLocation","_instance","getLocation","props","calendar","mail","profile","validateShowProfileRequest","showProfileRequest","modality","targetElementBoundingRect","triggerType","validatePersona","persona","identifiers","AadObjectId","Smtp","Upn","MicStateChangeReason","startAppAudioHandling","requestAppAudioHandlingParams","isAppHandlingAudio","isHostAudioless","micState","micMuteStateChangedCallback","newMicState","micStateDidUpdate","isMicMuted","setMicStateWithReason","HostInitiated","AppDeclinedToChange","AppFailedToChange","stopAppAudioHandling","MeetingReactionType","MeetingType","CallType","getIncomingClientAudioState","toggleIncomingClientAudio","getMeetingDetails","getAuthenticationTokenForAnonymousUser","getLiveStreamState","requestStartLiveStreaming","streamUrl","streamKey","requestStopLiveStreaming","registerLiveStreamChangedHandler","shareAppContentToStage","appContentUrl","getAppContentStageSharingCapabilities","stopSharingAppContentToStage","getAppContentStageSharingState","registerSpeakingStateChangeHandler","registerRaiseHandStateChangedHandler","registerMeetingReactionReceivedHandler","appShareButton","setOptions","shareInformation","contentUrl","requestAppAudioHandling","updateMicState","AppInitiated","openPurchaseExperience","param1","param2","planInfo","openCalendarItem","openCalendarItemParams","itemId","trim","composeMeeting","composeMeetingParams","openMailItem","openMailItemParams","composeMail","composeMailParams","ComposeMailType","selectPeopleHelper","selectPeople","showProfile","isValid","targetRectangle","appInitialization","registerAppButtonClickHandler","registerAppButtonHoverEnterHandler","registerAppButtonHoverLeaveHandler","registerChangeSettingsHandler","tabInfo","subEntityLabel","subEntityWebUrl","executeDeepLink","setFrameContext","VideoFrameFormat","EffectFailureReason","notifyVideoFrameProcessed","notifyError","EffectChangeType","registerForVideoFrame","frameCallback","videoFrame","videoFrameData","videoFrameBuffer","notifySelectedVideoEffectChanged","effectChangeType","effectId","registerForVideoEffect","validReason","InitializationFailure","isTextureStreamAvailable","mediaStream","webview","getTextureStream","registerTextureStream","getInputVideoTrack","streamId","chrome","tracks","getVideoTracks","errorMsg","createProcessedStreamGenerator","videoTrack","videoFrameCallback","MediaStreamTrackProcessor","track","readable","generator","MediaStreamTrackGenerator","kind","sink","writable","pipeThrough","TransformStream","transform","originalFrame","controller","frameProcessedByApp","processedFrame","VideoFrame","enqueue","pipeTo","mediaStreamInfo","NV12","onChangeHandlerName","onClosedHandlerName","onExecutedHandlerName","registerHandlers","onClosedHandler","onExecuteHandler","onChangeHandler","unregisterHandlers","shareWebContentHelper","shareWebContentRequest","SharingAPIMessages","shareWebContent","validateNonEmptyContent","shareRequest","validateTypeConsistency","validateContentForSupportedTypes","stageViewParams","isWebStorageClearedOnUserLogOut","CallModalities","startCall","startCallParams","requestedModalities","getSettings","setSettings","instanceSettings","tasks","UserMeetingRole","ContainerState","getUrlDialogInfoFromTaskInfo","getBotUrlDialogInfoFromTaskInfo","getDefaultSizeIfNotProvided","startTask","dialogSubmitHandler","sdkResponse","ChildAppWindow","updateTask","extra","submitTask","files","videoEx","getFluidTenantInfo","getFluidToken","containerId","getFluidContainerId","setFluidContainerId","getNtpTime","registerClientId","clientId","getClientRoles","create","LiveShareHost","getSdkError","CloudStorageProvider","CloudStorageProviderType","SpecialDocumentLibraryType","DocumentLibraryAccessType","FileDownloadStatus","CloudStorageProviderFileAction","getCloudStorageFolders","addCloudStorageFolder","deleteCloudStorageFolder","folderToDelete","getCloudStorageFolderContents","folder","providerCode","isSubdirectory","openCloudStorageFile","getExternalProviders","excludeAddedProviders","copyMoveFiles","selectedFiles","destinationFolder","destinationProviderCode","isMove","getFileDownloads","openDownloadFolder","fileObjectId","addCloudStorageProvider","removeCloudStorageProvider","logoutRequest","addCloudStorageProviderFile","addNewFileRequest","renameCloudStorageProviderFile","renameFileRequest","deleteCloudStorageProviderFile","deleteFileRequest","itemList","downloadCloudStorageProviderFile","downloadFileRequest","uploadCloudStorageProviderFile","uploadFileRequest","registerCloudStorageProviderListChangeHandler","registerCloudStorageProviderContentChangeHandler","getPairedMeetingRoomInfo","sendCommandToPairedMeetingRoom","commandName","registerMeetingRoomCapabilitiesUpdateHandler","capabilities","registerMeetingRoomStatesUpdateHandler","states","showNotification","showNotificationParameters","ControlCommand","ErrorReason","SessionTerminatedReason","getCapableParticipants","requestControl","participant","sendControlCommand","terminateSession","registerOnCapableParticipantsChangeHandler","registerOnErrorHandler","registerOnDeviceStateChangeHandler","registerOnSessionStatusChangeHandler","selectAppEntity","threadId","categories","getTeamChannels","refreshSiteUrl","getUserJoinedTeams","teamInstanceParameters","getConfigSetting","ErrorLevel","errorLevel","Warn","effectParam","updatePersonalizedEffects","effects","notifyFatalError","Fatal"],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GAAyB,oBAAdC,WAA6BA,UAAUC,WAAaD,UAAUC,UAAUC,cAAclB,MAAM,yBACtG,OAAO,EAKR,MAA4B,oBAAbmB,UAA4BA,SAASC,iBAAmBD,SAASC,gBAAgBC,OAASF,SAASC,gBAAgBC,MAAMC,kBAEpH,oBAAXT,QAA0BA,OAAOU,UAAYV,OAAOU,QAAQC,SAAYX,OAAOU,QAAQE,WAAaZ,OAAOU,QAAQG,QAGrG,oBAAdV,WAA6BA,UAAUC,WAAaD,UAAUC,UAAUC,cAAclB,MAAM,mBAAqB2B,SAASC,OAAOC,GAAI,KAAO,IAE9H,oBAAdb,WAA6BA,UAAUC,WAAaD,UAAUC,UAAUC,cAAclB,MAAM,qBACtG,EA/HAlB,EAAQqB,QAyOR,WACC,IAGC,OAAO2B,YACR,CAAE,MAAOxB,GAGT,CACD,CAlPkByB,GAClBjD,EAAQkD,QAAU,MACjB,IAAIC,GAAS,EAEb,MAAO,KACDA,IACJA,GAAS,EACTV,QAAQW,KAAK,yIACd,CAED,EATiB,GAelBpD,EAAQqD,OAAS,CAChB,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,WAsFDrD,EAAQsD,IAAMb,QAAQc,OAASd,QAAQa,KAAO,MAAS,GAkEvDrD,EAAOD,QAAU,EAAQ,GAAR,CAAoBA,GAErC,MAAM,WAACwD,GAAcvD,EAAOD,QAM5BwD,EAAWC,EAAI,SAAUC,GACxB,IACC,OAAOC,KAAKC,UAAUF,EACv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A0B,EAC5B,GACAC,E,CAGN,IACA,GAGF1f,GAAoB,8BAA+B,CAAC/N,GACtD,EAegB,EAAA+tB,iCAAhB,SACEC,EACAC,EACAiI,GAGA,GADA3yB,GAAkB9E,GAAS5E,EAAcqT,YACpCoB,IACH,MAAMnU,EAER4T,GAAoB,2BAA4B,CAACigB,EAAkBC,EAAUiI,GAC/E,EAqBgB,EAAAhI,uBAAhB,SAAuC7xB,GAErC,GADAkH,GAAkB9E,GAAS5E,EAAcqT,YACpCoB,IACH,MAAMnU,EAER8R,GAAgB,8BAA+B5P,GAAU,GACzD0R,GAAoB,+BACtB,EAqCgB,EAAAooB,0BAAhB,SAA0CC,GAExC,GADA7yB,GAAkB9E,GAAS5E,EAAcqT,YACpC3M,GAAM+N,cACT,MAAMnU,EAER4T,GAAoB,mCAAoC,CAACqoB,GAC3D,EAegB,EAAA9nB,YAAW,EA0CX,EAAA+nB,iBAAhB,SAAiCh7B,GAE/B,GADAkI,GAAkB9E,KACb8B,GAAM+N,cACT,MAAMnU,EAERszB,EAAYpyB,EAAc06B,EAAWO,MACvC,CACD,CAhRD,CAAiB1F,KAAAA,GAAO,I","sources":["webpack://microsoftTeams/webpack/universalModuleDefinition","webpack://microsoftTeams/../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js","webpack://microsoftTeams/../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js","webpack://microsoftTeams/../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js","webpack://microsoftTeams/webpack/bootstrap","webpack://microsoftTeams/webpack/runtime/define property getters","webpack://microsoftTeams/webpack/runtime/hasOwnProperty shorthand","webpack://microsoftTeams/webpack/runtime/make namespace object","webpack://microsoftTeams/./src/internal/constants.ts","webpack://microsoftTeams/./src/internal/globalVars.ts","webpack://microsoftTeams/./src/internal/telemetry.ts","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/native.js","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/rng.js","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/stringify.js","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/v4.js","webpack://microsoftTeams/./src/public/interfaces.ts","webpack://microsoftTeams/./src/public/constants.ts","webpack://microsoftTeams/./src/internal/utils.ts","webpack://microsoftTeams/./src/public/runtime.ts","webpack://microsoftTeams/./src/public/authentication.ts","webpack://microsoftTeams/./src/public/dialog.ts","webpack://microsoftTeams/./src/public/menus.ts","webpack://microsoftTeams/./src/public/teamsAPIs.ts","webpack://microsoftTeams/./src/public/app.ts","webpack://microsoftTeams/./src/public/pages.ts","webpack://microsoftTeams/./src/public/version.ts","webpack://microsoftTeams/./src/internal/internalAPIs.ts","webpack://microsoftTeams/./src/internal/handlers.ts","webpack://microsoftTeams/./src/internal/communication.ts","webpack://microsoftTeams/./src/private/logs.ts","webpack://microsoftTeams/./src/private/interfaces.ts","webpack://microsoftTeams/./src/private/conversations.ts","webpack://microsoftTeams/./src/private/privateAPIs.ts","webpack://microsoftTeams/./src/internal/deepLinkConstants.ts","webpack://microsoftTeams/./src/public/appInstallDialog.ts","webpack://microsoftTeams/./src/internal/deepLinkUtilities.ts","webpack://microsoftTeams/./src/public/media.ts","webpack://microsoftTeams/./src/public/barCode.ts","webpack://microsoftTeams/./src/public/chat.ts","webpack://microsoftTeams/./src/public/geoLocation.ts","webpack://microsoftTeams/./src/internal/mediaUtil.ts","webpack://microsoftTeams/./src/public/adaptiveCards.ts","webpack://microsoftTeams/./src/public/appWindow.ts","webpack://microsoftTeams/./src/public/location.ts","webpack://microsoftTeams/./src/public/meeting.ts","webpack://microsoftTeams/./src/public/monetization.ts","webpack://microsoftTeams/./src/public/calendar.ts","webpack://microsoftTeams/./src/public/mail.ts","webpack://microsoftTeams/./src/public/people.ts","webpack://microsoftTeams/./src/public/profile.ts","webpack://microsoftTeams/./src/public/video.ts","webpack://microsoftTeams/./src/public/search.ts","webpack://microsoftTeams/./src/public/sharing.ts","webpack://microsoftTeams/./src/public/stageView.ts","webpack://microsoftTeams/./src/public/webStorage.ts","webpack://microsoftTeams/./src/public/call.ts","webpack://microsoftTeams/./src/public/appInitialization.ts","webpack://microsoftTeams/./src/public/settings.ts","webpack://microsoftTeams/./src/internal/profileUtil.ts","webpack://microsoftTeams/./src/public/publicAPIs.ts","webpack://microsoftTeams/./src/public/navigation.ts","webpack://microsoftTeams/./src/public/tasks.ts","webpack://microsoftTeams/./src/public/liveShareHost.ts","webpack://microsoftTeams/./src/private/files.ts","webpack://microsoftTeams/./src/private/meetingRoom.ts","webpack://microsoftTeams/./src/private/notifications.ts","webpack://microsoftTeams/./src/private/remoteCamera.ts","webpack://microsoftTeams/./src/private/appEntity.ts","webpack://microsoftTeams/./src/private/teams.ts","webpack://microsoftTeams/./src/private/videoEx.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"microsoftTeams\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"microsoftTeams\"] = factory();\n\telse\n\t\troot[\"microsoftTeams\"] = factory();\n})(typeof self !== 'undefined' ? self : this, () => {\nreturn ","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * @hidden\n * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.\n * 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.\n * Mobile clients are passing versions, hence will be applicable to web and desktop clients only.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const defaultSDKVersionForCompatCheck = '2.0.1';\n\n/**\n * @hidden\n * This is the client version when selectMedia API - VideoAndImage is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const videoAndImageMediaAPISupportVersion = '2.0.2';\n\n/**\n * @hidden\n * This is the client version when selectMedia API - Video with non-full screen mode is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const nonFullScreenVideoModeAPISupportVersion = '2.0.3';\n\n/**\n * @hidden\n * This is the client version when selectMedia API - ImageOutputFormats is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const imageOutputFormatsAPISupportVersion = '2.0.4';\n\n/**\n * @hidden\n * Minimum required client supported version for {@link getUserJoinedTeams} to be supported on {@link HostClientType.android}\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const getUserJoinedTeamsSupportedAndroidClientVersion = '2.0.1';\n\n/**\n * @hidden\n * This is the client version when location APIs (getLocation and showLocation) are supported.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const locationAPIsRequiredVersion = '1.9.0';\n\n/**\n * @hidden\n * This is the client version when permisisons are supported\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const permissionsAPIsRequiredVersion = '2.0.1';\n\n/**\n * @hidden\n * This is the client version when people picker API is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const peoplePickerRequiredVersion = '2.0.0';\n\n/**\n * @hidden\n * This is the client version when captureImage API is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const captureImageMobileSupportVersion = '1.7.0';\n\n/**\n * @hidden\n * This is the client version when media APIs are supported on all three platforms ios, android and web.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const mediaAPISupportVersion = '1.8.0';\n\n/**\n * @hidden\n * This is the client version when getMedia API is supported via Callbacks on all three platforms ios, android and web.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const getMediaCallbackSupportVersion = '2.0.0';\n\n/**\n * @hidden\n * This is the client version when scanBarCode API is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const scanBarCodeAPIMobileSupportVersion = '1.9.0';\n\n/**\n * @hidden\n * List of supported Host origins\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const validOrigins = [\n 'teams.microsoft.com',\n 'teams.microsoft.us',\n 'gov.teams.microsoft.us',\n 'dod.teams.microsoft.us',\n 'int.teams.microsoft.com',\n 'teams.live.com',\n 'devspaces.skype.com',\n 'ssauth.skype.com',\n 'local.teams.live.com', // local development\n 'local.teams.live.com:8080', // local development\n 'local.teams.office.com', // local development\n 'local.teams.office.com:8080', // local development\n 'outlook.office.com',\n 'outlook-sdf.office.com',\n 'outlook.office365.com',\n 'outlook-sdf.office365.com',\n 'outlook.live.com',\n 'outlook-sdf.live.com',\n '*.teams.microsoft.com',\n '*.www.office.com',\n 'www.office.com',\n 'word.office.com',\n 'excel.office.com',\n 'powerpoint.office.com',\n 'www.officeppe.com',\n '*.www.microsoft365.com',\n 'www.microsoft365.com',\n];\n\n/**\n * @hidden\n * USer specified message origins should satisfy this test\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const userOriginUrlValidationRegExp = /^https:\\/\\//;\n\n/**\n * @hidden\n * The protocol used for deep links into Teams\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const teamsDeepLinkProtocol = 'https';\n\n/**\n * @hidden\n * The host used for deep links into Teams\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const teamsDeepLinkHost = 'teams.microsoft.com';\n\n/** @hidden */\nexport const errorLibraryNotInitialized = 'The library has not yet been initialized';\n\n/** @hidden */\nexport const errorRuntimeNotInitialized = 'The runtime has not yet been initialized';\n\n/** @hidden */\nexport const errorRuntimeNotSupported = 'The runtime version is not supported';\n","import { FrameContexts } from '../public';\nexport class GlobalVars {\n public static initializeCalled = false;\n public static initializeCompleted = false;\n public static additionalValidOrigins: string[] = [];\n public static initializePromise: Promise<void>;\n public static isFramelessWindow = false;\n public static frameContext: FrameContexts;\n public static hostClientType: string;\n public static clientSupportedSDKVersion: string;\n public static printCapabilityEnabled = false;\n}\n","import { debug as registerLogger, Debugger } from 'debug';\n\nconst topLevelLogger = registerLogger('teamsJs');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace\n */\nexport function getLogger(namespace: string): Debugger {\n return topLevelLogger.extend(namespace);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","/* eslint-disable @typescript-eslint/no-explicit-any*/\n\nimport { ChannelType, DialogDimension, HostClientType, HostName, TeamType, UserTeamRole } from './constants';\nimport { FrameContexts } from './constants';\n\n/**\n * Represents information about tabs for an app\n */\nexport interface TabInformation {\n teamTabs: TabInstance[];\n}\n\n/**\n * Represents information about a tab instance\n */\nexport interface TabInstance {\n /**\n * The name of the tab\n */\n tabName: string;\n\n /**\n * @internal\n * Limited to Microsoft-internal use\n * @protected\n */\n internalTabInstanceId?: string;\n\n /**\n * Last viewed time of this tab. null means unknown\n */\n lastViewUnixEpochTime?: string;\n\n /**\n * The developer-defined unique ID for the entity this content points to.\n */\n entityId?: string;\n\n /**\n * The Microsoft Teams ID for the channel with which the content is associated.\n */\n channelId?: string;\n\n /**\n * The name for the channel with which the content is associated.\n */\n channelName?: string;\n\n /**\n * Is this tab in a favorite channel?\n */\n channelIsFavorite?: boolean;\n\n /**\n * The Microsoft Teams ID for the team with which the content is associated.\n */\n teamId?: string;\n\n /**\n * The name for the team with which the content is associated.\n */\n teamName?: string;\n\n /**\n * Is this tab in a favorite team?\n */\n teamIsFavorite?: boolean;\n\n /**\n * The Office 365 group ID for the team with which the content is associated.\n * This field is available only when the identity permission is requested in the manifest.\n */\n groupId?: string;\n\n /**\n * Content URL of this tab\n */\n url?: string;\n\n /**\n * Website URL of this tab\n */\n websiteUrl?: string;\n}\n\n/**\n * Indicates information about the tab instance for filtering purposes.\n */\nexport interface TabInstanceParameters {\n /**\n * Flag allowing to select favorite channels only\n */\n favoriteChannelsOnly?: boolean;\n\n /**\n * Flag allowing to select favorite teams only\n */\n favoriteTeamsOnly?: boolean;\n}\n\n/**\n * Represents Team Information\n */\nexport interface TeamInformation {\n /**\n * Id of the team\n */\n teamId: string;\n\n /**\n * Team display name\n */\n teamName: string;\n\n /**\n * Team description\n */\n teamDescription?: string;\n\n /**\n * Thumbnail Uri\n */\n thumbnailUri?: string;\n\n /**\n * The Office 365 group ID for the team with which the content is associated.\n * This field is available only when the identity permission is requested in the manifest.\n */\n groupId?: string;\n\n /**\n * Role of current user in the team\n */\n userTeamRole?: UserTeamRole;\n\n /**\n * The type of the team.\n */\n teamType?: TeamType;\n\n /**\n * The locked status of the team\n */\n isTeamLocked?: boolean;\n\n /**\n * The archived status of the team\n */\n isTeamArchived?: boolean;\n}\n\n/**\n * Represents OS locale info used for formatting date and time data\n */\nexport interface LocaleInfo {\n platform: 'windows' | 'macos';\n regionalFormat: string;\n shortDate: string;\n longDate: string;\n shortTime: string;\n longTime: string;\n}\n\n/**\n * Allowed user file open preferences\n */\nexport enum FileOpenPreference {\n Inline = 'inline',\n Desktop = 'desktop',\n Web = 'web',\n}\n\n/**\n * Possible Action Types\n *\n * @beta\n */\nexport enum ActionObjectType {\n M365Content = 'm365content',\n}\n\n/**\n * Data pertaining to object(s) the action is being performed on\n *\n * @param T The type of action being implemented\n *\n * @beta\n */\nexport interface BaseActionObject<T extends ActionObjectType> {\n type: T;\n}\n\n/**\n * Stores information needed to represent M365 Content stored\n * in OneDrive or Sharepoint\n *\n * @beta\n */\nexport interface M365ContentAction extends BaseActionObject<ActionObjectType.M365Content> {\n /**\n * Only office content IDs are passed to the app. Apps should use these ids\n * to query the Microsoft graph for more details.\n */\n itemId: string;\n secondaryId?: SecondaryId;\n}\n\n/**\n * Contains information on what Graph item is being queried\n *\n * @beta\n */\nexport interface SecondaryId {\n name: SecondaryM365ContentIdName;\n value: string;\n}\n\n/**\n * These correspond with field names in the MSGraph\n *\n * @beta\n */\nexport enum SecondaryM365ContentIdName {\n DriveId = 'driveId',\n GroupId = 'groupId',\n SiteId = 'siteId',\n UserId = 'userId',\n}\n\n/**\n * Information common to all actions\n *\n * @beta\n */\nexport interface ActionInfo {\n /**\n * Maps to the action id supplied inside the manifest\n */\n actionId: string;\n /**\n * Array of corresponding action objects\n */\n actionObjects: BaseActionObject<ActionObjectType>[];\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use the {@link app.Context} interface and its updated properties instead.\n *\n * @remarks\n * For more details about the updated {@link app.Context} interface, visit the\n * [Teams JavaScript client SDK](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/using-teams-client-sdk#updates-to-the-context-interface)\n * overview article.\n *\n * Represents the structure of the received context message.\n */\nexport interface Context {\n /**\n * @deprecated\n * As of 2.0.0, please use {@link ActionInfo | app.Context.actionInfo} instead\n *\n * Common information applicable to all content actions\n */\n actionInfo?: ActionInfo;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.groupId | app.Context.team.groupId} instead\n *\n * The Office 365 group ID for the team with which the content is associated.\n * This field is available only when the identity permission is requested in the manifest.\n */\n groupId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.internalId | app.Context.team.internalId} instead\n *\n * The Microsoft Teams ID for the team with which the content is associated.\n */\n teamId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.displayName | app.Context.team.displayName} instead\n *\n * The name for the team with which the content is associated.\n */\n teamName?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.id | app.Context.channel.id} instead\n *\n * The Microsoft Teams ID for the channel with which the content is associated.\n */\n channelId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.displayName | app.Context.channel.displayName} instead\n *\n * The name for the channel with which the content is associated.\n */\n channelName?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.membershipType | app.Context.channel.membershipType} instead\n *\n * The type of the channel with which the content is associated.\n */\n channelType?: ChannelType;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.PageInfo.id | app.Context.page.id} instead\n *\n * The developer-defined unique ID for the entity this content points to.\n */\n entityId: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.PageInfo.subPageId | app.Context.page.subPageId} instead\n *\n * The developer-defined unique ID for the sub-entity this content points to.\n * This field should be used to restore to a specific state within an entity,\n * such as scrolling to or activating a specific piece of content.\n */\n subEntityId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.locale | app.Context.app.locale} instead\n *\n * The current locale that the user has configured for the app formatted as\n * languageId-countryId (for example, en-us).\n */\n locale: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.osLocaleInfo | app.Context.app.osLocaleInfo} instead\n *\n * More detailed locale info from the user's OS if available. Can be used together with\n * the @microsoft/globe NPM package to ensure your app respects the user's OS date and\n * time format configuration\n */\n osLocaleInfo?: LocaleInfo;\n\n /**\n * @deprecated\n *\n * As of 2.0.0, please use {@link app.UserInfo.loginHint | app.Context.user.loginHint} or\n * {@link app.UserInfo.userPrincipalName | app.Context.user.userPrincipalName} instead.\n * The UPN of the current user.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n upn?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TenantInfo.id | app.Context.user.tenant.id} instead\n *\n * The Azure AD tenant ID of the current user.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n tid?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.theme | app.Context.app.theme} instead\n *\n * The current UI theme.\n */\n theme?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.PageInfo.isFullScreen | app.Context.page.isFullScreen} instead\n *\n * Indication whether the tab is in full-screen mode.\n */\n isFullScreen?: boolean;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.type | app.Context.team.type} instead\n *\n * The type of the team.\n */\n teamType?: TeamType;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.SharePointSiteInfo.teamSiteUrl | app.Context.sharePointSite.teamSiteUrl} instead\n *\n * The root SharePoint site associated with the team.\n */\n teamSiteUrl?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.SharePointSiteInfo.teamSiteDomain | app.Context.sharePointSite.teamSiteDomain} instead\n *\n * The domain of the root SharePoint site associated with the team.\n */\n teamSiteDomain?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.SharePointSiteInfo.teamSitePath | app.Context.sharePointSite.teamSitePath} instead\n *\n * The relative path to the SharePoint site associated with the team.\n */\n teamSitePath?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.ownerTenantId | app.Context.channel.ownerTenantId} instead\n *\n * The tenant ID of the host team.\n */\n hostTeamTenantId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.ownerGroupId | app.Context.channel.ownerGroupId} instead\n *\n * The AAD group ID of the host team.\n */\n hostTeamGroupId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.relativeUrl | app.Context.channel.relativeUrl} instead\n *\n * The relative path to the SharePoint folder associated with the channel.\n */\n channelRelativeUrl?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppHostInfo.sessionId | app.Context.app.host.sessionId} instead\n *\n * Unique ID for the current Teams session for use in correlating telemetry data.\n */\n sessionId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.userRole | app.Context.team.userRole} instead\n *\n * The user's role in the team.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to the user's role, and never as proof of her role.\n */\n userTeamRole?: UserTeamRole;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChatInfo.id | app.Context.chat.id} instead\n *\n * The Microsoft Teams ID for the chat with which the content is associated.\n */\n chatId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.loginHint | app.Context.user.loginHint} instead\n *\n * A value suitable for use as a login_hint when authenticating with Azure AD.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n loginHint?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.userPrincipalName | app.Context.user.userPrincipalName} instead\n *\n * The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users).\n * Because a malicious party run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n userPrincipalName?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.id | app.Context.user.id} instead\n *\n * The Azure AD object id of the current user.\n * Because a malicious party run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n userObjectId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.isArchived | app.Context.team.isArchived} instead\n *\n * Indicates whether team is archived.\n * Apps should use this as a signal to prevent any changes to content associated with archived teams.\n */\n isTeamArchived?: boolean;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppHostInfo.name | app.Context.app.host.name} instead\n *\n * The name of the host client. Possible values are: Office, Orange, Outlook, Teams\n */\n hostName?: HostName;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppHostInfo.clientType | app.Context.app.host.clientType} instead\n *\n * The type of the host client. Possible values are : android, ios, web, desktop, rigel(deprecated, use teamsRoomsWindows instead),\n * surfaceHub, teamsRoomsWindows, teamsRoomsAndroid, teamsPhones, teamsDisplays\n */\n hostClientType?: HostClientType;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.PageInfo.frameContext | app.Context.page.frameContext} instead\n *\n * The context where tab url is loaded (content, task, setting, remove, sidePanel)\n */\n frameContext?: FrameContexts;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.Context | app.Context.sharepoint} instead\n *\n * SharePoint context. This is only available when hosted in SharePoint.\n */\n sharepoint?: any;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TenantInfo.teamsSku | app.Context.tenant.teamsSku} instead\n *\n * The type of license for the current users tenant.\n */\n tenantSKU?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.licenseType | app.Context.user.licenseType} instead\n *\n * The license type for the current user.\n */\n userLicenseType?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.parentMessageId | app.Context.app.parentMessageId} instead\n *\n * The ID of the parent message from which this task module was launched.\n * This is only available in task modules launched from bot cards.\n */\n parentMessageId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppHostInfo.ringId | app.Context.app.host.ringId} instead\n *\n * Current ring ID\n */\n ringId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.sessionId | app.Context.app.sessionId} instead\n *\n * Unique ID for the current session for use in correlating telemetry data.\n */\n appSessionId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.appLaunchId | app.Context.app.appLaunchId} instead\n *\n * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data``\n */\n appLaunchId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.isCallingAllowed | app.Context.user.isCallingAllowed} instead\n *\n * Represents whether calling is allowed for the current logged in User\n */\n isCallingAllowed?: boolean;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.isPSTNCallingAllowed | app.Context.user.isPSTNCallingAllowed} instead\n *\n * Represents whether PSTN calling is allowed for the current logged in User\n */\n isPSTNCallingAllowed?: boolean;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.MeetingInfo.id | app.Context.meeting.id} instead\n *\n * Meeting Id used by tab when running in meeting context\n */\n meetingId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ChannelInfo.defaultOneNoteSectionId | app.Context.channel.defaultOneNoteSectionId} instead\n *\n * The OneNote section ID that is linked to the channel.\n */\n defaultOneNoteSectionId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.PageInfo.isMultiWindow | app.Context.page.isMultiWindow} instead\n *\n * Indication whether the tab is in a pop out window\n */\n isMultiWindow?: boolean;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.iconPositionVertical | app.Context.app.iconPositionVertical} instead\n *\n * Personal app icon y coordinate position\n */\n appIconPosition?: number;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.PageInfo.sourceOrigin | app.Context.page.sourceOrigin} instead\n *\n * Source origin from where the tab is opened\n */\n sourceOrigin?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.userClickTime | app.Context.app.userClickTime} instead\n *\n * Time when the user clicked on the tab\n */\n userClickTime?: number;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.TeamInfo.templateId | app.Context.team.templateId} instead\n *\n * Team Template ID if there was a Team Template associated with the creation of the team.\n */\n teamTemplateId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.AppInfo.userFileOpenPreference | app.Context.app.userFileOpenPreference} instead\n *\n * Where the user prefers the file to be opened from by default during file open\n */\n userFileOpenPreference?: FileOpenPreference;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.UserInfo.displayName | app.Context.user.displayName} instead\n *\n * The address book name of the current user.\n */\n userDisplayName?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.SharePointSiteInfo.teamSiteId | app.Context.sharePointSite.teamSiteId} instead\n *\n * Teamsite ID, aka sharepoint site id.\n */\n teamSiteId?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.SharePointSiteInfo.mySiteDomain | app.Context.sharePointSite.mySiteDomain} instead\n *\n * The SharePoint my site domain associated with the user.\n */\n mySiteDomain?: string;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.SharePointSiteInfo.mySitePath | app.Context.sharePointSite.mySitePath} instead\n *\n * The SharePoint relative path to the current users mysite\n */\n mySitePath?: string;\n}\n\nexport interface ShareDeepLinkParameters {\n /**\n * The developer-defined unique ID for the sub-page to which this deep link points in the current page.\n * This field should be used to restore to a specific state within a page, such as scrolling to or activating a specific piece of content.\n */\n subPageId: string;\n\n /**\n * The label for the sub-page that should be displayed when the deep link is rendered in a client.\n */\n subPageLabel: string;\n\n /**\n * The fallback URL to which to navigate the user if the client cannot render the page.\n * This URL should lead directly to the sub-entity.\n */\n subPageWebUrl?: string;\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link ShareDeepLinkParameters} instead.\n */\nexport interface DeepLinkParameters {\n /**\n * The developer-defined unique ID for the sub-entity to which this deep link points in the current entity.\n * This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.\n */\n subEntityId: string;\n\n /**\n * The label for the sub-entity that should be displayed when the deep link is rendered in a client.\n */\n subEntityLabel: string;\n\n /**\n * The fallback URL to which to navigate the user if the client cannot render the page.\n * This URL should lead directly to the sub-entity.\n */\n subEntityWebUrl?: string;\n}\n\n/**\n * @hidden\n * Shared Dialog Properties\n */\nexport interface BaseDialogInfo {\n /*\n * The requested size of the dialog\n */\n size: DialogSize;\n\n /**\n * Title of the dialog module.\n */\n title?: string;\n}\n\n/**\n * Data structure to describe dialog information needed to open an Adaptive Card-based dialog.\n */\nexport interface AdaptiveCardDialogInfo extends BaseDialogInfo {\n /**\n * JSON defining an Adaptive Card.\n */\n card: string;\n}\n\n/**\n * Data structure to describe dialog information needed to open a bot-based Adaptive Card-based dialog.\n */\nexport interface BotAdaptiveCardDialogInfo extends AdaptiveCardDialogInfo {\n /**\n * Specifies a bot ID to send the result of the user's interaction with the dialog module.\n * The bot will receive a task/complete invoke event with a JSON object\n * in the event payload.\n */\n completionBotId: string;\n}\n\n/**\n * Data structure to represent the size of a dialog\n */\nexport interface DialogSize {\n /**\n * The requested height of the webview/iframe.\n */\n height: DialogDimension | number;\n\n /**\n * The requested width of the webview/iframe.\n */\n width: DialogDimension | number;\n}\n\n/**\n * Data structure to describe dialog information needed to open a url-based dialog.\n */\nexport interface UrlDialogInfo extends BaseDialogInfo {\n /**\n * The url to be rendered in the webview/iframe.\n *\n * @remarks\n * The domain of the url must match at least one of the\n * valid domains specified in the [validDomains block](https://learn.microsoft.com/microsoftteams/platform/resources/schema/manifest-schema#validdomains) of the app manifest\n */\n url: string;\n\n /**\n * If client doesnt support the URL, the URL that needs to be opened in the browser.\n */\n fallbackUrl?: string;\n}\n\n/**\n * Data structure to describe dialog information needed to open a bot based dialog.\n */\nexport interface BotUrlDialogInfo extends UrlDialogInfo {\n /**\n * Specifies a bot ID to send the result of the user's interaction with the task module.\n * The bot will receive a task/complete invoke event with a JSON object\n * in the event payload.\n */\n completionBotId: string;\n}\n\n/**\n * Data structure to describe dialog information\n */\nexport interface DialogInfo {\n /**\n * The url to be rendered in the webview/iframe.\n *\n * @remarks\n * The domain of the url must match at least one of the\n * valid domains specified in the validDomains block of the manifest\n */\n url?: string;\n\n /**\n * JSON defining an adaptive card.\n */\n card?: string;\n\n /**\n * The requested height of the webview/iframe.\n */\n height?: DialogDimension | number;\n\n /**\n * The requested width of the webview/iframe.\n */\n width?: DialogDimension | number;\n\n /**\n * Title of the task module.\n */\n title?: string;\n\n /**\n * If client doesnt support the URL, the URL that needs to be opened in the browser.\n */\n fallbackUrl?: string;\n\n /**\n * Specifies a bot ID to send the result of the user's interaction with the task module.\n * If specified, the bot will receive a task/complete invoke event with a JSON object\n * in the event payload.\n */\n completionBotId?: string;\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link DialogInfo} instead.\n */\nexport type TaskInfo = DialogInfo;\n\nexport interface DialogSize {\n height: DialogDimension | number;\n width: DialogDimension | number;\n}\n/**\n * @beta\n * Data structure to be used with the {@link teamsCore.registerOnLoadHandler teamsCore.registerOnLoadHandler(handler: (context: LoadContext) => void): void} to pass the context to the app.\n */\nexport interface LoadContext {\n /**\n * The entity that is requested to be loaded\n */\n entityId: string;\n\n /**\n * The content URL that is requested to be loaded\n */\n contentUrl: string;\n}\n\nexport interface FrameInfo {\n /**\n * The current URL that needs to be used in the iframe if the tab is reloaded\n */\n contentUrl: string;\n\n /**\n * The current URL that needs to be used for opening the website when the user clicks on 'Go to website'\n */\n websiteUrl: string;\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link FrameInfo} instead.\n */\nexport type FrameContext = FrameInfo;\n\nexport interface SdkError {\n /**\n error code\n */\n errorCode: ErrorCode;\n /**\n Optional description for the error. This may contain useful information for web-app developers.\n This string will not be localized and is not for end-user consumption. \n App should not depend on the string content. The exact value may change. This is only for debugging purposes.\n */\n message?: string;\n}\n\nexport enum ErrorCode {\n /**\n * API not supported in the current platform.\n */\n NOT_SUPPORTED_ON_PLATFORM = 100,\n /**\n * Internal error encountered while performing the required operation.\n */\n INTERNAL_ERROR = 500,\n /**\n * API is not supported in the current context\n */\n NOT_SUPPORTED_IN_CURRENT_CONTEXT = 501,\n /**\n Permissions denied by user\n */\n PERMISSION_DENIED = 1000,\n /**\n * Network issue\n */\n NETWORK_ERROR = 2000,\n /**\n * Underlying hardware doesn't support the capability\n */\n NO_HW_SUPPORT = 3000,\n /**\n * One or more arguments are invalid\n */\n INVALID_ARGUMENTS = 4000,\n /**\n * User is not authorized for this operation\n */\n UNAUTHORIZED_USER_OPERATION = 5000,\n /**\n * Could not complete the operation due to insufficient resources\n */\n INSUFFICIENT_RESOURCES = 6000,\n /**\n * Platform throttled the request because of API was invoked too frequently\n */\n THROTTLE = 7000,\n /**\n * User aborted the operation\n */\n USER_ABORT = 8000,\n /**\n * Could not complete the operation in the given time interval\n */\n OPERATION_TIMED_OUT = 8001,\n /**\n * Platform code is old and doesn't implement this API\n */\n OLD_PLATFORM = 9000,\n /**\n * The file specified was not found on the given location\n */\n FILE_NOT_FOUND = 404,\n /**\n * The return value is too big and has exceeded our size boundries\n */\n SIZE_EXCEEDED = 10000,\n}\n\n/** @hidden */\nexport enum DevicePermission {\n GeoLocation = 'geolocation',\n Media = 'media',\n}\n\n/** @hidden */\nexport interface HostVersionsInfo {\n adaptiveCardSchemaVersion?: AdaptiveCardVersion;\n}\n\n/**\n * Represents the major and minor versions of the Adaptive Card schema in the current host\n */\nexport interface AdaptiveCardVersion {\n majorVersion: number;\n minorVersion: number;\n}\n","export enum HostClientType {\n desktop = 'desktop',\n web = 'web',\n android = 'android',\n ios = 'ios',\n ipados = 'ipados',\n /**\n * @deprecated\n * As of 2.0.0, please use {@link teamsRoomsWindows} instead.\n */\n rigel = 'rigel',\n surfaceHub = 'surfaceHub',\n teamsRoomsWindows = 'teamsRoomsWindows',\n teamsRoomsAndroid = 'teamsRoomsAndroid',\n teamsPhones = 'teamsPhones',\n teamsDisplays = 'teamsDisplays',\n}\n\nexport enum HostName {\n /**\n * Office.com and Office Windows App\n */\n office = 'Office',\n\n /**\n * For \"desktop\" specifically, this refers to the new, pre-release version of Outlook for Windows.\n * Also used on other platforms that map to a single Outlook client.\n */\n outlook = 'Outlook',\n\n /**\n * Outlook for Windows: the classic, native, desktop client\n */\n outlookWin32 = 'OutlookWin32',\n\n /**\n * Microsoft-internal test Host\n */\n orange = 'Orange',\n\n /**\n * Teams\n */\n teams = 'Teams',\n\n /**\n * Modern Teams\n */\n teamsModern = 'TeamsModern',\n}\n\n// Ensure these declarations stay in sync with the framework.\nexport enum FrameContexts {\n settings = 'settings',\n content = 'content',\n authentication = 'authentication',\n remove = 'remove',\n task = 'task',\n sidePanel = 'sidePanel',\n stage = 'stage',\n meetingStage = 'meetingStage',\n}\n\n/**\n * Indicates the team type, currently used to distinguish between different team\n * types in Office 365 for Education (team types 1, 2, 3, and 4).\n */\nexport enum TeamType {\n Standard = 0,\n Edu = 1,\n Class = 2,\n Plc = 3,\n Staff = 4,\n}\n\n/**\n * Indicates the various types of roles of a user in a team.\n */\nexport enum UserTeamRole {\n Admin = 0,\n User = 1,\n Guest = 2,\n}\n\n/**\n * Dialog module dimension enum\n */\nexport enum DialogDimension {\n Large = 'large',\n Medium = 'medium',\n Small = 'small',\n}\n\nimport { AdaptiveCardVersion, ErrorCode, SdkError } from './interfaces';\n/**\n * @deprecated\n * As of 2.0.0, please use {@link DialogDimension} instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport import TaskModuleDimension = DialogDimension;\n\n/**\n * The type of the channel with which the content is associated.\n */\nexport enum ChannelType {\n Regular = 'Regular',\n Private = 'Private',\n Shared = 'Shared',\n}\n\nexport const errorNotSupportedOnPlatform: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\n\n/**\n * @hidden\n *\n * Minimum Adaptive Card version supported by the host.\n */\nexport const minAdaptiveCardVersion: AdaptiveCardVersion = { majorVersion: 1, minorVersion: 5 };\n","/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport * as uuid from 'uuid';\n\nimport { GlobalVars } from '../internal/globalVars';\nimport { minAdaptiveCardVersion } from '../public/constants';\nimport { AdaptiveCardVersion, SdkError } from '../public/interfaces';\nimport { pages } from '../public/pages';\nimport { validOrigins } from './constants';\n\n/**\n * @param pattern - reference pattern\n * @param host - candidate string\n * @returns returns true if host matches pre-know valid pattern\n *\n * @example\n * validateHostAgainstPattern('*.teams.microsoft.com', 'subdomain.teams.microsoft.com') returns true\n * validateHostAgainstPattern('teams.microsoft.com', 'team.microsoft.com') returns false\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction validateHostAgainstPattern(pattern: string, host: string): boolean {\n if (pattern.substring(0, 2) === '*.') {\n const suffix = pattern.substring(1);\n if (\n host.length > suffix.length &&\n host.split('.').length === suffix.split('.').length &&\n host.substring(host.length - suffix.length) === suffix\n ) {\n return true;\n }\n } else if (pattern === host) {\n return true;\n }\n return false;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateOrigin(messageOrigin: URL): boolean {\n // Check whether the url is in the pre-known allowlist or supplied by user\n if (messageOrigin.protocol !== 'https:') {\n return false;\n }\n const messageOriginHost = messageOrigin.host;\n\n if (validOrigins.some((pattern) => validateHostAgainstPattern(pattern, messageOriginHost))) {\n return true;\n }\n\n for (const domainOrPattern of GlobalVars.additionalValidOrigins) {\n const pattern = domainOrPattern.substring(0, 8) === 'https://' ? domainOrPattern.substring(8) : domainOrPattern;\n if (validateHostAgainstPattern(pattern, messageOriginHost)) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function getGenericOnCompleteHandler(errorMessage?: string): (success: boolean, reason?: string) => void {\n return (success: boolean, reason: string): void => {\n if (!success) {\n throw new Error(errorMessage ? errorMessage : reason);\n }\n };\n}\n\n/**\n * @hidden\n * Compares SDK versions.\n *\n * @param v1 - first version\n * @param v2 - second version\n * @returns NaN in case inputs are not in right format\n * -1 if v1 < v2\n * 1 if v1 > v2\n * 0 otherwise\n * @example\n * compareSDKVersions('1.2', '1.2.0') returns 0\n * compareSDKVersions('1.2a', '1.2b') returns NaN\n * compareSDKVersions('1.2', '1.3') returns -1\n * compareSDKVersions('2.0', '1.3.2') returns 1\n * compareSDKVersions('2.0', 2.0) returns NaN\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function compareSDKVersions(v1: string, v2: string): number {\n if (typeof v1 !== 'string' || typeof v2 !== 'string') {\n return NaN;\n }\n\n const v1parts = v1.split('.');\n const v2parts = v2.split('.');\n\n function isValidPart(x: string): boolean {\n // input has to have one or more digits\n // For ex - returns true for '11', false for '1a1', false for 'a', false for '2b'\n return /^\\d+$/.test(x);\n }\n\n if (!v1parts.every(isValidPart) || !v2parts.every(isValidPart)) {\n return NaN;\n }\n\n // Make length of both parts equal\n while (v1parts.length < v2parts.length) {\n v1parts.push('0');\n }\n while (v2parts.length < v1parts.length) {\n v2parts.push('0');\n }\n\n for (let i = 0; i < v1parts.length; ++i) {\n if (Number(v1parts[i]) == Number(v2parts[i])) {\n continue;\n } else if (Number(v1parts[i]) > Number(v2parts[i])) {\n return 1;\n } else {\n return -1;\n }\n }\n return 0;\n}\n\n/**\n * @hidden\n * Generates a GUID\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function generateGUID(): string {\n return uuid.v4();\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function deepFreeze<T extends object>(obj: T): T {\n Object.keys(obj).forEach((prop) => {\n if (typeof obj[prop] === 'object') {\n deepFreeze(obj[prop]);\n }\n });\n return Object.freeze(obj);\n}\n\n/**\n * @hidden\n * The following type definitions will be used in the\n * utility functions below, which help in transforming the\n * promises to support callbacks for backward compatibility\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport type ErrorResultCallback<T> = (err?: SdkError, result?: T) => void;\nexport type ErrorResultNullCallback<T> = (err: SdkError | null, result: T | null) => void;\nexport type ErrorBooleanResultCallback = (err?: SdkError, result?: boolean) => void;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type InputFunction<T> = (...args: any[]) => Promise<T>;\nexport type ResultCallback<T> = (result?: T) => void;\nexport type SdkErrorCallback = ResultCallback<SdkError | null>;\n\n/**\n * This utility function is used when the result of the promise is same as the result in the callback.\n * @param funcHelper\n * @param callback\n * @param args\n * @returns\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callCallbackWithErrorOrResultFromPromiseAndReturnPromise<T>(\n funcHelper: InputFunction<T>,\n callback?: ErrorResultCallback<T>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n): Promise<T> {\n const p = funcHelper(...args);\n p.then((result: T) => {\n if (callback) {\n callback(undefined, result);\n }\n }).catch((e: SdkError) => {\n if (callback) {\n callback(e);\n }\n });\n return p;\n}\n\n/**\n * This utility function is used when the return type of the promise is usually void and\n * the result in the callback is a boolean type (true for success and false for error)\n * @param funcHelper\n * @param callback\n * @param args\n * @returns\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callCallbackWithErrorOrBooleanFromPromiseAndReturnPromise<T>(\n funcHelper: InputFunction<T>,\n callback?: ErrorBooleanResultCallback,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n): Promise<T> {\n const p = funcHelper(...args);\n p.then(() => {\n if (callback) {\n callback(undefined, true);\n }\n }).catch((e: SdkError) => {\n if (callback) {\n callback(e, false);\n }\n });\n return p;\n}\n\n/**\n * This utility function is called when the callback has only Error/SdkError as the primary argument.\n * @param funcHelper\n * @param callback\n * @param args\n * @returns\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callCallbackWithSdkErrorFromPromiseAndReturnPromise<T>(\n funcHelper: InputFunction<T>,\n callback?: SdkErrorCallback,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n): Promise<T> {\n const p = funcHelper(...args);\n p.then(() => {\n if (callback) {\n callback(null);\n }\n }).catch((e: SdkError) => {\n if (callback) {\n callback(e);\n }\n });\n return p;\n}\n\n/**\n * This utility function is used when the result of the promise is same as the result in the callback.\n * @param funcHelper\n * @param callback\n * @param args\n * @returns\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise<T>(\n funcHelper: InputFunction<T>,\n callback?: ErrorResultNullCallback<T>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n): Promise<T> {\n const p = funcHelper(...args);\n p.then((result: T) => {\n if (callback) {\n callback(null, result);\n }\n }).catch((e: SdkError) => {\n if (callback) {\n callback(e, null);\n }\n });\n return p;\n}\n\n/**\n * A helper function to add a timeout to an asynchronous operation.\n *\n * @param action Action to wrap the timeout around\n * @param timeoutInMs Timeout period in milliseconds\n * @param timeoutError Error to reject the promise with if timeout elapses before the action completed\n * @returns A promise which resolves to the result of provided action or rejects with a provided timeout error\n * if the initial action didn't complete within provided timeout.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function runWithTimeout<TResult, TError>(\n action: () => Promise<TResult>,\n timeoutInMs: number,\n timeoutError: TError,\n): Promise<TResult> {\n return new Promise((resolve, reject) => {\n const timeoutHandle = setTimeout(reject, timeoutInMs, timeoutError);\n action()\n .then((result) => {\n clearTimeout(timeoutHandle);\n resolve(result);\n })\n .catch((error) => {\n clearTimeout(timeoutHandle);\n reject(error);\n });\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function createTeamsAppLink(params: pages.NavigateToAppParams): string {\n const url = new URL(\n 'https://teams.microsoft.com/l/entity/' +\n encodeURIComponent(params.appId) +\n '/' +\n encodeURIComponent(params.pageId),\n );\n\n if (params.webUrl) {\n url.searchParams.append('webUrl', params.webUrl);\n }\n if (params.channelId || params.subPageId) {\n url.searchParams.append('context', JSON.stringify({ channelId: params.channelId, subEntityId: params.subPageId }));\n }\n return url.toString();\n}\n\n/**\n * @hidden\n * Checks if the Adaptive Card schema version is supported by the host.\n * @param hostAdaptiveCardSchemaVersion Host's supported Adaptive Card version in the runtime.\n *\n * @returns true if the Adaptive Card Version is not supported and false if it is supported.\n */\nexport function isHostAdaptiveCardSchemaVersionUnsupported(\n hostAdaptiveCardSchemaVersion: AdaptiveCardVersion,\n): boolean {\n const versionCheck = compareSDKVersions(\n `${hostAdaptiveCardSchemaVersion.majorVersion}.${hostAdaptiveCardSchemaVersion.minorVersion}`,\n `${minAdaptiveCardVersion.majorVersion}.${minAdaptiveCardVersion.minorVersion}`,\n );\n if (versionCheck >= 0) {\n return false;\n } else {\n return true;\n }\n}\n","/* eslint-disable @typescript-eslint/ban-types */\n\nimport { errorRuntimeNotInitialized, errorRuntimeNotSupported } from '../internal/constants';\nimport { GlobalVars } from '../internal/globalVars';\nimport { getLogger } from '../internal/telemetry';\nimport { compareSDKVersions, deepFreeze } from '../internal/utils';\nimport { HostClientType } from './constants';\nimport { HostVersionsInfo } from './interfaces';\n\nconst runtimeLogger = getLogger('runtime');\n\nexport interface IBaseRuntime {\n readonly apiVersion: number;\n readonly hostVersionsInfo?: HostVersionsInfo;\n readonly isLegacyTeams?: boolean;\n readonly supports?: {};\n}\n\n/**\n * Latest runtime interface version\n */\nexport type Runtime = IRuntimeV2;\n\nexport const latestRuntimeApiVersion = 2;\n\nfunction isLatestRuntimeVersion(runtime: IBaseRuntime): runtime is Runtime {\n return runtime.apiVersion === latestRuntimeApiVersion;\n}\n\ninterface IRuntimeV1 extends IBaseRuntime {\n readonly apiVersion: 1;\n readonly isLegacyTeams?: boolean;\n readonly supports: {\n readonly appEntity?: {};\n readonly appInstallDialog?: {};\n readonly barCode?: {};\n readonly calendar?: {};\n readonly call?: {};\n readonly chat?: {};\n readonly conversations?: {};\n readonly dialog?: {\n readonly bot?: {};\n readonly update?: {};\n };\n readonly geoLocation?: {\n readonly map?: {};\n };\n readonly location?: {};\n readonly logs?: {};\n readonly mail?: {};\n readonly meetingRoom?: {};\n readonly menus?: {};\n readonly monetization?: {};\n readonly notifications?: {};\n readonly pages?: {\n readonly appButton?: {};\n readonly backStack?: {};\n readonly config?: {};\n readonly currentApp?: {};\n readonly fullTrust?: {};\n readonly tabs?: {};\n };\n readonly people?: {};\n readonly permissions?: {};\n readonly profile?: {};\n readonly remoteCamera?: {};\n readonly search?: {};\n readonly sharing?: {};\n readonly stageView?: {};\n readonly teams?: {\n readonly fullTrust?: {\n readonly joinedTeams?: {};\n };\n };\n readonly teamsCore?: {};\n readonly video?: {};\n readonly webStorage?: {};\n };\n}\n\ninterface IRuntimeV2 extends IBaseRuntime {\n readonly apiVersion: 2;\n readonly hostVersionsInfo?: HostVersionsInfo;\n readonly isLegacyTeams?: boolean;\n readonly supports: {\n readonly appEntity?: {};\n readonly appInstallDialog?: {};\n readonly barCode?: {};\n readonly calendar?: {};\n readonly call?: {};\n readonly chat?: {};\n readonly conversations?: {};\n readonly dialog?: {\n readonly card?: {\n readonly bot?: {};\n };\n readonly url?: {\n readonly bot?: {};\n };\n readonly update?: {};\n };\n readonly geoLocation?: {\n readonly map?: {};\n };\n readonly location?: {};\n readonly logs?: {};\n readonly mail?: {};\n readonly meetingRoom?: {};\n readonly menus?: {};\n readonly monetization?: {};\n readonly notifications?: {};\n readonly pages?: {\n readonly appButton?: {};\n readonly backStack?: {};\n readonly config?: {};\n readonly currentApp?: {};\n readonly fullTrust?: {};\n readonly tabs?: {};\n };\n readonly people?: {};\n readonly permissions?: {};\n readonly profile?: {};\n readonly remoteCamera?: {};\n readonly search?: {};\n readonly sharing?: {};\n readonly stageView?: {};\n readonly teams?: {\n readonly fullTrust?: {\n readonly joinedTeams?: {};\n };\n };\n readonly teamsCore?: {};\n readonly video?: {};\n readonly webStorage?: {};\n };\n}\n// Constant used to set the runtime configuration\nconst _uninitializedRuntime: UninitializedRuntime = {\n apiVersion: -1,\n supports: {},\n};\n\ninterface UninitializedRuntime extends IBaseRuntime {\n readonly apiVersion: -1;\n readonly supports: {};\n}\n\n/**\n * @hidden\n * Ensures that the runtime has been initialized\n\n * @returns True if the runtime has been initialized\n * @throws Error if the runtime has not been initialized\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isRuntimeInitialized(runtime: IBaseRuntime): runtime is Runtime {\n if (isLatestRuntimeVersion(runtime)) {\n return true;\n } else if (runtime.apiVersion === -1) {\n throw new Error(errorRuntimeNotInitialized);\n } else {\n throw new Error(errorRuntimeNotSupported);\n }\n}\n\nexport let runtime: Runtime | UninitializedRuntime = _uninitializedRuntime;\n\nexport const teamsRuntimeConfig: Runtime = {\n apiVersion: 2,\n hostVersionsInfo: undefined,\n isLegacyTeams: true,\n supports: {\n appInstallDialog: {},\n appEntity: {},\n call: {},\n chat: {},\n conversations: {},\n dialog: {\n url: {\n bot: {},\n },\n update: {},\n },\n logs: {},\n meetingRoom: {},\n menus: {},\n monetization: {},\n notifications: {},\n pages: {\n appButton: {},\n tabs: {},\n config: {},\n backStack: {},\n fullTrust: {},\n },\n remoteCamera: {},\n stageView: {},\n teams: {\n fullTrust: {},\n },\n teamsCore: {},\n video: {},\n },\n};\n\ninterface ICapabilityReqs {\n readonly capability: object;\n readonly hostClientTypes: Array<string>;\n}\n\nexport const v1HostClientTypes = [\n HostClientType.desktop,\n HostClientType.web,\n HostClientType.android,\n HostClientType.ios,\n HostClientType.rigel,\n HostClientType.surfaceHub,\n HostClientType.teamsRoomsWindows,\n HostClientType.teamsRoomsAndroid,\n HostClientType.teamsPhones,\n HostClientType.teamsDisplays,\n];\n\n/**\n * @hidden\n * `upgradeToNextVersion` transforms runtime of version `versionToUpgradeFrom` to the next higher version\n *\n * @internal\n * Limited to Microsoft-internal use\n */\ninterface IRuntimeUpgrade {\n versionToUpgradeFrom: number;\n upgradeToNextVersion: (previousVersionRuntime: IBaseRuntime) => IBaseRuntime;\n}\n\n/**\n * @hidden\n * Uses upgradeChain to transform an outdated runtime object to the latest format.\n * @param outdatedRuntime - The runtime object to be upgraded\n * @returns The upgraded runtime object\n * @throws Error if the runtime object could not be upgraded to the latest version\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function fastForwardRuntime(outdatedRuntime: IBaseRuntime): Runtime {\n let runtime = outdatedRuntime;\n if (runtime.apiVersion < latestRuntimeApiVersion) {\n upgradeChain.forEach((upgrade) => {\n if (runtime.apiVersion === upgrade.versionToUpgradeFrom) {\n runtime = upgrade.upgradeToNextVersion(runtime);\n }\n });\n }\n if (isLatestRuntimeVersion(runtime)) {\n return runtime;\n } else {\n throw new Error('Received a runtime that could not be upgraded to the latest version');\n }\n}\n\n/**\n * @hidden\n * List of transformations required to upgrade a runtime object from a previous version to the next higher version.\n * This list must be ordered from lowest version to highest version\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const upgradeChain: IRuntimeUpgrade[] = [\n // This upgrade has been included for testing, it may be removed when there is a real upgrade implemented\n {\n versionToUpgradeFrom: 1,\n upgradeToNextVersion: (previousVersionRuntime: IRuntimeV1): IRuntimeV2 => {\n return {\n apiVersion: 2,\n hostVersionsInfo: undefined,\n isLegacyTeams: previousVersionRuntime.isLegacyTeams,\n supports: {\n ...previousVersionRuntime.supports,\n dialog: previousVersionRuntime.supports.dialog\n ? {\n card: undefined,\n url: previousVersionRuntime.supports.dialog,\n update: previousVersionRuntime.supports.dialog?.update,\n }\n : undefined,\n },\n };\n },\n },\n];\n\nexport const versionConstants: Record<string, Array<ICapabilityReqs>> = {\n '1.9.0': [\n {\n capability: { location: {} },\n hostClientTypes: v1HostClientTypes,\n },\n ],\n '2.0.0': [\n {\n capability: { people: {} },\n hostClientTypes: v1HostClientTypes,\n },\n {\n capability: { sharing: {} },\n hostClientTypes: [HostClientType.desktop, HostClientType.web],\n },\n ],\n '2.0.1': [\n {\n capability: { teams: { fullTrust: { joinedTeams: {} } } },\n hostClientTypes: [\n HostClientType.android,\n HostClientType.desktop,\n HostClientType.ios,\n HostClientType.teamsRoomsAndroid,\n HostClientType.teamsPhones,\n HostClientType.teamsDisplays,\n HostClientType.web,\n ],\n },\n {\n capability: { webStorage: {} },\n hostClientTypes: [HostClientType.desktop],\n },\n ],\n '2.0.5': [\n {\n capability: { webStorage: {} },\n hostClientTypes: [HostClientType.android, HostClientType.desktop, HostClientType.ios],\n },\n ],\n};\n\nconst generateBackCompatRuntimeConfigLogger = runtimeLogger.extend('generateBackCompatRuntimeConfig');\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * Generates and returns a runtime configuration for host clients which are not on the latest host SDK version\n * and do not provide their own runtime config. Their supported capabilities are based on the highest\n * client SDK version that they can support.\n *\n * @param highestSupportedVersion - The highest client SDK version that the host client can support.\n * @returns runtime which describes the APIs supported by the legacy host client.\n */\nexport function generateBackCompatRuntimeConfig(highestSupportedVersion: string): Runtime {\n generateBackCompatRuntimeConfigLogger('generating back compat runtime config for %s', highestSupportedVersion);\n\n let newSupports = { ...teamsRuntimeConfig.supports };\n\n generateBackCompatRuntimeConfigLogger(\n 'Supported capabilities in config before updating based on highestSupportedVersion: %o',\n newSupports,\n );\n\n Object.keys(versionConstants).forEach((versionNumber) => {\n if (compareSDKVersions(highestSupportedVersion, versionNumber) >= 0) {\n versionConstants[versionNumber].forEach((capabilityReqs) => {\n if (capabilityReqs.hostClientTypes.includes(GlobalVars.hostClientType)) {\n newSupports = {\n ...newSupports,\n ...capabilityReqs.capability,\n };\n }\n });\n }\n });\n\n const backCompatRuntimeConfig: Runtime = {\n apiVersion: 2,\n isLegacyTeams: true,\n supports: newSupports,\n };\n\n generateBackCompatRuntimeConfigLogger(\n 'Runtime config after updating based on highestSupportedVersion: %o',\n backCompatRuntimeConfig,\n );\n\n return backCompatRuntimeConfig;\n}\n\nconst applyRuntimeConfigLogger = runtimeLogger.extend('applyRuntimeConfig');\nexport function applyRuntimeConfig(runtimeConfig: IBaseRuntime): void {\n // Some hosts that have not adopted runtime versioning send a string for apiVersion, so we should handle those as v1 inputs\n if (typeof runtimeConfig.apiVersion === 'string') {\n applyRuntimeConfigLogger('Trying to apply runtime with string apiVersion, processing as v1: %o', runtimeConfig);\n runtimeConfig = {\n ...runtimeConfig,\n apiVersion: 1,\n };\n }\n applyRuntimeConfigLogger('Fast-forwarding runtime %o', runtimeConfig);\n const ffRuntimeConfig = fastForwardRuntime(runtimeConfig);\n applyRuntimeConfigLogger('Applying runtime %o', ffRuntimeConfig);\n runtime = deepFreeze(ffRuntimeConfig);\n}\n\nexport function setUnitializedRuntime(): void {\n runtime = deepFreeze(_uninitializedRuntime);\n}\n\n/**\n * @hidden\n * Constant used to set minimum runtime configuration\n * while un-initializing an app in unit test case.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const _minRuntimeConfigToUninitialize: Runtime = {\n apiVersion: 2,\n supports: {\n pages: {\n appButton: {},\n tabs: {},\n config: {},\n backStack: {},\n fullTrust: {},\n },\n teamsCore: {},\n logs: {},\n },\n};\n","import {\n Communication,\n sendMessageEventToChild,\n sendMessageToParent,\n sendMessageToParentAsync,\n waitForMessageQueue,\n} from '../internal/communication';\nimport { GlobalVars } from '../internal/globalVars';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitializeCalled, ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts, HostClientType } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to interact with the authentication-specific part of the SDK.\n *\n * This object is used for starting or completing authentication flows.\n */\nexport namespace authentication {\n let authHandlers: { success: (string) => void; fail: (string) => void } | undefined;\n let authWindowMonitor: number | undefined;\n\n /**\n * @hidden\n * @internal\n * Limited to Microsoft-internal use; automatically called when library is initialized\n */\n export function initialize(): void {\n registerHandler('authentication.authenticate.success', handleSuccess, false);\n registerHandler('authentication.authenticate.failure', handleFailure, false);\n }\n\n let authParams: AuthenticateParameters | undefined;\n /**\n * @deprecated\n * As of 2.0.0, this function has been deprecated in favor of a Promise-based pattern using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>}\n *\n * Registers handlers to be called with the result of an authentication flow triggered using {@link authentication.authenticate authentication.authenticate(authenticateParameters?: AuthenticateParameters): void}\n *\n * @param authenticateParameters - Configuration for authentication flow pop-up result communication\n */\n export function registerAuthenticationHandlers(authenticateParameters: AuthenticateParameters): void {\n authParams = authenticateParameters;\n }\n\n /**\n * Initiates an authentication flow which requires a new window.\n * There are two primary uses for this function:\n * 1. When your app needs to authenticate using a 3rd-party identity provider (not Azure Active Directory)\n * 2. When your app needs to show authentication UI that is blocked from being shown in an iframe (e.g., Azure Active Directory consent prompts)\n *\n * For more details, see [Enable authentication using third-party OAuth provider](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/auth-flow-tab)\n *\n * This function is *not* needed for \"standard\" Azure SSO usage. Using {@link getAuthToken} is usually sufficient in that case. For more, see\n * [Enable SSO for tab apps](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/tab-sso-overview))\n *\n * @remarks\n * The authentication flow must start and end from the same domain, otherwise success and failure messages won't be returned to the window that initiated the call.\n * The [Teams authentication flow](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/auth-flow-tab) starts and ends at an endpoint on\n * your own service (with a redirect round-trip to the 3rd party identity provider in the middle).\n *\n * @param authenticateParameters - Parameters describing the authentication window used for executing the authentication flow\n *\n * @returns `Promise` that will be fulfilled with the result from the authentication pop-up, if successful. The string in this result is provided in the parameter\n * passed by your app when it calls {@link notifySuccess} in the pop-up window after returning from the identity provider redirect.\n *\n * @throws `Error` if the authentication request fails or is canceled by the user. This error is provided in the parameter passed by your app when it calls\n * {@link notifyFailure} in the pop-up window after returning from the identity provider redirect. However, in some cases it can also be provided by\n * the infrastructure depending on the failure (e.g., a user cancelation)\n *\n */\n export function authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise<string>;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} instead.\n *\n * The documentation for {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} applies\n * to this function.\n * The one difference is that instead of the result being returned via the `Promise`, the result is returned to the callback functions provided in the\n * `authenticateParameters` parameter.\n *\n * @param authenticateParameters - Parameters describing the authentication window used for executing the authentication flow and callbacks used for indicating the result\n *\n */\n export function authenticate(authenticateParameters?: AuthenticateParameters): void;\n export function authenticate(authenticateParameters?: AuthenticateParameters): Promise<string> {\n const isDifferentParamsInCall: boolean = authenticateParameters !== undefined;\n const authenticateParams: AuthenticateParameters | undefined = isDifferentParamsInCall\n ? authenticateParameters\n : authParams;\n if (!authenticateParams) {\n throw new Error('No parameters are provided for authentication');\n }\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n return authenticateHelper(authenticateParams)\n .then((value: string) => {\n try {\n if (authenticateParams && authenticateParams.successCallback) {\n authenticateParams.successCallback(value);\n return '';\n }\n return value;\n } finally {\n if (!isDifferentParamsInCall) {\n authParams = null;\n }\n }\n })\n .catch((err: Error) => {\n try {\n if (authenticateParams && authenticateParams.failureCallback) {\n authenticateParams.failureCallback(err.message);\n return '';\n }\n throw err;\n } finally {\n if (!isDifferentParamsInCall) {\n authParams = null;\n }\n }\n });\n }\n\n function authenticateHelper(authenticateParameters: AuthenticateParameters): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n if (\n GlobalVars.hostClientType === HostClientType.desktop ||\n GlobalVars.hostClientType === HostClientType.android ||\n GlobalVars.hostClientType === HostClientType.ios ||\n GlobalVars.hostClientType === HostClientType.ipados ||\n GlobalVars.hostClientType === HostClientType.rigel ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsWindows ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||\n GlobalVars.hostClientType === HostClientType.teamsPhones ||\n GlobalVars.hostClientType === HostClientType.teamsDisplays\n ) {\n // Convert any relative URLs into absolute URLs before sending them over to the parent window.\n const link = document.createElement('a');\n link.href = authenticateParameters.url;\n // Ask the parent window to open an authentication window with the parameters provided by the caller.\n resolve(\n sendMessageToParentAsync<[boolean, string]>('authentication.authenticate', [\n link.href,\n authenticateParameters.width,\n authenticateParameters.height,\n authenticateParameters.isExternal,\n ]).then(([success, response]: [boolean, string]) => {\n if (success) {\n return response;\n } else {\n throw new Error(response);\n }\n }),\n );\n } else {\n // Open an authentication window with the parameters provided by the caller.\n authHandlers = {\n success: resolve,\n fail: reject,\n };\n openAuthenticationWindow(authenticateParameters);\n }\n });\n }\n\n /**\n * Requests an Azure AD token to be issued on behalf of your app in an SSO flow.\n * The token is acquired from the cache if it is not expired. Otherwise a request is sent to Azure AD to\n * obtain a new token.\n * This function is used to enable SSO scenarios. See [Enable SSO for tab apps](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/tab-sso-overview)\n * for more details.\n *\n * @param authTokenRequest - An optional set of values that configure the token request.\n *\n * @returns `Promise` that will be resolved with the token, if successful.\n *\n * @throws `Error` if the request fails in some way\n */\n export function getAuthToken(authTokenRequest?: AuthTokenRequestParameters): Promise<string>;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link authentication.getAuthToken authentication.getAuthToken(authTokenRequest: AuthTokenRequestParameters): Promise\\<string\\>} instead.\n *\n * The documentation {@link authentication.getAuthToken authentication.getAuthToken(authTokenRequest: AuthTokenRequestParameters): Promise\\<string\\>} applies to this\n * function as well. The one difference when using this function is that the result is provided in the callbacks in the `authTokenRequest` parameter\n * instead of as a `Promise`.\n *\n * @param authTokenRequest - An optional set of values that configure the token request.\n * It contains callbacks to call in case of success/failure\n */\n export function getAuthToken(authTokenRequest?: AuthTokenRequest): void;\n export function getAuthToken(authTokenRequest?: AuthTokenRequest): Promise<string> {\n ensureInitializeCalled();\n return getAuthTokenHelper(authTokenRequest)\n .then((value: string) => {\n if (authTokenRequest && authTokenRequest.successCallback) {\n authTokenRequest.successCallback(value);\n return '';\n }\n return value;\n })\n .catch((err: Error) => {\n if (authTokenRequest && authTokenRequest.failureCallback) {\n authTokenRequest.failureCallback(err.message);\n return '';\n }\n throw err;\n });\n }\n\n function getAuthTokenHelper(authTokenRequest?: AuthTokenRequest): Promise<string> {\n return new Promise<[boolean, string]>((resolve) => {\n resolve(\n sendMessageToParentAsync('authentication.getAuthToken', [\n authTokenRequest?.resources,\n authTokenRequest?.claims,\n authTokenRequest?.silent,\n ]),\n );\n }).then(([success, result]: [boolean, string]) => {\n if (success) {\n return result;\n } else {\n throw new Error(result);\n }\n });\n }\n\n /**\n * @hidden\n * Requests the decoded Azure AD user identity on behalf of the app.\n *\n * @returns Promise that resolves with the {@link UserProfile}.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getUser(): Promise<UserProfile>;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link authentication.getUser authentication.getUser(): Promise\\<UserProfile\\>} instead.\n *\n * @hidden\n * Requests the decoded Azure AD user identity on behalf of the app.\n *\n * @param userRequest - It passes success/failure callbacks in the userRequest object(deprecated)\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getUser(userRequest: UserRequest): void;\n export function getUser(userRequest?: UserRequest): Promise<UserProfile> {\n ensureInitializeCalled();\n return getUserHelper()\n .then((value: UserProfile) => {\n if (userRequest && userRequest.successCallback) {\n userRequest.successCallback(value);\n return null;\n }\n return value;\n })\n .catch((err: Error) => {\n if (userRequest && userRequest.failureCallback) {\n userRequest.failureCallback(err.message);\n return null;\n }\n throw err;\n });\n }\n\n function getUserHelper(): Promise<UserProfile> {\n return new Promise<[boolean, UserProfile | string]>((resolve) => {\n resolve(sendMessageToParentAsync('authentication.getUser'));\n }).then(([success, result]: [boolean, UserProfile | string]) => {\n if (success) {\n return result as UserProfile;\n } else {\n throw new Error(result as string);\n }\n });\n }\n\n function closeAuthenticationWindow(): void {\n // Stop monitoring the authentication window\n stopAuthenticationWindowMonitor();\n // Try to close the authentication window and clear all properties associated with it\n try {\n if (Communication.childWindow) {\n Communication.childWindow.close();\n }\n } finally {\n Communication.childWindow = null;\n Communication.childOrigin = null;\n }\n }\n\n function openAuthenticationWindow(authenticateParameters: AuthenticateParameters): void {\n // Close the previously opened window if we have one\n closeAuthenticationWindow();\n // Start with a sensible default size\n let width = authenticateParameters.width || 600;\n let height = authenticateParameters.height || 400;\n // Ensure that the new window is always smaller than our app's window so that it never fully covers up our app\n width = Math.min(width, Communication.currentWindow.outerWidth - 400);\n height = Math.min(height, Communication.currentWindow.outerHeight - 200);\n // Convert any relative URLs into absolute URLs before sending them over to the parent window\n const link = document.createElement('a');\n link.href = authenticateParameters.url.replace('{oauthRedirectMethod}', 'web');\n // We are running in the browser, so we need to center the new window ourselves\n let left: number =\n typeof Communication.currentWindow.screenLeft !== 'undefined'\n ? Communication.currentWindow.screenLeft\n : Communication.currentWindow.screenX;\n let top: number =\n typeof Communication.currentWindow.screenTop !== 'undefined'\n ? Communication.currentWindow.screenTop\n : Communication.currentWindow.screenY;\n left += Communication.currentWindow.outerWidth / 2 - width / 2;\n top += Communication.currentWindow.outerHeight / 2 - height / 2;\n // Open a child window with a desired set of standard browser features\n Communication.childWindow = Communication.currentWindow.open(\n link.href,\n '_blank',\n 'toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top=' +\n top +\n ', left=' +\n left +\n ', width=' +\n width +\n ', height=' +\n height,\n );\n if (Communication.childWindow) {\n // Start monitoring the authentication window so that we can detect if it gets closed before the flow completes\n startAuthenticationWindowMonitor();\n } else {\n // If we failed to open the window, fail the authentication flow\n handleFailure('FailedToOpenWindow');\n }\n }\n\n function stopAuthenticationWindowMonitor(): void {\n if (authWindowMonitor) {\n clearInterval(authWindowMonitor);\n authWindowMonitor = 0;\n }\n removeHandler('initialize');\n removeHandler('navigateCrossDomain');\n }\n\n function startAuthenticationWindowMonitor(): void {\n // Stop the previous window monitor if one is running\n stopAuthenticationWindowMonitor();\n // Create an interval loop that\n // - Notifies the caller of failure if it detects that the authentication window is closed\n // - Keeps pinging the authentication window while it is open to re-establish\n // contact with any pages along the authentication flow that need to communicate\n // with us\n authWindowMonitor = Communication.currentWindow.setInterval(() => {\n if (!Communication.childWindow || Communication.childWindow.closed) {\n handleFailure('CancelledByUser');\n } else {\n const savedChildOrigin = Communication.childOrigin;\n try {\n Communication.childOrigin = '*';\n sendMessageEventToChild('ping');\n } finally {\n Communication.childOrigin = savedChildOrigin;\n }\n }\n }, 100);\n // Set up an initialize-message handler that gives the authentication window its frame context\n registerHandler('initialize', () => {\n return [FrameContexts.authentication, GlobalVars.hostClientType];\n });\n // Set up a navigateCrossDomain message handler that blocks cross-domain re-navigation attempts\n // in the authentication window. We could at some point choose to implement this method via a call to\n // authenticationWindow.location.href = url; however, we would first need to figure out how to\n // validate the URL against the tab's list of valid domains.\n registerHandler('navigateCrossDomain', () => {\n return false;\n });\n }\n\n /**\n * When using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>}, the\n * window that was opened to execute the authentication flow should call this method after authentiction to notify the caller of\n * {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} that the\n * authentication request was successful.\n *\n * @remarks\n * This function is usable only from the authentication window.\n * This call causes the authentication window to be closed.\n *\n * @param result - Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives\n * this value in its callback or via the `Promise` return value\n * @param callbackUrl - Specifies the url to redirect back to if the client is Win32 Outlook.\n */\n export function notifySuccess(result?: string, callbackUrl?: string): void {\n redirectIfWin32Outlook(callbackUrl, 'result', result);\n ensureInitialized(runtime, FrameContexts.authentication);\n sendMessageToParent('authentication.authenticate.success', [result]);\n // Wait for the message to be sent before closing the window\n waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));\n }\n\n /**\n * When using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>}, the\n * window that was opened to execute the authentication flow should call this method after authentiction to notify the caller of\n * {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} that the\n * authentication request failed.\n\n *\n * @remarks\n * This function is usable only on the authentication window.\n * This call causes the authentication window to be closed.\n *\n * @param result - Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives\n * this value in its callback or via the `Promise` return value\n * @param callbackUrl - Specifies the url to redirect back to if the client is Win32 Outlook.\n */\n export function notifyFailure(reason?: string, callbackUrl?: string): void {\n redirectIfWin32Outlook(callbackUrl, 'reason', reason);\n ensureInitialized(runtime, FrameContexts.authentication);\n sendMessageToParent('authentication.authenticate.failure', [reason]);\n // Wait for the message to be sent before closing the window\n waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));\n }\n\n function handleSuccess(result?: string): void {\n try {\n if (authHandlers) {\n authHandlers.success(result);\n }\n } finally {\n authHandlers = null;\n closeAuthenticationWindow();\n }\n }\n\n function handleFailure(reason?: string): void {\n try {\n if (authHandlers) {\n authHandlers.fail(new Error(reason));\n }\n } finally {\n authHandlers = null;\n closeAuthenticationWindow();\n }\n }\n\n /**\n * Validates that the callbackUrl param is a valid connector url, appends the result/reason and authSuccess/authFailure as URL fragments and redirects the window\n * @param callbackUrl - the connectors url to redirect to\n * @param key - \"result\" in case of success and \"reason\" in case of failure\n * @param value - the value of the passed result/reason parameter\n */\n function redirectIfWin32Outlook(callbackUrl?: string, key?: string, value?: string): void {\n if (callbackUrl) {\n const link = document.createElement('a');\n link.href = decodeURIComponent(callbackUrl);\n if (\n link.host &&\n link.host !== window.location.host &&\n link.host === 'outlook.office.com' &&\n link.search.indexOf('client_type=Win32_Outlook') > -1\n ) {\n if (key && key === 'result') {\n if (value) {\n link.href = updateUrlParameter(link.href, 'result', value);\n }\n Communication.currentWindow.location.assign(updateUrlParameter(link.href, 'authSuccess', ''));\n }\n if (key && key === 'reason') {\n if (value) {\n link.href = updateUrlParameter(link.href, 'reason', value);\n }\n Communication.currentWindow.location.assign(updateUrlParameter(link.href, 'authFailure', ''));\n }\n }\n }\n }\n\n /**\n * Appends either result or reason as a fragment to the 'callbackUrl'\n * @param uri - the url to modify\n * @param key - the fragment key\n * @param value - the fragment value\n */\n function updateUrlParameter(uri: string, key: string, value: string): string {\n const i = uri.indexOf('#');\n let hash = i === -1 ? '#' : uri.substr(i);\n hash = hash + '&' + key + (value !== '' ? '=' + value : '');\n uri = i === -1 ? uri : uri.substr(0, i);\n return uri + hash;\n }\n\n /**\n * @deprecated\n * As of 2.0.0, this interface has been deprecated in favor of leveraging the `Promise` returned from {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>}\n *-------------------------\n * Used in {@link AuthenticateParameters} and {@link AuthTokenRequest}\n */\n export interface LegacyCallBacks {\n /**\n * @deprecated\n * As of 2.0.0, this property has been deprecated in favor of a Promise-based pattern.\n *\n * A function that is called if the request succeeds.\n */\n successCallback?: (result: string) => void;\n /**\n * @deprecated\n * As of 2.0.0, this property has been deprecated in favor of a Promise-based pattern.\n *\n * A function that is called if the request fails, with the reason for the failure.\n */\n failureCallback?: (reason: string) => void;\n }\n\n /**\n * Describes the authentication pop-up parameters\n */\n export interface AuthenticatePopUpParameters {\n /**\n * The URL for the authentication pop-up.\n */\n url: string;\n /**\n * The preferred width for the pop-up. This value can be ignored if outside the acceptable bounds.\n */\n width?: number;\n /**\n * The preferred height for the pop-up. This value can be ignored if outside the acceptable bounds.\n */\n height?: number;\n /**\n * Some identity providers restrict their authentication pages from being displayed in embedded browsers (e.g., a web view inside of a native application)\n * If the identity provider you are using prevents embedded browser usage, this flag should be set to `true` to enable the authentication page specified in\n * the {@link url} property to be opened in an external browser.\n * If this flag is `false`, the page will be opened directly within the current hosting application.\n *\n * This flag is ignored when the host for the application is a web app (as opposed to a native application) as the behavior is unnecessary in a web-only\n * environment without an embedded browser.\n */\n isExternal?: boolean;\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} and\n * the associated {@link AuthenticatePopUpParameters} instead.\n *\n * @see {@link LegacyCallBacks}\n */\n export type AuthenticateParameters = AuthenticatePopUpParameters & LegacyCallBacks;\n\n /**\n * Describes authentication token request parameters\n */\n export interface AuthTokenRequestParameters {\n /**\n * @hidden\n * @internal\n * An list of resources for which to acquire the access token; only for internal Microsoft usage\n */\n resources?: string[];\n /**\n * An optional list of claims which to pass to AAD when requesting the access token.\n */\n claims?: string[];\n /**\n * An optional flag indicating whether to attempt the token acquisition silently or allow a prompt to be shown.\n */\n silent?: boolean;\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link AuthTokenRequestParameters} instead.\n */\n export type AuthTokenRequest = AuthTokenRequestParameters & LegacyCallBacks;\n\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface UserProfile {\n /**\n * @hidden\n * The intended recipient of the token. The application that receives the token must verify that the audience\n * value is correct and reject any tokens intended for a different audience.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n aud: string;\n /**\n * @hidden\n * Identifies how the subject of the token was authenticated.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n amr: string[];\n /**\n * @hidden\n * Stores the time at which the token was issued. It is often used to measure token freshness.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n iat: number;\n /**\n * @hidden\n * Identifies the security token service (STS) that constructs and returns the token. In the tokens that Azure AD\n * returns, the issuer is sts.windows.net. The GUID in the issuer claim value is the tenant ID of the Azure AD\n * directory. The tenant ID is an immutable and reliable identifier of the directory.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n iss: string;\n /**\n * @hidden\n * Provides the last name, surname, or family name of the user as defined in the Azure AD user object.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n family_name: string;\n /**\n * @hidden\n * Provides the first or \"given\" name of the user, as set on the Azure AD user object.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n given_name: string;\n /**\n * @hidden\n * Provides a human-readable value that identifies the subject of the token. This value is not guaranteed to\n * be unique within a tenant and is designed to be used only for display purposes.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n unique_name: string;\n /**\n * @hidden\n * Contains a unique identifier of an object in Azure AD. This value is immutable and cannot be reassigned or\n * reused. Use the object ID to identify an object in queries to Azure AD.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n oid: string;\n /**\n * @hidden\n * Identifies the principal about which the token asserts information, such as the user of an application.\n * This value is immutable and cannot be reassigned or reused, so it can be used to perform authorization\n * checks safely. Because the subject is always present in the tokens the Azure AD issues, we recommended\n * using this value in a general-purpose authorization system.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n sub: string;\n /**\n * @hidden\n * An immutable, non-reusable identifier that identifies the directory tenant that issued the token. You can\n * use this value to access tenant-specific directory resources in a multitenant application. For example,\n * you can use this value to identify the tenant in a call to the Graph API.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n tid: string;\n /**\n * @hidden\n * Defines the end of the time interval within which a token is valid. The service that validates the token\n * should verify that the current date is within the token lifetime; otherwise it should reject the token. The\n * service might allow for up to five minutes beyond the token lifetime to account for any differences in clock\n * time (\"time skew\") between Azure AD and the service.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n exp: number;\n /**\n * @hidden\n * Defines the start of the time interval within which a token is valid. The service that validates the token\n * should verify that the current date is within the token lifetime; otherwise it should reject the token. The\n * service might allow for up to five minutes beyond the token lifetime to account for any differences in clock\n * time (\"time skew\") between Azure AD and the service.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n nbf: number;\n /**\n * @hidden\n * Stores the user name of the user principal.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n upn: string;\n /**\n * @hidden\n * Stores the version number of the token.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n ver: string;\n /**\n * @hidden\n * Stores the data residency of the user.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n dataResidency?: DataResidency;\n }\n\n /**\n * @hidden\n * Limited set of data residencies information exposed to 1P application developers\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum DataResidency {\n /**\n * Public\n */\n Public = 'public',\n\n /**\n * European Union Data Boundary\n */\n EUDB = 'eudb',\n\n /**\n * Other, stored to cover fields that will not be exposed\n */\n Other = 'other',\n }\n\n /**\n * @deprecated\n * As of 2.0.0, this interface has been deprecated in favor of a Promise-based pattern.\n * @hidden\n * Describes the UserRequest. Success callback describes how a successful request is handled.\n * Failure callback describes how a failed request is handled.\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface UserRequest {\n /**\n * A function that is called if the token request succeeds, with the resulting token.\n */\n successCallback?: (user: UserProfile) => void;\n /**\n * A function that is called if the token request fails, with the reason for the failure.\n */\n failureCallback?: (reason: string) => void;\n }\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { sendMessageToParent } from '../internal/communication';\nimport { GlobalVars } from '../internal/globalVars';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { isHostAdaptiveCardSchemaVersionUnsupported } from '../internal/utils';\nimport { DialogDimension, errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport {\n AdaptiveCardDialogInfo,\n BotAdaptiveCardDialogInfo,\n BotUrlDialogInfo,\n DialogInfo,\n DialogSize,\n M365ContentAction,\n TaskInfo,\n UrlDialogInfo,\n} from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * This group of capabilities enables apps to show modal dialogs. There are two primary types of dialogs: URL-based dialogs and [Adaptive Card](https://learn.microsoft.com/adaptive-cards/) dialogs.\n * Both types of dialogs are shown on top of your app, preventing interaction with your app while they are displayed.\n * - URL-based dialogs allow you to specify a URL from which the contents will be shown inside the dialog.\n * - For URL dialogs, use the functions and interfaces in the {@link dialog.url} namespace.\n * - Adaptive Card-based dialogs allow you to provide JSON describing an Adaptive Card that will be shown inside the dialog.\n * - For Adaptive Card dialogs, use the functions and interfaces in the {@link dialog.adaptiveCard} namespace.\n *\n * @remarks Note that dialogs were previously called \"task modules\". While they have been renamed for clarity, the functionality has been maintained.\n * For more details, see [Dialogs](https://learn.microsoft.com/microsoftteams/platform/task-modules-and-cards/what-are-task-modules)\n *\n * @beta\n */\nexport namespace dialog {\n /**\n * Data Structure to represent the SDK response when dialog closes\n *\n * @beta\n */\n export interface ISdkResponse {\n /**\n * Error in case there is a failure before dialog submission\n */\n err?: string;\n\n /**\n * Value provided in the `result` parameter by the dialog when the {@linkcode url.submit} function\n * was called.\n * If the dialog was closed by the user without submitting (e.g., using a control in the corner\n * of the dialog), this value will be `undefined` here.\n */\n result?: string | object;\n }\n\n /**\n * Handler used to receive and process messages sent between a dialog and the app that launched it\n * @beta\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export type PostMessageChannel = (message: any) => void;\n\n /**\n * Handler used for receiving results when a dialog closes, either the value passed by {@linkcode url.submit}\n * or an error if the dialog was closed by the user.\n *\n * @see {@linkcode ISdkResponse}\n *\n * @beta\n */\n export type DialogSubmitHandler = (result: ISdkResponse) => void;\n const storedMessages: string[] = [];\n\n /**\n * @hidden\n * Hide from docs because this function is only used during initialization\n *\n * Adds register handlers for messageForChild upon initialization and only in the tasks FrameContext. {@link FrameContexts.task}\n * Function is called during app initialization\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function initialize(): void {\n registerHandler('messageForChild', handleDialogMessage, false);\n }\n\n function handleDialogMessage(message: string): void {\n if (!GlobalVars.frameContext) {\n // GlobalVars.frameContext is currently not set\n return;\n }\n\n if (GlobalVars.frameContext === FrameContexts.task) {\n storedMessages.push(message);\n } else {\n // Not in task FrameContext, remove 'messageForChild' handler\n removeHandler('messageForChild');\n }\n }\n\n export namespace url {\n /**\n * Allows app to open a url based dialog.\n *\n * @remarks\n * This function cannot be called from inside of a dialog\n *\n * @param urlDialogInfo - An object containing the parameters of the dialog module.\n * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode submit} function or when the user closes the dialog.\n * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.\n *\n * @beta\n */\n export function open(\n urlDialogInfo: UrlDialogInfo,\n submitHandler?: DialogSubmitHandler,\n messageFromChildHandler?: PostMessageChannel,\n ): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (messageFromChildHandler) {\n registerHandler('messageForParent', messageFromChildHandler);\n }\n const dialogInfo: DialogInfo = getDialogInfoFromUrlDialogInfo(urlDialogInfo);\n sendMessageToParent('tasks.startTask', [dialogInfo], (err: string, result: string | object) => {\n submitHandler?.({ err, result });\n removeHandler('messageForParent');\n });\n }\n\n /**\n * Submit the dialog module and close the dialog\n *\n * @remarks\n * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.\n *\n * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it,\n * If this function is called from a dialog while {@link M365ContentAction} is set in the context object by the host, result will be ignored\n *\n * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.\n *\n * @beta\n */\n export function submit(result?: string | object, appIds?: string | string[]): void {\n // FrameContext content should not be here because dialog.submit can be called only from inside of a dialog (FrameContext task)\n // but it's here because Teams mobile incorrectly returns FrameContext.content when calling app.getFrameContext().\n // FrameContexts.content will be removed once the bug is fixed.\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n // Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients\n sendMessageToParent('tasks.completeTask', [result, appIds ? (Array.isArray(appIds) ? appIds : [appIds]) : []]);\n }\n\n /**\n * Send message to the parent from dialog\n *\n * @remarks\n * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.\n *\n * @param message - The message to send to the parent\n *\n * @beta\n */\n export function sendMessageToParentFromDialog(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message: any,\n ): void {\n ensureInitialized(runtime, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n sendMessageToParent('messageForParent', [message]);\n }\n\n /**\n * Send message to the dialog from the parent\n *\n * @param message - The message to send\n *\n * @beta\n */\n export function sendMessageToDialog(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message: any,\n ): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n sendMessageToParent('messageForChild', [message]);\n }\n\n /**\n * Register a listener that will be triggered when a message is received from the app that opened the dialog.\n *\n * @remarks\n * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.\n *\n * @param listener - The listener that will be triggered.\n *\n * @beta\n */\n export function registerOnMessageFromParent(listener: PostMessageChannel): void {\n ensureInitialized(runtime, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n // We need to remove the original 'messageForChild'\n // handler since the original does not allow for post messages.\n // It is replaced by the user specified listener that is passed in.\n removeHandler('messageForChild');\n registerHandler('messageForChild', listener);\n storedMessages.reverse();\n while (storedMessages.length > 0) {\n const message = storedMessages.pop();\n listener(message);\n }\n }\n\n /**\n * Checks if dialog.url module is supported by the host\n *\n * @returns boolean to represent whether dialog.url module is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && (runtime.supports.dialog && runtime.supports.dialog.url) !== undefined;\n }\n\n /**\n * Namespace to open a dialog that sends results to the bot framework\n *\n * @beta\n */\n export namespace bot {\n /**\n * Allows an app to open the dialog module using bot.\n *\n * @param botUrlDialogInfo - An object containing the parameters of the dialog module including completionBotId.\n * @param submitHandler - Handler that triggers when the dialog has been submitted or closed.\n * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.\n *\n * @returns a function that can be used to send messages to the dialog.\n *\n * @beta\n */\n export function open(\n botUrlDialogInfo: BotUrlDialogInfo,\n submitHandler?: DialogSubmitHandler,\n messageFromChildHandler?: PostMessageChannel,\n ): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (messageFromChildHandler) {\n registerHandler('messageForParent', messageFromChildHandler);\n }\n const dialogInfo: DialogInfo = getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo);\n\n sendMessageToParent('tasks.startTask', [dialogInfo], (err: string, result: string | object) => {\n submitHandler?.({ err, result });\n removeHandler('messageForParent');\n });\n }\n\n /**\n * Checks if dialog.url.bot capability is supported by the host\n *\n * @returns boolean to represent whether dialog.url.bot is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return (\n ensureInitialized(runtime) &&\n (runtime.supports.dialog && runtime.supports.dialog.url && runtime.supports.dialog.url.bot) !== undefined\n );\n }\n }\n\n /**\n * @hidden\n *\n * Convert UrlDialogInfo to DialogInfo to send the information to host in {@linkcode open} API.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getDialogInfoFromUrlDialogInfo(urlDialogInfo: UrlDialogInfo): DialogInfo {\n const dialogInfo: DialogInfo = {\n url: urlDialogInfo.url,\n height: urlDialogInfo.size ? urlDialogInfo.size.height : DialogDimension.Small,\n width: urlDialogInfo.size ? urlDialogInfo.size.width : DialogDimension.Small,\n title: urlDialogInfo.title,\n fallbackUrl: urlDialogInfo.fallbackUrl,\n };\n return dialogInfo;\n }\n\n /**\n * @hidden\n *\n * Convert BotUrlDialogInfo to DialogInfo to send the information to host in {@linkcode bot.open} API.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo: BotUrlDialogInfo): DialogInfo {\n const dialogInfo: DialogInfo = getDialogInfoFromUrlDialogInfo(botUrlDialogInfo);\n dialogInfo.completionBotId = botUrlDialogInfo.completionBotId;\n return dialogInfo;\n }\n }\n\n /**\n * This function currently serves no purpose and should not be used. All functionality that used\n * to be covered by this method is now in subcapabilities and those isSupported methods should be\n * used directly.\n *\n * @hidden\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.dialog ? true : false;\n }\n\n /**\n * Namespace to update the dialog\n *\n * @beta\n */\n export namespace update {\n /**\n * Update dimensions - height/width of a dialog.\n *\n * @param dimensions - An object containing width and height properties.\n *\n * @beta\n */\n export function resize(dimensions: DialogSize): void {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.task,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('tasks.updateTask', [dimensions]);\n }\n\n /**\n * Checks if dialog.update capability is supported by the host\n * @returns boolean to represent whether dialog.update capabilty is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.dialog\n ? runtime.supports.dialog.update\n ? true\n : false\n : false;\n }\n }\n\n /**\n * Subcapability for interacting with adaptive card dialogs\n * @beta\n */\n export namespace adaptiveCard {\n /**\n * Allows app to open an adaptive card based dialog.\n *\n * @remarks\n * This function cannot be called from inside of a dialog\n *\n * @param adaptiveCardDialogInfo - An object containing the parameters of the dialog module {@link AdaptiveCardDialogInfo}.\n * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode url.submit} function or when the user closes the dialog.\n *\n * @beta\n */\n export function open(adaptiveCardDialogInfo: AdaptiveCardDialogInfo, submitHandler?: DialogSubmitHandler): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const dialogInfo: DialogInfo = getDialogInfoFromAdaptiveCardDialogInfo(adaptiveCardDialogInfo);\n sendMessageToParent('tasks.startTask', [dialogInfo], (err: string, result: string | object) => {\n submitHandler?.({ err, result });\n });\n }\n\n /**\n * Checks if dialog.adaptiveCard module is supported by the host\n *\n * @returns boolean to represent whether dialog.adaptiveCard module is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n const isAdaptiveCardVersionSupported =\n runtime.hostVersionsInfo &&\n runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&\n !isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);\n return (\n ensureInitialized(runtime) &&\n (isAdaptiveCardVersionSupported && runtime.supports.dialog && runtime.supports.dialog.card) !== undefined\n );\n }\n\n /**\n * Namespace for interaction with adaptive card dialogs that need to communicate with the bot framework\n *\n * @beta\n */\n export namespace bot {\n /**\n * Allows an app to open an adaptive card-based dialog module using bot.\n *\n * @param botAdaptiveCardDialogInfo - An object containing the parameters of the dialog module including completionBotId.\n * @param submitHandler - Handler that triggers when the dialog has been submitted or closed.\n *\n * @beta\n */\n export function open(\n botAdaptiveCardDialogInfo: BotAdaptiveCardDialogInfo,\n submitHandler?: DialogSubmitHandler,\n ): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n const dialogInfo: DialogInfo = getDialogInfoFromBotAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo);\n\n sendMessageToParent('tasks.startTask', [dialogInfo], (err: string, result: string | object) => {\n submitHandler?.({ err, result });\n });\n }\n\n /**\n * Checks if dialog.adaptiveCard.bot capability is supported by the host\n *\n * @returns boolean to represent whether dialog.adaptiveCard.bot is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n const isAdaptiveCardVersionSupported =\n runtime.hostVersionsInfo &&\n runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&\n !isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);\n return (\n ensureInitialized(runtime) &&\n (isAdaptiveCardVersionSupported &&\n runtime.supports.dialog &&\n runtime.supports.dialog.card &&\n runtime.supports.dialog.card.bot) !== undefined\n );\n }\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Convert AdaptiveCardDialogInfo to DialogInfo to send the information to host in {@linkcode adaptiveCard.open} API.\n *\n * @internal\n */\n export function getDialogInfoFromAdaptiveCardDialogInfo(\n adaptiveCardDialogInfo: AdaptiveCardDialogInfo,\n ): DialogInfo {\n const dialogInfo: DialogInfo = {\n card: adaptiveCardDialogInfo.card,\n height: adaptiveCardDialogInfo.size ? adaptiveCardDialogInfo.size.height : DialogDimension.Small,\n width: adaptiveCardDialogInfo.size ? adaptiveCardDialogInfo.size.width : DialogDimension.Small,\n title: adaptiveCardDialogInfo.title,\n };\n return dialogInfo;\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Convert BotAdaptiveCardDialogInfo to DialogInfo to send the information to host in {@linkcode adaptiveCard.open} API.\n *\n * @internal\n */\n export function getDialogInfoFromBotAdaptiveCardDialogInfo(\n botAdaptiveCardDialogInfo: BotAdaptiveCardDialogInfo,\n ): DialogInfo {\n const dialogInfo: DialogInfo = getDialogInfoFromAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo);\n dialogInfo.completionBotId = botAdaptiveCardDialogInfo.completionBotId;\n return dialogInfo;\n }\n\n /**\n * @hidden\n * Converts {@link TaskInfo} to {@link AdaptiveCardDialogInfo}\n * @param taskInfo - TaskInfo object to convert\n * @returns - converted AdaptiveCardDialogInfo\n */\n export function getAdaptiveCardDialogInfoFromTaskInfo(taskInfo: TaskInfo): AdaptiveCardDialogInfo {\n // eslint-disable-next-line strict-null-checks/all\n const adaptiveCardDialogInfo: AdaptiveCardDialogInfo = {\n card: taskInfo.card,\n size: {\n height: taskInfo.height ? taskInfo.height : DialogDimension.Small,\n width: taskInfo.width ? taskInfo.width : DialogDimension.Small,\n },\n title: taskInfo.title,\n };\n\n return adaptiveCardDialogInfo;\n }\n\n /**\n * @hidden\n * Converts {@link TaskInfo} to {@link BotAdaptiveCardDialogInfo}\n * @param taskInfo - TaskInfo object to convert\n * @returns - converted BotAdaptiveCardDialogInfo\n */\n export function getBotAdaptiveCardDialogInfoFromTaskInfo(taskInfo: TaskInfo): BotAdaptiveCardDialogInfo {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const botAdaptiveCardDialogInfo: BotAdaptiveCardDialogInfo = {\n card: taskInfo.card,\n size: {\n height: taskInfo.height ? taskInfo.height : DialogDimension.Small,\n width: taskInfo.width ? taskInfo.width : DialogDimension.Small,\n },\n title: taskInfo.title,\n completionBotId: taskInfo.completionBotId,\n };\n\n return botAdaptiveCardDialogInfo;\n }\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { runtime } from '../public/runtime';\nimport { errorNotSupportedOnPlatform } from './constants';\n\n/**\n * Namespace to interact with the menu-specific part of the SDK.\n * This object is used to show View Configuration, Action Menu and Navigation Bar Menu.\n */\nexport namespace menus {\n /**\n * @hidden\n * Represents information about item in View Configuration.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface ViewConfiguration {\n /**\n * @hidden\n * Unique identifier of view.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n id: string;\n /**\n * @hidden\n * Display title of the view.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n /**\n * @hidden\n * Additional information for accessibility.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n contentDescription?: string;\n }\n\n /**\n * Defines how a menu item should appear in the NavBar.\n */\n export enum DisplayMode {\n /**\n * Only place this item in the NavBar if there's room for it.\n * If there's no room, item is shown in the overflow menu.\n */\n ifRoom = 0,\n /**\n * Never place this item in the NavBar.\n * The item would always be shown in NavBar's overflow menu.\n */\n overflowOnly = 1,\n }\n\n /**\n * @hidden\n * Represents information about menu item for Action Menu and Navigation Bar Menu.\n */\n export class MenuItem {\n /**\n * @hidden\n * Unique identifier for the menu item.\n */\n public id: string;\n /**\n * @hidden\n * Display title of the menu item.\n */\n public title: string;\n /**\n * @hidden\n * Display icon of the menu item. The icon value must be a string having SVG icon content.\n */\n public icon: string;\n /**\n * @hidden\n * Selected state display icon of the menu item. The icon value must be a string having SVG icon content.\n */\n public iconSelected?: string;\n /**\n * @hidden\n * Additional information for accessibility.\n */\n public contentDescription?: string;\n /**\n * @hidden\n * State of the menu item\n */\n public enabled = true;\n /**\n * @hidden\n * Interface to show list of items on selection of menu item.\n */\n public viewData?: ViewData;\n /**\n * @hidden\n * Whether the menu item is selected or not\n */\n public selected = false;\n /**\n * The Display Mode of the menu item.\n * Default Behaviour would be DisplayMode.ifRoom if null.\n * Refer {@link DisplayMode}\n */\n public displayMode?: DisplayMode;\n }\n\n /**\n * @hidden\n * Represents information about view to show on Navigation Bar Menu item selection\n */\n export interface ViewData {\n /**\n * @hidden\n * Display header title of the item list.\n */\n listTitle?: string;\n /**\n * @hidden\n * Type of the menu item.\n */\n listType: MenuListType;\n /**\n * @hidden\n * Array of MenuItem. Icon value will be required for all items in the list.\n */\n listItems: MenuItem[];\n }\n\n /**\n * @hidden\n * Represents information about type of list to display in Navigation Bar Menu.\n */\n export enum MenuListType {\n dropDown = 'dropDown',\n popOver = 'popOver',\n }\n let navBarMenuItemPressHandler: ((id: string) => boolean) | undefined;\n let actionMenuItemPressHandler: ((id: string) => boolean) | undefined;\n let viewConfigItemPressHandler: ((id: string) => boolean) | undefined;\n\n export function initialize(): void {\n registerHandler('navBarMenuItemPress', handleNavBarMenuItemPress, false);\n registerHandler('actionMenuItemPress', handleActionMenuItemPress, false);\n registerHandler('setModuleView', handleViewConfigItemPress, false);\n }\n\n /**\n * @hidden\n * Registers list of view configurations and it's handler.\n * Handler is responsible for listening selection of View Configuration.\n *\n * @param viewConfig - List of view configurations. Minimum 1 value is required.\n * @param handler - The handler to invoke when the user selects view configuration.\n */\n export function setUpViews(viewConfig: ViewConfiguration[], handler: (id: string) => boolean): void {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n viewConfigItemPressHandler = handler;\n sendMessageToParent('setUpViews', [viewConfig]);\n }\n\n function handleViewConfigItemPress(id: string): void {\n if (!viewConfigItemPressHandler || !viewConfigItemPressHandler(id)) {\n ensureInitialized(runtime);\n sendMessageToParent('viewConfigItemPress', [id]);\n }\n }\n\n /**\n * @hidden\n * Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.\n *\n * @param items List of MenuItems for Navigation Bar Menu.\n * @param handler The handler to invoke when the user selects menu item.\n */\n export function setNavBarMenu(items: MenuItem[], handler: (id: string) => boolean): void {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n navBarMenuItemPressHandler = handler;\n sendMessageToParent('setNavBarMenu', [items]);\n }\n\n function handleNavBarMenuItemPress(id: string): void {\n if (!navBarMenuItemPressHandler || !navBarMenuItemPressHandler(id)) {\n ensureInitialized(runtime);\n sendMessageToParent('handleNavBarMenuItemPress', [id]);\n }\n }\n\n export interface ActionMenuParameters {\n /**\n * @hidden\n * Display title for Action Menu\n */\n title: string;\n /**\n * @hidden\n * List of MenuItems for Action Menu\n */\n items: MenuItem[];\n }\n\n /**\n * @hidden\n * Used to show Action Menu.\n *\n * @param params - Parameters for Menu Parameters\n * @param handler - The handler to invoke when the user selects menu item.\n */\n export function showActionMenu(params: ActionMenuParameters, handler: (id: string) => boolean): void {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n actionMenuItemPressHandler = handler;\n sendMessageToParent('showActionMenu', [params]);\n }\n\n function handleActionMenuItemPress(id: string): void {\n if (!actionMenuItemPressHandler || !actionMenuItemPressHandler(id)) {\n ensureInitialized(runtime);\n sendMessageToParent('handleActionMenuItemPress', [id]);\n }\n }\n\n /**\n * Checks if the menus capability is supported by the host\n * @returns boolean to represent whether the menus capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.menus ? true : false;\n }\n}\n","import { GlobalVars } from '../internal/globalVars';\nimport * as Handlers from '../internal/handlers'; // Conflict with some names\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform } from './constants';\nimport { LoadContext } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Namespace containing the set of APIs that support Teams-specific functionalities.\n */\n\nexport namespace teamsCore {\n /**\n * Enable print capability to support printing page using Ctrl+P and cmd+P\n */\n export function enablePrintCapability(): void {\n if (!GlobalVars.printCapabilityEnabled) {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n GlobalVars.printCapabilityEnabled = true;\n // adding ctrl+P and cmd+P handler\n document.addEventListener('keydown', (event: KeyboardEvent) => {\n if ((event.ctrlKey || event.metaKey) && event.keyCode === 80) {\n print();\n event.cancelBubble = true;\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n });\n }\n }\n\n /**\n * default print handler\n */\n export function print(): void {\n if (typeof window !== 'undefined') {\n window.print();\n } else {\n // This codepath only exists to enable compilation in a server-side redered environment. In standard usage, the window object should never be undefined so this code path should never run.\n // If this error has actually been thrown, something has gone very wrong and it is a bug\n throw new Error('window object undefined at print call');\n }\n }\n\n /**\n * Registers a handler to be called when the page has been requested to load.\n *\n * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)\n * for a more detailed explanation about using this API.\n *\n * @param handler - The handler to invoke when the page is loaded.\n *\n * @beta\n */\n export function registerOnLoadHandler(handler: (context: LoadContext) => void): void {\n registerOnLoadHandlerHelper(handler, () => {\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerOnLoadHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param handler - The handler to invoke when the page is loaded.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerOnLoadHandlerHelper(\n handler: (context: LoadContext) => void,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime);\n\n if (handler && versionSpecificHelper) {\n versionSpecificHelper();\n }\n\n Handlers.registerOnLoadHandler(handler);\n }\n\n /**\n * Registers a handler to be called before the page is unloaded.\n *\n * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)\n * for a more detailed explanation about using this API.\n *\n * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should\n * invoke the readyToUnload function provided to it once it's ready to be unloaded.\n *\n * @beta\n */\n export function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void {\n registerBeforeUnloadHandlerHelper(handler, () => {\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerBeforeUnloadHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param handler - - The handler to invoke before the page is unloaded. If this handler returns true the page should\n * invoke the readyToUnload function provided to it once it's ready to be unloaded.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerBeforeUnloadHandlerHelper(\n handler: (readyToUnload: () => void) => boolean,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime);\n if (handler && versionSpecificHelper) {\n versionSpecificHelper();\n }\n Handlers.registerBeforeUnloadHandler(handler);\n }\n\n /**\n * Checks if teamsCore capability is supported by the host\n *\n * @returns boolean to represent whether the teamsCore capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.teamsCore ? true : false;\n }\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport {\n Communication,\n initializeCommunication,\n sendAndHandleStatusAndReason as send,\n sendAndUnwrap,\n sendMessageToParent,\n uninitializeCommunication,\n} from '../internal/communication';\nimport { defaultSDKVersionForCompatCheck } from '../internal/constants';\nimport { GlobalVars } from '../internal/globalVars';\nimport * as Handlers from '../internal/handlers'; // Conflict with some names\nimport { ensureInitializeCalled, ensureInitialized, processAdditionalValidOrigins } from '../internal/internalAPIs';\nimport { getLogger } from '../internal/telemetry';\nimport { compareSDKVersions, runWithTimeout } from '../internal/utils';\nimport { logs } from '../private/logs';\nimport { authentication } from './authentication';\nimport { ChannelType, FrameContexts, HostClientType, HostName, TeamType, UserTeamRole } from './constants';\nimport { dialog } from './dialog';\nimport { ActionInfo, Context as LegacyContext, FileOpenPreference, LocaleInfo } from './interfaces';\nimport { menus } from './menus';\nimport { pages } from './pages';\nimport { applyRuntimeConfig, generateBackCompatRuntimeConfig, IBaseRuntime, runtime } from './runtime';\nimport { teamsCore } from './teamsAPIs';\nimport { version } from './version';\n\n/**\n * Namespace to interact with app initialization and lifecycle.\n */\nexport namespace app {\n const appLogger = getLogger('app');\n\n // ::::::::::::::::::::::: MicrosoftTeams client SDK public API ::::::::::::::::::::\n\n export const Messages = {\n AppLoaded: 'appInitialization.appLoaded',\n Success: 'appInitialization.success',\n Failure: 'appInitialization.failure',\n ExpectedFailure: 'appInitialization.expectedFailure',\n };\n\n /**\n * Describes errors that caused app initialization to fail\n */\n export enum FailedReason {\n /**\n * Authentication failed\n */\n AuthFailed = 'AuthFailed',\n /**\n * The application timed out\n */\n Timeout = 'Timeout',\n /**\n * The app failed for a different reason\n */\n Other = 'Other',\n }\n\n /**\n * Describes expected errors that occurred during an otherwise successful\n * app initialization\n */\n export enum ExpectedFailureReason {\n /**\n * There was a permission error\n */\n PermissionError = 'PermissionError',\n /**\n * The item was not found\n */\n NotFound = 'NotFound',\n /**\n * The network is currently throttled\n */\n Throttling = 'Throttling',\n /**\n * The application is currently offline\n */\n Offline = 'Offline',\n /**\n * The app failed for a different reason\n */\n Other = 'Other',\n }\n\n /**\n * Represents the failed request sent during a failed app initialization.\n */\n export interface IFailedRequest {\n /**\n * The reason for the failure\n */\n reason: FailedReason;\n /**\n * This property is currently unused.\n */\n message?: string;\n }\n\n /**\n * Represents the failure request sent during an erroneous app initialization.\n */\n export interface IExpectedFailureRequest {\n /**\n * The reason for the failure\n */\n reason: ExpectedFailureReason;\n /**\n * A message that describes the failure\n */\n message?: string;\n }\n\n /**\n * Represents application information.\n */\n export interface AppInfo {\n /**\n * The current locale that the user has configured for the app formatted as\n * languageId-countryId (for example, en-us).\n */\n locale: string;\n\n /**\n * The current UI theme of the host. Possible values: \"default\", \"dark\", or \"contrast\".\n */\n theme: string;\n\n /**\n * Unique ID for the current session for use in correlating telemetry data.\n */\n sessionId: string;\n\n /**\n * Info of the host\n */\n host: AppHostInfo;\n\n /**\n * More detailed locale info from the user's OS if available. Can be used together with\n * the @microsoft/globe NPM package to ensure your app respects the user's OS date and\n * time format configuration\n */\n osLocaleInfo?: LocaleInfo;\n /**\n * Personal app icon y coordinate position\n */\n iconPositionVertical?: number;\n\n /**\n * Time when the user clicked on the tab\n */\n userClickTime?: number;\n\n /**\n * The ID of the parent message from which this task module was launched.\n * This is only available in task modules launched from bot cards.\n */\n parentMessageId?: string;\n\n /**\n * Where the user prefers the file to be opened from by default during file open\n */\n userFileOpenPreference?: FileOpenPreference;\n\n /**\n * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data.\n */\n appLaunchId?: string;\n }\n\n /**\n * Represents information about the application's host.\n */\n export interface AppHostInfo {\n /**\n * Identifies which host is running your app\n */\n name: HostName;\n\n /**\n * The client type on which the host is running\n */\n clientType: HostClientType;\n\n /**\n * Unique ID for the current Host session for use in correlating telemetry data.\n */\n sessionId: string;\n\n /**\n * Current ring ID\n */\n ringId?: string;\n }\n\n /**\n * Represents Channel information.\n */\n export interface ChannelInfo {\n /**\n * The Microsoft Teams ID for the channel with which the content is associated.\n */\n id: string;\n\n /**\n * The name for the channel with which the content is associated.\n */\n displayName?: string;\n\n /**\n * The relative path to the SharePoint folder associated with the channel.\n */\n relativeUrl?: string;\n\n /**\n * The type of the channel with which the content is associated.\n */\n membershipType?: ChannelType;\n\n /**\n * The OneNote section ID that is linked to the channel.\n */\n defaultOneNoteSectionId?: string;\n\n /**\n * The tenant ID of the team which owns the channel.\n */\n ownerTenantId?: string;\n\n /**\n * The AAD group ID of the team which owns the channel.\n */\n ownerGroupId?: string;\n }\n\n /**\n * Represents Chat information.\n */\n export interface ChatInfo {\n /**\n * The Microsoft Teams ID for the chat with which the content is associated.\n */\n id: string;\n }\n\n /**\n * Represents Meeting information.\n */\n export interface MeetingInfo {\n /**\n * Meeting Id used by tab when running in meeting context\n */\n id: string;\n }\n\n /**\n * Represents Page information.\n */\n export interface PageInfo {\n /**\n * The developer-defined unique ID for the page this content points to.\n */\n id: string;\n\n /**\n * The context where page url is loaded (content, task, setting, remove, sidePanel)\n */\n frameContext: FrameContexts;\n\n /**\n * The developer-defined unique ID for the sub-page this content points to.\n * This field should be used to restore to a specific state within a page,\n * such as scrolling to or activating a specific piece of content.\n */\n subPageId?: string;\n\n /**\n * Indication whether the page is in full-screen mode.\n */\n isFullScreen?: boolean;\n\n /**\n * Indication whether the page is in a pop out window\n */\n isMultiWindow?: boolean;\n\n /**\n * Source origin from where the page is opened\n */\n sourceOrigin?: string;\n }\n\n /**\n * Represents Team information.\n */\n export interface TeamInfo {\n /**\n * The Microsoft Teams ID for the team with which the content is associated.\n */\n internalId: string;\n\n /**\n * The name for the team with which the content is associated.\n */\n displayName?: string;\n\n /**\n * The type of the team.\n */\n type?: TeamType;\n\n /**\n * The Office 365 group ID for the team with which the content is associated.\n * This field is available only when the identity permission is requested in the manifest.\n */\n groupId?: string;\n\n /**\n * Indicates whether team is archived.\n * Apps should use this as a signal to prevent any changes to content associated with archived teams.\n */\n isArchived?: boolean;\n\n /**\n * Team Template ID if there was a Team Template associated with the creation of the team.\n */\n templateId?: string;\n\n /**\n * The user's role in the team.\n\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to the user's role, and never as proof of her role.\n */\n userRole?: UserTeamRole;\n }\n\n /**\n * Represents User information.\n */\n export interface UserInfo {\n /**\n * The Azure AD object id of the current user.\n *\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a optimization hint as to who the user is and never as proof of identity.\n * Specifically, this value should never be used to determine if a user is authorized to access\n * a resource; access tokens should be used for that.\n * See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.\n *\n * This field is available only when the identity permission is requested in the manifest.\n */\n id: string;\n\n /**\n * The address book name of the current user.\n */\n displayName?: string;\n\n /**\n * Represents whether calling is allowed for the current logged in User\n */\n isCallingAllowed?: boolean;\n\n /**\n * Represents whether PSTN calling is allowed for the current logged in User\n */\n isPSTNCallingAllowed?: boolean;\n\n /**\n * The license type for the current user. Possible values are:\n * \"Unknown\", \"Teacher\", \"Student\", \"Free\", \"SmbBusinessVoice\", \"SmbNonVoice\", \"FrontlineWorker\", \"Anonymous\"\n */\n licenseType?: string;\n\n /**\n * A value suitable for use when providing a login_hint to Azure Active Directory for authentication purposes.\n * See [Provide optional claims to your app](https://learn.microsoft.com/azure/active-directory/develop/active-directory-optional-claims#v10-and-v20-optional-claims-set)\n * for more information about the use of login_hint\n *\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a optimization hint as to who the user is and never as proof of identity.\n * Specifically, this value should never be used to determine if a user is authorized to access\n * a resource; access tokens should be used for that.\n * See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.\n */\n loginHint?: string;\n\n /**\n * The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users).\n\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a optimization hint as to who the user is and never as proof of identity.\n * Specifically, this value should never be used to determine if a user is authorized to access\n * a resource; access tokens should be used for that.\n * See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.\n */\n userPrincipalName?: string;\n\n /**\n * The tenant related info of the current user.\n */\n tenant?: TenantInfo;\n }\n\n /**\n * Represents Tenant information.\n */\n export interface TenantInfo {\n /**\n * The Azure AD tenant ID of the current user.\n\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a optimization hint as to who the user is and never as proof of identity.\n * Specifically, this value should never be used to determine if a user is authorized to access\n * a resource; access tokens should be used for that.\n * See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.\n */\n id: string;\n\n /**\n * The type of license for the current users tenant.\n */\n teamsSku?: string;\n }\n\n export interface SharePointSiteInfo {\n /**\n * The root SharePoint site associated with the team.\n */\n teamSiteUrl?: string;\n\n /**\n * The domain of the root SharePoint site associated with the team.\n */\n teamSiteDomain?: string;\n\n /**\n * The relative path to the SharePoint site associated with the team.\n */\n teamSitePath?: string;\n\n /**\n * Teamsite ID, aka sharepoint site id.\n */\n teamSiteId?: string;\n\n /**\n * The SharePoint my site domain associated with the user.\n */\n mySiteDomain?: string;\n\n /**\n * The SharePoint relative path to the current users mysite\n */\n mySitePath?: string;\n }\n\n /**\n * Represents structure of the received context message.\n */\n export interface Context {\n /**\n * Content Action Info\n *\n * @beta\n */\n actionInfo?: ActionInfo;\n /**\n * Properties about the current session for your app\n */\n app: AppInfo;\n\n /**\n * Info about the current page context hosting your app\n */\n page: PageInfo;\n\n /**\n * Info about the currently logged in user running the app.\n * If the current user is not logged in/authenticated (e.g. a meeting app running for an anonymously-joined partcipant) this will be `undefined`.\n */\n user?: UserInfo;\n\n /**\n * When running in the context of a Teams channel, provides information about the channel, else `undefined`\n */\n channel?: ChannelInfo;\n\n /**\n * When running in the context of a Teams chat, provides information about the chat, else `undefined`\n */\n chat?: ChatInfo;\n\n /**\n * When running in the context of a Teams meeting, provides information about the meeting, else `undefined`\n */\n meeting?: MeetingInfo;\n\n /**\n * When hosted in SharePoint, this is the [SharePoint PageContext](https://learn.microsoft.com/javascript/api/sp-page-context/pagecontext?view=sp-typescript-latest), else `undefined`\n */\n sharepoint?: any;\n\n /**\n * When running in Teams for an organization with a tenant, provides information about the SharePoint site associated with the team.\n * Will be `undefined` when not running in Teams for an organization with a tenant.\n */\n sharePointSite?: SharePointSiteInfo;\n\n /**\n * When running in Teams, provides information about the Team context in which your app is running.\n * Will be `undefined` when not running in Teams.\n */\n team?: TeamInfo;\n }\n\n /**\n * Checks whether the Teams client SDK has been initialized.\n * @returns whether the Teams client SDK has been initialized.\n */\n export function isInitialized(): boolean {\n return GlobalVars.initializeCompleted;\n }\n\n /**\n * Gets the Frame Context that the App is running in. See {@link FrameContexts} for the list of possible values.\n * @returns the Frame Context.\n */\n export function getFrameContext(): FrameContexts {\n return GlobalVars.frameContext;\n }\n\n /**\n * Number of milliseconds we'll give the initialization call to return before timing it out\n */\n const initializationTimeoutInMs = 5000;\n\n /**\n * Initializes the library.\n *\n * @remarks\n * Initialize must have completed successfully (as determined by the resolved Promise) before any other library calls are made\n *\n * @param validMessageOrigins - Optionally specify a list of cross frame message origins. They must have\n * https: protocol otherwise they will be ignored. Example: https://www.example.com\n * @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out\n */\n export function initialize(validMessageOrigins?: string[]): Promise<void> {\n if (!inServerSideRenderingEnvironment()) {\n return runWithTimeout(\n () => initializeHelper(validMessageOrigins),\n initializationTimeoutInMs,\n new Error('SDK initialization timed out.'),\n );\n } else {\n const initializeLogger = appLogger.extend('initialize');\n // This log statement should NEVER actually be written. This code path exists only to enable compilation in server-side rendering environments.\n // If you EVER see this statement in ANY log file, something has gone horribly wrong and a bug needs to be filed.\n initializeLogger('window object undefined at initialization');\n return Promise.resolve();\n }\n }\n\n const initializeHelperLogger = appLogger.extend('initializeHelper');\n function initializeHelper(validMessageOrigins?: string[]): Promise<void> {\n return new Promise<void>((resolve) => {\n // Independent components might not know whether the SDK is initialized so might call it to be safe.\n // Just no-op if that happens to make it easier to use.\n if (!GlobalVars.initializeCalled) {\n GlobalVars.initializeCalled = true;\n\n Handlers.initializeHandlers();\n GlobalVars.initializePromise = initializeCommunication(validMessageOrigins).then(\n ({ context, clientType, runtimeConfig, clientSupportedSDKVersion = defaultSDKVersionForCompatCheck }) => {\n GlobalVars.frameContext = context;\n GlobalVars.hostClientType = clientType;\n GlobalVars.clientSupportedSDKVersion = clientSupportedSDKVersion;\n // Temporary workaround while the Host is updated with the new argument order.\n // For now, we might receive any of these possibilities:\n // - `runtimeConfig` in `runtimeConfig` and `clientSupportedSDKVersion` in `clientSupportedSDKVersion`.\n // - `runtimeConfig` in `clientSupportedSDKVersion` and `clientSupportedSDKVersion` in `runtimeConfig`.\n // - `clientSupportedSDKVersion` in `runtimeConfig` and no `clientSupportedSDKVersion`.\n // This code supports any of these possibilities\n\n // Teams AppHost won't provide this runtime config\n // so we assume that if we don't have it, we must be running in Teams.\n // After Teams updates its client code, we can remove this default code.\n try {\n initializeHelperLogger('Parsing %s', runtimeConfig);\n const givenRuntimeConfig: IBaseRuntime | null = JSON.parse(runtimeConfig);\n initializeHelperLogger('Checking if %o is a valid runtime object', givenRuntimeConfig ?? 'null');\n // Check that givenRuntimeConfig is a valid instance of IBaseRuntime\n if (!givenRuntimeConfig || !givenRuntimeConfig.apiVersion) {\n throw new Error('Received runtime config is invalid');\n }\n runtimeConfig && applyRuntimeConfig(givenRuntimeConfig);\n } catch (e) {\n if (e instanceof SyntaxError) {\n try {\n initializeHelperLogger('Attempting to parse %s as an SDK version', runtimeConfig);\n // if the given runtime config was actually meant to be a SDK version, store it as such.\n // TODO: This is a temporary workaround to allow Teams to store clientSupportedSDKVersion even when\n // it doesn't provide the runtimeConfig. After Teams updates its client code, we should\n // remove this feature.\n if (!isNaN(compareSDKVersions(runtimeConfig, defaultSDKVersionForCompatCheck))) {\n GlobalVars.clientSupportedSDKVersion = runtimeConfig;\n }\n const givenRuntimeConfig: IBaseRuntime | null = JSON.parse(clientSupportedSDKVersion);\n initializeHelperLogger('givenRuntimeConfig parsed to %o', givenRuntimeConfig ?? 'null');\n\n if (!givenRuntimeConfig) {\n throw new Error(\n 'givenRuntimeConfig string was successfully parsed. However, it parsed to value of null',\n );\n } else {\n applyRuntimeConfig(givenRuntimeConfig);\n }\n } catch (e) {\n if (e instanceof SyntaxError) {\n applyRuntimeConfig(generateBackCompatRuntimeConfig(GlobalVars.clientSupportedSDKVersion));\n } else {\n throw e;\n }\n }\n } else {\n // If it's any error that's not a JSON parsing error, we want the program to fail.\n throw e;\n }\n }\n\n GlobalVars.initializeCompleted = true;\n },\n );\n\n authentication.initialize();\n menus.initialize();\n pages.config.initialize();\n dialog.initialize();\n }\n\n // Handle additional valid message origins if specified\n if (Array.isArray(validMessageOrigins)) {\n processAdditionalValidOrigins(validMessageOrigins);\n }\n\n resolve(GlobalVars.initializePromise);\n });\n }\n\n /**\n * @hidden\n * Undocumented function used to set a mock window for unit tests\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function _initialize(hostWindow: any): void {\n Communication.currentWindow = hostWindow;\n }\n\n /**\n * @hidden\n * Undocumented function used to clear state between unit tests\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function _uninitialize(): void {\n if (!GlobalVars.initializeCalled) {\n return;\n }\n\n if (GlobalVars.frameContext) {\n /* eslint-disable strict-null-checks/all */ /* Fix tracked by 5730662 */\n registerOnThemeChangeHandler(null);\n pages.backStack.registerBackButtonHandler(null);\n pages.registerFullScreenHandler(null);\n teamsCore.registerBeforeUnloadHandler(null);\n teamsCore.registerOnLoadHandler(null);\n logs.registerGetLogHandler(null); /* Fix tracked by 5730662 */\n /* eslint-enable strict-null-checks/all */\n }\n\n if (GlobalVars.frameContext === FrameContexts.settings) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n pages.config.registerOnSaveHandler(null);\n }\n\n if (GlobalVars.frameContext === FrameContexts.remove) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n pages.config.registerOnRemoveHandler(null);\n }\n\n GlobalVars.initializeCalled = false;\n GlobalVars.initializeCompleted = false;\n GlobalVars.initializePromise = null;\n GlobalVars.additionalValidOrigins = [];\n GlobalVars.frameContext = null;\n GlobalVars.hostClientType = null;\n GlobalVars.isFramelessWindow = false;\n\n uninitializeCommunication();\n }\n\n /**\n * Retrieves the current context the frame is running in.\n *\n * @returns Promise that will resolve with the {@link app.Context} object.\n */\n export function getContext(): Promise<app.Context> {\n return new Promise<LegacyContext>((resolve) => {\n ensureInitializeCalled();\n resolve(sendAndUnwrap('getContext'));\n }).then((legacyContext) => transformLegacyContextToAppContext(legacyContext)); // converts globalcontext to app.context\n }\n\n /**\n * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.\n */\n export function notifyAppLoaded(): void {\n ensureInitializeCalled();\n sendMessageToParent(Messages.AppLoaded, [version]);\n }\n\n /**\n * Notifies the frame that app initialization is successful and is ready for user interaction.\n */\n export function notifySuccess(): void {\n ensureInitializeCalled();\n sendMessageToParent(Messages.Success, [version]);\n }\n\n /**\n * Notifies the frame that app initialization has failed and to show an error page in its place.\n *\n * @param appInitializationFailedRequest - The failure request containing the reason for why the app failed\n * during initialization as well as an optional message.\n */\n export function notifyFailure(appInitializationFailedRequest: IFailedRequest): void {\n ensureInitializeCalled();\n sendMessageToParent(Messages.Failure, [\n appInitializationFailedRequest.reason,\n appInitializationFailedRequest.message,\n ]);\n }\n\n /**\n * Notifies the frame that app initialized with some expected errors.\n *\n * @param expectedFailureRequest - The expected failure request containing the reason and an optional message\n */\n export function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void {\n ensureInitializeCalled();\n sendMessageToParent(Messages.ExpectedFailure, [expectedFailureRequest.reason, expectedFailureRequest.message]);\n }\n\n /**\n * Registers a handler for theme changes.\n *\n * @remarks\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the user changes their theme.\n */\n export function registerOnThemeChangeHandler(handler: (theme: string) => void): void {\n // allow for registration cleanup even when not called initialize\n handler && ensureInitializeCalled();\n Handlers.registerOnThemeChangeHandler(handler);\n }\n\n /**\n * open link API.\n *\n * @param deepLink - deep link.\n * @returns Promise that will be fulfilled when the operation has completed\n */\n export function openLink(deepLink: string): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n resolve(send('executeDeepLink', deepLink));\n });\n }\n}\n\n/**\n * @hidden\n * Transforms the Legacy Context object received from Messages to the structured app.Context object\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction transformLegacyContextToAppContext(legacyContext: LegacyContext): app.Context {\n const context: app.Context = {\n actionInfo: legacyContext.actionInfo,\n app: {\n locale: legacyContext.locale,\n sessionId: legacyContext.appSessionId ? legacyContext.appSessionId : '',\n theme: legacyContext.theme ? legacyContext.theme : 'default',\n iconPositionVertical: legacyContext.appIconPosition,\n osLocaleInfo: legacyContext.osLocaleInfo,\n parentMessageId: legacyContext.parentMessageId,\n userClickTime: legacyContext.userClickTime,\n userFileOpenPreference: legacyContext.userFileOpenPreference,\n host: {\n name: legacyContext.hostName ? legacyContext.hostName : HostName.teams,\n clientType: legacyContext.hostClientType ? legacyContext.hostClientType : HostClientType.web,\n sessionId: legacyContext.sessionId ? legacyContext.sessionId : '',\n ringId: legacyContext.ringId,\n },\n appLaunchId: legacyContext.appLaunchId,\n },\n page: {\n id: legacyContext.entityId,\n frameContext: legacyContext.frameContext ? legacyContext.frameContext : GlobalVars.frameContext,\n subPageId: legacyContext.subEntityId,\n isFullScreen: legacyContext.isFullScreen,\n isMultiWindow: legacyContext.isMultiWindow,\n sourceOrigin: legacyContext.sourceOrigin,\n },\n user: {\n id: legacyContext.userObjectId,\n displayName: legacyContext.userDisplayName,\n isCallingAllowed: legacyContext.isCallingAllowed,\n isPSTNCallingAllowed: legacyContext.isPSTNCallingAllowed,\n licenseType: legacyContext.userLicenseType,\n loginHint: legacyContext.loginHint,\n userPrincipalName: legacyContext.userPrincipalName,\n tenant: legacyContext.tid\n ? {\n id: legacyContext.tid,\n teamsSku: legacyContext.tenantSKU,\n }\n : undefined,\n },\n channel: legacyContext.channelId\n ? {\n id: legacyContext.channelId,\n displayName: legacyContext.channelName,\n relativeUrl: legacyContext.channelRelativeUrl,\n membershipType: legacyContext.channelType,\n defaultOneNoteSectionId: legacyContext.defaultOneNoteSectionId,\n ownerGroupId: legacyContext.hostTeamGroupId,\n ownerTenantId: legacyContext.hostTeamTenantId,\n }\n : undefined,\n chat: legacyContext.chatId\n ? {\n id: legacyContext.chatId,\n }\n : undefined,\n meeting: legacyContext.meetingId\n ? {\n id: legacyContext.meetingId,\n }\n : undefined,\n sharepoint: legacyContext.sharepoint,\n team: legacyContext.teamId\n ? {\n internalId: legacyContext.teamId,\n displayName: legacyContext.teamName,\n type: legacyContext.teamType,\n groupId: legacyContext.groupId,\n templateId: legacyContext.teamTemplateId,\n isArchived: legacyContext.isTeamArchived,\n userRole: legacyContext.userTeamRole,\n }\n : undefined,\n sharePointSite:\n legacyContext.teamSiteUrl ||\n legacyContext.teamSiteDomain ||\n legacyContext.teamSitePath ||\n legacyContext.mySitePath ||\n legacyContext.mySiteDomain\n ? {\n teamSiteUrl: legacyContext.teamSiteUrl,\n teamSiteDomain: legacyContext.teamSiteDomain,\n teamSitePath: legacyContext.teamSitePath,\n teamSiteId: legacyContext.teamSiteId,\n mySitePath: legacyContext.mySitePath,\n mySiteDomain: legacyContext.mySiteDomain,\n }\n : undefined,\n };\n\n return context;\n}\n\nfunction inServerSideRenderingEnvironment(): boolean {\n return typeof window === 'undefined';\n}\n","import {\n Communication,\n sendAndHandleSdkError,\n sendAndHandleStatusAndReason as send,\n sendAndHandleStatusAndReasonWithDefaultError as sendAndDefaultError,\n sendAndUnwrap,\n sendMessageEventToChild,\n sendMessageToParent,\n} from '../internal/communication';\nimport { registerHandler, registerHandlerHelper } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { createTeamsAppLink } from '../internal/utils';\nimport { app } from './app';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { FrameInfo, ShareDeepLinkParameters, TabInformation, TabInstance, TabInstanceParameters } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Navigation-specific part of the SDK.\n */\nexport namespace pages {\n /**\n * Return focus to the host. Will move focus forward or backward based on where the application container falls in\n * the F6/tab order in the host.\n * On mobile hosts or hosts where there is no keyboard interaction or UI notion of \"focus\" this function has no\n * effect and will be a no-op when called.\n * @param navigateForward - Determines the direction to focus in host.\n */\n export function returnFocus(navigateForward?: boolean): void {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('returnFocus', [navigateForward]);\n }\n\n /**\n * @hidden\n *\n * Registers a handler for specifying focus when it passes from the host to the application.\n * On mobile hosts or hosts where there is no UI notion of \"focus\" the handler registered with\n * this function will never be called.\n *\n * @param handler - The handler for placing focus within the application.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void {\n registerHandlerHelper('focusEnter', handler, [], () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * Sets/Updates the current frame with new information\n *\n * @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the\n * user clicks 'Go To Website'\n */\n export function setCurrentFrame(frameInfo: FrameInfo): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('setFrameContext', [frameInfo]);\n }\n\n /**\n * Initializes the library with context information for the frame\n *\n * @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the\n * user clicks 'Go To Website'\n * @param callback - An optional callback that is executed once the application has finished initialization.\n * @param validMessageOrigins - An optional list of cross-frame message origins. They must have\n * https: protocol otherwise they will be ignored. Example: https:www.example.com\n */\n export function initializeWithFrameContext(\n frameInfo: FrameInfo,\n callback?: () => void,\n validMessageOrigins?: string[],\n ): void {\n app.initialize(validMessageOrigins).then(() => callback && callback());\n setCurrentFrame(frameInfo);\n }\n\n /**\n * Defines the configuration of the current or desired instance\n */\n export interface InstanceConfig {\n /**\n * A suggested display name for the new content.\n * In the settings for an existing instance being updated, this call has no effect.\n */\n suggestedDisplayName?: string;\n /**\n * Sets the URL to use for the content of this instance.\n */\n contentUrl: string;\n /**\n * Sets the URL for the removal configuration experience.\n */\n removeUrl?: string;\n /**\n * Sets the URL to use for the external link to view the underlying resource in a browser.\n */\n websiteUrl?: string;\n /**\n * The developer-defined unique ID for the entity to which this content points.\n */\n entityId?: string;\n }\n\n /**\n * Gets the config for the current instance.\n * @returns Promise that resolves with the {@link InstanceConfig} object.\n */\n export function getConfig(): Promise<InstanceConfig> {\n return new Promise<InstanceConfig>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.sidePanel,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndUnwrap('settings.getSettings'));\n });\n }\n\n /**\n * Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the\n * valid domains specified in the validDomains block of the manifest; otherwise, an exception will be\n * thrown. This function needs to be used only when navigating the frame to a URL in a different domain\n * than the current one in a way that keeps the application informed of the change and allows the SDK to\n * continue working.\n * @param url - The URL to navigate the frame to.\n * @returns Promise that resolves when the navigation has completed.\n */\n export function navigateCrossDomain(url: string): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const errorMessage =\n 'Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.';\n resolve(sendAndDefaultError('navigateCrossDomain', errorMessage, url));\n });\n }\n\n /**\n * Navigate to the given application ID and page ID, with optional parameters for a WebURL (if the application\n * cannot be navigated to, such as if it is not installed), Channel ID (for applications installed as a channel tab),\n * and sub-page ID (for navigating to specific content within the page). This is equivalent to navigating to\n * a deep link with the above data, but does not require the application to build a URL or worry about different\n * deep link formats for different hosts.\n * @param params - Parameters for the navigation\n * @returns a promise that will resolve if the navigation was successful\n */\n export function navigateToApp(params: NavigateToAppParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (runtime.isLegacyTeams) {\n resolve(send('executeDeepLink', createTeamsAppLink(params)));\n } else {\n resolve(send('pages.navigateToApp', params));\n }\n });\n }\n\n /**\n * Shares a deep link that a user can use to navigate back to a specific state in this page.\n * Please note that this method does yet work on mobile hosts.\n *\n * @param deepLinkParameters - ID and label for the link and fallback URL.\n */\n export function shareDeepLink(deepLinkParameters: ShareDeepLinkParameters): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('shareDeepLink', [\n deepLinkParameters.subPageId,\n deepLinkParameters.subPageLabel,\n deepLinkParameters.subPageWebUrl,\n ]);\n }\n\n /**\n * Registers a handler for changes from or to full-screen view for a tab.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * On hosts where there is no support for making an app full screen, the handler registered\n * with this function will never be called.\n * @param handler - The handler to invoke when the user toggles full-screen view for a tab.\n */\n export function registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void {\n registerHandlerHelper('fullScreenChange', handler, [], () => {\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * Checks if the pages capability is supported by the host\n * @returns boolean to represent whether the appEntity capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages ? true : false;\n }\n\n /**\n * Parameters for the NavigateToApp API\n */\n export interface NavigateToAppParams {\n /**\n * ID of the application to navigate to\n */\n appId: string;\n\n /**\n * Developer-defined ID of the Page to navigate to within the application (Formerly EntityID)\n */\n pageId: string;\n\n /**\n * Optional URL to open if the navigation cannot be completed within the host\n */\n webUrl?: string;\n\n /**\n * Optional developer-defined ID describing the content to navigate to within the Page. This will be passed\n * back to the application via the Context object.\n */\n subPageId?: string;\n\n /**\n * Optional ID of the Teams Channel where the application should be opened\n */\n channelId?: string;\n }\n\n /**\n * Provides APIs for querying and navigating between contextual tabs of an application. Unlike personal tabs,\n * contextual tabs are pages associated with a specific context, such as channel or chat.\n */\n export namespace tabs {\n /**\n * Navigates the hosted application to the specified tab instance.\n * @param tabInstance - The destination tab instance.\n * @returns Promise that resolves when the navigation has completed.\n */\n export function navigateToTab(tabInstance: TabInstance): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const errorMessage = 'Invalid internalTabInstanceId and/or channelId were/was provided';\n resolve(sendAndDefaultError('navigateToTab', errorMessage, tabInstance));\n });\n }\n /**\n * Retrieves application tabs for the current user.\n * If no TabInstanceParameters are passed, the application defaults to favorite teams and favorite channels.\n * @param tabInstanceParameters - An optional set of flags that specify whether to scope call to favorite teams or channels.\n * @returns Promise that resolves with the {@link TabInformation}. Contains information for the user's tabs that are owned by this application {@link TabInstance}.\n */\n export function getTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise<TabInformation> {\n return new Promise<TabInformation>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(sendAndUnwrap('getTabInstances', tabInstanceParameters));\n });\n }\n\n /**\n * Retrieves the most recently used application tabs for the current user.\n * @param tabInstanceParameters - An optional set of flags. Note this is currently ignored and kept for future use.\n * @returns Promise that resolves with the {@link TabInformation}. Contains information for the users' most recently used tabs {@link TabInstance}.\n */\n export function getMruTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise<TabInformation> {\n return new Promise<TabInformation>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(sendAndUnwrap('getMruTabInstances', tabInstanceParameters));\n });\n }\n\n /**\n * Checks if the pages.tab capability is supported by the host\n * @returns boolean to represent whether the pages.tab capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.tabs\n ? true\n : false\n : false;\n }\n }\n /**\n * Provides APIs to interact with the configuration-specific part of the SDK.\n * This object is usable only on the configuration frame.\n */\n export namespace config {\n let saveHandler: undefined | ((evt: SaveEvent) => void);\n let removeHandler: undefined | ((evt: RemoveEvent) => void);\n\n /**\n * @hidden\n * Hide from docs because this function is only used during initialization\n *\n * Adds register handlers for settings.save and settings.remove upon initialization. Function is called in {@link app.initializeHelper}\n * @internal\n * Limited to Microsoft-internal use\n */\n export function initialize(): void {\n registerHandler('settings.save', handleSave, false);\n registerHandler('settings.remove', handleRemove, false);\n }\n\n /**\n * Sets the validity state for the configuration.\n * The initial value is false, so the user cannot save the configuration until this is called with true.\n * @param validityState - Indicates whether the save or remove button is enabled for the user.\n */\n export function setValidityState(validityState: boolean): void {\n ensureInitialized(runtime, FrameContexts.settings, FrameContexts.remove);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('settings.setValidityState', [validityState]);\n }\n\n /**\n * Sets the configuration for the current instance.\n * This is an asynchronous operation; calls to getConfig are not guaranteed to reflect the changed state.\n * @param instanceConfig - The desired configuration for this instance.\n * @returns Promise that resolves when the operation has completed.\n */\n export function setConfig(instanceConfig: InstanceConfig): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(send('settings.setSettings', instanceConfig));\n });\n }\n\n /**\n * Registers a handler for when the user attempts to save the configuration. This handler should be used\n * to create or update the underlying resource powering the content.\n * The object passed to the handler must be used to notify whether to proceed with the save.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when the user selects the Save button.\n */\n export function registerOnSaveHandler(handler: (evt: SaveEvent) => void): void {\n registerOnSaveHandlerHelper(handler, () => {\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerOnSaveHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param handler - The handler to invoke when the user selects the Save button.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerOnSaveHandlerHelper(\n handler: (evt: SaveEvent) => void,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime, FrameContexts.settings);\n if (versionSpecificHelper) {\n versionSpecificHelper();\n }\n saveHandler = handler;\n handler && sendMessageToParent('registerHandler', ['save']);\n }\n\n /**\n * Registers a handler for user attempts to remove content. This handler should be used\n * to remove the underlying resource powering the content.\n * The object passed to the handler must be used to indicate whether to proceed with the removal.\n * Only one handler may be registered at a time. Subsequent registrations will override the first.\n * @param handler - The handler to invoke when the user selects the Remove button.\n */\n export function registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void {\n registerOnRemoveHandlerHelper(handler, () => {\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerOnRemoveHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param handler - The handler to invoke when the user selects the Remove button.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerOnRemoveHandlerHelper(\n handler: (evt: RemoveEvent) => void,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime, FrameContexts.remove, FrameContexts.settings);\n if (versionSpecificHelper) {\n versionSpecificHelper();\n }\n removeHandler = handler;\n handler && sendMessageToParent('registerHandler', ['remove']);\n }\n\n function handleSave(result?: SaveParameters): void {\n const saveEvent = new SaveEventImpl(result);\n if (saveHandler) {\n saveHandler(saveEvent);\n } else if (Communication.childWindow) {\n sendMessageEventToChild('settings.save', [result]);\n } else {\n // If no handler is registered, we assume success.\n saveEvent.notifySuccess();\n }\n }\n\n /**\n * Registers a handler for when the tab configuration is changed by the user\n * @param handler - The handler to invoke when the user clicks on Settings.\n */\n export function registerChangeConfigHandler(handler: () => void): void {\n registerHandlerHelper('changeSettings', handler, [FrameContexts.content], () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * Describes the results of the settings.save event. Includes result, notifySuccess, and notifyFailure\n * to indicate the return object (result) and the status of whether the settings.save call succeeded or not and why.\n */\n export interface SaveEvent {\n /**\n * Object containing properties passed as arguments to the settings.save event.\n */\n result: SaveParameters;\n /**\n * Indicates that the underlying resource has been created and the config can be saved.\n */\n notifySuccess(): void;\n /**\n * Indicates that creation of the underlying resource failed and that the config cannot be saved.\n * @param reason - Specifies a reason for the failure. If provided, this string is displayed to the user; otherwise a generic error is displayed.\n */\n notifyFailure(reason?: string): void;\n }\n\n /**\n * Describes the results of the settings.remove event. Includes notifySuccess, and notifyFailure\n * to indicate the status of whether the settings.save call succeeded or not and why.\n */\n export interface RemoveEvent {\n /**\n * Indicates that the underlying resource has been removed and the content can be removed.\n */\n notifySuccess(): void;\n /**\n * Indicates that removal of the underlying resource failed and that the content cannot be removed.\n * @param reason - Specifies a reason for the failure. If provided, this string is displayed to the user; otherwise a generic error is displayed.\n */\n notifyFailure(reason?: string): void;\n }\n\n /**\n * Parameters used in the settings.save event\n */\n export interface SaveParameters {\n /**\n * Connector's webhook Url returned as arguments to settings.save event as part of user clicking on Save\n */\n webhookUrl?: string;\n }\n\n /**\n * @hidden\n * Hide from docs, since this class is not directly used.\n */\n class SaveEventImpl implements SaveEvent {\n public notified = false;\n public result: SaveParameters;\n public constructor(result?: SaveParameters) {\n this.result = result ? result : {};\n }\n public notifySuccess(): void {\n this.ensureNotNotified();\n sendMessageToParent('settings.save.success');\n this.notified = true;\n }\n public notifyFailure(reason?: string): void {\n this.ensureNotNotified();\n sendMessageToParent('settings.save.failure', [reason]);\n this.notified = true;\n }\n private ensureNotNotified(): void {\n if (this.notified) {\n throw new Error('The SaveEvent may only notify success or failure once.');\n }\n }\n }\n\n function handleRemove(): void {\n const removeEvent = new RemoveEventImpl();\n if (removeHandler) {\n removeHandler(removeEvent);\n } else if (Communication.childWindow) {\n sendMessageEventToChild('settings.remove', []);\n } else {\n // If no handler is registered, we assume success.\n removeEvent.notifySuccess();\n }\n }\n\n /**\n * @hidden\n * Hide from docs, since this class is not directly used.\n */\n class RemoveEventImpl implements RemoveEvent {\n public notified = false;\n\n public notifySuccess(): void {\n this.ensureNotNotified();\n sendMessageToParent('settings.remove.success');\n this.notified = true;\n }\n\n public notifyFailure(reason?: string): void {\n this.ensureNotNotified();\n sendMessageToParent('settings.remove.failure', [reason]);\n this.notified = true;\n }\n\n private ensureNotNotified(): void {\n if (this.notified) {\n throw new Error('The removeEvent may only notify success or failure once.');\n }\n }\n }\n\n /**\n * Checks if the pages.config capability is supported by the host\n * @returns boolean to represent whether the pages.config capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.config\n ? true\n : false\n : false;\n }\n }\n\n /**\n * Provides APIs for handling the user's navigational history.\n */\n export namespace backStack {\n let backButtonPressHandler: (() => boolean) | undefined;\n\n export function _initialize(): void {\n registerHandler('backButtonPress', handleBackButtonPress, false);\n }\n\n /**\n * Navigates back in the hosted application. See {@link pages.backStack.registerBackButtonHandler} for notes on usage.\n * @returns Promise that resolves when the navigation has completed.\n */\n export function navigateBack(): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const errorMessage = 'Back navigation is not supported in the current client or context.';\n resolve(sendAndDefaultError('navigateBack', errorMessage));\n });\n }\n\n /**\n * Registers a handler for user presses of the host client's back button. Experiences that maintain an internal\n * navigation stack should use this handler to navigate the user back within their frame. If an application finds\n * that after running its back button handler it cannot handle the event it should call the navigateBack\n * method to ask the host client to handle it instead.\n * @param handler - The handler to invoke when the user presses the host client's back button.\n */\n export function registerBackButtonHandler(handler: () => boolean): void {\n registerBackButtonHandlerHelper(handler, () => {\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerBackButtonHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param handler - The handler to invoke when the user presses the host client's back button.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerBackButtonHandlerHelper(handler: () => boolean, versionSpecificHelper?: () => void): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime);\n if (versionSpecificHelper) {\n versionSpecificHelper();\n }\n backButtonPressHandler = handler;\n handler && sendMessageToParent('registerHandler', ['backButton']);\n }\n\n function handleBackButtonPress(): void {\n if (!backButtonPressHandler || !backButtonPressHandler()) {\n if (Communication.childWindow) {\n // If the current window did not handle it let the child window\n sendMessageEventToChild('backButtonPress', []);\n } else {\n navigateBack();\n }\n }\n }\n\n /**\n * Checks if the pages.backStack capability is supported by the host\n * @returns boolean to represent whether the pages.backStack capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.backStack\n ? true\n : false\n : false;\n }\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n * Provides APIs to interact with the full-trust part of the SDK. Limited to 1P applications\n */\n export namespace fullTrust {\n /**\n * @hidden\n * Hide from docs\n * ------\n * Place the tab into full-screen mode.\n */\n export function enterFullscreen(): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('enterFullscreen', []);\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n * Reverts the tab into normal-screen mode.\n */\n export function exitFullscreen(): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('exitFullscreen', []);\n }\n /**\n * @hidden\n *\n * Checks if the pages.fullTrust capability is supported by the host\n * @returns boolean to represent whether the pages.fullTrust capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.fullTrust\n ? true\n : false\n : false;\n }\n }\n\n /**\n * Provides APIs to interact with the app button part of the SDK.\n */\n export namespace appButton {\n /**\n * Registers a handler for clicking the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when the personal app button is clicked in the app bar.\n */\n export function onClick(handler: () => void): void {\n registerHandlerHelper('appButtonClick', handler, [FrameContexts.content], () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * Registers a handler for entering hover of the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.\n */\n export function onHoverEnter(handler: () => void): void {\n registerHandlerHelper('appButtonHoverEnter', handler, [FrameContexts.content], () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * Registers a handler for exiting hover of the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.\n */\n export function onHoverLeave(handler: () => void): void {\n registerHandlerHelper('appButtonHoverLeave', handler, [FrameContexts.content], () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n });\n }\n\n /**\n * Checks if pages.appButton capability is supported by the host\n * @returns boolean to represent whether the pages.appButton capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.appButton\n ? true\n : false\n : false;\n }\n }\n\n /**\n * Provides functions for navigating without needing to specify your application ID.\n *\n * @beta\n */\n export namespace currentApp {\n /**\n * Parameters for the NavigateWithinApp\n *\n * @beta\n */\n export interface NavigateWithinAppParams {\n /**\n * The developer-defined unique ID for the page defined in the manifest or when first configuring\n * the page. (Known as {@linkcode Context.entityId} prior to TeamsJS v.2.0.0)\n */\n pageId: string;\n\n /**\n * Optional developer-defined unique ID describing the content to navigate to within the page. This\n * can be retrieved from the Context object {@link app.PageInfo.subPageId | app.Context.page.subPageId}\n */\n subPageId?: string;\n }\n\n /**\n * Navigate within the currently running application with page ID, and sub-page ID (for navigating to\n * specific content within the page).\n * @param params - Parameters for the navigation\n * @returns a promise that will resolve if the navigation was successful\n *\n * @beta\n */\n export function navigateTo(params: NavigateWithinAppParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError('pages.currentApp.navigateTo', params));\n });\n }\n\n /**\n * Navigate to the currently running application's first static page defined in the application\n * manifest.\n * @beta\n */\n export function navigateToDefaultPage(): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError('pages.currentApp.navigateToDefaultPage'));\n });\n }\n\n /**\n * Checks if pages.currentApp capability is supported by the host\n * @returns boolean to represent whether the pages.currentApp capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.currentApp\n ? true\n : false\n : false;\n }\n }\n}\n","// This assignment is replaced at build time by a webpack plugin (or Jest during unit tests) which ensures the value matches the version set in the package version\ndeclare const PACKAGE_VERSION = 'ERROR: This value should be replaced by webpack!';\nexport const version = PACKAGE_VERSION;\n","import { HostClientType } from '../public/constants';\nimport { ErrorCode, SdkError } from '../public/interfaces';\nimport { IBaseRuntime, isRuntimeInitialized, Runtime } from '../public/runtime';\nimport {\n defaultSDKVersionForCompatCheck,\n errorLibraryNotInitialized,\n userOriginUrlValidationRegExp,\n} from './constants';\nimport { GlobalVars } from './globalVars';\nimport { getLogger } from './telemetry';\nimport { compareSDKVersions } from './utils';\n\nconst internalLogger = getLogger('internal');\nconst ensureInitializeCalledLogger = internalLogger.extend('ensureInitializeCalled');\nconst ensureInitializedLogger = internalLogger.extend('ensureInitialized');\n\n/**\n * Ensures `initialize` was called. This function does NOT verify that a response from Host was received and initialization completed.\n *\n * `ensureInitializeCalled` should only be used for APIs which:\n * - work in all FrameContexts\n * - are part of a required Capability\n * - are suspected to be used directly after calling `initialize`, potentially without awaiting the `initialize` call itself\n *\n * For most APIs {@link ensureInitialized} is the right validation function to use instead.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function ensureInitializeCalled(): void {\n if (!GlobalVars.initializeCalled) {\n ensureInitializeCalledLogger(errorLibraryNotInitialized);\n throw new Error(errorLibraryNotInitialized);\n }\n}\n\n/**\n * Ensures `initialize` was called and response from Host was received and processed and that `runtime` is initialized.\n * If expected FrameContexts are provided, it also validates that the current FrameContext matches one of the expected ones.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function ensureInitialized(runtime: IBaseRuntime, ...expectedFrameContexts: string[]): runtime is Runtime {\n // This global var can potentially be removed in the future if we use the initialization status of the runtime object as our source of truth\n if (!GlobalVars.initializeCompleted) {\n ensureInitializedLogger(\n '%s. initializeCalled: %s',\n errorLibraryNotInitialized,\n GlobalVars.initializeCalled.toString(),\n );\n throw new Error(errorLibraryNotInitialized);\n }\n\n if (expectedFrameContexts && expectedFrameContexts.length > 0) {\n let found = false;\n for (let i = 0; i < expectedFrameContexts.length; i++) {\n if (expectedFrameContexts[i] === GlobalVars.frameContext) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n throw new Error(\n `This call is only allowed in following contexts: ${JSON.stringify(expectedFrameContexts)}. ` +\n `Current context: \"${GlobalVars.frameContext}\".`,\n );\n }\n }\n return isRuntimeInitialized(runtime);\n}\n\n/**\n * @hidden\n * Checks whether the platform has knowledge of this API by doing a comparison\n * on API required version and platform supported version of the SDK\n *\n * @param requiredVersion - SDK version required by the API\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isCurrentSDKVersionAtLeast(requiredVersion: string = defaultSDKVersionForCompatCheck): boolean {\n const value = compareSDKVersions(GlobalVars.clientSupportedSDKVersion, requiredVersion);\n if (isNaN(value)) {\n return false;\n }\n return value >= 0;\n}\n\n/**\n * @hidden\n * Helper function to identify if host client is either android, ios, or ipados\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isHostClientMobile(): boolean {\n return (\n GlobalVars.hostClientType == HostClientType.android ||\n GlobalVars.hostClientType == HostClientType.ios ||\n GlobalVars.hostClientType == HostClientType.ipados\n );\n}\n\n/**\n * @hidden\n * Helper function which indicates if current API is supported on mobile or not.\n * @throws SdkError if host client is not android/ios or if the requiredVersion is not\n * supported by platform or not. Null is returned in case of success.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function throwExceptionIfMobileApiIsNotSupported(\n requiredVersion: string = defaultSDKVersionForCompatCheck,\n): void {\n if (!isHostClientMobile()) {\n const notSupportedError: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\n throw notSupportedError;\n } else if (!isCurrentSDKVersionAtLeast(requiredVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n throw oldPlatformError;\n }\n}\n\n/**\n * @hidden\n * Processes the valid origins specifuied by the user, de-duplicates and converts them into a regexp\n * which is used later for message source/origin validation\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function processAdditionalValidOrigins(validMessageOrigins: string[]): void {\n let combinedOriginUrls = GlobalVars.additionalValidOrigins.concat(\n validMessageOrigins.filter((_origin: string) => {\n return typeof _origin === 'string' && userOriginUrlValidationRegExp.test(_origin);\n }),\n );\n const dedupUrls: { [url: string]: boolean } = {};\n combinedOriginUrls = combinedOriginUrls.filter((_originUrl) => {\n if (dedupUrls[_originUrl]) {\n return false;\n }\n dedupUrls[_originUrl] = true;\n return true;\n });\n GlobalVars.additionalValidOrigins = combinedOriginUrls;\n}\n","/* eslint-disable @typescript-eslint/ban-types */\n\nimport { FrameContexts, LoadContext } from '../public';\nimport { pages } from '../public/pages';\nimport { runtime } from '../public/runtime';\nimport { Communication, sendMessageEventToChild, sendMessageToParent } from './communication';\nimport { ensureInitialized } from './internalAPIs';\nimport { getLogger } from './telemetry';\n\nconst handlersLogger = getLogger('handlers');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nclass HandlersPrivate {\n public static handlers: {\n [func: string]: Function;\n } = {};\n public static themeChangeHandler: (theme: string) => void;\n public static loadHandler: (context: LoadContext) => void;\n public static beforeUnloadHandler: (readyToUnload: () => void) => boolean;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function initializeHandlers(): void {\n // ::::::::::::::::::::MicrosoftTeams SDK Internal :::::::::::::::::\n HandlersPrivate.handlers['themeChange'] = handleThemeChange;\n HandlersPrivate.handlers['load'] = handleLoad;\n HandlersPrivate.handlers['beforeUnload'] = handleBeforeUnload;\n pages.backStack._initialize();\n}\n\nconst callHandlerLogger = handlersLogger.extend('callHandler');\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callHandler(name: string, args?: unknown[]): [true, unknown] | [false, undefined] {\n const handler = HandlersPrivate.handlers[name];\n if (handler) {\n callHandlerLogger('Invoking the registered handler for message %s with arguments %o', name, args);\n const result = handler.apply(this, args);\n return [true, result];\n } else if (Communication.childWindow) {\n sendMessageEventToChild(name, [args]);\n return [false, undefined];\n } else {\n callHandlerLogger('Handler for action message %s not found.', name);\n return [false, undefined];\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerHandler(name: string, handler: Function, sendMessage = true, args: unknown[] = []): void {\n if (handler) {\n HandlersPrivate.handlers[name] = handler;\n sendMessage && sendMessageToParent('registerHandler', [name, ...args]);\n } else {\n delete HandlersPrivate.handlers[name];\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function removeHandler(name: string): void {\n delete HandlersPrivate.handlers[name];\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function doesHandlerExist(name: string): boolean {\n return HandlersPrivate.handlers[name] != null;\n}\n\n/**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of register*Handler APIs\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param name - The name of the handler to register.\n * @param handler - The handler to invoke.\n * @param contexts - The context within which it is valid to register this handler.\n * @param registrationHelper - The helper function containing logic pertaining to a specific version of the API.\n */\nexport function registerHandlerHelper(\n name: string,\n handler: Function,\n contexts: FrameContexts[],\n registrationHelper?: () => void,\n): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime, ...contexts);\n if (registrationHelper) {\n registrationHelper();\n }\n\n registerHandler(name, handler);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerOnThemeChangeHandler(handler: (theme: string) => void): void {\n HandlersPrivate.themeChangeHandler = handler;\n handler && sendMessageToParent('registerHandler', ['themeChange']);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function handleThemeChange(theme: string): void {\n if (HandlersPrivate.themeChangeHandler) {\n HandlersPrivate.themeChangeHandler(theme);\n }\n\n if (Communication.childWindow) {\n sendMessageEventToChild('themeChange', [theme]);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerOnLoadHandler(handler: (context: LoadContext) => void): void {\n HandlersPrivate.loadHandler = handler;\n handler && sendMessageToParent('registerHandler', ['load']);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction handleLoad(context: LoadContext): void {\n if (HandlersPrivate.loadHandler) {\n HandlersPrivate.loadHandler(context);\n }\n\n if (Communication.childWindow) {\n sendMessageEventToChild('load', [context]);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void {\n HandlersPrivate.beforeUnloadHandler = handler;\n handler && sendMessageToParent('registerHandler', ['beforeUnload']);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction handleBeforeUnload(): void {\n const readyToUnload = (): void => {\n sendMessageToParent('readyToUnload', []);\n };\n\n if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {\n if (Communication.childWindow) {\n sendMessageEventToChild('beforeUnload');\n } else {\n readyToUnload();\n }\n }\n}\n","/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { FrameContexts } from '../public/constants';\nimport { SdkError } from '../public/interfaces';\nimport { latestRuntimeApiVersion } from '../public/runtime';\nimport { version } from '../public/version';\nimport { GlobalVars } from './globalVars';\nimport { callHandler } from './handlers';\nimport { DOMMessageEvent, ExtendedWindow, MessageRequest, MessageResponse } from './interfaces';\nimport { getLogger } from './telemetry';\nimport { validateOrigin } from './utils';\n\nconst communicationLogger = getLogger('communication');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport class Communication {\n public static currentWindow: Window | any;\n public static parentOrigin: string;\n public static parentWindow: Window | any;\n public static childWindow: Window;\n public static childOrigin: string;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nclass CommunicationPrivate {\n public static parentMessageQueue: MessageRequest[] = [];\n public static childMessageQueue: MessageRequest[] = [];\n public static nextMessageId = 0;\n public static callbacks: {\n [id: number]: Function; // (arg1, arg2, ...etc) => void\n } = {};\n public static promiseCallbacks: {\n [id: number]: Function; // (args[]) => void\n } = {};\n public static messageListener: Function;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\ninterface InitializeResponse {\n context: FrameContexts;\n clientType: string;\n runtimeConfig: string;\n clientSupportedSDKVersion: string;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function initializeCommunication(validMessageOrigins: string[] | undefined): Promise<InitializeResponse> {\n // Listen for messages post to our window\n CommunicationPrivate.messageListener = (evt: DOMMessageEvent): void => processMessage(evt);\n\n // If we are in an iframe, our parent window is the one hosting us (i.e., window.parent); otherwise,\n // it's the window that opened us (i.e., window.opener)\n Communication.currentWindow = Communication.currentWindow || window;\n Communication.parentWindow =\n Communication.currentWindow.parent !== Communication.currentWindow.self\n ? Communication.currentWindow.parent\n : Communication.currentWindow.opener;\n\n // Listen to messages from the parent or child frame.\n // Frameless windows will only receive this event from child frames and if validMessageOrigins is passed.\n if (Communication.parentWindow || validMessageOrigins) {\n Communication.currentWindow.addEventListener('message', CommunicationPrivate.messageListener, false);\n }\n\n if (!Communication.parentWindow) {\n const extendedWindow = Communication.currentWindow as unknown as ExtendedWindow;\n if (extendedWindow.nativeInterface) {\n GlobalVars.isFramelessWindow = true;\n extendedWindow.onNativeMessage = handleParentMessage;\n } else {\n // at this point we weren't able to find a parent to talk to, no way initialization will succeed\n return Promise.reject(new Error('Initialization Failed. No Parent window found.'));\n }\n }\n\n try {\n // Send the initialized message to any origin, because at this point we most likely don't know the origin\n // of the parent window, and this message contains no data that could pose a security risk.\n Communication.parentOrigin = '*';\n return sendMessageToParentAsync<[FrameContexts, string, string, string]>('initialize', [\n version,\n latestRuntimeApiVersion,\n ]).then(\n ([context, clientType, runtimeConfig, clientSupportedSDKVersion]: [FrameContexts, string, string, string]) => {\n return { context, clientType, runtimeConfig, clientSupportedSDKVersion };\n },\n );\n } finally {\n Communication.parentOrigin = null;\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function uninitializeCommunication(): void {\n if (Communication.currentWindow) {\n Communication.currentWindow.removeEventListener('message', CommunicationPrivate.messageListener, false);\n }\n\n Communication.currentWindow = null;\n Communication.parentWindow = null;\n Communication.parentOrigin = null;\n Communication.childWindow = null;\n Communication.childOrigin = null;\n CommunicationPrivate.parentMessageQueue = [];\n CommunicationPrivate.childMessageQueue = [];\n CommunicationPrivate.nextMessageId = 0;\n CommunicationPrivate.callbacks = {};\n CommunicationPrivate.promiseCallbacks = {};\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendAndUnwrap<T>(actionName: string, ...args: any[]): Promise<T> {\n return sendMessageToParentAsync(actionName, args).then(([result]: [T]) => result);\n}\n\nexport function sendAndHandleStatusAndReason(actionName: string, ...args: any[]): Promise<void> {\n return sendMessageToParentAsync(actionName, args).then(([status, reason]: [boolean, string]) => {\n if (!status) {\n throw new Error(reason);\n }\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendAndHandleStatusAndReasonWithDefaultError(\n actionName: string,\n defaultError: string,\n ...args: any[]\n): Promise<void> {\n return sendMessageToParentAsync(actionName, args).then(([status, reason]: [boolean, string]) => {\n if (!status) {\n throw new Error(reason ? reason : defaultError);\n }\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendAndHandleSdkError<T>(actionName: string, ...args: any[]): Promise<T> {\n return sendMessageToParentAsync(actionName, args).then(([error, result]: [SdkError, T]) => {\n if (error) {\n throw error;\n }\n return result;\n });\n}\n\n/**\n * @hidden\n * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageToParentAsync<T>(actionName: string, args: any[] = undefined): Promise<T> {\n return new Promise((resolve) => {\n const request = sendMessageToParentHelper(actionName, args);\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(waitForResponse<T>(request.id));\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction waitForResponse<T>(requestId: number): Promise<T> {\n return new Promise<T>((resolve) => {\n CommunicationPrivate.promiseCallbacks[requestId] = resolve;\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageToParent(actionName: string, callback?: Function): void;\n\n/**\n * @hidden\n * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageToParent(actionName: string, args: any[], callback?: Function): void;\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageToParent(actionName: string, argsOrCallback?: any[] | Function, callback?: Function): void {\n let args: any[] | undefined;\n if (argsOrCallback instanceof Function) {\n callback = argsOrCallback;\n } else if (argsOrCallback instanceof Array) {\n args = argsOrCallback;\n }\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const request = sendMessageToParentHelper(actionName, args);\n if (callback) {\n CommunicationPrivate.callbacks[request.id] = callback;\n }\n}\n\nconst sendMessageToParentHelperLogger = communicationLogger.extend('sendMessageToParentHelper');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction sendMessageToParentHelper(actionName: string, args: any[]): MessageRequest {\n const logger = sendMessageToParentHelperLogger;\n\n const targetWindow = Communication.parentWindow;\n const request = createMessageRequest(actionName, args);\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n logger('Message %i information: %o', request.id, { actionName, args });\n\n if (GlobalVars.isFramelessWindow) {\n if (Communication.currentWindow && Communication.currentWindow.nativeInterface) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n logger('Sending message %i to parent via framelessPostMessage interface', request.id);\n (Communication.currentWindow as ExtendedWindow).nativeInterface.framelessPostMessage(JSON.stringify(request));\n }\n } else {\n const targetOrigin = getTargetOrigin(targetWindow);\n\n // If the target window isn't closed and we already know its origin, send the message right away; otherwise,\n // queue the message and send it after the origin is established\n if (targetWindow && targetOrigin) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n logger('Sending message %i to parent via postMessage', request.id);\n targetWindow.postMessage(request, targetOrigin);\n } else {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n logger('Adding message %i to parent message queue', request.id);\n getTargetMessageQueue(targetWindow).push(request);\n }\n }\n return request;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction processMessage(evt: DOMMessageEvent): void {\n // Process only if we received a valid message\n if (!evt || !evt.data || typeof evt.data !== 'object') {\n return;\n }\n\n // Process only if the message is coming from a different window and a valid origin\n // valid origins are either a pre-known\n const messageSource = evt.source || (evt.originalEvent && evt.originalEvent.source);\n const messageOrigin = evt.origin || (evt.originalEvent && evt.originalEvent.origin);\n if (!shouldProcessMessage(messageSource, messageOrigin)) {\n return;\n }\n\n // Update our parent and child relationships based on this message\n updateRelationships(messageSource, messageOrigin);\n\n // Handle the message\n if (messageSource === Communication.parentWindow) {\n handleParentMessage(evt);\n } else if (messageSource === Communication.childWindow) {\n handleChildMessage(evt);\n }\n}\n\n/**\n * @hidden\n * Validates the message source and origin, if it should be processed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction shouldProcessMessage(messageSource: Window, messageOrigin: string): boolean {\n // Process if message source is a different window and if origin is either in\n // Teams' pre-known whitelist or supplied as valid origin by user during initialization\n if (Communication.currentWindow && messageSource === Communication.currentWindow) {\n return false;\n } else if (\n Communication.currentWindow &&\n Communication.currentWindow.location &&\n messageOrigin &&\n messageOrigin === Communication.currentWindow.location.origin\n ) {\n return true;\n } else {\n return validateOrigin(new URL(messageOrigin));\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction updateRelationships(messageSource: Window, messageOrigin: string): void {\n // Determine whether the source of the message is our parent or child and update our\n // window and origin pointer accordingly\n // For frameless windows (i.e mobile), there is no parent frame, so the message must be from the child.\n if (\n !GlobalVars.isFramelessWindow &&\n (!Communication.parentWindow || Communication.parentWindow.closed || messageSource === Communication.parentWindow)\n ) {\n Communication.parentWindow = messageSource;\n Communication.parentOrigin = messageOrigin;\n } else if (\n !Communication.childWindow ||\n Communication.childWindow.closed ||\n messageSource === Communication.childWindow\n ) {\n Communication.childWindow = messageSource;\n Communication.childOrigin = messageOrigin;\n }\n\n // Clean up pointers to closed parent and child windows\n if (Communication.parentWindow && Communication.parentWindow.closed) {\n Communication.parentWindow = null;\n Communication.parentOrigin = null;\n }\n if (Communication.childWindow && Communication.childWindow.closed) {\n Communication.childWindow = null;\n Communication.childOrigin = null;\n }\n\n // If we have any messages in our queue, send them now\n flushMessageQueue(Communication.parentWindow);\n flushMessageQueue(Communication.childWindow);\n}\n\nconst handleParentMessageLogger = communicationLogger.extend('handleParentMessage');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction handleParentMessage(evt: DOMMessageEvent): void {\n const logger = handleParentMessageLogger;\n\n if ('id' in evt.data && typeof evt.data.id === 'number') {\n // Call any associated Communication.callbacks\n const message = evt.data as MessageResponse;\n const callback = CommunicationPrivate.callbacks[message.id];\n logger('Received a response from parent for message %i', message.id);\n if (callback) {\n logger('Invoking the registered callback for message %i with arguments %o', message.id, message.args);\n callback.apply(null, [...message.args, message.isPartialResponse]);\n\n // Remove the callback to ensure that the callback is called only once and to free up memory if response is a complete response\n if (!isPartialResponse(evt)) {\n logger('Removing registered callback for message %i', message.id);\n delete CommunicationPrivate.callbacks[message.id];\n }\n }\n const promiseCallback = CommunicationPrivate.promiseCallbacks[message.id];\n if (promiseCallback) {\n logger('Invoking the registered promise callback for message %i with arguments %o', message.id, message.args);\n promiseCallback(message.args);\n\n logger('Removing registered promise callback for message %i', message.id);\n delete CommunicationPrivate.promiseCallbacks[message.id];\n }\n } else if ('func' in evt.data && typeof evt.data.func === 'string') {\n // Delegate the request to the proper handler\n const message = evt.data as MessageRequest;\n logger('Received an action message %s from parent', message.func);\n callHandler(message.func, message.args);\n } else {\n logger('Received an unknown message: %O', evt);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction isPartialResponse(evt: DOMMessageEvent): boolean {\n return evt.data.isPartialResponse === true;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction handleChildMessage(evt: DOMMessageEvent): void {\n if ('id' in evt.data && 'func' in evt.data) {\n // Try to delegate the request to the proper handler, if defined\n const message = evt.data as MessageRequest;\n const [called, result] = callHandler(message.func, message.args);\n if (called && typeof result !== 'undefined') {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n sendMessageResponseToChild(message.id, Array.isArray(result) ? result : [result]);\n } else {\n // No handler, proxy to parent\n sendMessageToParent(message.func, message.args, (...args: any[]): void => {\n if (Communication.childWindow) {\n const isPartialResponse = args.pop();\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n sendMessageResponseToChild(message.id, args, isPartialResponse);\n }\n });\n }\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction getTargetMessageQueue(targetWindow: Window): MessageRequest[] {\n return targetWindow === Communication.parentWindow\n ? CommunicationPrivate.parentMessageQueue\n : targetWindow === Communication.childWindow\n ? CommunicationPrivate.childMessageQueue\n : [];\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction getTargetOrigin(targetWindow: Window): string {\n return targetWindow === Communication.parentWindow\n ? Communication.parentOrigin\n : targetWindow === Communication.childWindow\n ? Communication.childOrigin\n : null;\n}\n\nconst flushMessageQueueLogger = communicationLogger.extend('flushMessageQueue');\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction flushMessageQueue(targetWindow: Window | any): void {\n const targetOrigin = getTargetOrigin(targetWindow);\n const targetMessageQueue = getTargetMessageQueue(targetWindow);\n const target = targetWindow == Communication.parentWindow ? 'parent' : 'child';\n while (targetWindow && targetOrigin && targetMessageQueue.length > 0) {\n const request = targetMessageQueue.shift();\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n flushMessageQueueLogger('Flushing message %i from ' + target + ' message queue via postMessage.', request.id);\n targetWindow.postMessage(request, targetOrigin);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function waitForMessageQueue(targetWindow: Window, callback: () => void): void {\n const messageQueueMonitor = Communication.currentWindow.setInterval(() => {\n if (getTargetMessageQueue(targetWindow).length === 0) {\n clearInterval(messageQueueMonitor);\n callback();\n }\n }, 100);\n}\n\n/**\n * @hidden\n * Send a response to child for a message request that was from child\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction sendMessageResponseToChild(id: number, args?: any[], isPartialResponse?: boolean): void {\n const targetWindow = Communication.childWindow;\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const response = createMessageResponse(id, args, isPartialResponse);\n const targetOrigin = getTargetOrigin(targetWindow);\n if (targetWindow && targetOrigin) {\n targetWindow.postMessage(response, targetOrigin);\n }\n}\n\n/**\n * @hidden\n * Send a custom message object that can be sent to child window,\n * instead of a response message to a child\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageEventToChild(actionName: string, args?: any[]): void {\n const targetWindow = Communication.childWindow;\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const customEvent = createMessageEvent(actionName, args);\n const targetOrigin = getTargetOrigin(targetWindow);\n\n // If the target window isn't closed and we already know its origin, send the message right away; otherwise,\n // queue the message and send it after the origin is established\n if (targetWindow && targetOrigin) {\n targetWindow.postMessage(customEvent, targetOrigin);\n } else {\n getTargetMessageQueue(targetWindow).push(customEvent);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction createMessageRequest(func: string, args: any[]): MessageRequest {\n return {\n id: CommunicationPrivate.nextMessageId++,\n func: func,\n timestamp: Date.now(),\n args: args || [],\n };\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction createMessageResponse(id: number, args: any[], isPartialResponse: boolean): MessageResponse {\n return {\n id: id,\n args: args || [],\n isPartialResponse,\n };\n}\n\n/**\n * @hidden\n * Creates a message object without any id, used for custom actions being sent to child frame/window\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction createMessageEvent(func: string, args: any[]): MessageRequest {\n return {\n func: func,\n args: args || [],\n };\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform } from '../public/constants';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n * Namespace to interact with the logging part of the SDK.\n * This object is used to send the app logs on demand to the host client\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace logs {\n /**\n * @hidden\n *\n * Registers a handler for getting app log\n *\n * @param handler - The handler to invoke to get the app log\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerGetLogHandler(handler: () => string): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime);\n if (handler && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (handler) {\n registerHandler('log.request', () => {\n const log: string = handler();\n sendMessageToParent('log.receive', [log]);\n });\n } else {\n removeHandler('log.request');\n }\n }\n\n /**\n * @hidden\n *\n * Checks if the logs capability is supported by the host\n * @returns boolean to represent whether the logs capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.logs ? true : false;\n }\n}\n","import { FileOpenPreference, TeamInformation } from '../public/interfaces';\n\n/**\n * @hidden\n *\n * Information about all members in a chat\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface ChatMembersInformation {\n members: ThreadMember[];\n}\n\n/**\n * @hidden\n *\n * Information about a chat member\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface ThreadMember {\n /**\n * @hidden\n * The member's user principal name in the current tenant.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n upn: string;\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport enum NotificationTypes {\n fileDownloadStart = 'fileDownloadStart',\n fileDownloadComplete = 'fileDownloadComplete',\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface ShowNotificationParameters {\n message: string;\n notificationType: NotificationTypes;\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport enum ViewerActionTypes {\n view = 'view',\n edit = 'edit',\n editNew = 'editNew',\n}\n\n/**\n * @hidden\n *\n * User setting changes that can be subscribed to\n */\nexport enum UserSettingTypes {\n /**\n * @hidden\n * Use this key to subscribe to changes in user's file open preference\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n fileOpenPreference = 'fileOpenPreference',\n /**\n * @hidden\n * Use this key to subscribe to theme changes\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n theme = 'theme',\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface FilePreviewParameters {\n /**\n * @hidden\n * The developer-defined unique ID for the file.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n entityId?: string;\n\n /**\n * @hidden\n * The display name of the file.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title?: string;\n\n /**\n * @hidden\n * An optional description of the file.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n description?: string;\n\n /**\n * @hidden\n * The file extension; e.g. pptx, docx, etc.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n type: string;\n\n /**\n * @hidden\n * A url to the source of the file, used to open the content in the user's default browser\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n objectUrl: string;\n\n /**\n * @hidden\n * Optional; an alternate self-authenticating url used to preview the file in Mobile clients and offer it for download by the user\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n downloadUrl?: string;\n\n /**\n * @hidden\n * Optional; an alternate url optimized for previewing the file in web and desktop clients\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n webPreviewUrl?: string;\n\n /**\n * @hidden\n * Optional; an alternate url that allows editing of the file in web and desktop clients\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n webEditUrl?: string;\n\n /**\n * @hidden\n * Optional; the base url of the site where the file is hosted\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n baseUrl?: string;\n\n /**\n * @hidden\n * Deprecated; prefer using {@linkcode viewerAction} instead\n * Optional; indicates whether the file should be opened in edit mode\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n editFile?: boolean;\n\n /**\n * @hidden\n * Optional; the developer-defined unique ID for the sub-entity to return to when the file stage closes.\n * This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n subEntityId?: string;\n\n /**\n * @hidden\n * Optional; indicates the mode in which file should be opened. Takes precedence over edit mode.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n viewerAction?: ViewerActionTypes;\n\n /**\n * @hidden\n * Optional; indicates how user prefers to open the file\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n fileOpenPreference?: FileOpenPreference;\n\n /**\n * @hidden\n * Optional; id required to enable conversation button in files. Will be channel id in case file is shared in a channel or the chat id in p2p chat case.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n conversationId?: string;\n}\n\n/**\n * @hidden\n *\n * Query parameters used when fetching team information\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface TeamInstanceParameters {\n /**\n * @hidden\n * Flag allowing to select favorite teams only\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n favoriteTeamsOnly?: boolean;\n}\n\n/**\n * @hidden\n *\n * Information on userJoined Teams\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface UserJoinedTeamsInformation {\n /**\n * @hidden\n * List of team information\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n userJoinedTeams: TeamInformation[];\n}\n","import {\n sendAndHandleStatusAndReason as sendAndHandleError,\n sendAndUnwrap,\n sendMessageToParent,\n} from '../internal/communication';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { ChatMembersInformation } from './interfaces';\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface OpenConversationRequest {\n /**\n * @hidden\n * The Id of the subEntity where the conversation is taking place\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n subEntityId: string;\n\n /**\n * @hidden\n * The title of the conversation\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n\n /**\n * @hidden\n * The Id of the conversation. This is optional and should be specified whenever a previous conversation about a specific sub-entity has already been started before\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n conversationId?: string;\n\n /**\n * @hidden\n * The Id of the channel. This is optional and should be specified whenever a conversation is started or opened in a personal app scope\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n channelId?: string;\n\n /**\n * @hidden\n * The entity Id of the tab\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n entityId: string;\n\n /**\n * @hidden\n * A function that is called once the conversation Id has been created\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n onStartConversation?: (conversationResponse: ConversationResponse) => void;\n\n /**\n * @hidden\n * A function that is called if the pane is closed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n onCloseConversation?: (conversationResponse: ConversationResponse) => void;\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface ConversationResponse {\n /**\n * @hidden\n *\n * Limited to Microsoft-internal use\n * The Id of the subEntity where the conversation is taking place\n */\n subEntityId: string;\n\n /**\n * @hidden\n * The Id of the conversation. This is optional and should be specified whenever a previous conversation about a specific sub-entity has already been started before\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n conversationId?: string;\n\n /**\n * @hidden\n * The Id of the channel. This is optional and should be specified whenever a conversation is started or opened in a personal app scope\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n channelId?: string;\n\n /**\n * @hidden\n * The entity Id of the tab\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n entityId?: string;\n}\n\n/**\n * @hidden\n * Namespace to interact with the conversational subEntities inside the tab\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace conversations {\n /**\n * @hidden\n * Hide from docs\n * --------------\n * Allows the user to start or continue a conversation with each subentity inside the tab\n *\n * @returns Promise resolved upon completion\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openConversation(openConversationRequest: OpenConversationRequest): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const sendPromise = sendAndHandleError('conversations.openConversation', {\n title: openConversationRequest.title,\n subEntityId: openConversationRequest.subEntityId,\n conversationId: openConversationRequest.conversationId,\n channelId: openConversationRequest.channelId,\n entityId: openConversationRequest.entityId,\n });\n if (openConversationRequest.onStartConversation) {\n registerHandler(\n 'startConversation',\n (subEntityId: string, conversationId: string, channelId: string, entityId: string) =>\n openConversationRequest.onStartConversation({\n subEntityId,\n conversationId,\n channelId,\n entityId,\n }),\n );\n }\n if (openConversationRequest.onCloseConversation) {\n registerHandler(\n 'closeConversation',\n (subEntityId: string, conversationId?: string, channelId?: string, entityId?: string) =>\n openConversationRequest.onCloseConversation({\n subEntityId,\n conversationId,\n channelId,\n entityId,\n }),\n );\n }\n resolve(sendPromise);\n });\n }\n\n /**\n * @hidden\n *\n * Allows the user to close the conversation in the right pane\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function closeConversation(): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('conversations.closeConversation');\n removeHandler('startConversation');\n removeHandler('closeConversation');\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n * Allows retrieval of information for all chat members.\n * NOTE: This value should be used only as a hint as to who the members are\n * and never as proof of membership in case your app is being hosted by a malicious party.\n *\n * @returns Promise resolved with information on all chat members\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getChatMembers(): Promise<ChatMembersInformation> {\n return new Promise<ChatMembersInformation>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndUnwrap('getChatMembers'));\n });\n }\n\n /**\n * Checks if the conversations capability is supported by the host\n * @returns boolean to represent whether conversations capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.conversations ? true : false;\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { Communication, sendMessageEventToChild, sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { FilePreviewParameters, UserSettingTypes } from './interfaces';\n\n/**\n * @hidden\n * Upload a custom App manifest directly to both team and personal scopes.\n * This method works just for the first party Apps.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function uploadCustomApp(manifestBlob: Blob, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(runtime);\n\n sendMessageToParent('uploadCustomApp', [manifestBlob], onComplete ? onComplete : getGenericOnCompleteHandler());\n}\n\n/**\n * @hidden\n * Sends a custom action MessageRequest to host or parent window\n *\n * @param actionName - Specifies name of the custom action to be sent\n * @param args - Specifies additional arguments passed to the action\n * @param callback - Optionally specify a callback to receive response parameters from the parent\n * @returns id of sent message\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendCustomMessage(actionName: string, args?: any[], callback?: (...args: any[]) => void): void {\n ensureInitialized(runtime);\n\n sendMessageToParent(actionName, args, callback);\n}\n\n/**\n * @hidden\n * Sends a custom action MessageEvent to a child iframe/window, only if you are not using auth popup.\n * Otherwise it will go to the auth popup (which becomes the child)\n *\n * @param actionName - Specifies name of the custom action to be sent\n * @param args - Specifies additional arguments passed to the action\n * @returns id of sent message\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendCustomEvent(actionName: string, args?: any[]): void {\n ensureInitialized(runtime);\n\n //validate childWindow\n if (!Communication.childWindow) {\n throw new Error('The child window has not yet been initialized or is not present');\n }\n sendMessageEventToChild(actionName, args);\n}\n\n/**\n * @hidden\n * Adds a handler for an action sent by a child window or parent window\n *\n * @param actionName - Specifies name of the action message to handle\n * @param customHandler - The callback to invoke when the action message is received. The return value is sent to the child\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerCustomHandler(actionName: string, customHandler: (...args: any[]) => any[]): void {\n ensureInitialized(runtime);\n registerHandler(actionName, (...args: any[]) => {\n return customHandler.apply(this, args);\n });\n}\n\n/**\n * @hidden\n * register a handler to be called when a user setting changes. The changed setting type & value is provided in the callback.\n *\n * @param settingTypes - List of user setting changes to subscribe\n * @param handler - When a subscribed setting is updated this handler is called\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerUserSettingsChangeHandler(\n settingTypes: UserSettingTypes[],\n handler: (settingType: UserSettingTypes, value: any) => void,\n): void {\n ensureInitialized(runtime);\n\n registerHandler('userSettingsChange', handler, true, [settingTypes]);\n}\n\n/**\n * @hidden\n * Opens a client-friendly preview of the specified file.\n *\n * @param file - The file to preview.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function openFilePreview(filePreviewParameters: FilePreviewParameters): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n const params = [\n filePreviewParameters.entityId,\n filePreviewParameters.title,\n filePreviewParameters.description,\n filePreviewParameters.type,\n filePreviewParameters.objectUrl,\n filePreviewParameters.downloadUrl,\n filePreviewParameters.webPreviewUrl,\n filePreviewParameters.webEditUrl,\n filePreviewParameters.baseUrl,\n filePreviewParameters.editFile,\n filePreviewParameters.subEntityId,\n filePreviewParameters.viewerAction,\n filePreviewParameters.fileOpenPreference,\n filePreviewParameters.conversationId,\n ];\n\n sendMessageToParent('openFilePreview', params);\n}\n","/**\n * App install dialog constants\n */\nexport const teamsDeepLinkUrlPathForAppInstall = '/l/app/';\n\n/**\n * Calendar constants\n */\nexport const teamsDeepLinkUrlPathForCalendar = '/l/meeting/new';\nexport const teamsDeepLinkAttendeesUrlParameterName = 'attendees';\nexport const teamsDeepLinkStartTimeUrlParameterName = 'startTime';\nexport const teamsDeepLinkEndTimeUrlParameterName = 'endTime';\nexport const teamsDeepLinkSubjectUrlParameterName = 'subject';\nexport const teamsDeepLinkContentUrlParameterName = 'content';\n\n/**\n * Call constants\n */\nexport const teamsDeepLinkUrlPathForCall = '/l/call/0/0';\nexport const teamsDeepLinkSourceUrlParameterName = 'source';\nexport const teamsDeepLinkWithVideoUrlParameterName = 'withVideo';\n\n/**\n * Chat constants\n */\nexport const teamsDeepLinkUrlPathForChat = '/l/chat/0/0';\nexport const teamsDeepLinkUsersUrlParameterName = 'users';\nexport const teamsDeepLinkTopicUrlParameterName = 'topicName';\nexport const teamsDeepLinkMessageUrlParameterName = 'message';\n","import { sendMessageToParent } from '../internal/communication';\nimport { sendAndHandleStatusAndReason as sendAndHandleError } from '../internal/communication';\nimport { createTeamsDeepLinkForAppInstallDialog } from '../internal/deepLinkUtilities';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\nexport namespace appInstallDialog {\n export interface OpenAppInstallDialogParams {\n appId: string;\n }\n\n export function openAppInstallDialog(openAPPInstallDialogParams: OpenAppInstallDialogParams): Promise<void> {\n return new Promise((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleError(\n 'executeDeepLink',\n createTeamsDeepLinkForAppInstallDialog(openAPPInstallDialogParams.appId),\n ),\n );\n } else {\n sendMessageToParent('appInstallDialog.openAppInstallDialog', [openAPPInstallDialogParams]);\n resolve();\n }\n });\n }\n\n /**\n * Checks if the appInstallDialog capability is supported by the host\n * @returns boolean to represent whether the appInstallDialog capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.appInstallDialog ? true : false;\n }\n}\n","import { teamsDeepLinkHost, teamsDeepLinkProtocol } from './constants';\nimport {\n teamsDeepLinkAttendeesUrlParameterName,\n teamsDeepLinkContentUrlParameterName,\n teamsDeepLinkEndTimeUrlParameterName,\n teamsDeepLinkMessageUrlParameterName,\n teamsDeepLinkSourceUrlParameterName,\n teamsDeepLinkStartTimeUrlParameterName,\n teamsDeepLinkSubjectUrlParameterName,\n teamsDeepLinkTopicUrlParameterName,\n teamsDeepLinkUrlPathForAppInstall,\n teamsDeepLinkUrlPathForCalendar,\n teamsDeepLinkUrlPathForCall,\n teamsDeepLinkUrlPathForChat,\n teamsDeepLinkUsersUrlParameterName,\n teamsDeepLinkWithVideoUrlParameterName,\n} from './deepLinkConstants';\n\nexport function createTeamsDeepLinkForChat(users: string[], topic?: string, message?: string): string {\n if (users.length === 0) {\n throw new Error('Must have at least one user when creating a chat deep link');\n }\n\n const usersSearchParameter =\n `${teamsDeepLinkUsersUrlParameterName}=` + users.map((user) => encodeURIComponent(user)).join(',');\n const topicSearchParameter =\n topic === undefined ? '' : `&${teamsDeepLinkTopicUrlParameterName}=${encodeURIComponent(topic)}`;\n const messageSearchParameter =\n message === undefined ? '' : `&${teamsDeepLinkMessageUrlParameterName}=${encodeURIComponent(message)}`;\n\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForChat}?${usersSearchParameter}${topicSearchParameter}${messageSearchParameter}`;\n}\n\nexport function createTeamsDeepLinkForCall(targets: string[], withVideo?: boolean, source?: string): string {\n if (targets.length === 0) {\n throw new Error('Must have at least one target when creating a call deep link');\n }\n const usersSearchParameter =\n `${teamsDeepLinkUsersUrlParameterName}=` + targets.map((user) => encodeURIComponent(user)).join(',');\n const withVideoSearchParameter =\n withVideo === undefined ? '' : `&${teamsDeepLinkWithVideoUrlParameterName}=${encodeURIComponent(withVideo)}`;\n const sourceSearchParameter =\n source === undefined ? '' : `&${teamsDeepLinkSourceUrlParameterName}=${encodeURIComponent(source)}`;\n\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForCall}?${usersSearchParameter}${withVideoSearchParameter}${sourceSearchParameter}`;\n}\n\nexport function createTeamsDeepLinkForCalendar(\n attendees?: string[],\n startTime?: string,\n endTime?: string,\n subject?: string,\n content?: string,\n): string {\n const attendeeSearchParameter =\n attendees === undefined\n ? ''\n : `${teamsDeepLinkAttendeesUrlParameterName}=` +\n attendees.map((attendee) => encodeURIComponent(attendee)).join(',');\n const startTimeSearchParameter =\n startTime === undefined ? '' : `&${teamsDeepLinkStartTimeUrlParameterName}=${encodeURIComponent(startTime)}`;\n const endTimeSearchParameter =\n endTime === undefined ? '' : `&${teamsDeepLinkEndTimeUrlParameterName}=${encodeURIComponent(endTime)}`;\n const subjectSearchParameter =\n subject === undefined ? '' : `&${teamsDeepLinkSubjectUrlParameterName}=${encodeURIComponent(subject)}`;\n const contentSearchParameter =\n content === undefined ? '' : `&${teamsDeepLinkContentUrlParameterName}=${encodeURIComponent(content)}`;\n\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForCalendar}?${attendeeSearchParameter}${startTimeSearchParameter}${endTimeSearchParameter}${subjectSearchParameter}${contentSearchParameter}`;\n}\n\nexport function createTeamsDeepLinkForAppInstallDialog(appId: string): string {\n if (!appId) {\n throw new Error('App ID must be set when creating an app install dialog deep link');\n }\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForAppInstall}${encodeURIComponent(\n appId,\n )}`;\n}\n","/* eslint-disable @typescript-eslint/explicit-member-accessibility */\n\nimport { sendMessageToParent } from '../internal/communication';\nimport {\n captureImageMobileSupportVersion,\n getMediaCallbackSupportVersion,\n mediaAPISupportVersion,\n nonFullScreenVideoModeAPISupportVersion,\n scanBarCodeAPIMobileSupportVersion,\n} from '../internal/constants';\nimport { GlobalVars } from '../internal/globalVars';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport {\n ensureInitialized,\n isCurrentSDKVersionAtLeast,\n throwExceptionIfMobileApiIsNotSupported,\n} from '../internal/internalAPIs';\nimport {\n createFile,\n decodeAttachment,\n isVideoControllerRegistered,\n throwExceptionIfMediaCallIsNotSupportedOnMobile,\n validateGetMediaInputs,\n validateScanBarCodeInput,\n validateSelectMediaInputs,\n validateViewImagesInput,\n} from '../internal/mediaUtil';\nimport { generateGUID } from '../internal/utils';\nimport { FrameContexts, HostClientType } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\nexport namespace media {\n /**\n * Enum for file formats supported\n */\n export enum FileFormat {\n Base64 = 'base64',\n ID = 'id',\n }\n\n /**\n * File object that can be used to represent image or video or audio\n */\n export class File {\n /**\n * Content of the file. When format is Base64, this is the base64 content\n * When format is ID, this is id mapping to the URI\n * When format is base64 and app needs to use this directly in HTML tags, it should convert this to dataUrl.\n */\n public content: string;\n\n /**\n * Format of the content\n */\n public format: FileFormat;\n\n /**\n * Size of the file in KB\n */\n public size: number;\n\n /**\n * MIME type. This can be used for constructing a dataUrl, if needed.\n */\n public mimeType: string;\n\n /**\n * Optional: Name of the file\n */\n public name?: string;\n }\n\n /**\n * Launch camera, capture image or choose image from gallery and return the images as a File[] object to the callback.\n *\n * @params callback - Callback will be called with an @see SdkError if there are any.\n * If error is null or undefined, the callback will be called with a collection of @see File objects\n * @remarks\n * Note: Currently we support getting one File through this API, i.e. the file arrays size will be one.\n * Note: For desktop, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.\n *\n */\n export function captureImage(callback: (error: SdkError, files: File[]) => void): void {\n if (!callback) {\n throw new Error('[captureImage] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n if (!GlobalVars.isFramelessWindow) {\n const notSupportedError: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(notSupportedError, undefined);\n return;\n }\n\n if (!isCurrentSDKVersionAtLeast(captureImageMobileSupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(oldPlatformError, undefined);\n return;\n }\n\n sendMessageToParent('captureImage', callback);\n }\n\n /**\n * Media object returned by the select Media API\n */\n export class Media extends File {\n constructor(that: Media = null) {\n super();\n if (that) {\n this.content = that.content;\n this.format = that.format;\n this.mimeType = that.mimeType;\n this.name = that.name;\n this.preview = that.preview;\n this.size = that.size;\n }\n }\n\n /**\n * A preview of the file which is a lightweight representation.\n * In case of images this will be a thumbnail/compressed image in base64 encoding.\n */\n public preview: string;\n\n /**\n * Gets the media in chunks irrespective of size, these chunks are assembled and sent back to the webapp as file/blob\n * @param callback - callback is called with the @see SdkError if there is an error\n * If error is null or undefined, the callback will be called with @see Blob.\n */\n public getMedia(callback: (error: SdkError, blob: Blob) => void): void {\n if (!callback) {\n throw new Error('[get Media] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(oldPlatformError, null);\n return;\n }\n if (!validateGetMediaInputs(this.mimeType, this.format, this.content)) {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(invalidInput, null);\n return;\n }\n // Call the new get media implementation via callbacks if the client version is greater than or equal to '2.0.0'\n if (isCurrentSDKVersionAtLeast(getMediaCallbackSupportVersion)) {\n this.getMediaViaCallback(callback);\n } else {\n this.getMediaViaHandler(callback);\n }\n }\n\n private getMediaViaCallback(callback: (error: SdkError, blob: Blob) => void): void {\n const helper: MediaHelper = {\n mediaMimeType: this.mimeType,\n assembleAttachment: [],\n };\n const localUriId = [this.content];\n function handleGetMediaCallbackRequest(mediaResult: MediaResult): void {\n if (callback) {\n if (mediaResult && mediaResult.error) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(mediaResult.error, null);\n } else {\n if (mediaResult && mediaResult.mediaChunk) {\n // If the chunksequence number is less than equal to 0 implies EOF\n // create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number\n if (mediaResult.mediaChunk.chunkSequence <= 0) {\n const file = createFile(helper.assembleAttachment, helper.mediaMimeType);\n callback(mediaResult.error, file);\n } else {\n // Keep pushing chunks into assemble attachment\n const assemble: AssembleAttachment = decodeAttachment(mediaResult.mediaChunk, helper.mediaMimeType);\n helper.assembleAttachment.push(assemble);\n }\n } else {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, null);\n }\n }\n }\n }\n sendMessageToParent('getMedia', localUriId, handleGetMediaCallbackRequest);\n }\n\n private getMediaViaHandler(callback: (error: SdkError, blob: Blob) => void): void {\n const actionName = generateGUID();\n const helper: MediaHelper = {\n mediaMimeType: this.mimeType,\n assembleAttachment: [],\n };\n const params = [actionName, this.content];\n this.content && callback && sendMessageToParent('getMedia', params);\n function handleGetMediaRequest(response: string): void {\n if (callback) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const mediaResult: MediaResult = JSON.parse(response);\n if (mediaResult.error) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(mediaResult.error, null);\n removeHandler('getMedia' + actionName);\n } else {\n if (mediaResult.mediaChunk) {\n // If the chunksequence number is less than equal to 0 implies EOF\n // create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number\n if (mediaResult.mediaChunk.chunkSequence <= 0) {\n const file = createFile(helper.assembleAttachment, helper.mediaMimeType);\n callback(mediaResult.error, file);\n removeHandler('getMedia' + actionName);\n } else {\n // Keep pushing chunks into assemble attachment\n const assemble: AssembleAttachment = decodeAttachment(mediaResult.mediaChunk, helper.mediaMimeType);\n helper.assembleAttachment.push(assemble);\n }\n } else {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, null);\n removeHandler('getMedia' + actionName);\n }\n }\n }\n }\n\n registerHandler('getMedia' + actionName, handleGetMediaRequest);\n }\n }\n\n /**\n * Input parameter supplied to the select Media API\n */\n export interface MediaInputs {\n /**\n * Only one media type can be selected at a time\n */\n mediaType: MediaType;\n\n /**\n * max limit of media allowed to be selected in one go, current max limit is 10 set by office lens.\n */\n maxMediaCount: number;\n\n /**\n * Additional properties for customization of select media - Image in mobile devices\n */\n imageProps?: ImageProps;\n\n /**\n * Additional properties for customization of select media - Video in mobile devices\n */\n videoProps?: VideoProps;\n\n /**\n * Additional properties for customization of select media - VideoAndImage in mobile devices\n */\n videoAndImageProps?: VideoAndImageProps;\n\n /**\n * Additional properties for audio capture flows.\n */\n audioProps?: AudioProps;\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * All properties common to Image and Video Props\n */\n interface MediaProps {\n /**\n * @hidden\n * Optional; Lets the developer specify the media source, more than one can be specified.\n * Default value is both camera and gallery\n */\n sources?: Source[];\n\n /**\n * @hidden\n * Optional; Specify in which mode the camera will be opened.\n * Default value is Photo\n */\n startMode?: CameraStartMode;\n\n /**\n * @hidden\n * Optional; indicate if user is allowed to move between front and back camera\n * Default value is true\n */\n cameraSwitcher?: boolean;\n }\n\n /**\n * All properties in ImageProps are optional and have default values in the platform\n */\n export interface ImageProps extends MediaProps {\n /**\n * Optional; indicate if inking on the selected Image is allowed or not\n * Default value is true\n */\n ink?: boolean;\n\n /**\n * Optional; indicate if putting text stickers on the selected Image is allowed or not\n * Default value is true\n */\n textSticker?: boolean;\n\n /**\n * Optional; indicate if image filtering mode is enabled on the selected image\n * Default value is false\n */\n enableFilter?: boolean;\n\n /**\n * Optional; Lets the developer specify the image output formats, more than one can be specified.\n * Default value is Image.\n */\n imageOutputFormats?: ImageOutputFormats[];\n }\n\n /**\n * All properties in VideoProps are optional and have default values in the platform\n */\n export interface VideoProps extends MediaProps {\n /**\n * Optional; the maximum duration in seconds after which the recording should terminate automatically.\n * Default value is defined by the platform serving the API.\n */\n maxDuration?: number;\n\n /**\n * Optional; to determine if the video capturing flow needs to be launched\n * in Full Screen Mode (Lens implementation) or PictureInPicture Mode (Native implementation).\n * Default value is true, indicating video will always launch in Full Screen Mode via lens.\n */\n isFullScreenMode?: boolean;\n\n /**\n * Optional; controls the visibility of stop button in PictureInPicture Mode.\n * Default value is true, indicating the user will be able to stop the video.\n */\n isStopButtonVisible?: boolean;\n\n /**\n * Optional; setting VideoController will register your app to listen to the lifecycle events during the video capture flow.\n * Your app can also dynamically control the experience while capturing the video by notifying the host client.\n */\n videoController?: VideoController;\n }\n\n /**\n * All properties in VideoAndImageProps are optional and have default values in the platform\n */\n export interface VideoAndImageProps extends ImageProps, VideoProps {}\n\n /**\n * All properties in AudioProps are optional and have default values in the platform\n */\n export interface AudioProps {\n /**\n * Optional; the maximum duration in minutes after which the recording should terminate automatically\n * Default value is defined by the platform serving the API.\n */\n maxDuration?: number;\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Base class which holds the callback and notifies events to the host client\n */\n abstract class MediaController<T> {\n protected controllerCallback: T;\n\n public constructor(controllerCallback?: T) {\n this.controllerCallback = controllerCallback;\n }\n\n protected abstract getMediaType(): MediaType;\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * This function will be implemented by the respective media class which holds the logic\n * of specific events that needs to be notified to the app.\n * @param mediaEvent indicates the event signed by the host client to the app\n */\n protected abstract notifyEventToApp(mediaEvent: MediaControllerEvent): void;\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Function to notify the host client to programatically control the experience\n * @param mediaEvent indicates what the event that needs to be signaled to the host client\n * Optional; @param callback is used to send app if host client has successfully handled the notification event or not\n */\n protected notifyEventToHost(mediaEvent: MediaControllerEvent, callback?: (err?: SdkError) => void): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n try {\n throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);\n } catch (err) {\n if (callback) {\n callback(err);\n }\n return;\n }\n\n const params: MediaControllerParam = { mediaType: this.getMediaType(), mediaControllerEvent: mediaEvent };\n sendMessageToParent('media.controller', [params], (err?: SdkError) => {\n if (callback) {\n callback(err);\n }\n });\n }\n\n /**\n * Function to programatically stop the ongoing media event\n * Optional; @param callback is used to send app if host client has successfully stopped the event or not\n */\n public stop(callback?: (err?: SdkError) => void): void {\n this.notifyEventToHost(MediaControllerEvent.StopRecording, callback);\n }\n }\n\n /**\n * Callback which will register your app to listen to lifecycle events during the video capture flow\n */\n export interface VideoControllerCallback {\n onRecordingStarted?(): void;\n }\n\n /**\n * VideoController class is used to communicate between the app and the host client during the video capture flow\n */\n export class VideoController extends MediaController<VideoControllerCallback> {\n protected getMediaType(): MediaType {\n return MediaType.Video;\n }\n\n public notifyEventToApp(mediaEvent: MediaControllerEvent): void {\n if (!this.controllerCallback) {\n // Early return as app has not registered with the callback\n return;\n }\n\n switch (mediaEvent) {\n case MediaControllerEvent.StartRecording:\n if (this.controllerCallback.onRecordingStarted) {\n this.controllerCallback.onRecordingStarted();\n break;\n }\n }\n }\n }\n\n /**\n * @beta\n * Events which are used to communicate between the app and the host client during the media recording flow\n */\n export enum MediaControllerEvent {\n StartRecording = 1,\n StopRecording = 2,\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Interface with relevant info to send communication from the app to the host client\n */\n interface MediaControllerParam {\n /**\n * List of team information\n */\n mediaType: media.MediaType;\n\n /**\n * List of team information\n */\n mediaControllerEvent: MediaControllerEvent;\n }\n\n /**\n * The modes in which camera can be launched in select Media API\n */\n export enum CameraStartMode {\n Photo = 1,\n Document = 2,\n Whiteboard = 3,\n BusinessCard = 4,\n }\n\n /**\n * Specifies the image source\n */\n export enum Source {\n Camera = 1,\n Gallery = 2,\n }\n\n /**\n * Specifies the type of Media\n */\n export enum MediaType {\n Image = 1,\n Video = 2,\n VideoAndImage = 3,\n Audio = 4,\n }\n\n /**\n * Input for view images API\n */\n export interface ImageUri {\n value: string;\n type: ImageUriType;\n }\n\n /**\n * ID contains a mapping for content uri on platform's side, URL is generic\n */\n export enum ImageUriType {\n ID = 1,\n URL = 2,\n }\n\n /**\n * Specifies the image output formats.\n */\n export enum ImageOutputFormats {\n IMAGE = 1,\n PDF = 2,\n }\n\n /**\n * Media chunks an output of getMedia API from platform\n */\n export interface MediaChunk {\n /**\n * Base 64 data for the requested uri\n */\n chunk: string;\n\n /**\n * chunk sequence number\n */\n chunkSequence: number;\n }\n\n /**\n * Output of getMedia API from platform\n */\n export interface MediaResult {\n /**\n * error encountered in getMedia API\n */\n error: SdkError;\n\n /**\n * Media chunk which will be assemebled and converted into a blob\n */\n mediaChunk: MediaChunk;\n }\n\n /**\n * Helper object to assembled media chunks\n */\n export interface AssembleAttachment {\n sequence: number;\n file: Blob;\n }\n\n /**\n * Helper class for assembling media\n */\n interface MediaHelper {\n mediaMimeType: string;\n assembleAttachment: AssembleAttachment[];\n }\n\n /**\n * Select an attachment using camera/gallery\n *\n * @param mediaInputs - The input params to customize the media to be selected\n * @param callback - The callback to invoke after fetching the media\n */\n export function selectMedia(\n mediaInputs: MediaInputs,\n callback: (error: SdkError, attachments: Media[]) => void,\n ): void {\n if (!callback) {\n throw new Error('[select Media] Callback cannot be null');\n }\n\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(oldPlatformError, null);\n return;\n }\n\n try {\n throwExceptionIfMediaCallIsNotSupportedOnMobile(mediaInputs);\n } catch (err) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(err, null);\n return;\n }\n\n if (!validateSelectMediaInputs(mediaInputs)) {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(invalidInput, null);\n return;\n }\n\n const params = [mediaInputs];\n // What comes back from native as attachments would just be objects and will be missing getMedia method on them\n sendMessageToParent(\n 'selectMedia',\n params,\n (err: SdkError, localAttachments?: Media[], mediaEvent?: MediaControllerEvent) => {\n // MediaControllerEvent response is used to notify the app about events and is a partial response to selectMedia\n if (mediaEvent) {\n if (isVideoControllerRegistered(mediaInputs)) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n mediaInputs.videoProps.videoController.notifyEventToApp(mediaEvent);\n }\n return;\n }\n\n // Media Attachments are final response to selectMedia\n if (!localAttachments) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(err, null);\n return;\n }\n\n const mediaArray: Media[] = [];\n for (const attachment of localAttachments) {\n mediaArray.push(new Media(attachment));\n }\n callback(err, mediaArray);\n },\n );\n }\n\n /**\n * View images using native image viewer\n *\n * @param uriList - list of URIs for images to be viewed - can be content URI or server URL. Supports up to 10 Images in a single call\n * @param callback - returns back error if encountered, returns null in case of success\n */\n export function viewImages(uriList: ImageUri[], callback: (error?: SdkError) => void): void {\n if (!callback) {\n throw new Error('[view images] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n callback(oldPlatformError);\n return;\n }\n if (!validateViewImagesInput(uriList)) {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n callback(invalidInput);\n return;\n }\n\n const params = [uriList];\n sendMessageToParent('viewImages', params, callback);\n }\n\n /**\n * Barcode configuration supplied to scanBarCode API to customize barcode scanning experience in mobile\n * All properties in BarCodeConfig are optional and have default values in the platform\n */\n export interface BarCodeConfig {\n /**\n * Optional; Lets the developer specify the scan timeout interval in seconds\n * Default value is 30 seconds and max allowed value is 60 seconds\n */\n timeOutIntervalInSec?: number;\n }\n\n /**\n * @deprecated\n * As of 2.1.0, please use {@link barCode.scanBarCode barCode.scanBarCode(config?: BarCodeConfig): Promise\\<string\\>} instead.\n\n * Scan Barcode/QRcode using camera\n *\n * @remarks\n * Note: For desktop and web, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.\n *\n * @param callback - callback to invoke after scanning the barcode\n * @param config - optional input configuration to customize the barcode scanning experience\n */\n export function scanBarCode(callback: (error: SdkError, decodedText: string) => void, config?: BarCodeConfig): void {\n if (!callback) {\n throw new Error('[media.scanBarCode] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n if (\n GlobalVars.hostClientType === HostClientType.desktop ||\n GlobalVars.hostClientType === HostClientType.web ||\n GlobalVars.hostClientType === HostClientType.rigel ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsWindows ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||\n GlobalVars.hostClientType === HostClientType.teamsPhones ||\n GlobalVars.hostClientType === HostClientType.teamsDisplays\n ) {\n const notSupportedError: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(notSupportedError, null);\n return;\n }\n\n if (!isCurrentSDKVersionAtLeast(scanBarCodeAPIMobileSupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(oldPlatformError, null);\n return;\n }\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n if (!validateScanBarCodeInput(config)) {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(invalidInput, null);\n return;\n }\n\n sendMessageToParent('media.scanBarCode', [config], callback);\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { validateScanBarCodeInput } from '../internal/mediaUtil';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { DevicePermission, ErrorCode } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to interact with the barcode scanning-specific part of the SDK.\n *\n * @beta\n */\nexport namespace barCode {\n /**\n * Data structure to customize the barcode scanning experience in scanBarCode API.\n * All properties in BarCodeConfig are optional and have default values in the platform\n *\n * @beta\n */\n export interface BarCodeConfig {\n /**\n * Optional; designates the scan timeout interval in seconds.\n * Default value is 30 seconds, max allowed value is 60 seconds.\n */\n timeOutIntervalInSec?: number;\n }\n\n /**\n * Scan Barcode or QRcode using camera\n *\n * @param barCodeConfig - input configuration to customize the barcode scanning experience\n *\n * @returns a scanned code\n *\n * @beta\n */\n export function scanBarCode(barCodeConfig: BarCodeConfig): Promise<string> {\n return new Promise<string>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (!validateScanBarCodeInput(barCodeConfig)) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n\n resolve(sendAndHandleSdkError('media.scanBarCode', barCodeConfig));\n });\n }\n\n /**\n * Checks whether or not media has user permission\n *\n * @returns true if the user has granted the app permission to media information, false otherwise\n *\n * @beta\n */\n export function hasPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.Media;\n\n return new Promise<boolean>((resolve) => {\n resolve(sendAndHandleSdkError('permissions.has', permissions));\n });\n }\n\n /**\n * Requests user permission for media\n *\n * @returns true if the user has granted the app permission to the media, false otherwise\n *\n * @beta\n */\n export function requestPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.Media;\n\n return new Promise<boolean>((resolve) => {\n resolve(sendAndHandleSdkError('permissions.request', permissions));\n });\n }\n\n /**\n * Checks if barCode capability is supported by the host\n * @returns boolean to represent whether the barCode capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.barCode && runtime.supports.permissions ? true : false;\n }\n}\n","import { sendAndHandleStatusAndReason as sendAndHandleError } from '../internal/communication';\nimport { createTeamsDeepLinkForChat } from '../internal/deepLinkUtilities';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\n\n/**\n * Describes information needed to start a chat\n *\n * @beta\n */\ninterface OpenChatRequest {\n /**\n * An optional message used when initiating chat\n */\n message?: string;\n}\n\n/**\n * Used when starting a chat with one person\n *\n * @see OpenGroupChatRequest for use when a chat with more than one person\n *\n * @beta\n */\nexport interface OpenSingleChatRequest extends OpenChatRequest {\n /**\n * The Azure Active Directory UPN (e-mail address) of the user to chat with\n */\n user: string;\n}\n\n/**\n * Used when starting a chat with more than one person\n *\n * @see OpenSingleChatRequest for use in a chat with only one person\n *\n * @beta\n */\nexport interface OpenGroupChatRequest extends OpenChatRequest {\n /**\n * Array containing Azure Active Directory UPNs (e-mail addresss) of users to open chat with\n */\n users: string[];\n /**\n * The display name of a conversation for 3 or more users (chats with fewer than three users will ignore this field)\n */\n topic?: string;\n}\n\n/**\n * Contains functionality to start chat with others\n *\n * @beta\n */\nexport namespace chat {\n /**\n * Allows the user to open a chat with a single user and allows\n * for the user to specify the message they wish to send.\n *\n * @param openChatRequest: {@link OpenSingleChatRequest}- a request object that contains a user's email as well as an optional message parameter.\n *\n * @returns Promise resolved upon completion\n *\n * @beta\n */\n export function openChat(openChatRequest: OpenSingleChatRequest): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleError(\n 'executeDeepLink',\n createTeamsDeepLinkForChat([openChatRequest.user], undefined /*topic*/, openChatRequest.message),\n ),\n );\n } else {\n const sendPromise = sendAndHandleError('chat.openChat', {\n members: openChatRequest.user,\n message: openChatRequest.message,\n });\n resolve(sendPromise);\n }\n });\n }\n /**\n * Allows the user to create a chat with multiple users (2+) and allows\n * for the user to specify a message and name the topic of the conversation. If\n * only 1 user is provided into users array default back to origin openChat.\n *\n * @param openChatRequest: {@link OpenGroupChatRequest} - a request object that contains a list of user emails as well as optional parameters for message and topic (display name for the group chat).\n *\n * @returns Promise resolved upon completion\n *\n * @beta\n */\n export function openGroupChat(openChatRequest: OpenGroupChatRequest): Promise<void> {\n return new Promise<void>((resolve) => {\n if (openChatRequest.users.length < 1) {\n throw Error('OpenGroupChat Failed: No users specified');\n }\n if (openChatRequest.users.length === 1) {\n const chatRequest: OpenSingleChatRequest = {\n user: openChatRequest.users[0],\n message: openChatRequest.message,\n };\n openChat(chatRequest);\n } else {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleError(\n 'executeDeepLink',\n createTeamsDeepLinkForChat(openChatRequest.users, openChatRequest.topic, openChatRequest.message),\n ),\n );\n } else {\n const sendPromise = sendAndHandleError('chat.openChat', {\n members: openChatRequest.users,\n message: openChatRequest.message,\n topic: openChatRequest.topic,\n });\n resolve(sendPromise);\n }\n }\n });\n }\n\n /**\n * Checks if the chat capability is supported by the host\n * @returns boolean to represent whether the chat capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.chat ? true : false;\n }\n}\n","import { sendAndHandleSdkError as sendAndHandleError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { DevicePermission, ErrorCode } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to interact with the geoLocation module-specific part of the SDK. This is the newer version of location module.\n *\n * @beta\n */\nexport namespace geoLocation {\n /**\n * Data struture to represent the location information\n *\n * @beta\n */\n export interface Location {\n /**\n Latitude of the location\n */\n latitude: number;\n /**\n Longitude of the location\n */\n longitude: number;\n /**\n Accuracy describes the maximum distance in meters from the captured coordinates to the possible actual location\n @remarks\n This property is only in scope for mobile\n */\n accuracy?: number;\n /**\n Time stamp when the location was captured\n */\n timestamp?: number;\n }\n /**\n * Fetches current user coordinates\n * @returns Promise that will resolve with {@link geoLocation.Location} object or reject with an error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function getCurrentLocation(): Promise<Location> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n return sendAndHandleError('location.getLocation', { allowChooseLocation: false, showMap: false });\n }\n\n /**\n * Checks whether or not location has user permission\n *\n * @returns Promise that will resolve with true if the user had granted the app permission to location information, or with false otherwise,\n * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function hasPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.GeoLocation;\n\n return new Promise<boolean>((resolve) => {\n resolve(sendAndHandleError('permissions.has', permissions));\n });\n }\n\n /**\n * Requests user permission for location\n *\n * @returns true if the user consented permission for location, false otherwise\n * @returns Promise that will resolve with true if the user consented permission for location, or with false otherwise,\n * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function requestPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.GeoLocation;\n\n return new Promise<boolean>((resolve) => {\n resolve(sendAndHandleError('permissions.request', permissions));\n });\n }\n\n /**\n * Checks if geoLocation capability is supported by the host\n * @returns boolean to represent whether geoLocation is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.geoLocation && runtime.supports.permissions ? true : false;\n }\n\n /**\n * Namespace to interact with the location on map module-specific part of the SDK.\n *\n * @beta\n */\n export namespace map {\n /**\n * Allows user to choose location on map\n *\n * @returns Promise that will resolve with {@link geoLocation.Location} object chosen by the user or reject with an error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function chooseLocation(): Promise<Location> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n return sendAndHandleError('location.getLocation', { allowChooseLocation: true, showMap: true });\n }\n\n /**\n * Shows the location on map corresponding to the given coordinates\n *\n * @param location - Location to be shown on the map\n * @returns Promise that resolves when the location dialog has been closed or reject with an error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function showLocation(location: Location): Promise<void> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (!location) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n return sendAndHandleError('location.showLocation', location);\n }\n\n /**\n * Checks if geoLocation.map capability is supported by the host\n * @returns boolean to represent whether geoLocation.map is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) &&\n runtime.supports.geoLocation &&\n runtime.supports.geoLocation.map &&\n runtime.supports.permissions\n ? true\n : false;\n }\n }\n}\n","import { media } from '../public/media';\nimport { people } from '../public/people';\nimport {\n imageOutputFormatsAPISupportVersion,\n nonFullScreenVideoModeAPISupportVersion,\n videoAndImageMediaAPISupportVersion,\n} from './constants';\nimport { throwExceptionIfMobileApiIsNotSupported } from './internalAPIs';\n\n/**\n * @hidden\n * Helper function to create a blob from media chunks based on their sequence\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function createFile(assembleAttachment: media.AssembleAttachment[], mimeType: string): Blob {\n if (assembleAttachment == null || mimeType == null || assembleAttachment.length <= 0) {\n return null;\n }\n let file: Blob | undefined;\n let sequence = 1;\n assembleAttachment.sort((a, b) => (a.sequence > b.sequence ? 1 : -1));\n assembleAttachment.forEach((item) => {\n if (item.sequence == sequence) {\n if (file) {\n file = new Blob([file, item.file], { type: mimeType });\n } else {\n file = new Blob([item.file], { type: mimeType });\n }\n sequence++;\n }\n });\n return file;\n}\n\n/**\n * @hidden\n * Helper function to convert Media chunks into another object type which can be later assemebled\n * Converts base 64 encoded string to byte array and then into an array of blobs\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function decodeAttachment(attachment: media.MediaChunk, mimeType: string): media.AssembleAttachment {\n if (attachment == null || mimeType == null) {\n return null;\n }\n const decoded = atob(attachment.chunk);\n const byteNumbers = new Array(decoded.length);\n for (let i = 0; i < decoded.length; i++) {\n byteNumbers[i] = decoded.charCodeAt(i);\n }\n const byteArray = new Uint8Array(byteNumbers);\n const blob: Blob = new Blob([byteArray], { type: mimeType });\n const assemble: media.AssembleAttachment = {\n sequence: attachment.chunkSequence,\n file: blob,\n };\n return assemble;\n}\n\n/**\n * @hidden\n * Function throws an SdkError if the media call is not supported on current mobile version, else undefined.\n *\n * @throws an SdkError if the media call is not supported\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function throwExceptionIfMediaCallIsNotSupportedOnMobile(mediaInputs: media.MediaInputs): void {\n if (isMediaCallForVideoAndImageInputs(mediaInputs)) {\n throwExceptionIfMobileApiIsNotSupported(videoAndImageMediaAPISupportVersion);\n } else if (isMediaCallForNonFullScreenVideoMode(mediaInputs)) {\n throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);\n } else if (isMediaCallForImageOutputFormats(mediaInputs)) {\n throwExceptionIfMobileApiIsNotSupported(imageOutputFormatsAPISupportVersion);\n }\n}\n\n/**\n * @hidden\n * Function returns true if the app has registered to listen to video controller events, else false.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isVideoControllerRegistered(mediaInputs: media.MediaInputs): boolean {\n if (\n mediaInputs.mediaType == media.MediaType.Video &&\n mediaInputs.videoProps &&\n mediaInputs.videoProps.videoController\n ) {\n return true;\n }\n return false;\n}\n\n/**\n * @hidden\n * Returns true if the mediaInput params are valid and false otherwise\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateSelectMediaInputs(mediaInputs: media.MediaInputs): boolean {\n if (mediaInputs == null || mediaInputs.maxMediaCount > 10) {\n return false;\n }\n return true;\n}\n\n/**\n * @hidden\n * Returns true if the mediaInput params are called for mediatype Image and contains Image outputs formats, false otherwise\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isMediaCallForImageOutputFormats(mediaInputs: media.MediaInputs): boolean {\n if (mediaInputs?.mediaType == media.MediaType.Image && mediaInputs?.imageProps?.imageOutputFormats) {\n return true;\n }\n return false;\n}\n\n/**\n * @hidden\n * Returns true if the mediaInput params are called for mediatype VideoAndImage and false otherwise\n *\n * @internal\n */\nexport function isMediaCallForVideoAndImageInputs(mediaInputs: media.MediaInputs): boolean {\n if (mediaInputs && (mediaInputs.mediaType == media.MediaType.VideoAndImage || mediaInputs.videoAndImageProps)) {\n return true;\n }\n return false;\n}\n\n/**\n * @hidden\n * Returns true if the mediaInput params are called for non-full screen video mode and false otherwise\n *\n * @internal\n */\nexport function isMediaCallForNonFullScreenVideoMode(mediaInputs: media.MediaInputs): boolean {\n if (\n mediaInputs &&\n mediaInputs.mediaType == media.MediaType.Video &&\n mediaInputs.videoProps &&\n !mediaInputs.videoProps.isFullScreenMode\n ) {\n return true;\n }\n return false;\n}\n\n/**\n * @hidden\n * Returns true if the get Media params are valid and false otherwise\n *\n * @internal\n */\nexport function validateGetMediaInputs(mimeType: string, format: media.FileFormat, content: string): boolean {\n if (mimeType == null || format == null || format != media.FileFormat.ID || content == null) {\n return false;\n }\n return true;\n}\n\n/**\n * @hidden\n * Returns true if the view images param is valid and false otherwise\n *\n * @internal\n */\nexport function validateViewImagesInput(uriList: media.ImageUri[]): boolean {\n if (uriList == null || uriList.length <= 0 || uriList.length > 10) {\n return false;\n }\n return true;\n}\n\n/**\n * @hidden\n * Returns true if the scan barcode param is valid and false otherwise\n *\n * @internal\n */\nexport function validateScanBarCodeInput(barCodeConfig: media.BarCodeConfig): boolean {\n if (barCodeConfig) {\n if (\n barCodeConfig.timeOutIntervalInSec === null ||\n barCodeConfig.timeOutIntervalInSec <= 0 ||\n barCodeConfig.timeOutIntervalInSec > 60\n ) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * @hidden\n * Returns true if the people picker params are valid and false otherwise\n *\n * @internal\n */\nexport function validatePeoplePickerInput(peoplePickerInputs: people.PeoplePickerInputs): boolean {\n if (peoplePickerInputs) {\n if (peoplePickerInputs.title) {\n if (typeof peoplePickerInputs.title !== 'string') {\n return false;\n }\n }\n\n if (peoplePickerInputs.setSelected) {\n if (typeof peoplePickerInputs.setSelected !== 'object') {\n return false;\n }\n }\n\n if (peoplePickerInputs.openOrgWideSearchInChatOrChannel) {\n if (typeof peoplePickerInputs.openOrgWideSearchInChatOrChannel !== 'boolean') {\n return false;\n }\n }\n if (peoplePickerInputs.singleSelect) {\n if (typeof peoplePickerInputs.singleSelect !== 'boolean') {\n return false;\n }\n }\n }\n return true;\n}\n","import { AdaptiveCardVersion } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * @returns The {@linkcode AdaptiveCardVersion} representing the Adaptive Card schema\n * version supported by the host, or undefined if the host does not support Adaptive Cards\n */\nexport function getAdaptiveCardSchemaVersion(): AdaptiveCardVersion | undefined {\n if (!runtime.hostVersionsInfo) {\n return undefined;\n } else {\n return runtime.hostVersionsInfo.adaptiveCardSchemaVersion;\n }\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\n\nimport { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\nexport interface IAppWindow {\n /**\n * Send a message to the AppWindow.\n *\n * @param message - The message to send\n * @param onComplete - The callback to know if the postMessage has been success/failed.\n */\n postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;\n\n /**\n * Add a listener that will be called when an event is received from this AppWindow.\n *\n * @param type - The event to listen to. Currently the only supported type is 'message'.\n * @param listener - The listener that will be called\n */\n addEventListener(type: string, listener: Function): void;\n}\n\nexport class ChildAppWindow implements IAppWindow {\n /**\n * Send a message to the ChildAppWindow.\n *\n * @param message - The message to send\n * @param onComplete - The callback to know if the postMessage has been success/failed.\n */\n public postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(runtime);\n sendMessageToParent('messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());\n }\n /**\n * Add a listener that will be called when an event is received from the ChildAppWindow.\n *\n * @param type - The event to listen to. Currently the only supported type is 'message'.\n * @param listener - The listener that will be called\n */\n public addEventListener(type: string, listener: (message: any) => void): void {\n ensureInitialized(runtime);\n if (type === 'message') {\n registerHandler('messageForParent', listener);\n }\n }\n}\n\nexport class ParentAppWindow implements IAppWindow {\n private static _instance: ParentAppWindow;\n public static get Instance(): IAppWindow {\n // Do you need arguments? Make it a regular method instead.\n return this._instance || (this._instance = new this());\n }\n\n /**\n * Send a message to the ParentAppWindow.\n *\n * @param message - The message to send\n * @param onComplete - The callback to know if the postMessage has been success/failed.\n */\n public postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(runtime, FrameContexts.task);\n sendMessageToParent('messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());\n }\n\n /**\n * Add a listener that will be called when an event is received from the ParentAppWindow.\n *\n * @param type - The event to listen to. Currently the only supported type is 'message'.\n * @param listener - The listener that will be called\n */\n public addEventListener(type: string, listener: (message: any) => void): void {\n ensureInitialized(runtime, FrameContexts.task);\n if (type === 'message') {\n registerHandler('messageForChild', listener);\n }\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { locationAPIsRequiredVersion } from '../internal/constants';\nimport { ensureInitialized, isCurrentSDKVersionAtLeast } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * @deprecated\n * As of 2.1.0, please use geoLocation namespace.\n *\n * Namespace to interact with the location module-specific part of the SDK.\n */\nexport namespace location {\n /**\n * @deprecated\n * Data Structure to set the location properties in getLocation call.\n */\n export interface LocationProps {\n /**\n whether user can alter location or not\n if false, user will be shown current location \n and wouldn't be allowed to alter it\n */\n allowChooseLocation: boolean;\n /**\n whether selected location should be shown to user on map or not.\n If allowChooseLocation is true, this parameter will be ignored by platform.\n If allowChooseLocation is false, and this parameter is not provided, default \n value will be false.\n */\n showMap?: boolean;\n }\n\n /**\n * @deprecated\n * Data struture to represent the location information\n */\n export interface Location {\n /**\n Latitude of the location\n */\n latitude: number;\n /**\n Longitude of the location\n */\n longitude: number;\n /**\n Accuracy of the coordinates captured\n */\n accuracy?: number;\n /**\n Time stamp when the location was captured\n */\n timestamp?: number;\n }\n\n /**\n * @deprecated\n * As of 2.1.0, please use one of the following functions:\n * - {@link geoLocation.getCurrentLocation geoLocation.getCurrentLocation(): Promise\\<Location\\>} to get the current location.\n * - {@link geoLocation.map.chooseLocation geoLocation.map.chooseLocation(): Promise\\<Location\\>} to choose location on map.\n *\n * Fetches user location\n * @param props {@link LocationProps} - Specifying how the location request is handled\n * @param callback - Callback to invoke when current user location is fetched\n */\n export function getLocation(props: LocationProps, callback: (error: SdkError, location: Location) => void): void {\n if (!callback) {\n throw new Error('[location.getLocation] Callback cannot be null');\n }\n\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {\n throw { errorCode: ErrorCode.OLD_PLATFORM };\n }\n if (!props) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('location.getLocation', [props], callback);\n }\n\n /**\n * @deprecated\n * As of 2.1.0, please use {@link geoLocation.map.showLocation geoLocation.map.showLocation(location: Location): Promise\\<void\\>} instead.\n *\n * Shows the location on map corresponding to the given coordinates\n *\n * @param location - Location to be shown on the map\n * @param callback - Callback to invoke when the location is opened on map\n */\n export function showLocation(location: Location, callback: (error: SdkError, status: boolean) => void): void {\n if (!callback) {\n throw new Error('[location.showLocation] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {\n throw { errorCode: ErrorCode.OLD_PLATFORM };\n }\n if (!location) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n sendMessageToParent('location.showLocation', [location], callback);\n }\n\n /**\n * @deprecated\n * As of 2.1.0, please use geoLocation namespace, and use {@link geoLocation.isSupported geoLocation.isSupported: boolean} to check if geoLocation is supported.\n *\n * Checks if Location capability is supported by the host\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @returns boolean to represent whether Location is supported\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.location ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { doesHandlerExist, registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts } from './constants';\nimport { SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\nexport namespace meeting {\n /**\n * @hidden\n * Data structure to represent meeting details\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IMeetingDetailsResponse {\n /**\n * @hidden\n * details object\n */\n details: IMeetingDetails | ICallDetails;\n\n /**\n * @hidden\n * conversation object\n */\n conversation: IConversation;\n\n /**\n * @hidden\n * organizer object\n */\n organizer: IOrganizer;\n }\n\n /**\n * @hidden\n * Hide from docs\n * Base data structure to represent a meeting or call detail\n */\n export interface IMeetingOrCallDetailsBase<T> {\n /**\n * @hidden\n * Scheduled start time of the meeting or start time of the call\n */\n scheduledStartTime: string;\n\n /**\n * @hidden\n * url to join the current meeting or call\n */\n joinUrl?: string;\n\n /**\n * @hidden\n * type of the meeting or call\n */\n type?: T;\n }\n\n /**\n * @hidden\n * Hide from docs\n * Data structure to represent call details\n */\n export type ICallDetails = IMeetingOrCallDetailsBase<CallType>;\n\n /**\n * @hidden\n * Hide from docs\n * Data structure to represent meeting details.\n */\n export interface IMeetingDetails extends IMeetingOrCallDetailsBase<MeetingType> {\n /**\n * @hidden\n * Scheduled end time of the meeting\n */\n scheduledEndTime: string;\n\n /**\n * @hidden\n * meeting title name of the meeting\n */\n title?: string;\n }\n\n /**\n * @hidden\n * Data structure to represent a conversation object.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IConversation {\n /**\n * @hidden\n * conversation id of the meeting\n */\n id: string;\n }\n\n /**\n * @hidden\n * Data structure to represent an organizer object.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IOrganizer {\n /**\n * @hidden\n * organizer id of the meeting\n */\n id?: string;\n /**\n * @hidden\n * tenant id of the meeting\n */\n tenantId?: string;\n }\n\n export interface LiveStreamState {\n /**\n * indicates whether meeting is streaming\n */\n isStreaming: boolean;\n\n /**\n * error object in case there is a failure\n */\n error?: {\n /** error code from the streaming service, e.g. IngestionFailure */\n code: string;\n /** detailed error message string */\n message?: string;\n };\n }\n\n export interface IAppContentStageSharingCapabilities {\n /**\n * indicates whether app has permission to share contents to meeting stage\n */\n doesAppHaveSharePermission: boolean;\n }\n\n export interface IAppContentStageSharingState {\n /**\n * indicates whether app is currently being shared to stage\n */\n isAppSharing: boolean;\n }\n\n /**\n * Property bag for the speakingState changed event\n *\n */\n export interface ISpeakingState {\n /**\n * Indicates whether one or more participants in a meeting are speaking, or\n * if no participants are speaking\n */\n isSpeakingDetected: boolean;\n\n /**\n * error object in case there is a failure\n */\n error?: SdkError;\n }\n\n /**\n * Property bag for the meeting reaction received event\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface MeetingReactionReceivedEventData {\n /**\n * Indicates the type of meeting reaction received\n *\n * @hidden\n * Hide from docs.\n */\n meetingReactionType?: MeetingReactionType;\n /**\n * error object in case there is a failure\n *\n * @hidden\n * Hide from docs.\n */\n error?: SdkError;\n }\n\n /**\n * Interface for raiseHandState properties\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface IRaiseHandState {\n /** Indicates whether the selfParticipant's hand is raised or not\n *\n * @hidden\n * Hide from docs.\n */\n\n isHandRaised: boolean;\n }\n\n /**\n * Property bag for the raiseHandState changed event\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface RaiseHandStateChangedEventData {\n /**\n * entire raiseHandState object for the selfParticipant\n *\n * @hidden\n * Hide from docs.\n */\n raiseHandState: IRaiseHandState;\n\n /**\n * error object in case there is a failure\n *\n * @hidden\n * Hide from docs.\n */\n error?: SdkError;\n }\n\n /**\n * Interface for mic state change\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface MicState {\n /**\n * Indicates the mute status of the mic\n */\n isMicMuted: boolean;\n }\n\n /**\n * Reasons for the app's microphone state to change\n */\n enum MicStateChangeReason {\n HostInitiated,\n AppInitiated,\n AppDeclinedToChange,\n AppFailedToChange,\n }\n\n /**\n * Interface for RequestAppAudioHandling properties\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface RequestAppAudioHandlingParams {\n /**\n * Indicates whether the app is requesting to start handling audio, or if\n * it's giving audio back to the host\n */\n isAppHandlingAudio: boolean;\n /**\n * Callback for the host to tell the app to change its microphone state\n * @param micState The microphone state for the app to use\n * @returns A promise with the updated microphone state\n */\n micMuteStateChangedCallback: (micState: MicState) => Promise<MicState>;\n }\n\n /**\n * Different types of meeting reactions that can be sent/received\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export enum MeetingReactionType {\n like = 'like',\n heart = 'heart',\n laugh = 'laugh',\n surprised = 'surprised',\n applause = 'applause',\n }\n\n export enum MeetingType {\n Unknown = 'Unknown',\n Adhoc = 'Adhoc',\n Scheduled = 'Scheduled',\n Recurring = 'Recurring',\n Broadcast = 'Broadcast',\n MeetNow = 'MeetNow',\n }\n\n export enum CallType {\n OneOnOneCall = 'oneOnOneCall',\n GroupCall = 'groupCall',\n }\n\n /**\n * Allows an app to get the incoming audio speaker setting for the meeting user\n *\n * @param callback - Callback contains 2 parameters, error and result.\n *\n * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful\n * result can either contain the true/false value, incase of a successful fetch or null when the fetching fails\n * result: True means incoming audio is muted and false means incoming audio is unmuted\n */\n export function getIncomingClientAudioState(\n callback: (error: SdkError | null, result: boolean | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[get incoming client audio state] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('getIncomingClientAudioState', callback);\n }\n\n /**\n * Allows an app to toggle the incoming audio speaker setting for the meeting user from mute to unmute or vice-versa\n *\n * @param callback - Callback contains 2 parameters, error and result.\n * error can either contain an error of type SdkError, incase of an error, or null when toggle is successful\n * result can either contain the true/false value, incase of a successful toggle or null when the toggling fails\n * result: True means incoming audio is muted and false means incoming audio is unmuted\n */\n export function toggleIncomingClientAudio(callback: (error: SdkError | null, result: boolean | null) => void): void {\n if (!callback) {\n throw new Error('[toggle incoming client audio] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('toggleIncomingClientAudio', callback);\n }\n\n /**\n * @hidden\n * Allows an app to get the meeting details for the meeting\n *\n * @param callback - Callback contains 2 parameters, error and meetingDetailsResponse.\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\n * result can either contain a IMeetingDetailsResponse value, in case of a successful get or null when the get fails\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getMeetingDetails(\n callback: (error: SdkError | null, meetingDetails: IMeetingDetailsResponse | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[get meeting details] Callback cannot be null');\n }\n ensureInitialized(\n runtime,\n FrameContexts.sidePanel,\n FrameContexts.meetingStage,\n FrameContexts.settings,\n FrameContexts.content,\n );\n sendMessageToParent('meeting.getMeetingDetails', callback);\n }\n\n /**\n * @hidden\n * Allows an app to get the authentication token for the anonymous or guest user in the meeting\n *\n * @param callback - Callback contains 2 parameters, error and authenticationTokenOfAnonymousUser.\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\n * authenticationTokenOfAnonymousUser can either contain a string value, incase of a successful get or null when the get fails\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getAuthenticationTokenForAnonymousUser(\n callback: (error: SdkError | null, authenticationTokenOfAnonymousUser: string | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[get Authentication Token For AnonymousUser] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.task);\n sendMessageToParent('meeting.getAuthenticationTokenForAnonymousUser', callback);\n }\n\n /**\n * Allows an app to get the state of the live stream in the current meeting\n *\n * @param callback - Callback contains 2 parameters: error and liveStreamState.\n * error can either contain an error of type SdkError, in case of an error, or null when get is successful\n * liveStreamState can either contain a LiveStreamState value, or null when operation fails\n */\n export function getLiveStreamState(\n callback: (error: SdkError | null, liveStreamState: LiveStreamState | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[get live stream state] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n sendMessageToParent('meeting.getLiveStreamState', callback);\n }\n\n /**\n * Allows an app to request the live streaming be started at the given streaming url\n *\n * @remarks\n * Use getLiveStreamState or registerLiveStreamChangedHandler to get updates on the live stream state\n *\n * @param streamUrl - the url to the stream resource\n * @param streamKey - the key to the stream resource\n * @param callback - Callback contains error parameter which can be of type SdkError in case of an error, or null when operation is successful\n */\n export function requestStartLiveStreaming(\n callback: (error: SdkError | null) => void,\n streamUrl: string,\n streamKey?: string,\n ): void {\n if (!callback) {\n throw new Error('[request start live streaming] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n sendMessageToParent('meeting.requestStartLiveStreaming', [streamUrl, streamKey], callback);\n }\n\n /**\n * Allows an app to request the live streaming be stopped at the given streaming url\n *\n * @remarks\n * Use getLiveStreamState or registerLiveStreamChangedHandler to get updates on the live stream state\n *\n * @param callback - Callback contains error parameter which can be of type SdkError in case of an error, or null when operation is successful\n */\n export function requestStopLiveStreaming(callback: (error: SdkError | null) => void): void {\n if (!callback) {\n throw new Error('[request stop live streaming] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n sendMessageToParent('meeting.requestStopLiveStreaming', callback);\n }\n\n /**\n * Registers a handler for changes to the live stream.\n *\n * @remarks\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the live stream state changes\n */\n export function registerLiveStreamChangedHandler(handler: (liveStreamState: LiveStreamState) => void): void {\n if (!handler) {\n throw new Error('[register live stream changed handler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n registerHandler('meeting.liveStreamChanged', handler);\n }\n\n /**\n * Allows an app to share contents in the meeting\n *\n * @param callback - Callback contains 2 parameters, error and result.\n * error can either contain an error of type SdkError, incase of an error, or null when share is successful\n * result can either contain a true value, incase of a successful share or null when the share fails\n * @param appContentUrl - is the input URL which needs to be shared on to the stage\n */\n export function shareAppContentToStage(\n callback: (error: SdkError | null, result: boolean | null) => void,\n appContentUrl: string,\n ): void {\n if (!callback) {\n throw new Error('[share app content to stage] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('meeting.shareAppContentToStage', [appContentUrl], callback);\n }\n\n /**\n * Provides information related app's in-meeting sharing capabilities\n *\n * @param callback - Callback contains 2 parameters, error and result.\n * error can either contain an error of type SdkError (error indication), or null (non-error indication)\n * appContentStageSharingCapabilities can either contain an IAppContentStageSharingCapabilities object\n * (indication of successful retrieval), or null (indication of failed retrieval)\n */\n export function getAppContentStageSharingCapabilities(\n callback: (\n error: SdkError | null,\n appContentStageSharingCapabilities: IAppContentStageSharingCapabilities | null,\n ) => void,\n ): void {\n if (!callback) {\n throw new Error('[get app content stage sharing capabilities] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('meeting.getAppContentStageSharingCapabilities', callback);\n }\n\n /**\n * @hidden\n * Hide from docs.\n * Terminates current stage sharing session in meeting\n *\n * @param callback - Callback contains 2 parameters, error and result.\n * error can either contain an error of type SdkError (error indication), or null (non-error indication)\n * result can either contain a true boolean value (successful termination), or null (unsuccessful fetch)\n */\n export function stopSharingAppContentToStage(\n callback: (error: SdkError | null, result: boolean | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[stop sharing app content to stage] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('meeting.stopSharingAppContentToStage', callback);\n }\n\n /**\n * Provides information related to current stage sharing state for app\n *\n * @param callback - Callback contains 2 parameters, error and result.\n * error can either contain an error of type SdkError (error indication), or null (non-error indication)\n * appContentStageSharingState can either contain an IAppContentStageSharingState object\n * (indication of successful retrieval), or null (indication of failed retrieval)\n */\n export function getAppContentStageSharingState(\n callback: (error: SdkError | null, appContentStageSharingState: IAppContentStageSharingState | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[get app content stage sharing state] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('meeting.getAppContentStageSharingState', callback);\n }\n\n /**\n * Registers a handler for changes to paticipant speaking states. This API returns {@link ISpeakingState}, which will have isSpeakingDetected\n * and/or an error object. If any participant is speaking, isSpeakingDetected will be true. If no participants are speaking, isSpeakingDetected\n * will be false. Default value is false. Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler The handler to invoke when the speaking state of any participant changes (start/stop speaking).\n */\n export function registerSpeakingStateChangeHandler(handler: (speakingState: ISpeakingState) => void): void {\n if (!handler) {\n throw new Error('[registerSpeakingStateChangeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n registerHandler('meeting.speakingStateChanged', handler);\n }\n\n /**\n * Registers a handler for changes to the selfParticipant's (current user's) raiseHandState. If the selfParticipant raises their hand, isHandRaised\n * will be true. By default and if the selfParticipant hand is lowered, isHandRaised will be false. This API will return {@link RaiseHandStateChangedEventData}\n * that will have the raiseHandState or an error object. Only one handler can be registered at a time. A subsequent registration\n * replaces an existing registration.\n *\n * @param handler The handler to invoke when the selfParticipant's (current user's) raiseHandState changes.\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function registerRaiseHandStateChangedHandler(\n handler: (eventData: RaiseHandStateChangedEventData) => void,\n ): void {\n if (!handler) {\n throw new Error('[registerRaiseHandStateChangedHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n registerHandler('meeting.raiseHandStateChanged', handler);\n }\n\n /**\n * Registers a handler for receiving meeting reactions. When the selfParticipant (current user) successfully sends a meeting reaction and it is being rendered on the UI, the meetingReactionType will be populated. Only one handler can be registered\n * at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler The handler to invoke when the selfParticipant (current user) successfully sends a meeting reaction\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function registerMeetingReactionReceivedHandler(\n handler: (eventData: MeetingReactionReceivedEventData) => void,\n ): void {\n if (!handler) {\n throw new Error('[registerMeetingReactionReceivedHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n registerHandler('meeting.meetingReactionReceived', handler);\n }\n\n /**\n * Nested namespace for functions to control behavior of the app share button\n *\n * @beta\n */\n export namespace appShareButton {\n /**\n * Property bag for the setVisibilityInfo\n *\n * @beta\n */\n export interface ShareInformation {\n /**\n * boolean flag to set show or hide app share button\n */\n isVisible: boolean;\n\n /**\n * optional string contentUrl, which will override contentUrl coming from Manifest\n */\n contentUrl?: string;\n }\n /**\n * By default app share button will be hidden and this API will govern the visibility of it.\n *\n * This function can be used to hide/show app share button in meeting,\n * along with contentUrl (overrides contentUrl populated in app manifest)\n * @throws standard Invalid Url error\n * @param shareInformation has two elements, one isVisible boolean flag and another\n * optional string contentUrl, which will override contentUrl coming from Manifest\n * @beta\n */\n export function setOptions(shareInformation: ShareInformation): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (shareInformation.contentUrl) {\n new URL(shareInformation.contentUrl);\n }\n sendMessageToParent('meeting.appShareButton.setOptions', [shareInformation]);\n }\n }\n\n /**\n * Have the app handle audio (mic & speaker) and turn off host audio.\n *\n * When {@link RequestAppAudioHandlingParams.isAppHandlingAudio} is true, the host will switch to audioless mode\n * Registers for mic mute status change events, which are events that the app can receive from the host asking the app to\n * mute or unmute the microphone.\n *\n * When {@link RequestAppAudioHandlingParams.isAppHandlingAudio} is false, the host will switch out of audioless mode\n * Unregisters the mic mute status change events so the app will no longer receive these events\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n * @throws Error if {@link RequestAppAudioHandlingParams.micMuteStateChangedCallback} parameter is not defined\n *\n * @param requestAppAudioHandlingParams - {@link RequestAppAudioHandlingParams} object with values for the audio switchover\n * @param callback - Callback with one parameter, the result\n * can either be true (the host is now in audioless mode) or false (the host is not in audioless mode)\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function requestAppAudioHandling(\n requestAppAudioHandlingParams: RequestAppAudioHandlingParams,\n callback: (isHostAudioless: boolean) => void,\n ): void {\n if (!callback) {\n throw new Error('[requestAppAudioHandling] Callback response cannot be null');\n }\n if (!requestAppAudioHandlingParams.micMuteStateChangedCallback) {\n throw new Error('[requestAppAudioHandling] Callback Mic mute state handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n\n if (requestAppAudioHandlingParams.isAppHandlingAudio) {\n startAppAudioHandling(requestAppAudioHandlingParams, callback);\n } else {\n stopAppAudioHandling(requestAppAudioHandlingParams, callback);\n }\n }\n\n function startAppAudioHandling(\n requestAppAudioHandlingParams: RequestAppAudioHandlingParams,\n callback: (isHostAudioless: boolean) => void,\n ): void {\n const callbackInternalRequest = (error: SdkError | null, isHostAudioless: boolean | null): void => {\n if (error && isHostAudioless != null) {\n throw new Error('[requestAppAudioHandling] Callback response - both parameters cannot be set');\n }\n if (error) {\n throw new Error(`[requestAppAudioHandling] Callback response - SDK error ${error.errorCode} ${error.message}`);\n }\n if (typeof isHostAudioless !== 'boolean') {\n throw new Error('[requestAppAudioHandling] Callback response - isHostAudioless must be a boolean');\n }\n\n const micStateChangedCallback = async (micState: MicState): Promise<void> => {\n try {\n const newMicState = await requestAppAudioHandlingParams.micMuteStateChangedCallback(micState);\n\n const micStateDidUpdate = newMicState.isMicMuted === micState.isMicMuted;\n setMicStateWithReason(\n newMicState,\n micStateDidUpdate ? MicStateChangeReason.HostInitiated : MicStateChangeReason.AppDeclinedToChange,\n );\n } catch {\n setMicStateWithReason(micState, MicStateChangeReason.AppFailedToChange);\n }\n };\n registerHandler('meeting.micStateChanged', micStateChangedCallback);\n\n callback(isHostAudioless);\n };\n sendMessageToParent(\n 'meeting.requestAppAudioHandling',\n [requestAppAudioHandlingParams.isAppHandlingAudio],\n callbackInternalRequest,\n );\n }\n\n function stopAppAudioHandling(\n requestAppAudioHandlingParams: RequestAppAudioHandlingParams,\n callback: (isHostAudioless: boolean) => void,\n ): void {\n const callbackInternalStop = (error: SdkError | null, isHostAudioless: boolean | null): void => {\n if (error && isHostAudioless != null) {\n throw new Error('[requestAppAudioHandling] Callback response - both parameters cannot be set');\n }\n if (error) {\n throw new Error(`[requestAppAudioHandling] Callback response - SDK error ${error.errorCode} ${error.message}`);\n }\n if (typeof isHostAudioless !== 'boolean') {\n throw new Error('[requestAppAudioHandling] Callback response - isHostAudioless must be a boolean');\n }\n\n if (doesHandlerExist('meeting.micStateChanged')) {\n removeHandler('meeting.micStateChanged');\n }\n\n callback(isHostAudioless);\n };\n\n sendMessageToParent(\n 'meeting.requestAppAudioHandling',\n [requestAppAudioHandlingParams.isAppHandlingAudio],\n callbackInternalStop,\n );\n }\n\n /**\n * Notifies the host that the microphone state has changed in the app.\n * @param micState - The new state that the microphone is in\n * isMicMuted - Boolean to indicate the current mute status of the mic.\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function updateMicState(micState: MicState): void {\n setMicStateWithReason(micState, MicStateChangeReason.AppInitiated);\n }\n\n function setMicStateWithReason(micState: MicState, reason: MicStateChangeReason): void {\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('meeting.updateMicState', [micState, reason]);\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise, InputFunction } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\nexport namespace monetization {\n /**\n * @hidden\n * Data structure to represent a subscription plan.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface PlanInfo {\n /**\n * @hidden\n * plan id\n */\n planId: string;\n /**\n * @hidden\n * term of the plan\n */\n term: string;\n }\n\n /**\n * @hidden\n * Open dialog to start user's purchase experience\n *\n * @param planInfo optional parameter. It contains info of the subscription plan pushed to users.\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\n * @returns Promise that will be resolved when the operation has completed or rejected with SdkError value\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openPurchaseExperience(planInfo?: PlanInfo): Promise<void>;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link monetization.openPurchaseExperience monetization.openPurchaseExperience(planInfo?: PlanInfo): Promise\\<void\\>} instead.\n *\n * @hidden\n * Open dialog to start user's purchase experience\n *\n * @param callback Callback contains 1 parameters, error.\n * @param planInfo optional parameter. It contains info of the subscription plan pushed to users.\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openPurchaseExperience(callback: (error: SdkError | null) => void, planInfo?: PlanInfo): void;\n /**\n * @hidden\n * This function is the overloaded implementation of openPurchaseExperience.\n * Since the method signatures of the v1 callback and v2 promise differ in the type of the first parameter,\n * we need to do an extra check to know the typeof the @param1 to set the proper arguments of the utility function.\n * @param param1\n * @param param2\n * @returns Promise that will be resolved when the operation has completed or rejected with SdkError value\n */\n export function openPurchaseExperience(\n param1: ((error: SdkError | null) => void) | PlanInfo | undefined,\n param2?: PlanInfo,\n ): Promise<void> {\n let callback: ((error: SdkError | null) => void) | undefined;\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n let planInfo: PlanInfo;\n if (typeof param1 === 'function') {\n callback = param1;\n planInfo = param2;\n } else {\n planInfo = param1;\n }\n const wrappedFunction: InputFunction<void> = () => {\n return new Promise<void>((resolve) => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError('monetization.openPurchaseExperience', planInfo));\n });\n };\n\n ensureInitialized(runtime, FrameContexts.content);\n return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(wrappedFunction, callback);\n }\n\n /**\n * @hidden\n *\n * Checks if the monetization capability is supported by the host\n * @returns boolean to represent whether the monetization capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.monetization ? true : false;\n }\n}\n","import { sendAndHandleStatusAndReason as sendAndHandleError } from '../internal/communication';\nimport { createTeamsDeepLinkForCalendar } from '../internal/deepLinkUtilities';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\nexport namespace calendar {\n export function openCalendarItem(openCalendarItemParams: OpenCalendarItemParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n\n if (!openCalendarItemParams.itemId || !openCalendarItemParams.itemId.trim()) {\n throw new Error('Must supply an itemId to openCalendarItem');\n }\n\n resolve(sendAndHandleError('calendar.openCalendarItem', openCalendarItemParams));\n });\n }\n export function composeMeeting(composeMeetingParams: ComposeMeetingParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleError(\n 'executeDeepLink',\n createTeamsDeepLinkForCalendar(\n composeMeetingParams.attendees,\n composeMeetingParams.startTime,\n composeMeetingParams.endTime,\n composeMeetingParams.subject,\n composeMeetingParams.content,\n ),\n ),\n );\n } else {\n resolve(sendAndHandleError('calendar.composeMeeting', composeMeetingParams));\n }\n });\n }\n\n /**\n * Checks if the calendar capability is supported by the host\n * @returns boolean to represent whether the calendar capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.calendar ? true : false;\n }\n\n export interface OpenCalendarItemParams {\n itemId: string;\n }\n\n export interface ComposeMeetingParams {\n attendees?: string[];\n startTime?: string;\n endTime?: string;\n subject?: string;\n content?: string;\n }\n}\n","import { sendAndHandleStatusAndReason as sendAndHandleError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\nexport namespace mail {\n export function openMailItem(openMailItemParams: OpenMailItemParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n\n if (!openMailItemParams.itemId || !openMailItemParams.itemId.trim()) {\n throw new Error('Must supply an itemId to openMailItem');\n }\n\n resolve(sendAndHandleError('mail.openMailItem', openMailItemParams));\n });\n }\n\n export function composeMail(composeMailParams: ComposeMailParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n\n resolve(sendAndHandleError('mail.composeMail', composeMailParams));\n });\n }\n\n /**\n * Checks if the mail capability is supported by the host\n * @returns boolean to represent whether the mail capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.mail ? true : false;\n }\n\n export interface OpenMailItemParams {\n itemId: string;\n }\n\n export enum ComposeMailType {\n New = 'new',\n Reply = 'reply',\n ReplyAll = 'replyAll',\n Forward = 'forward',\n }\n\n /**\n * Foundational interface for all other mail compose interfaces\n * Used for holding the type of mail item being composed\n *\n * @see {@link ComposeMailType}\n */\n interface ComposeMailBase<T extends ComposeMailType> {\n type: T;\n }\n\n /**\n * Parameters supplied when composing a new mail item\n */\n export interface ComposeNewParams extends ComposeMailBase<ComposeMailType.New> {\n /**\n * The To: recipients for the message\n */\n toRecipients?: string[];\n\n /**\n * The Cc: recipients for the message\n */\n ccRecipients?: string[];\n\n /**\n * The Bcc: recipients for the message\n */\n bccRecipients?: string[];\n\n /**\n * The subject of the message\n */\n subject?: string;\n\n /**\n * The body of the message\n */\n message?: string;\n }\n\n /**\n * Parameters supplied when composing a reply to or forward of a message\n *\n * @see {@link ComposeMailType}\n */\n export interface ComposeReplyOrForwardParams<T extends ComposeMailType> extends ComposeMailBase<T> {\n itemid: string;\n }\n\n /**\n * Parameters supplied to {@link composeMail} when composing a new mail item\n *\n * @see {@link ComposeNewParams}\n * @see {@link ComposeReplyOrForwardParams}\n * @see {@link ComposeMailType}\n */\n export type ComposeMailParams =\n | ComposeNewParams\n | ComposeReplyOrForwardParams<ComposeMailType.Reply>\n | ComposeReplyOrForwardParams<ComposeMailType.ReplyAll>\n | ComposeReplyOrForwardParams<ComposeMailType.Forward>;\n}\n","import { sendAndHandleSdkError as sendAndHandleError } from '../internal/communication';\nimport { peoplePickerRequiredVersion } from '../internal/constants';\nimport { ensureInitialized, isCurrentSDKVersionAtLeast } from '../internal/internalAPIs';\nimport { validatePeoplePickerInput } from '../internal/mediaUtil';\nimport { callCallbackWithErrorOrResultFromPromiseAndReturnPromise } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\nexport namespace people {\n /**\n * Launches a people picker and allows the user to select one or more people from the list\n * If the app is added to personal app scope the people picker launched is org wide and if the app is added to a chat/channel, people picker launched is also limited to the members of chat/channel\n \n * @param callback - Returns list of JSON object of type PeoplePickerResult which consists of AAD IDs, display names and emails of the selected users\n * @param peoplePickerInputs - Input parameters to launch customized people picker\n * @returns Promise that will be fulfilled when the operation has completed\n */\n export function selectPeople(peoplePickerInputs?: PeoplePickerInputs): Promise<PeoplePickerResult[]>;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link people.selectPeople people.selectPeople(peoplePickerInputs?: PeoplePickerInputs): Promise\\<PeoplePickerResult[]\\>} instead.\n *\n * Launches a people picker and allows the user to select one or more people from the list\n * If the app is added to personal app scope the people picker launched is org wide and if the app is added to a chat/channel, people picker launched is also limited to the members of chat/channel\n \n * @param callback - Returns list of JSON object of type PeoplePickerResult which consists of AAD IDs, display names and emails of the selected users\n * @param peoplePickerInputs - Input parameters to launch customized people picker\n */\n export function selectPeople(\n callback: (error: SdkError, people: PeoplePickerResult[]) => void,\n peoplePickerInputs?: PeoplePickerInputs,\n ): void;\n /**\n * @hidden\n * This function is the overloaded implementation of selectPeople.\n * Since the method signatures of the v1 callback and v2 promise differ in the type of the first parameter,\n * we need to do an extra check to know the typeof the @param1 to set the proper arguments of the utility function.\n * @param param1\n * @param param2\n * @returns Promise of Array of PeoplePickerResult objects.\n */\n export function selectPeople(\n param1: PeoplePickerInputs | ((error: SdkError, people: PeoplePickerResult[]) => void) | undefined,\n param2?: PeoplePickerInputs,\n ): Promise<PeoplePickerResult[]> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.settings);\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n let callback: (error: SdkError, people: PeoplePickerResult[]) => void;\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n let peoplePickerInputs: PeoplePickerInputs;\n\n if (typeof param1 === 'function') {\n [callback, peoplePickerInputs] = [param1, param2];\n } else {\n peoplePickerInputs = param1;\n }\n\n return callCallbackWithErrorOrResultFromPromiseAndReturnPromise<PeoplePickerResult[]>(\n selectPeopleHelper,\n callback,\n peoplePickerInputs,\n );\n }\n\n function selectPeopleHelper(peoplePickerInputs?: PeoplePickerInputs): Promise<PeoplePickerResult[]> {\n return new Promise<PeoplePickerResult[]>((resolve) => {\n if (!isCurrentSDKVersionAtLeast(peoplePickerRequiredVersion)) {\n throw { errorCode: ErrorCode.OLD_PLATFORM };\n }\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n if (!validatePeoplePickerInput(peoplePickerInputs)) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(sendAndHandleError('people.selectPeople', peoplePickerInputs));\n });\n }\n\n /**\n * Input parameter supplied to the People Picker API\n */\n export interface PeoplePickerInputs {\n /**\n * Optional; Set title for the people picker\n * Default value is \"Select people\" for multiselect and \"Select a person\" for single select\n */\n title?: string;\n\n /**\n * Optional; AAD ids of the users to be pre-populated in the search box of people picker control\n * If single select is enabled this value, only the first user in the list will be pre-populated\n * Default value is null\n */\n setSelected?: string[];\n\n /**\n * Optional; launches the people picker in org wide scope even if the app is added to a chat or channel\n * Default value is false\n */\n openOrgWideSearchInChatOrChannel?: boolean;\n\n /**\n * Optional; launches the people picker for which only 1 person can be selected\n * Default value is false\n */\n singleSelect?: boolean;\n }\n\n /**\n * Output user object of people picker API\n */\n export interface PeoplePickerResult {\n /**\n * user object Id (also known as aad id) of the selected user\n */\n objectId: string;\n\n /**\n * Optional; display name of the selected user\n */\n displayName?: string;\n\n /**\n * Optional; email of the selected user\n */\n email?: string;\n }\n\n /**\n * Checks if the people capability is supported by the host\n * @returns boolean to represent whether the people capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.people ? true : false;\n }\n}\n","import { sendAndHandleSdkError as sendAndHandleError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { validateShowProfileRequest } from '../internal/profileUtil';\nimport { FrameContexts } from './constants';\nimport { ErrorCode } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Namespace for profile related APIs.\n *\n * @beta\n */\nexport namespace profile {\n /**\n * Opens a profile card at a specified position to show profile information about a persona.\n * @param showProfileRequest The parameters to position the card and identify the target user.\n * @returns Promise that will be fulfilled when the operation has completed\n *\n * @beta\n */\n export function showProfile(showProfileRequest: ShowProfileRequest): Promise<void> {\n ensureInitialized(runtime, FrameContexts.content);\n\n return new Promise<void>((resolve) => {\n const [isValid, message] = validateShowProfileRequest(showProfileRequest);\n if (!isValid) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS, message };\n }\n\n // Convert the app provided parameters to the form suitable for postMessage.\n const requestInternal: ShowProfileRequestInternal = {\n modality: showProfileRequest.modality,\n persona: showProfileRequest.persona,\n triggerType: showProfileRequest.triggerType,\n targetRectangle: {\n x: showProfileRequest.targetElementBoundingRect.x,\n y: showProfileRequest.targetElementBoundingRect.y,\n width: showProfileRequest.targetElementBoundingRect.width,\n height: showProfileRequest.targetElementBoundingRect.height,\n },\n };\n\n resolve(sendAndHandleError('profile.showProfile', requestInternal));\n });\n }\n\n /**\n * The type of modalities that are supported when showing a profile.\n * Can be provided as an optional hint with the request and will be\n * respected if the hosting M365 application supports it.\n *\n * @beta\n */\n export type Modality = 'Card' | 'Expanded';\n\n /**\n * The type of the profile trigger.\n * - MouseHover: The user hovered a target.\n * - Press: The target was pressed with either a mouse click or keyboard key press.\n * - AppRequest: The show profile request is happening programmatically, without direct user interaction.\n *\n * @beta\n */\n export type TriggerType = 'MouseHover' | 'Press' | 'AppRequest';\n\n /**\n * The set of identifiers that are supported for resolving the persona.\n *\n * At least one is required, and if multiple are provided then only the highest\n * priority one will be used (AadObjectId > Upn > Smtp).\n *\n * @beta\n */\n export type PersonaIdentifiers = {\n /**\n * The object id in Azure Active Directory.\n *\n * This id is guaranteed to be unique for an object within a tenant,\n * and so if provided will lead to a more performant lookup. It can\n * be resolved via MS Graph (see https://learn.microsoft.com/graph/api/resources/users\n * for examples).\n */\n readonly AadObjectId?: string;\n\n /**\n * The primary SMTP address.\n */\n readonly Smtp?: string;\n\n /**\n * The user principle name.\n */\n readonly Upn?: string;\n };\n\n /**\n * The persona to show the profile for.\n *\n * @beta\n */\n export interface Persona {\n /**\n * The set of identifiers that are supported for resolving the persona.\n */\n identifiers: PersonaIdentifiers;\n\n /**\n * Optional display name override. If not specified the user's display name will be resolved normally.\n */\n displayName?: string;\n }\n\n /**\n * Input parameters provided to the showProfile API.\n *\n * @beta\n */\n export interface ShowProfileRequest {\n /**\n * An optional hint to the hosting M365 application about which modality of the profile you want to show.\n */\n modality?: Modality;\n\n /**\n * The information about the persona to show the profile for.\n */\n persona: Persona;\n\n /**\n * The bounding rectangle of the target.\n */\n targetElementBoundingRect: DOMRect;\n\n /**\n * Specifies which user interaction was used to trigger the API call.\n */\n triggerType: TriggerType;\n }\n\n /**\n * Checks if the profile capability is supported by the host\n * @returns boolean to represent whether the profile capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.profile ? true : false;\n }\n}\n\n/**\n * Internal representation of a DOMRect suitable for sending via postMessage.\n */\nexport type Rectangle = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\n/**\n * @beta\n * @hidden\n * An internal representation of the showProfile parameters suitable for sending via postMessage.\n * The hub expects to receive an object of this type.\n */\nexport interface ShowProfileRequestInternal {\n modality?: profile.Modality;\n persona: profile.Persona;\n targetRectangle: Rectangle;\n triggerType: profile.TriggerType;\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to video extensibility of the SDK\n * @beta\n */\nexport namespace video {\n /**\n * Represents a video frame\n * @beta\n */\n export interface VideoFrame {\n /**\n * Video frame width\n */\n width: number;\n /**\n * Video frame height\n */\n height: number;\n /**\n * Video frame buffer\n */\n data: Uint8ClampedArray;\n /**\n * NV12 luma stride, valid only when video frame format is NV12\n */\n lumaStride?: number;\n /**\n * NV12 chroma stride, valid only when video frame format is NV12\n */\n chromaStride?: number;\n /**\n * RGB stride, valid only when video frame format is RGB\n */\n stride?: number;\n /**\n * The time stamp of the current video frame\n */\n timestamp?: number;\n }\n\n /**\n * Video frame format enum, currently only support NV12\n * @beta\n */\n export enum VideoFrameFormat {\n NV12,\n }\n\n /**\n * Video frame configuration supplied to the host to customize the generated video frame parameters, like format\n * @beta\n */\n export interface VideoFrameConfig {\n /**\n * Video format\n */\n format: VideoFrameFormat;\n }\n\n /**\n * Video effect change type enum\n * @beta\n */\n export enum EffectChangeType {\n /**\n * Current video effect changed\n */\n EffectChanged,\n /**\n * Disable the video effect\n */\n EffectDisabled,\n }\n\n /**\n * Video frame call back function definition\n * @beta\n */\n export type VideoFrameCallback = (\n frame: VideoFrame,\n notifyVideoFrameProcessed: () => void,\n notifyError: (errorMessage: string) => void,\n ) => void;\n\n /**\n * Predefined failure reasons for preparing the selected video effect\n * @beta\n */\n export enum EffectFailureReason {\n /**\n * A wrong effect id is provide.\n * Use this reason when the effect id is not found or empty, this may indicate a mismatch between the app and its manifest or a bug of the host.\n */\n InvalidEffectId = 'InvalidEffectId',\n /**\n * The effect can't be initialized\n */\n InitializationFailure = 'InitializationFailure',\n }\n\n /**\n * Video effect change call back function definition\n * Return a Promise which will be resolved when the effect is prepared, or throw an {@link EffectFailureReason} on error.\n * @beta\n */\n export type VideoEffectCallback = (effectId: string | undefined) => Promise<void>;\n\n /**\n * Register to read the video frames in Permissions section\n * @beta\n * @param frameCallback - The callback to invoke when registerForVideoFrame has completed\n * @param config - VideoFrameConfig to customize generated video frame parameters\n */\n export function registerForVideoFrame(frameCallback: VideoFrameCallback, config: VideoFrameConfig): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n registerHandler(\n 'video.newVideoFrame',\n (videoFrame: VideoFrame) => {\n if (videoFrame) {\n const timestamp = videoFrame.timestamp;\n frameCallback(\n videoFrame,\n () => {\n notifyVideoFrameProcessed(timestamp);\n },\n notifyError,\n );\n }\n },\n false,\n );\n sendMessageToParent('video.registerForVideoFrame', [config]);\n }\n\n /**\n * Video extension should call this to notify host that the current selected effect parameter changed.\n * If it's pre-meeting, host will call videoEffectCallback immediately then use the videoEffect.\n * If it's the in-meeting scenario, we will call videoEffectCallback when apply button clicked.\n * @beta\n * @param effectChangeType - the effect change type.\n * @param effectId - Newly selected effect id.\n */\n export function notifySelectedVideoEffectChanged(\n effectChangeType: EffectChangeType,\n effectId: string | undefined,\n ): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('video.videoEffectChanged', [effectChangeType, effectId]);\n }\n\n /**\n * Register a callback to be notified when a new video effect is applied.\n * @beta\n * @param callback - Function to be called when new video effect is applied.\n */\n export function registerForVideoEffect(callback: VideoEffectCallback): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n const effectParameterChangeHandler = (effectId: string | undefined): void => {\n callback(effectId)\n .then(() => {\n sendMessageToParent('video.videoEffectReadiness', [true, effectId]);\n })\n .catch((reason) => {\n const validReason = reason in EffectFailureReason ? reason : EffectFailureReason.InitializationFailure;\n sendMessageToParent('video.videoEffectReadiness', [false, effectId, validReason]);\n });\n };\n\n registerHandler('video.effectParameterChange', effectParameterChangeHandler, false);\n sendMessageToParent('video.registerForVideoEffect');\n }\n\n /**\n * Sending notification to host finished the video frame processing, now host can render this video frame\n * or pass the video frame to next one in video pipeline\n * @beta\n */\n function notifyVideoFrameProcessed(timestamp?: number): void {\n sendMessageToParent('video.videoFrameProcessed', [timestamp]);\n }\n\n /**\n * Sending error notification to host\n * @beta\n * @param errorMessage - The error message that will be sent to the host\n */\n function notifyError(errorMessage: string): void {\n sendMessageToParent('video.notifyError', [errorMessage]);\n }\n\n /**\n * Checks if video capability is supported by the host\n * @beta\n * @returns boolean to represent whether the video capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.video ? true : false;\n }\n} //end of video namespace\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * Allows your application to interact with the host M365 application's search box.\n * By integrating your application with the host's search box, users can search\n * your app using the same search box they use elsewhere in Teams, Outlook, or Office.\n *\n * This functionality is in Beta.\n * @beta\n */\nexport namespace search {\n const onChangeHandlerName = 'search.queryChange';\n const onClosedHandlerName = 'search.queryClose';\n const onExecutedHandlerName = 'search.queryExecute';\n\n /**\n * This interface contains information pertaining to the contents of the host M365 application's search box\n *\n * @beta\n */\n export interface SearchQuery {\n /** The current search term in the host search experience */\n searchTerm: string;\n\n /** Timestamp sequence value to ensure messages are processed in correct order / combine them. */\n timestamp: number;\n }\n\n /**\n * This type will store the SearchQuery and allow other logic to be made inside the handler.\n *\n * @beta\n */\n export type SearchQueryHandler = (query: SearchQuery) => void;\n\n /**\n * Allows the caller to register for various events fired by the host search experience.\n * Calling this function indicates that your application intends to plug into the host's search box and handle search events,\n * when the user is actively using your page/tab.\n * \n * The host may visually update its search box, e.g. with the name or icon of your application.\n * \n * Your application should *not* re-render inside of these callbacks, there may be a large number\n * of onChangeHandler calls if the user is typing rapidly in the search box.\n *\n * @param onClosedHandler - This handler will be called when the user exits or cancels their search.\n * Should be used to return your application to its most recent, non-search state. The value of {@link SearchQuery.searchTerm} \n * will be whatever the last query was before ending search. \n * \n * @param onExecuteHandler - The handler will be called when the user executes their \n * search (by pressing Enter for example). Should be used to display the full list of search results. \n * The value of {@link SearchQuery.searchTerm} is the complete query the user entered in the search box.\n *\n * @param onChangeHandler - This optional handler will be called when the user first starts using the\n * host's search box and as the user types their query. Can be used to put your application into a \n * word-wheeling state or to display suggestions as the user is typing. \n * \n * This handler will be called with an empty {@link SearchQuery.searchTerm} when search is beginning, and subsequently,\n * with the current contents of the search box.\n * @example\n * ``` ts\n * search.registerHandlers(\n query => {\n console.log('Update your application to handle the search experience being closed. Last query: ${query.searchTerm}');\n },\n query => {\n console.log(`Update your application to handle an executed search result: ${query.searchTerm}`);\n },\n query => {\n console.log(`Update your application with the changed search query: ${query.searchTerm}`);\n },\n );\n * ```\n *\n * @beta\n */\n export function registerHandlers(\n onClosedHandler: SearchQueryHandler,\n onExecuteHandler: SearchQueryHandler,\n onChangeHandler?: SearchQueryHandler,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n registerHandler(onClosedHandlerName, onClosedHandler);\n registerHandler(onExecutedHandlerName, onExecuteHandler);\n if (onChangeHandler) {\n registerHandler(onChangeHandlerName, onChangeHandler);\n }\n }\n\n /**\n * Allows the caller to unregister for all events fired by the host search experience. Calling\n * this function will cause your app to stop appearing in the set of search scopes in the hosts\n *\n * @beta\n */\n export function unregisterHandlers(): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n // This should let the host know to stop making the app scope show up in the search experience\n // Can also be used to clean up handlers on the host if desired\n sendMessageToParent('search.unregister');\n removeHandler(onChangeHandlerName);\n removeHandler(onClosedHandlerName);\n removeHandler(onExecutedHandlerName);\n }\n\n /**\n * Checks if search capability is supported by the host\n * @returns boolean to represent whether the search capability is supported\n *\n * @throws Error if {@link app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.search ? true : false;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { callCallbackWithSdkErrorFromPromiseAndReturnPromise, InputFunction } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to open a share dialog for web content.\n * For more info, see [Share to Teams from personal app or tab](https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/share-to-teams-from-personal-app-or-tab)\n */\nexport namespace sharing {\n export const SharingAPIMessages = {\n shareWebContent: 'sharing.shareWebContent',\n };\n\n // More types can be added as we expand share capability\n type ContentType = 'URL';\n\n interface IBaseSharedContent {\n type: ContentType;\n }\n\n // More types can be added as we expand share capability\n export type IShareRequestContentType = IURLContent;\n\n export interface IShareRequest<T> {\n content: T[];\n }\n\n export interface IURLContent extends IBaseSharedContent {\n type: 'URL';\n\n /**\n * Required URL\n */\n url: string;\n\n /**\n * Default initial message text\n */\n message?: string;\n\n /**\n * Show URL preview, defaults to true\n */\n preview?: boolean;\n }\n\n /**\n * Feature is under development\n * Opens a share dialog for web content\n *\n * @param shareWebContentRequest - web content info\n * @returns Promise that will be fulfilled when the operation has completed\n */\n export function shareWebContent(shareWebContentRequest: IShareRequest<IShareRequestContentType>): Promise<void>;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link sharing.shareWebContent sharing.shareWebContent(shareWebContentRequest: IShareRequest\\<IShareRequestContentType\\>): Promise\\<void\\>} instead.\n *\n * Feature is under development\n * Opens a share dialog for web content\n *\n * @param shareWebContentRequest - web content info\n * @param callback - optional callback\n */\n export function shareWebContent(\n shareWebContentRequest: IShareRequest<IShareRequestContentType>,\n callback: (err?: SdkError) => void,\n ): void;\n export function shareWebContent(\n shareWebContentRequest: IShareRequest<IShareRequestContentType>,\n callback?: (err?: SdkError) => void,\n ): Promise<void> {\n // validate the given input (synchronous check)\n try {\n validateNonEmptyContent(shareWebContentRequest);\n validateTypeConsistency(shareWebContentRequest);\n validateContentForSupportedTypes(shareWebContentRequest);\n } catch (err) {\n //return the error via callback(v1) or rejected promise(v2)\n const wrappedFunction: InputFunction<void> = () => Promise.reject(err);\n return callCallbackWithSdkErrorFromPromiseAndReturnPromise(wrappedFunction, callback);\n }\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n return callCallbackWithSdkErrorFromPromiseAndReturnPromise(shareWebContentHelper, callback, shareWebContentRequest);\n }\n\n function shareWebContentHelper(shareWebContentRequest: IShareRequest<IShareRequestContentType>): Promise<void> {\n return new Promise<void>((resolve) => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError(SharingAPIMessages.shareWebContent, shareWebContentRequest));\n });\n }\n\n /**\n * Functions for validating the shareRequest input parameter\n */\n function validateNonEmptyContent(shareRequest: IShareRequest<IShareRequestContentType>): void {\n if (!(shareRequest && shareRequest.content && shareRequest.content.length)) {\n const err: SdkError = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'Shared content is missing',\n };\n throw err;\n }\n }\n\n function validateTypeConsistency(shareRequest: IShareRequest<IShareRequestContentType>): void {\n let err: SdkError | undefined;\n if (shareRequest.content.some((item) => !item.type)) {\n err = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'Shared content type cannot be undefined',\n };\n throw err;\n }\n if (shareRequest.content.some((item) => item.type !== shareRequest.content[0].type)) {\n err = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'Shared content must be of the same type',\n };\n throw err;\n }\n }\n\n function validateContentForSupportedTypes(shareRequest: IShareRequest<IShareRequestContentType>): void {\n let err: SdkError | undefined;\n if (shareRequest.content[0].type === 'URL') {\n if (shareRequest.content.some((item) => !item.url)) {\n err = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'URLs are required for URL content types',\n };\n throw err;\n }\n } else {\n err = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'Content type is unsupported',\n };\n throw err;\n }\n }\n\n /**\n * Checks if the sharing capability is supported by the host\n * @returns boolean to represent whether the sharing capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.sharing ? true : false;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to interact with the stage view specific part of the SDK.\n *\n * @beta\n */\nexport namespace stageView {\n /**\n * Parameters to open a stage view.\n */\n export interface StageViewParams {\n /**\n * The ID of the Teams application to be opened.\n */\n appId: string;\n\n /**\n * The URL of the content to display.\n */\n contentUrl: string;\n\n /**\n * The chat or channel ID.\n */\n threadId: string;\n\n /**\n * The title to give the stage view.\n */\n title: string;\n\n /**\n * The Teams application website URL.\n */\n websiteUrl?: string;\n\n /**\n * The entity ID of the Teams application content being opened.\n */\n entityId?: string;\n }\n\n /**\n * @hidden\n * Feature is under development\n *\n * Opens a stage view to display a Teams application\n * @beta\n * @param stageViewParams - The parameters to pass into the stage view.\n * @returns Promise that resolves or rejects with an error once the stage view is closed.\n */\n export function open(stageViewParams: StageViewParams): Promise<void> {\n return new Promise((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!stageViewParams) {\n throw new Error('[stageView.open] Stage view params cannot be null');\n }\n\n resolve(sendAndHandleSdkError('stageView.open', stageViewParams));\n });\n }\n\n /**\n * Checks if stageView capability is supported by the host\n * @beta\n * @returns boolean to represent whether the stageView capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.stageView ? true : false;\n }\n}\n","import { ensureInitialized } from '../internal/internalAPIs';\nimport { runtime } from './runtime';\n\n/**\n * Contains functionality to allow web apps to store data in webview cache\n *\n * @beta\n */\nexport namespace webStorage {\n /**\n * Checks if web storage gets cleared when a user logs out from host client\n *\n * @returns true is web storage gets cleared on logout and false if it does not\n *\n * @beta\n */\n export function isWebStorageClearedOnUserLogOut(): boolean {\n ensureInitialized(runtime);\n return isSupported();\n }\n\n /**\n * Checks if webStorage capability is supported by the host\n * @returns boolean to represent whether the webStorage capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.webStorage ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { sendAndHandleSdkError as sendAndHandleError } from '../internal/communication';\nimport { createTeamsDeepLinkForCall } from '../internal/deepLinkUtilities';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\nexport namespace call {\n export enum CallModalities {\n Unknown = 'unknown',\n Audio = 'audio',\n Video = 'video',\n VideoBasedScreenSharing = 'videoBasedScreenSharing',\n Data = 'data',\n }\n\n export interface StartCallParams {\n /**\n * Comma-separated list of user IDs representing the participants of the call.\n *\n * @remarks\n * Currently the User ID field supports the Azure AD UserPrincipalName,\n * typically an email address, or in case of a PSTN call, it supports a pstn\n * mri 4:\\<phonenumber>.\n */\n targets: string[];\n /**\n * List of modalities for the call. Defaults to [“audio”].\n */\n requestedModalities?: CallModalities[];\n /**\n * An optional parameter that informs about the source of the deep link\n */\n source?: string;\n }\n\n /**\n * Starts a call with other users\n *\n * @param startCallParams - Parameters for the call\n * @returns If the call is accepted\n */\n export function startCall(startCallParams: StartCallParams): Promise<boolean> {\n return new Promise((resolve) => {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleError(\n 'executeDeepLink',\n createTeamsDeepLinkForCall(\n startCallParams.targets,\n startCallParams.requestedModalities?.includes(CallModalities.Video),\n startCallParams.source,\n ),\n ),\n );\n } else {\n return sendMessageToParent('call.startCall', [startCallParams], resolve);\n }\n });\n }\n\n /**\n * Checks if the call capability is supported by the host\n * @returns boolean to represent whether the call capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.call ? true : false;\n }\n}\n","import { app } from './app';\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link app} namespace instead.\n */\nexport namespace appInitialization {\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.Messages} instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n export import Messages = app.Messages;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.FailedReason} instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n export import FailedReason = app.FailedReason;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.ExpectedFailureReason} instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n export import ExpectedFailureReason = app.ExpectedFailureReason;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.IFailedRequest} instead.\n */\n export import IFailedRequest = app.IFailedRequest;\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.IExpectedFailureRequest} instead.\n */\n export import IExpectedFailureRequest = app.IExpectedFailureRequest;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.notifyAppLoaded app.notifyAppLoaded(): void} instead.\n *\n * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.\n */\n export function notifyAppLoaded(): void {\n app.notifyAppLoaded();\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.notifySuccess app.notifySuccess(): void} instead.\n *\n * Notifies the frame that app initialization is successful and is ready for user interaction.\n */\n export function notifySuccess(): void {\n app.notifySuccess();\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.notifyFailure app.notifyFailure(appInitializationFailedRequest: IFailedRequest): void} instead.\n *\n * Notifies the frame that app initialization has failed and to show an error page in its place.\n * @param appInitializationFailedRequest - The failure request containing the reason for why the app failed\n * during initialization as well as an optional message.\n */\n export function notifyFailure(appInitializationFailedRequest: IFailedRequest): void {\n app.notifyFailure(appInitializationFailedRequest);\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link app.notifyExpectedFailure app.notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void} instead.\n *\n * Notifies the frame that app initialized with some expected errors.\n * @param expectedFailureRequest - The expected failure request containing the reason and an optional message\n */\n export function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void {\n app.notifyExpectedFailure(expectedFailureRequest);\n }\n}\n","import { ensureInitialized } from '../internal/internalAPIs';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { FrameContexts } from './constants';\nimport { pages } from './pages';\nimport { runtime } from './runtime';\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config} namespace instead.\n *\n * Namespace to interact with the settings-specific part of the SDK.\n * This object is usable only on the settings frame.\n */\nexport namespace settings {\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.Config} instead.\n * @remarks\n * Renamed to config in pages.Config\n */\n export import Settings = pages.InstanceConfig;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.SaveEvent} instead.\n * @remarks\n * See pages.SaveEvent\n */\n export import SaveEvent = pages.config.SaveEvent;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.RemoveEvent} instead.\n * @remarks\n * See pages.RemoveEvent\n */\n export import RemoveEvent = pages.config.RemoveEvent;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.SaveParameters} instead.\n * @remarks\n * See pages.SaveParameters\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n export import SaveParameters = pages.config.SaveParameters;\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.setValidityState pages.config.setValidityState(validityState: boolean): void} instead.\n *\n * Sets the validity state for the settings.\n * The initial value is false, so the user cannot save the settings until this is called with true.\n *\n * @param validityState - Indicates whether the save or remove button is enabled for the user.\n */\n export function setValidityState(validityState: boolean): void {\n pages.config.setValidityState(validityState);\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.getConfig pages.getConfig(): Promise\\<InstanceConfig\\>} instead.\n *\n * Gets the settings for the current instance.\n *\n * @param callback - The callback to invoke when the {@link Settings} object is retrieved.\n */\n export function getSettings(callback: (instanceSettings: Settings) => void): void {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.sidePanel,\n );\n pages.getConfig().then((config: pages.InstanceConfig) => {\n callback(config);\n });\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.setConfig pages.config.setConfig(instanceSettings: Config): Promise\\<void\\>} instead.\n *\n * Sets the settings for the current instance.\n * This is an asynchronous operation; calls to getSettings are not guaranteed to reflect the changed state.\n *\n * @param - Set the desired settings for this instance.\n */\n export function setSettings(\n instanceSettings: Settings,\n onComplete?: (status: boolean, reason?: string) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\n pages.config\n .setConfig(instanceSettings)\n .then(() => {\n onComplete(true);\n })\n .catch((error: Error) => {\n onComplete(false, error.message);\n });\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.registerOnSaveHandler pages.config.registerOnSaveHandler(handler: (evt: SaveEvent) => void): void} instead.\n *\n * Registers a handler for when the user attempts to save the settings. This handler should be used\n * to create or update the underlying resource powering the content.\n * The object passed to the handler must be used to notify whether to proceed with the save.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the user selects the save button.\n */\n export function registerOnSaveHandler(handler: (evt: SaveEvent) => void): void {\n pages.config.registerOnSaveHandlerHelper(handler);\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.registerOnRemoveHandler pages.config.registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void} instead.\n *\n * Registers a handler for user attempts to remove content. This handler should be used\n * to remove the underlying resource powering the content.\n * The object passed to the handler must be used to indicate whether to proceed with the removal.\n * Only one handler may be registered at a time. Subsequent registrations will override the first.\n *\n * @param handler - The handler to invoke when the user selects the remove button.\n */\n export function registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void {\n pages.config.registerOnRemoveHandlerHelper(handler);\n }\n}\n","import { profile } from '../public/profile';\n\n/**\n * @hidden\n * Validates the request parameters\n * @param showProfileRequest The request parameters\n * @returns true if the parameters are valid, false otherwise\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateShowProfileRequest(\n showProfileRequest: profile.ShowProfileRequest,\n): [boolean, string | undefined] {\n if (!showProfileRequest) {\n return [false, 'A request object is required'];\n }\n\n // Validate modality\n if (showProfileRequest.modality && typeof showProfileRequest.modality !== 'string') {\n return [false, 'modality must be a string'];\n }\n\n // Validate targetElementBoundingRect\n if (\n !showProfileRequest.targetElementBoundingRect ||\n typeof showProfileRequest.targetElementBoundingRect !== 'object'\n ) {\n return [false, 'targetElementBoundingRect must be a DOMRect'];\n }\n\n // Validate triggerType\n if (!showProfileRequest.triggerType || typeof showProfileRequest.triggerType !== 'string') {\n return [false, 'triggerType must be a valid string'];\n }\n\n return validatePersona(showProfileRequest.persona);\n}\n\n/**\n * @hidden\n * Validates the persona that is used to resolve the profile target\n * @param persona The persona object\n * @returns true if the persona is valid, false otherwise\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction validatePersona(persona: profile.Persona): [boolean, string | undefined] {\n if (!persona) {\n return [false, 'persona object must be provided'];\n }\n\n if (persona.displayName && typeof persona.displayName !== 'string') {\n return [false, 'displayName must be a string'];\n }\n\n if (!persona.identifiers || typeof persona.identifiers !== 'object') {\n return [false, 'persona identifiers object must be provided'];\n }\n\n if (!persona.identifiers.AadObjectId && !persona.identifiers.Smtp && !persona.identifiers.Upn) {\n return [false, 'at least one valid identifier must be provided'];\n }\n\n if (persona.identifiers.AadObjectId && typeof persona.identifiers.AadObjectId !== 'string') {\n return [false, 'AadObjectId identifier must be a string'];\n }\n\n if (persona.identifiers.Smtp && typeof persona.identifiers.Smtp !== 'string') {\n return [false, 'Smtp identifier must be a string'];\n }\n\n if (persona.identifiers.Upn && typeof persona.identifiers.Upn !== 'string') {\n return [false, 'Upn identifier must be a string'];\n }\n\n return [true, undefined];\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { GlobalVars } from '../internal/globalVars';\nimport { registerHandlerHelper } from '../internal/handlers';\nimport { ensureInitializeCalled, ensureInitialized } from '../internal/internalAPIs';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { app } from './app';\nimport { FrameContexts } from './constants';\nimport {\n Context,\n DeepLinkParameters,\n FrameContext,\n LoadContext,\n TabInformation,\n TabInstanceParameters,\n} from './interfaces';\nimport { pages } from './pages';\nimport { runtime } from './runtime';\nimport { teamsCore } from './teamsAPIs';\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link app.initialize app.initialize(validMessageOrigins?: string[]): Promise\\<void\\>} instead.\n *\n * Initializes the library. This must be called before any other SDK calls\n * but after the frame is loaded successfully.\n * @param callback - Optionally specify a callback to invoke when Teams SDK has successfully initialized\n * @param validMessageOrigins - Optionally specify a list of cross frame message origins. There must have\n * https: protocol otherwise they will be ignored. Example: https://www.example.com\n */\nexport function initialize(callback?: () => void, validMessageOrigins?: string[]): void {\n app.initialize(validMessageOrigins).then(() => {\n if (callback) {\n callback();\n }\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link teamsCore.enablePrintCapability teamsCore.enablePrintCapability(): void} instead.\n *\n * Enable print capability to support printing page using Ctrl+P and cmd+P\n */\nexport function enablePrintCapability(): void {\n teamsCore.enablePrintCapability();\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link teamsCore.print teamsCore.print(): void} instead.\n *\n * Default print handler\n */\nexport function print(): void {\n teamsCore.print();\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link app.getContext app.getContext(): Promise\\<app.Context\\>} instead.\n *\n * Retrieves the current context the frame is running in.\n *\n * @param callback - The callback to invoke when the {@link Context} object is retrieved.\n */\nexport function getContext(callback: (context: Context) => void): void {\n ensureInitializeCalled();\n sendMessageToParent('getContext', (context: Context) => {\n if (!context.frameContext) {\n // Fallback logic for frameContext properties\n context.frameContext = GlobalVars.frameContext;\n }\n callback(context);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link app.registerOnThemeChangeHandler app.registerOnThemeChangeHandler(handler: (theme: string) => void): void} instead.\n *\n * Registers a handler for theme changes.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the user changes their theme.\n */\nexport function registerOnThemeChangeHandler(handler: (theme: string) => void): void {\n app.registerOnThemeChangeHandler(handler);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.registerFullScreenHandler pages.registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void} instead.\n *\n * Registers a handler for changes from or to full-screen view for a tab.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the user toggles full-screen view for a tab.\n */\nexport function registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void {\n registerHandlerHelper('fullScreenChange', handler, []);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.appButton.onClick pages.appButton.onClick(handler: () => void): void} instead.\n *\n * Registers a handler for clicking the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the personal app button is clicked in the app bar.\n */\nexport function registerAppButtonClickHandler(handler: () => void): void {\n registerHandlerHelper('appButtonClick', handler, [FrameContexts.content]);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.appButton.onHoverEnter pages.appButton.onHoverEnter(handler: () => void): void} instead.\n *\n * Registers a handler for entering hover of the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.\n */\nexport function registerAppButtonHoverEnterHandler(handler: () => void): void {\n registerHandlerHelper('appButtonHoverEnter', handler, [FrameContexts.content]);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.appButton.onHoverLeave pages.appButton.onHoverLeave(handler: () => void): void} instead.\n *\n * Registers a handler for exiting hover of the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.\n *\n */\nexport function registerAppButtonHoverLeaveHandler(handler: () => void): void {\n registerHandlerHelper('appButtonHoverLeave', handler, [FrameContexts.content]);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.backStack.registerBackButtonHandler pages.backStack.registerBackButtonHandler(handler: () => boolean): void} instead.\n *\n * Registers a handler for user presses of the Team client's back button. Experiences that maintain an internal\n * navigation stack should use this handler to navigate the user back within their frame. If an app finds\n * that after running its back button handler it cannot handle the event it should call the navigateBack\n * method to ask the Teams client to handle it instead.\n *\n * @param handler - The handler to invoke when the user presses their Team client's back button.\n */\nexport function registerBackButtonHandler(handler: () => boolean): void {\n pages.backStack.registerBackButtonHandlerHelper(handler);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link teamsCore.registerOnLoadHandler teamsCore.registerOnLoadHandler(handler: (context: LoadContext) => void): void} instead.\n *\n * @hidden\n * Registers a handler to be called when the page has been requested to load.\n *\n * @param handler - The handler to invoke when the page is loaded.\n */\nexport function registerOnLoadHandler(handler: (context: LoadContext) => void): void {\n teamsCore.registerOnLoadHandlerHelper(handler);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link teamsCore.registerBeforeUnloadHandler teamsCore.registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void} instead.\n *\n * @hidden\n * Registers a handler to be called before the page is unloaded.\n *\n * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should\n * invoke the readyToUnload function provided to it once it's ready to be unloaded.\n */\nexport function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void {\n teamsCore.registerBeforeUnloadHandlerHelper(handler);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.registerFocusEnterHandler pages.registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void} instead.\n *\n * @hidden\n * Registers a handler when focus needs to be passed from teams to the place of choice on app.\n *\n * @param handler - The handler to invoked by the app when they want the focus to be in the place of their choice.\n */\nexport function registerFocusEnterHandler(handler: (navigateForward: boolean) => boolean): void {\n registerHandlerHelper('focusEnter', handler, []);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.config.registerChangeConfigHandler pages.config.registerChangeConfigHandler(handler: () => void): void} instead.\n *\n * Registers a handler for when the user reconfigurated tab.\n *\n * @param handler - The handler to invoke when the user click on Settings.\n */\nexport function registerChangeSettingsHandler(handler: () => void): void {\n registerHandlerHelper('changeSettings', handler, [FrameContexts.content]);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.tabs.getTabInstances pages.tabs.getTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise\\<TabInformation\\>} instead.\n *\n * Allows an app to retrieve for this user tabs that are owned by this app.\n * If no TabInstanceParameters are passed, the app defaults to favorite teams and favorite channels.\n *\n * @param callback - The callback to invoke when the {@link TabInstanceParameters} object is retrieved.\n * @param tabInstanceParameters - OPTIONAL Flags that specify whether to scope call to favorite teams or channels.\n */\nexport function getTabInstances(\n callback: (tabInfo: TabInformation) => void,\n tabInstanceParameters?: TabInstanceParameters,\n): void {\n ensureInitialized(runtime);\n pages.tabs.getTabInstances(tabInstanceParameters).then((tabInfo: TabInformation) => {\n callback(tabInfo);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.tabs.getMruTabInstances pages.tabs.getMruTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise\\<TabInformation\\>} instead.\n *\n * Allows an app to retrieve the most recently used tabs for this user.\n *\n * @param callback - The callback to invoke when the {@link TabInformation} object is retrieved.\n * @param tabInstanceParameters - OPTIONAL Ignored, kept for future use\n */\nexport function getMruTabInstances(\n callback: (tabInfo: TabInformation) => void,\n tabInstanceParameters?: TabInstanceParameters,\n): void {\n ensureInitialized(runtime);\n pages.tabs.getMruTabInstances(tabInstanceParameters).then((tabInfo: TabInformation) => {\n callback(tabInfo);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.shareDeepLink pages.shareDeepLink(deepLinkParameters: DeepLinkParameters): void} instead.\n *\n * Shares a deep link that a user can use to navigate back to a specific state in this page.\n *\n * @param deepLinkParameters - ID and label for the link and fallback URL.\n */\nexport function shareDeepLink(deepLinkParameters: DeepLinkParameters): void {\n pages.shareDeepLink({\n subPageId: deepLinkParameters.subEntityId,\n subPageLabel: deepLinkParameters.subEntityLabel,\n subPageWebUrl: deepLinkParameters.subEntityWebUrl,\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link app.openLink app.openLink(deepLink: string): Promise\\<void\\>} instead.\n *\n * Execute deep link API.\n *\n * @param deepLink - deep link.\n */\nexport function executeDeepLink(deepLink: string, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\n app\n .openLink(deepLink)\n .then(() => {\n onComplete(true);\n })\n .catch((err: Error) => {\n onComplete(false, err.message);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.setCurrentFrame pages.setCurrentFrame(frameInfo: FrameInfo): void} instead.\n *\n * Set the current Frame Context\n *\n * @param frameContext - FrameContext information to be set\n */\nexport function setFrameContext(frameContext: FrameContext): void {\n pages.setCurrentFrame(frameContext);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.initializeWithFrameContext pages.initializeWithFrameContext(frameInfo: FrameInfo, callback?: () => void, validMessageOrigins?: string[],): void} instead.\n *\n * Initialize with FrameContext\n *\n * @param frameContext - FrameContext information to be set\n * @param callback - The optional callback to be invoked be invoked after initilizing the frame context\n * @param validMessageOrigins - Optionally specify a list of cross frame message origins.\n * They must have https: protocol otherwise they will be ignored. Example: https:www.example.com\n */\nexport function initializeWithFrameContext(\n frameContext: FrameContext,\n callback?: () => void,\n validMessageOrigins?: string[],\n): void {\n pages.initializeWithFrameContext(frameContext, callback, validMessageOrigins);\n}\n","import { ensureInitialized } from '../internal/internalAPIs';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { FrameContexts } from './constants';\nimport { TabInstance } from './interfaces';\nimport { pages } from './pages';\nimport { runtime } from './runtime';\n/**\n * Navigation specific part of the SDK.\n */\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.returnFocus pages.returnFocus(navigateForward?: boolean): void} instead.\n *\n * Return focus to the main Teams app. Will focus search bar if navigating foward and app bar if navigating back.\n *\n * @param navigateForward - Determines the direction to focus in teams app.\n */\nexport function returnFocus(navigateForward?: boolean): void {\n pages.returnFocus(navigateForward);\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.tabs.navigateToTab pages.tabs.navigateToTab(tabInstance: TabInstance): Promise\\<void\\>} instead.\n *\n * Navigates the Microsoft Teams app to the specified tab instance.\n *\n * @param tabInstance - The tab instance to navigate to.\n * @param onComplete - The callback to invoke when the action is complete.\n */\nexport function navigateToTab(tabInstance: TabInstance, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(runtime);\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\n pages.tabs\n .navigateToTab(tabInstance)\n .then(() => {\n onComplete(true);\n })\n .catch((error: Error) => {\n onComplete(false, error.message);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.navigateCrossDomain pages.navigateCrossDomain(url: string): Promise\\<void\\>} instead.\n *\n * Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the\n * valid domains specified in the validDomains block of the manifest; otherwise, an exception will be\n * thrown. This function needs to be used only when navigating the frame to a URL in a different domain\n * than the current one in a way that keeps the app informed of the change and allows the SDK to\n * continue working.\n *\n * @param url - The URL to navigate the frame to.\n * @param onComplete - The callback to invoke when the action is complete.\n */\nexport function navigateCrossDomain(url: string, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\n pages\n .navigateCrossDomain(url)\n .then(() => {\n onComplete(true);\n })\n .catch((error: Error) => {\n onComplete(false, error.message);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link pages.backStack.navigateBack pages.backStack.navigateBack(): Promise\\<void\\>} instead.\n *\n * Navigates back in the Teams client.\n * See registerBackButtonHandler for more information on when it's appropriate to use this method.\n *\n * @param onComplete - The callback to invoke when the action is complete.\n */\nexport function navigateBack(onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(runtime);\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\n pages.backStack\n .navigateBack()\n .then(() => {\n onComplete(true);\n })\n .catch((error: Error) => {\n onComplete(false, error.message);\n });\n}\n","/* eslint-disable @typescript-eslint/ban-types */\n\nimport { sendMessageToParent } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ChildAppWindow, IAppWindow } from './appWindow';\nimport { FrameContexts, TaskModuleDimension } from './constants';\nimport { dialog } from './dialog';\nimport { BotUrlDialogInfo, DialogInfo, DialogSize, TaskInfo, UrlDialogInfo } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * @deprecated\n * As of 2.0.0, please use {@link dialog} namespace instead.\n *\n * Namespace to interact with the task module-specific part of the SDK.\n * This object is usable only on the content frame.\n * The tasks namespace will be deprecated. Please use dialog for future developments.\n */\nexport namespace tasks {\n /**\n * @deprecated\n * As of 2.8.0:\n * - For url-based dialogs, please use {@link dialog.url.open dialog.url.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} .\n * - For url-based dialogs with bot interaction, please use {@link dialog.url.bot.open dialog.url.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}\n * - For Adaptive Card-based dialogs:\n * - In Teams, please continue to use this function until the new functions in {@link dialog.adaptiveCard} have been fully implemented. You can tell at runtime when they are implemented in Teams by checking\n * the return value of the {@link dialog.adaptiveCard.isSupported} function. This documentation line will also be removed once they have been fully implemented in Teams.\n * - In all other hosts, please use {@link dialog.adaptiveCard.open dialog.adaptiveCard.open(cardDialogInfo: CardDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}\n *\n * Allows an app to open the task module.\n *\n * @param taskInfo - An object containing the parameters of the task module\n * @param submitHandler - Handler to call when the task module is completed\n */\n export function startTask(\n taskInfo: TaskInfo,\n submitHandler?: (err: string, result: string | object) => void,\n ): IAppWindow {\n const dialogSubmitHandler = submitHandler\n ? /* eslint-disable-next-line strict-null-checks/all */ /* fix tracked by 5730662 */\n (sdkResponse: dialog.ISdkResponse) => submitHandler(sdkResponse.err, sdkResponse.result)\n : undefined;\n if (taskInfo.card === undefined && taskInfo.url === undefined) {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('tasks.startTask', [taskInfo as DialogInfo], submitHandler);\n } else if (taskInfo.card) {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent('tasks.startTask', [taskInfo as DialogInfo], submitHandler);\n } else if (taskInfo.completionBotId !== undefined) {\n dialog.url.bot.open(getBotUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);\n } else {\n dialog.url.open(getUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);\n }\n return new ChildAppWindow();\n }\n\n /**\n * @deprecated\n * As of 2.0.0, please use {@link dialog.update.resize dialog.update.resize(dimensions: DialogSize): void} instead.\n *\n * Update height/width task info properties.\n *\n * @param taskInfo - An object containing width and height properties\n */\n export function updateTask(taskInfo: TaskInfo): void {\n taskInfo = getDefaultSizeIfNotProvided(taskInfo);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { width, height, ...extra } = taskInfo;\n\n if (Object.keys(extra).length) {\n throw new Error('resize requires a TaskInfo argument containing only width and height');\n }\n dialog.update.resize(taskInfo as DialogSize);\n }\n\n /**\n * @deprecated\n * As of 2.8.0, please use {@link dialog.url.submit} instead.\n *\n * Submit the task module.\n *\n * @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it\n * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.\n */\n export function submitTask(result?: string | object, appIds?: string | string[]): void {\n dialog.url.submit(result, appIds);\n }\n\n /**\n * Converts {@link TaskInfo} to {@link UrlDialogInfo}\n * @param taskInfo - TaskInfo object to convert\n * @returns - Converted UrlDialogInfo object\n */\n function getUrlDialogInfoFromTaskInfo(taskInfo: TaskInfo): UrlDialogInfo {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const urldialogInfo: UrlDialogInfo = {\n url: taskInfo.url,\n size: {\n height: taskInfo.height ? taskInfo.height : TaskModuleDimension.Small,\n width: taskInfo.width ? taskInfo.width : TaskModuleDimension.Small,\n },\n title: taskInfo.title,\n fallbackUrl: taskInfo.fallbackUrl,\n };\n return urldialogInfo;\n }\n\n /**\n * Converts {@link TaskInfo} to {@link BotUrlDialogInfo}\n * @param taskInfo - TaskInfo object to convert\n * @returns - converted BotUrlDialogInfo object\n */\n function getBotUrlDialogInfoFromTaskInfo(taskInfo: TaskInfo): BotUrlDialogInfo {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const botUrldialogInfo: BotUrlDialogInfo = {\n url: taskInfo.url,\n size: {\n height: taskInfo.height ? taskInfo.height : TaskModuleDimension.Small,\n width: taskInfo.width ? taskInfo.width : TaskModuleDimension.Small,\n },\n title: taskInfo.title,\n fallbackUrl: taskInfo.fallbackUrl,\n completionBotId: taskInfo.completionBotId,\n };\n return botUrldialogInfo;\n }\n\n /**\n * Sets the height and width of the {@link TaskInfo} object to the original height and width, if initially specified,\n * otherwise uses the height and width values corresponding to {@link DialogDimension | TaskModuleDimension.Small}\n * @param taskInfo TaskInfo object from which to extract size info, if specified\n * @returns TaskInfo with height and width specified\n */\n export function getDefaultSizeIfNotProvided(taskInfo: TaskInfo): TaskInfo {\n taskInfo.height = taskInfo.height ? taskInfo.height : TaskModuleDimension.Small;\n taskInfo.width = taskInfo.width ? taskInfo.width : TaskModuleDimension.Small;\n return taskInfo;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * @hidden\n * Allowed roles during a meeting.\n *\n * @beta\n */\nexport enum UserMeetingRole {\n guest = 'Guest',\n attendee = 'Attendee',\n presenter = 'Presenter',\n organizer = 'Organizer',\n}\n\n/**\n * @hidden\n * State of the current Live Share sessions backing fluid container.\n *\n * @beta\n */\nexport enum ContainerState {\n /**\n * The call to `LiveShareHost.setContainerId()` successfully created the container mapping\n * for the current Live Share session.\n */\n added = 'Added',\n\n /**\n * A container mapping for the current Live Share Session already exists and should be used\n * when joining the sessions Fluid container.\n */\n alreadyExists = 'AlreadyExists',\n\n /**\n * The call to `LiveShareHost.setContainerId()` failed to create the container mapping due to\n * another client having already set the container ID for the current Live Share session.\n */\n conflict = 'Conflict',\n\n /**\n * A container mapping for the current Live Share session doesn't exist yet.\n */\n notFound = 'NotFound',\n}\n\n/**\n * @hidden\n * Returned from `LiveShareHost.get/setFluidContainerId()` to specify the container mapping for the\n * current Live Share session.\n *\n * @beta\n */\nexport interface IFluidContainerInfo {\n /**\n * State of the containerId mapping.\n */\n containerState: ContainerState;\n\n /**\n * ID of the container to join for the meeting. Undefined if the container hasn't been\n * created yet.\n */\n containerId: string | undefined;\n\n /**\n * If true, the local client should create the container and then save the created containers\n * ID to the mapping service.\n */\n shouldCreate: boolean;\n\n /**\n * If `containerId` is undefined and `shouldCreate` is false, the container isn't ready but\n * another client is creating it. The local client should wait the specified amount of time and\n * then ask for the container info again.\n */\n retryAfter: number;\n}\n\n/**\n * @hidden\n * Returned from `LiveShareHost.getNtpTime()` to specify the global timestamp for the current\n * Live Share session.\n *\n * @beta\n */\nexport interface INtpTimeInfo {\n /**\n * ISO 8601 formatted server time. For example: '2019-09-07T15:50-04:00'\n */\n ntpTime: string;\n\n /**\n * Server time expressed as the number of milliseconds since the ECMAScript epoch.\n */\n ntpTimeInUTC: number;\n}\n\n/**\n * @hidden\n * Returned from `LiveShareHost.getFluidTenantInfo()` to specify the Fluid service to use for the\n * current Live Share session.\n *\n * @beta\n */\nexport interface IFluidTenantInfo {\n /**\n * The Fluid Tenant ID Live Share should use.\n */\n tenantId: string;\n\n /**\n * The Fluid service endpoint Live Share should use.\n */\n serviceEndpoint: string;\n}\n\n/**\n * Live Share host implementation for O365 and Teams clients.\n *\n * @beta\n */\nexport class LiveShareHost {\n /**\n * @hidden\n * Returns the Fluid Tenant connection info for user's current context.\n *\n * @beta\n */\n public getFluidTenantInfo(): Promise<IFluidTenantInfo> {\n return new Promise<IFluidTenantInfo>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n resolve(sendAndHandleSdkError('interactive.getFluidTenantInfo'));\n });\n }\n\n /**\n * @hidden\n * Returns the fluid access token for mapped container Id.\n *\n * @param containerId Fluid's container Id for the request. Undefined for new containers.\n * @returns token for connecting to Fluid's session.\n *\n * @beta\n */\n public getFluidToken(containerId?: string): Promise<string> {\n return new Promise<string>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n // eslint-disable-next-line strict-null-checks/all\n resolve(sendAndHandleSdkError('interactive.getFluidToken', containerId));\n });\n }\n\n /**\n * @hidden\n * Returns the ID of the fluid container associated with the user's current context.\n *\n * @beta\n */\n public getFluidContainerId(): Promise<IFluidContainerInfo> {\n return new Promise<IFluidContainerInfo>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n resolve(sendAndHandleSdkError('interactive.getFluidContainerId'));\n });\n }\n\n /**\n * @hidden\n * Sets the ID of the fluid container associated with the current context.\n *\n * @remarks\n * If this returns false, the client should delete the container they created and then call\n * `getFluidContainerId()` to get the ID of the container being used.\n * @param containerId ID of the fluid container the client created.\n * @returns A data structure with a `containerState` indicating the success or failure of the request.\n *\n * @beta\n */\n public setFluidContainerId(containerId: string): Promise<IFluidContainerInfo> {\n return new Promise<IFluidContainerInfo>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n resolve(sendAndHandleSdkError('interactive.setFluidContainerId', containerId));\n });\n }\n\n /**\n * @hidden\n * Returns the shared clock server's current time.\n *\n * @beta\n */\n public getNtpTime(): Promise<INtpTimeInfo> {\n return new Promise<INtpTimeInfo>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n resolve(sendAndHandleSdkError('interactive.getNtpTime'));\n });\n }\n\n /**\n * @hidden\n * Associates the fluid client ID with a set of user roles.\n *\n * @param clientId The ID for the current user's Fluid client. Changes on reconnects.\n * @returns The roles for the current user.\n *\n * @beta\n */\n public registerClientId(clientId: string): Promise<UserMeetingRole[]> {\n return new Promise<UserMeetingRole[]>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n resolve(sendAndHandleSdkError('interactive.registerClientId', clientId));\n });\n }\n\n /**\n * @hidden\n * Returns the roles associated with a client ID.\n *\n * @param clientId The Client ID the message was received from.\n * @returns The roles for a given client. Returns `undefined` if the client ID hasn't been registered yet.\n *\n * @beta\n */\n public getClientRoles(clientId: string): Promise<UserMeetingRole[] | undefined> {\n return new Promise<UserMeetingRole[] | undefined>((resolve) => {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n resolve(sendAndHandleSdkError('interactive.getClientRoles', clientId));\n });\n }\n\n /**\n * Returns a host instance for the client that can be passed to the `LiveShareClient` class.\n *\n * @remarks\n * The application must first be initialized and may only be called from `meetingStage` or `sidePanel` contexts.\n *\n * @beta\n */\n public static create(): LiveShareHost {\n ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);\n\n return new LiveShareHost();\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ErrorCode, FileOpenPreference, FrameContexts, SdkError } from '../public';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n *\n * Namespace to interact with the files specific part of the SDK.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace files {\n /**\n * @hidden\n *\n * Cloud storage providers registered with Microsoft Teams\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum CloudStorageProvider {\n Dropbox = 'DROPBOX',\n Box = 'BOX',\n Sharefile = 'SHAREFILE',\n GoogleDrive = 'GOOGLEDRIVE',\n Egnyte = 'EGNYTE',\n SharePoint = 'SharePoint',\n }\n interface IWopiThumbnail {\n size: number;\n url: string;\n }\n\n interface IWopiService {\n name: string;\n description: string;\n thumbnails: IWopiThumbnail[];\n }\n\n /**\n * @hidden\n *\n * External third-party cloud storages providers interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IExternalProvider extends IWopiService {\n providerType: CloudStorageProviderType;\n providerCode: CloudStorageProvider;\n }\n\n /**\n * @hidden\n *\n * Cloud storage provider type enums\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum CloudStorageProviderType {\n Sharepoint = 0,\n WopiIntegration,\n Google,\n OneDrive,\n Recent,\n Aggregate,\n FileSystem, // Used for Downloaded files on Desktop\n Search, // Used by P2P files with OSearch\n AllFiles, // Used by P2P files with AllFiles API\n SharedWithMe,\n }\n\n /**\n * @hidden\n *\n * Cloud storage folder interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageFolder {\n /**\n * @hidden\n * ID of the cloud storage folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n id: string;\n /**\n * @hidden\n * Display Name/Title of the cloud storage folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n /**\n * @hidden\n * ID of the cloud storage folder in the provider\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n folderId: string;\n /**\n * @hidden\n * Type of the cloud storage folder provider integration\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n providerType: CloudStorageProviderType;\n /**\n * @hidden\n * Code of the supported cloud storage folder provider\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n providerCode: CloudStorageProvider;\n /**\n * @hidden\n * Display name of the owner of the cloud storage folder provider\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n ownerDisplayName: string;\n /**\n * @hidden\n * Sharepoint specific siteURL of the folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n siteUrl?: string;\n /**\n * @hidden\n * Sharepoint specific serverRelativeUrl of the folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n serverRelativeUrl?: string;\n /**\n * @hidden\n * Sharepoint specific libraryType of the folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n libraryType?: string;\n /**\n * @hidden\n * Sharepoint specific accessType of the folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n accessType?: string;\n }\n\n /**\n * @hidden\n *\n * Cloud storage item interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageFolderItem {\n /**\n * @hidden\n * ID of the item in the provider\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n id: string;\n /**\n * @hidden\n * Display name/title\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n /**\n * @hidden\n * Key to differentiate files and subdirectory\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n isSubdirectory: boolean;\n /**\n * @hidden\n * File extension\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n type: string;\n /**\n * @hidden\n * Last modifed time of the item\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n lastModifiedTime: string;\n /**\n * @hidden\n * Display size of the items in bytes\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n size: number;\n /**\n * @hidden\n * URL of the file\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n objectUrl: string;\n /**\n * @hidden\n * Temporary access token for the item\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n accessToken?: string;\n }\n\n /**\n * @hidden\n *\n * Files entity user interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IFilesEntityUser {\n /**\n * @hidden\n * User name.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n displayName: string;\n /**\n * @hidden\n * User email.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n email: string;\n\n /**\n * @hidden\n * User MRI.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n mri: string;\n }\n\n /**\n * @hidden\n *\n * Special Document Library enum\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum SpecialDocumentLibraryType {\n ClassMaterials = 'classMaterials',\n }\n\n /**\n * @hidden\n *\n * Document Library Access enum\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum DocumentLibraryAccessType {\n Readonly = 'readonly',\n }\n\n /**\n * @hidden\n *\n * SharePoint file interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface ISharePointFile {\n siteId?: string;\n siteUrl: string;\n objectId: string;\n objectUrl: string;\n openInWindowFileUrl: string;\n title: string;\n isFolder: boolean;\n serverRelativeUrl: string;\n lastModifiedByUser: IFilesEntityUser;\n lastModifiedTime: string;\n sentByUser: IFilesEntityUser;\n createdByUser: IFilesEntityUser;\n createdTime: string;\n size: number;\n type: string;\n spItemUrl?: string;\n libraryType?: SpecialDocumentLibraryType;\n accessType?: DocumentLibraryAccessType;\n etag?: string;\n remoteItem?: string;\n listUrl?: string;\n }\n\n /**\n * @hidden\n *\n * Download status enum\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum FileDownloadStatus {\n Downloaded = 'Downloaded',\n Downloading = 'Downloading',\n Failed = 'Failed',\n }\n\n /**\n * @hidden\n *\n * Download Files interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IFileItem {\n /**\n * @hidden\n * ID of the file metadata\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n objectId?: string;\n /**\n * @hidden\n * Path of the file\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n path?: string;\n /**\n * @hidden\n * Size of the file in bytes\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n sizeInBytes?: number;\n /**\n * @hidden\n * Download status\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n status?: FileDownloadStatus;\n /**\n * @hidden\n * Download timestamp\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n timestamp: Date;\n /**\n * @hidden\n * File name\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n /**\n * @hidden\n * Type of file i.e. the file extension.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n extension: string;\n }\n\n /**\n * @hidden\n * Object used to represent a file\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface File extends Blob {\n /**\n * A number that represents the number of milliseconds since the Unix epoch\n */\n lastModified: number;\n /**\n * Name of the file\n */\n name: string;\n /**\n * A string containing the path of the file relative to the ancestor directory the user selected\n */\n webkitRelativePath?: string;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Actions specific to 3P cloud storage provider file and / or account\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum CloudStorageProviderFileAction {\n Download = 'DOWNLOAD',\n Upload = 'UPLOAD',\n Delete = 'DELETE',\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface for 3P cloud storage provider request content type\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderRequest<T> {\n content: T;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Base interface for 3P cloud storage provider action request content\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderContent {\n providerCode: CloudStorageProvider;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface representing 3P cloud storage provider add new file action.\n * The file extension represents type of file e.g. docx, pptx etc. and need not be prefixed with dot(.)\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderNewFileContent extends CloudStorageProviderContent {\n newFileName: string;\n newFileExtension: string;\n destinationFolder: CloudStorageFolderItem | ISharePointFile;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface representing 3P cloud storage provider rename existing file action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderRenameFileContent extends CloudStorageProviderContent {\n existingFile: CloudStorageFolderItem | ISharePointFile;\n newFile: CloudStorageFolderItem | ISharePointFile;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface representing 3P cloud storage provider delete existing file(s) action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderDeleteFileContent extends CloudStorageProviderContent {\n itemList: CloudStorageFolderItem[] | ISharePointFile[];\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface representing 3P cloud storage provider download existing file(s) action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderDownloadFileContent extends CloudStorageProviderContent {\n itemList: CloudStorageFolderItem[] | ISharePointFile[];\n }\n\n /**\n * @hidden\n * Hide from docs\n * @beta\n *\n * Interface representing 3P cloud storage provider upload existing file(s) action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderUploadFileContent extends CloudStorageProviderContent {\n itemList: File[];\n destinationFolder: CloudStorageFolderItem | ISharePointFile;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Gets a list of cloud storage folders added to the channel\n * @param channelId - ID of the channel whose cloud storage folders should be retrieved\n * @param callback - Callback that will be triggered post folders load\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getCloudStorageFolders(\n channelId: string,\n callback: (error: SdkError, folders: CloudStorageFolder[]) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!channelId || channelId.length === 0) {\n throw new Error('[files.getCloudStorageFolders] channelId name cannot be null or empty');\n }\n if (!callback) {\n throw new Error('[files.getCloudStorageFolders] Callback cannot be null');\n }\n\n sendMessageToParent('files.getCloudStorageFolders', [channelId], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n * Initiates the add cloud storage folder flow\n *\n * @param channelId - ID of the channel to add cloud storage folder\n * @param callback - Callback that will be triggered post add folder flow is compelete\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function addCloudStorageFolder(\n channelId: string,\n callback: (error: SdkError, isFolderAdded: boolean, folders: CloudStorageFolder[]) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!channelId || channelId.length === 0) {\n throw new Error('[files.addCloudStorageFolder] channelId name cannot be null or empty');\n }\n if (!callback) {\n throw new Error('[files.addCloudStorageFolder] Callback cannot be null');\n }\n\n sendMessageToParent('files.addCloudStorageFolder', [channelId], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n *\n * Deletes a cloud storage folder from channel\n *\n * @param channelId - ID of the channel where folder is to be deleted\n * @param folderToDelete - cloud storage folder to be deleted\n * @param callback - Callback that will be triggered post delete\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function deleteCloudStorageFolder(\n channelId: string,\n folderToDelete: CloudStorageFolder,\n callback: (error: SdkError, isFolderDeleted: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!channelId) {\n throw new Error('[files.deleteCloudStorageFolder] channelId name cannot be null or empty');\n }\n if (!folderToDelete) {\n throw new Error('[files.deleteCloudStorageFolder] folderToDelete cannot be null or empty');\n }\n if (!callback) {\n throw new Error('[files.deleteCloudStorageFolder] Callback cannot be null');\n }\n\n sendMessageToParent('files.deleteCloudStorageFolder', [channelId, folderToDelete], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n *\n * Fetches the contents of a Cloud storage folder (CloudStorageFolder) / sub directory\n *\n * @param folder - Cloud storage folder (CloudStorageFolder) / sub directory (CloudStorageFolderItem)\n * @param providerCode - Code of the cloud storage folder provider\n * @param callback - Callback that will be triggered post contents are loaded\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getCloudStorageFolderContents(\n folder: CloudStorageFolder | CloudStorageFolderItem,\n providerCode: CloudStorageProvider,\n callback: (error: SdkError, items: CloudStorageFolderItem[]) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!folder || !providerCode) {\n throw new Error('[files.getCloudStorageFolderContents] folder/providerCode name cannot be null or empty');\n }\n\n if (!callback) {\n throw new Error('[files.getCloudStorageFolderContents] Callback cannot be null');\n }\n\n if ('isSubdirectory' in folder && !folder.isSubdirectory) {\n throw new Error('[files.getCloudStorageFolderContents] provided folder is not a subDirectory');\n }\n\n sendMessageToParent('files.getCloudStorageFolderContents', [folder, providerCode], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n *\n * Open a cloud storage file in Teams\n *\n * @param file - cloud storage file that should be opened\n * @param providerCode - Code of the cloud storage folder provider\n * @param fileOpenPreference - Whether file should be opened in web/inline\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openCloudStorageFile(\n file: CloudStorageFolderItem,\n providerCode: CloudStorageProvider,\n fileOpenPreference?: FileOpenPreference.Web | FileOpenPreference.Inline,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!file || !providerCode) {\n throw new Error('[files.openCloudStorageFile] file/providerCode cannot be null or empty');\n }\n\n if (file.isSubdirectory) {\n throw new Error('[files.openCloudStorageFile] provided file is a subDirectory');\n }\n\n sendMessageToParent('files.openCloudStorageFile', [file, providerCode, fileOpenPreference]);\n }\n\n /**\n * @hidden\n * Allow 1st party apps to call this function to get the external\n * third party cloud storage accounts that the tenant supports\n * @param excludeAddedProviders: return a list of support third party\n * cloud storages that hasn't been added yet.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getExternalProviders(\n excludeAddedProviders = false,\n callback: (error: SdkError, providers: IExternalProvider[]) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw new Error('[files.getExternalProviders] Callback cannot be null');\n }\n\n sendMessageToParent('files.getExternalProviders', [excludeAddedProviders], callback);\n }\n\n /**\n * @hidden\n * Allow 1st party apps to call this function to move files\n * among SharePoint and third party cloud storages.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function copyMoveFiles(\n selectedFiles: CloudStorageFolderItem[] | ISharePointFile[],\n providerCode: CloudStorageProvider,\n destinationFolder: CloudStorageFolderItem | ISharePointFile,\n destinationProviderCode: CloudStorageProvider,\n isMove = false,\n callback: (error?: SdkError) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!selectedFiles || selectedFiles.length === 0) {\n throw new Error('[files.copyMoveFiles] selectedFiles cannot be null or empty');\n }\n if (!providerCode) {\n throw new Error('[files.copyMoveFiles] providerCode cannot be null or empty');\n }\n if (!destinationFolder) {\n throw new Error('[files.copyMoveFiles] destinationFolder cannot be null or empty');\n }\n if (!destinationProviderCode) {\n throw new Error('[files.copyMoveFiles] destinationProviderCode cannot be null or empty');\n }\n if (!callback) {\n throw new Error('[files.copyMoveFiles] callback cannot be null');\n }\n sendMessageToParent(\n 'files.copyMoveFiles',\n [selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n *\n * Gets list of downloads for current user\n * @param callback Callback that will be triggered post downloads load\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getFileDownloads(callback: (error?: SdkError, files?: IFileItem[]) => void): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw new Error('[files.getFileDownloads] Callback cannot be null');\n }\n\n sendMessageToParent('files.getFileDownloads', [], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Open download preference folder if fileObjectId value is undefined else open folder containing the file with id fileObjectId\n * @param fileObjectId - Id of the file whose containing folder should be opened\n * @param callback Callback that will be triggered post open download folder/path\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openDownloadFolder(fileObjectId: string = undefined, callback: (error?: SdkError) => void): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw new Error('[files.openDownloadFolder] Callback cannot be null');\n }\n\n sendMessageToParent('files.openDownloadFolder', [fileObjectId], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates add 3P cloud storage provider flow, where a pop up window opens for user to select required\n * 3P provider from the configured policy supported 3P provider list, following which user authentication\n * for selected 3P provider is performed on success of which the selected 3P provider support is added for user\n * @beta\n *\n * @param callback Callback that will be triggered post add 3P cloud storage provider action.\n * If the error is encountered (and hence passed back), no provider value is sent back.\n * For success scenarios, error value will be passed as null and a valid provider value is sent.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function addCloudStorageProvider(callback: (error?: SdkError, provider?: CloudStorageProvider) => void): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProvider] callback cannot be null');\n }\n\n sendMessageToParent('files.addCloudStorageProvider', [], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates signout of 3P cloud storage provider flow, which will remove the selected\n * 3P cloud storage provider from the list of added providers. No other user input and / or action\n * is required except the 3P cloud storage provider to signout from\n *\n * @param logoutRequest 3P cloud storage provider remove action request content\n * @param callback Callback that will be triggered post signout of 3P cloud storage provider action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function removeCloudStorageProvider(\n logoutRequest: CloudStorageProviderRequest<CloudStorageProviderContent>,\n callback: (error?: SdkError) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.removeCloudStorageProvider] callback cannot be null');\n }\n\n if (!(logoutRequest && logoutRequest.content)) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.removeCloudStorageProvider] 3P cloud storage provider request content is missing',\n );\n }\n\n sendMessageToParent('files.removeCloudStorageProvider', [logoutRequest], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the add 3P cloud storage file flow, which will add a new file for the given 3P provider\n *\n * @param addNewFileRequest 3P cloud storage provider add action request content\n * @param callback Callback that will be triggered post adding a new file flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function addCloudStorageProviderFile(\n addNewFileRequest: CloudStorageProviderRequest<CloudStorageProviderNewFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProviderFile] callback cannot be null');\n }\n\n if (!(addNewFileRequest && addNewFileRequest.content)) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.addCloudStorageProviderFile] 3P cloud storage provider request content is missing',\n );\n }\n\n sendMessageToParent('files.addCloudStorageProviderFile', [addNewFileRequest], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the rename 3P cloud storage file flow, which will rename an existing file in the given 3P provider\n *\n * @param renameFileRequest 3P cloud storage provider rename action request content\n * @param callback Callback that will be triggered post renaming an existing file flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function renameCloudStorageProviderFile(\n renameFileRequest: CloudStorageProviderRequest<CloudStorageProviderRenameFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.renameCloudStorageProviderFile] callback cannot be null');\n }\n\n if (!(renameFileRequest && renameFileRequest.content)) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.renameCloudStorageProviderFile] 3P cloud storage provider request content is missing',\n );\n }\n\n sendMessageToParent('files.renameCloudStorageProviderFile', [renameFileRequest], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the delete 3P cloud storage file(s) / folder (folder has to be empty) flow,\n * which will delete existing file(s) / folder from the given 3P provider\n *\n * @param deleteFileRequest 3P cloud storage provider delete action request content\n * @param callback Callback that will be triggered post deleting existing file(s) flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function deleteCloudStorageProviderFile(\n deleteFileRequest: CloudStorageProviderRequest<CloudStorageProviderDeleteFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.deleteCloudStorageProviderFile] callback cannot be null');\n }\n\n if (\n !(\n deleteFileRequest &&\n deleteFileRequest.content &&\n deleteFileRequest.content.itemList &&\n deleteFileRequest.content.itemList.length > 0\n )\n ) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.deleteCloudStorageProviderFile] 3P cloud storage provider request content details are missing',\n );\n }\n\n sendMessageToParent('files.deleteCloudStorageProviderFile', [deleteFileRequest], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the download 3P cloud storage file(s) flow,\n * which will download existing file(s) from the given 3P provider in the teams client side without sharing any file info in the callback\n *\n * @param downloadFileRequest 3P cloud storage provider download file(s) action request content\n * @param callback Callback that will be triggered post downloading existing file(s) flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function downloadCloudStorageProviderFile(\n downloadFileRequest: CloudStorageProviderRequest<CloudStorageProviderDownloadFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.downloadCloudStorageProviderFile] callback cannot be null',\n );\n }\n\n if (\n !(\n downloadFileRequest &&\n downloadFileRequest.content &&\n downloadFileRequest.content.itemList &&\n downloadFileRequest.content.itemList.length > 0\n )\n ) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.downloadCloudStorageProviderFile] 3P cloud storage provider request content details are missing',\n );\n }\n\n sendMessageToParent('files.downloadCloudStorageProviderFile', [downloadFileRequest], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the upload 3P cloud storage file(s) flow, which will upload file(s) to the given 3P provider\n * @beta\n *\n * @param uploadFileRequest 3P cloud storage provider upload file(s) action request content\n * @param callback Callback that will be triggered post uploading file(s) flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function uploadCloudStorageProviderFile(\n uploadFileRequest: CloudStorageProviderRequest<CloudStorageProviderUploadFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.uploadCloudStorageProviderFile] callback cannot be null');\n }\n\n if (\n !(\n uploadFileRequest &&\n uploadFileRequest.content &&\n uploadFileRequest.content.itemList &&\n uploadFileRequest.content.itemList.length > 0\n )\n ) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.uploadCloudStorageProviderFile] 3P cloud storage provider request content details are missing',\n );\n }\n\n if (!uploadFileRequest.content.destinationFolder) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.uploadCloudStorageProviderFile] Invalid destination folder details',\n );\n }\n\n sendMessageToParent('files.uploadCloudStorageProviderFile', [uploadFileRequest], callback);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Register a handler to be called when a user's 3P cloud storage provider list changes i.e.\n * post adding / removing a 3P provider, list is updated\n *\n * @param handler - When 3P cloud storage provider list is updated this handler is called\n *\n * @internal Limited to Microsoft-internal use\n */\n export function registerCloudStorageProviderListChangeHandler(handler: () => void): void {\n ensureInitialized(runtime);\n\n if (!handler) {\n throw new Error('[registerCloudStorageProviderListChangeHandler] Handler cannot be null');\n }\n\n registerHandler('files.cloudStorageProviderListChange', handler);\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Register a handler to be called when a user's 3P cloud storage provider content changes i.e.\n * when file(s) is/are added / renamed / deleted / uploaded, the list of files is updated\n *\n * @param handler - When 3P cloud storage provider content is updated this handler is called\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerCloudStorageProviderContentChangeHandler(handler: () => void): void {\n ensureInitialized(runtime);\n\n if (!handler) {\n throw new Error('[registerCloudStorageProviderContentChangeHandler] Handler cannot be null');\n }\n\n registerHandler('files.cloudStorageProviderContentChange', handler);\n }\n\n function getSdkError(errorCode: ErrorCode, message: string): SdkError {\n const sdkError: SdkError = {\n errorCode: errorCode,\n message: message,\n };\n return sdkError;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform } from '../public/constants';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace meetingRoom {\n /**\n * @hidden\n *\n * Data structure to represent a meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface MeetingRoomInfo {\n /**\n * @hidden\n * Endpoint id of the meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n endpointId: string;\n /**\n * @hidden\n * Device name of the meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n deviceName: string;\n /**\n * @hidden\n * Client type of the meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n clientType: string;\n /**\n * @hidden\n * Client version of the meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n clientVersion: string;\n }\n\n /**\n * @hidden\n * Type of Media control capabilities of a meeting room.\n */\n type MediaControls = 'toggleMute' | 'toggleCamera' | 'toggleCaptions' | 'volume';\n\n /**\n * @hidden\n * Types of Stage Layout control capabilities of a meeting room.\n */\n\n type StageLayoutControls =\n | 'showVideoGallery'\n | 'showContent'\n | 'showVideoGalleryAndContent'\n | 'showLargeGallery'\n | 'showTogether';\n\n /**\n * @hidden\n * Types of Meeting Control capabilities of a meeting room.\n */\n\n type MeetingControls = 'leaveMeeting';\n\n /**\n * @hidden\n * Types of Stage Layout State of a meeting room.\n */\n\n type StageLayoutStates = 'Gallery' | 'Content + gallery' | 'Content' | 'Large gallery' | 'Together mode';\n\n /**\n * @hidden\n * Data structure to represent capabilities of a meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface MeetingRoomCapability {\n /**\n * @hidden\n * Media control capabilities, value can be \"toggleMute\", \"toggleCamera\", \"toggleCaptions\", \"volume\".\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n mediaControls: MediaControls[];\n /**\n * @hidden\n * Main stage layout control capabilities, value can be \"showVideoGallery\", \"showContent\", \"showVideoGalleryAndContent\", \"showLargeGallery\", \"showTogether\".\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n stageLayoutControls: StageLayoutControls[];\n /**\n * @hidden\n * Meeting control capabilities, value can be \"leaveMeeting\".\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n meetingControls: MeetingControls[];\n }\n\n /**\n * @hidden\n * Data structure to represent states of a meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface MeetingRoomState {\n /**\n * @hidden\n * Current mute state, true: mute, false: unmute.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n toggleMute: boolean;\n /**\n * @hidden\n * Current camera state, true: camera on, false: camera off.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n toggleCamera: boolean;\n /**\n * @hidden\n * Current captions state, true: captions on, false: captions off.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n toggleCaptions: boolean;\n /**\n * @hidden\n * Current main stage layout state, value can be one of \"Gallery\", \"Content + gallery\", \"Content\", \"Large gallery\" and \"Together mode\".\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n stageLayout: StageLayoutStates;\n /**\n * @hidden\n * Current leaveMeeting state, true: leave, false: no-op.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n leaveMeeting: boolean;\n }\n\n /**\n * @hidden\n * Fetch the meeting room info that paired with current client.\n *\n * @returns Promise resolved with meeting room info or rejected with SdkError value\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getPairedMeetingRoomInfo(): Promise<MeetingRoomInfo> {\n return new Promise<MeetingRoomInfo>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError('meetingRoom.getPairedMeetingRoomInfo'));\n });\n }\n\n /**\n * @hidden\n * Send a command to paired meeting room.\n *\n * @param commandName The command name.\n * @returns Promise resolved upon completion or rejected with SdkError value\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function sendCommandToPairedMeetingRoom(commandName: string): Promise<void> {\n return new Promise<void>((resolve) => {\n if (!commandName || commandName.length == 0) {\n throw new Error('[meetingRoom.sendCommandToPairedMeetingRoom] Command name cannot be null or empty');\n }\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError('meetingRoom.sendCommandToPairedMeetingRoom', commandName));\n });\n }\n\n /**\n * @hidden\n * Registers a handler for meeting room capabilities update.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler The handler to invoke when the capabilities of meeting room update.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerMeetingRoomCapabilitiesUpdateHandler(\n handler: (capabilities: MeetingRoomCapability) => void,\n ): void {\n if (!handler) {\n throw new Error('[meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler] Handler cannot be null');\n }\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('meetingRoom.meetingRoomCapabilitiesUpdate', (capabilities: MeetingRoomCapability) => {\n ensureInitialized(runtime);\n handler(capabilities);\n });\n }\n\n /**\n * @hidden\n * Hide from docs\n * Registers a handler for meeting room states update.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler The handler to invoke when the states of meeting room update.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerMeetingRoomStatesUpdateHandler(handler: (states: MeetingRoomState) => void): void {\n if (!handler) {\n throw new Error('[meetingRoom.registerMeetingRoomStatesUpdateHandler] Handler cannot be null');\n }\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('meetingRoom.meetingRoomStatesUpdate', (states: MeetingRoomState) => {\n ensureInitialized(runtime);\n handler(states);\n });\n }\n\n /**\n * @hidden\n *\n * Checks if the meetingRoom capability is supported by the host\n * @returns boolean to represent whether the meetingRoom capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.meetingRoom ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { ShowNotificationParameters } from './interfaces';\n\nexport namespace notifications {\n /**\n * @hidden\n * display notification API.\n *\n * @param message - Notification message.\n * @param notificationType - Notification type\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function showNotification(showNotificationParameters: ShowNotificationParameters): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n sendMessageToParent('notifications.showNotification', [showNotificationParameters]);\n }\n\n /**\n * @hidden\n *\n * Checks if the notifications capability is supported by the host\n * @returns boolean to represent whether the notifications capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.notifications ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { SdkError } from '../public/interfaces';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace remoteCamera {\n /**\n * @hidden\n * Data structure to represent patricipant details needed to request control of camera.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface Participant {\n /**\n * @hidden\n * Id of participant.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n id: string;\n /**\n * @hidden\n * Display name of participant.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n displayName?: string;\n /**\n * @hidden\n * Active indicates whether the participant's device is actively being controlled.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n active?: boolean;\n }\n\n /**\n * @hidden\n * Enum used to indicate possible camera control commands.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum ControlCommand {\n Reset = 'Reset',\n ZoomIn = 'ZoomIn',\n ZoomOut = 'ZoomOut',\n PanLeft = 'PanLeft',\n PanRight = 'PanRight',\n TiltUp = 'TiltUp',\n TiltDown = 'TiltDown',\n }\n\n /**\n * @hidden\n * Data structure to indicate the current state of the device.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface DeviceState {\n /**\n * @hidden\n * All operation are available to apply.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n available: boolean;\n /**\n * @hidden\n * Either camera doesnt support to get state or It unable to apply command.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n error: boolean;\n /**\n * @hidden\n * Reset max out or already applied. Client Disable Reset.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n reset: boolean;\n /**\n * @hidden\n * ZoomIn maxed out.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n zoomIn: boolean;\n /**\n * @hidden\n * ZoomOut maxed out.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n zoomOut: boolean;\n /**\n * @hidden\n * PanLeft reached max left.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n panLeft: boolean;\n /**\n * @hidden\n * PanRight reached max right.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n panRight: boolean;\n /**\n * @hidden\n * TiltUp reached top.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n tiltUp: boolean;\n /**\n * @hidden\n * TiltDown reached bottom.\n *\n * @internal Limited to Microsoft-internal use\n */\n tiltDown: boolean;\n }\n\n /**\n * @hidden\n * Enum used to indicate the reason for the error.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum ErrorReason {\n CommandResetError,\n CommandZoomInError,\n CommandZoomOutError,\n CommandPanLeftError,\n CommandPanRightError,\n CommandTiltUpError,\n CommandTiltDownError,\n SendDataError,\n }\n\n /**\n * @hidden\n * Data structure to indicate the status of the current session.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface SessionStatus {\n /**\n * @hidden\n * Whether the far-end user is controlling a device.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n inControl: boolean;\n /**\n * @hidden\n * Reason the control session was terminated.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n terminatedReason?: SessionTerminatedReason;\n }\n\n /**\n * @hidden\n * Enum used to indicate the reason the session was terminated.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum SessionTerminatedReason {\n None,\n ControlDenied,\n ControlNoResponse,\n ControlBusy,\n AckTimeout,\n ControlTerminated,\n ControllerTerminated,\n DataChannelError,\n ControllerCancelled,\n ControlDisabled,\n ControlTerminatedToAllowOtherController,\n }\n\n /**\n * @hidden\n * Fetch a list of the participants with controllable-cameras in a meeting.\n *\n * @param callback - Callback contains 2 parameters, error and participants.\n * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful\n * participants can either contain an array of Participant objects, incase of a successful fetch or null when it fails\n * participants: object that contains an array of participants with controllable-cameras\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getCapableParticipants(\n callback: (error: SdkError | null, participants: Participant[] | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[remoteCamera.getCapableParticipants] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('remoteCamera.getCapableParticipants', callback);\n }\n\n /**\n * @hidden\n * Request control of a participant's camera.\n *\n * @param participant - Participant specifies the participant to send the request for camera control.\n * @param callback - Callback contains 2 parameters, error and requestResponse.\n * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful\n * requestResponse can either contain the true/false value, incase of a successful request or null when it fails\n * requestResponse: True means request was accepted and false means request was denied\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function requestControl(\n participant: Participant,\n callback: (error: SdkError | null, requestResponse: boolean | null) => void,\n ): void {\n if (!participant) {\n throw new Error('[remoteCamera.requestControl] Participant cannot be null');\n }\n if (!callback) {\n throw new Error('[remoteCamera.requestControl] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('remoteCamera.requestControl', [participant], callback);\n }\n\n /**\n * @hidden\n * Send control command to the participant's camera.\n *\n * @param ControlCommand - ControlCommand specifies the command for controling the camera.\n * @param callback - Callback to invoke when the command response returns.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function sendControlCommand(ControlCommand: ControlCommand, callback: (error: SdkError | null) => void): void {\n if (!ControlCommand) {\n throw new Error('[remoteCamera.sendControlCommand] ControlCommand cannot be null');\n }\n if (!callback) {\n throw new Error('[remoteCamera.sendControlCommand] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('remoteCamera.sendControlCommand', [ControlCommand], callback);\n }\n\n /**\n * @hidden\n * Terminate the remote session\n *\n * @param callback - Callback to invoke when the command response returns.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function terminateSession(callback: (error: SdkError | null) => void): void {\n if (!callback) {\n throw new Error('[remoteCamera.terminateSession] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('remoteCamera.terminateSession', callback);\n }\n\n /**\n * @hidden\n * Registers a handler for change in participants with controllable-cameras.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the list of participants with controllable-cameras changes.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerOnCapableParticipantsChangeHandler(\n handler: (participantChange: Participant[]) => void,\n ): void {\n if (!handler) {\n throw new Error('[remoteCamera.registerOnCapableParticipantsChangeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('remoteCamera.capableParticipantsChange', handler);\n }\n\n /**\n * @hidden\n * Registers a handler for error.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when there is an error from the camera handler.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerOnErrorHandler(handler: (error: ErrorReason) => void): void {\n if (!handler) {\n throw new Error('[remoteCamera.registerOnErrorHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('remoteCamera.handlerError', handler);\n }\n\n /**\n * @hidden\n * Registers a handler for device state change.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the controlled device changes state.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerOnDeviceStateChangeHandler(handler: (deviceStateChange: DeviceState) => void): void {\n if (!handler) {\n throw new Error('[remoteCamera.registerOnDeviceStateChangeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('remoteCamera.deviceStateChange', handler);\n }\n\n /**\n * @hidden\n * Registers a handler for session status change.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the current session status changes.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerOnSessionStatusChangeHandler(handler: (sessionStatusChange: SessionStatus) => void): void {\n if (!handler) {\n throw new Error('[remoteCamera.registerOnSessionStatusChangeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('remoteCamera.sessionStatusChange', handler);\n }\n\n /**\n * @hidden\n *\n * Checks if the remoteCamera capability is supported by the host\n * @returns boolean to represent whether the remoteCamera capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.remoteCamera ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { FrameContexts, SdkError } from '../public';\nimport { errorNotSupportedOnPlatform } from '../public/constants';\nimport { runtime } from '../public/runtime';\n/**\n * @hidden\n * Namespace to interact with the application entities specific part of the SDK.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace appEntity {\n /**\n * @hidden\n *\n * Information on an app entity\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface AppEntity {\n /**\n * @hidden\n * ID of the application\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n appId: string;\n\n /**\n * @hidden\n * URL for the application's icon\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n appIconUrl: string;\n\n /**\n * @hidden\n * Content URL for the app entity\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n contentUrl: string;\n\n /**\n * @hidden\n * The display name for the app entity\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n displayName: string;\n\n /**\n * @hidden\n * Website URL for the app entity. It is meant to be opened by the user in a browser.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n websiteUrl: string;\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Open the Tab Gallery and retrieve the app entity\n * @param threadId ID of the thread where the app entity will be created\n * @param categories A list of application categories that will be displayed in the opened tab gallery\n * @param subEntityId An object that will be made available to the application being configured\n * through the Context's subEntityId field.\n * @param callback Callback that will be triggered once the app entity information is available.\n * The callback takes two arguments: an SdkError in case something happened (i.e.\n * no permissions to execute the API) and the app entity configuration, if available\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function selectAppEntity(\n threadId: string,\n categories: string[],\n subEntityId: string,\n callback: (sdkError?: SdkError, appEntity?: AppEntity) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!threadId || threadId.length == 0) {\n throw new Error('[appEntity.selectAppEntity] threadId name cannot be null or empty');\n }\n\n if (!callback) {\n throw new Error('[appEntity.selectAppEntity] Callback cannot be null');\n }\n\n sendMessageToParent('appEntity.selectAppEntity', [threadId, categories, subEntityId], callback);\n }\n\n /**\n * @hidden\n *\n * Checks if the appEntity capability is supported by the host\n * @returns boolean to represent whether the appEntity capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.appEntity ? true : false;\n }\n}\n","import { sendAndUnwrap, sendMessageToParent } from '../internal/communication';\nimport { getUserJoinedTeamsSupportedAndroidClientVersion } from '../internal/constants';\nimport { GlobalVars } from '../internal/globalVars';\nimport { ensureInitialized, isCurrentSDKVersionAtLeast } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts, HostClientType } from '../public/constants';\nimport { ErrorCode, SdkError } from '../public/interfaces';\nimport { runtime } from '../public/runtime';\nimport { TeamInstanceParameters, UserJoinedTeamsInformation } from './interfaces';\n\n/**\n * @hidden\n * Namespace to interact with the `teams` specific part of the SDK.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace teams {\n export enum ChannelType {\n Regular = 0,\n Private = 1,\n Shared = 2,\n }\n\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface ChannelInfo {\n siteUrl: string;\n objectId: string;\n folderRelativeUrl: string;\n displayName: string;\n channelType: ChannelType;\n }\n\n /**\n * @hidden\n * Get a list of channels belong to a Team\n *\n * @param groupId - a team's objectId\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getTeamChannels(groupId: string, callback: (error: SdkError, channels: ChannelInfo[]) => void): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!groupId) {\n throw new Error('[teams.getTeamChannels] groupId cannot be null or empty');\n }\n\n if (!callback) {\n throw new Error('[teams.getTeamChannels] Callback cannot be null');\n }\n\n sendMessageToParent('teams.getTeamChannels', [groupId], callback);\n }\n\n /**\n * @hidden\n * Allow 1st party apps to call this function when they receive migrated errors to inform the Hub/Host to refresh the siteurl\n * when site admin renames siteurl.\n *\n * @param threadId - ID of the thread where the app entity will be created; if threadId is not\n * provided, the threadId from route params will be used.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function refreshSiteUrl(threadId: string, callback: (error: SdkError) => void): void {\n ensureInitialized(runtime);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!threadId) {\n throw new Error('[teams.refreshSiteUrl] threadId cannot be null or empty');\n }\n\n if (!callback) {\n throw new Error('[teams.refreshSiteUrl] Callback cannot be null');\n }\n\n sendMessageToParent('teams.refreshSiteUrl', [threadId], callback);\n }\n\n /**\n * @hidden\n *\n * Checks if teams capability is supported by the host\n * @returns boolean to represent whether the teams capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.teams ? true : false;\n }\n\n /**\n * @hidden\n * @internal\n * Limited to Microsoft-internal use\n */\n export namespace fullTrust {\n /**\n * @hidden\n * @internal\n * Limited to Microsoft-internal use\n */\n export namespace joinedTeams {\n /**\n * @hidden\n * Allows an app to retrieve information of all user joined teams\n *\n * @param teamInstanceParameters - Optional flags that specify whether to scope call to favorite teams\n * @returns Promise that resolves with information about the user joined teams or rejects with an error when the operation has completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getUserJoinedTeams(\n teamInstanceParameters?: TeamInstanceParameters,\n ): Promise<UserJoinedTeamsInformation> {\n return new Promise<UserJoinedTeamsInformation>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (\n (GlobalVars.hostClientType === HostClientType.android ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||\n GlobalVars.hostClientType === HostClientType.teamsPhones ||\n GlobalVars.hostClientType === HostClientType.teamsDisplays) &&\n !isCurrentSDKVersionAtLeast(getUserJoinedTeamsSupportedAndroidClientVersion)\n ) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n throw new Error(JSON.stringify(oldPlatformError));\n }\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(sendAndUnwrap('getUserJoinedTeams', teamInstanceParameters));\n });\n }\n /**\n * @hidden\n *\n * Checks if teams.fullTrust.joinedTeams capability is supported by the host\n * @returns boolean to represent whether the teams.fullTrust.joinedTeams capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.teams\n ? runtime.supports.teams.fullTrust\n ? runtime.supports.teams.fullTrust.joinedTeams\n ? true\n : false\n : false\n : false;\n }\n }\n\n /**\n * @hidden\n * Allows an app to get the configuration setting value\n *\n * @param key - The key for the config setting\n * @returns Promise that resolves with the value for the provided configuration setting or rejects with an error when the operation has completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getConfigSetting(key: string): Promise<string> {\n return new Promise<string>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndUnwrap('getConfigSetting', key));\n });\n }\n\n /**\n * @hidden\n *\n * Checks if teams.fullTrust capability is supported by the host\n * @returns boolean to represent whether the teams.fullTrust capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.teams\n ? runtime.supports.teams.fullTrust\n ? true\n : false\n : false;\n }\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { video } from '../public/video';\n\n/**\n * @hidden\n * Extended video API\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace videoEx {\n /**\n * @hidden\n * Error level when notifying errors to the host, the host will decide what to do acording to the error level.\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum ErrorLevel {\n Fatal = 'fatal',\n Warn = 'warn',\n }\n /**\n * @hidden\n * Video frame configuration supplied to the host to customize the generated video frame parameters\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface VideoFrameConfig extends video.VideoFrameConfig {\n /**\n * @hidden\n * Flag to indicate use camera stream to synthesize video frame or not.\n * Default value is true.\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n requireCameraStream?: boolean;\n /**\n * @hidden\n * Machine learning model to run in the host to do audio inference for you\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n audioInferenceModel?: ArrayBuffer;\n }\n\n /**\n * @hidden\n * Represents a video frame\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface VideoFrame extends video.VideoFrame {\n /**\n * @hidden\n * The model output if you passed in an {@linkcode VideoFrameConfig.audioInferenceModel}\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n audioInferenceResult?: Uint8Array;\n }\n\n /**\n * @hidden\n * Video frame call back function\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type VideoFrameCallback = (\n frame: VideoFrame,\n notifyVideoFrameProcessed: () => void,\n notifyError: (errorMessage: string) => void,\n ) => void;\n\n /**\n * @hidden\n * Register to process video frames\n * @beta\n *\n * @param frameCallback - The callback to invoke when registerForVideoFrame has completed\n * @param config - VideoFrameConfig to customize generated video frame parameters\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerForVideoFrame(frameCallback: VideoFrameCallback, config: VideoFrameConfig): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n registerHandler(\n 'video.newVideoFrame',\n (videoFrame: VideoFrame) => {\n if (videoFrame) {\n const timestamp = videoFrame.timestamp;\n frameCallback(\n videoFrame,\n () => {\n notifyVideoFrameProcessed(timestamp);\n },\n notifyError,\n );\n }\n },\n false,\n );\n\n sendMessageToParent('video.registerForVideoFrame', [config]);\n }\n\n /**\n * @hidden\n * Video extension should call this to notify host that the current selected effect parameter changed.\n * If it's pre-meeting, host will call videoEffectCallback immediately then use the videoEffect.\n * If it's the in-meeting scenario, we will call videoEffectCallback when apply button clicked.\n * @beta\n * @param effectChangeType - the effect change type.\n * @param effectId - Newly selected effect id. {@linkcode VideoEffectCallBack}\n * @param effectParam Variant for the newly selected effect. {@linkcode VideoEffectCallBack}\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function notifySelectedVideoEffectChanged(\n effectChangeType: video.EffectChangeType,\n effectId: string | undefined,\n effectParam?: string,\n ): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('video.videoEffectChanged', [effectChangeType, effectId, effectParam]);\n }\n\n /**\n * @hidden\n * Video effect change call back function definition\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type VideoEffectCallBack = (effectId: string | undefined, effectParam?: string) => void;\n\n /**\n * @hidden\n * Register the video effect callback, host uses this to notify the video extension the new video effect will by applied\n * @beta\n * @param callback - The VideoEffectCallback to invoke when registerForVideoEffect has completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerForVideoEffect(callback: VideoEffectCallBack): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler('video.effectParameterChange', callback, false);\n sendMessageToParent('video.registerForVideoEffect');\n }\n\n /**\n * @hidden\n * Personalized video effect\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface PersonalizedEffect {\n /**\n * Personalized effect id\n */\n id: string;\n /**\n * Display name\n */\n name: string;\n /**\n * Effect type defined by app\n */\n type: string;\n /**\n * Data URI of the thumbnail image content encoded in ASCII format using the base64 scheme\n */\n thumbnail: string;\n }\n\n /**\n * @hidden\n * Send personalized effects to Teams client\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function updatePersonalizedEffects(effects: PersonalizedEffect[]): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!video.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent('video.personalizedEffectsChanged', [effects]);\n }\n\n /**\n * @hidden\n *\n * Checks if video capability is supported by the host\n * @beta\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @returns boolean to represent whether the video capability is supported\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n ensureInitialized(runtime);\n return video.isSupported();\n }\n\n /**\n * @hidden\n * Sending notification to host finished the video frame processing, now host can render this video frame\n * or pass the video frame to next one in video pipeline\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n function notifyVideoFrameProcessed(timestamp?: number): void {\n sendMessageToParent('video.videoFrameProcessed', [timestamp]);\n }\n\n /**\n * @hidden\n * Sending error notification to host\n * @beta\n * @param errorMessage - The error message that will be sent to the host\n * @param errorLevel - The error level that will be sent to the host\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n function notifyError(errorMessage: string, errorLevel: ErrorLevel = ErrorLevel.Warn): void {\n sendMessageToParent('video.notifyError', [errorMessage, errorLevel]);\n }\n\n /**\n * @hidden\n * Sending fatal error notification to host. Call this function only when your app meets fatal error and can't continue.\n * The host will stop the video pipeline and terminate this session, and optionally, show an error message to the user.\n * @beta\n * @param errorMessage - The error message that will be sent to the host\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function notifyFatalError(errorMessage: string): void {\n ensureInitialized(runtime);\n if (!video.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n notifyError(errorMessage, ErrorLevel.Fatal);\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","this","formatArgs","args","useColors","namespace","humanize","diff","c","color","splice","index","lastC","replace","match","save","namespaces","storage","setItem","removeItem","error","load","r","getItem","process","env","DEBUG","window","type","__nwjs","navigator","userAgent","toLowerCase","document","documentElement","style","WebkitAppearance","console","firebug","exception","table","parseInt","RegExp","$1","localStorage","localstorage","destroy","warned","warn","colors","log","debug","formatters","j","v","JSON","stringify","message","createDebug","prevTime","namespacesCache","enabledCache","enableOverride","enabled","curr","Number","Date","ms","prev","coerce","unshift","format","formatter","val","call","apply","selectColor","extend","Object","defineProperty","enumerable","configurable","get","set","init","delimiter","newDebug","toNamespace","regexp","toString","substring","length","default","Error","stack","disable","names","map","skips","join","enable","i","split","len","push","slice","name","test","keys","forEach","key","hash","charCodeAt","Math","abs","s","m","h","d","w","y","parse","str","String","exec","n","parseFloat","fmtShort","msAbs","round","fmtLong","plural","isPlural","options","isFinite","long","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","definition","o","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","value","defaultSDKVersionForCompatCheck","videoAndImageMediaAPISupportVersion","nonFullScreenVideoModeAPISupportVersion","imageOutputFormatsAPISupportVersion","getUserJoinedTeamsSupportedAndroidClientVersion","locationAPIsRequiredVersion","peoplePickerRequiredVersion","captureImageMobileSupportVersion","mediaAPISupportVersion","scanBarCodeAPIMobileSupportVersion","validOrigins","userOriginUrlValidationRegExp","teamsDeepLinkProtocol","teamsDeepLinkHost","errorLibraryNotInitialized","errorRuntimeNotInitialized","errorRuntimeNotSupported","initializeCalled","initializeCompleted","additionalValidOrigins","isFramelessWindow","printCapabilityEnabled","topLevelLogger","getLogger","randomUUID","crypto","bind","getRandomValues","rnds8","Uint8Array","rng","byteToHex","unsafeStringify","arr","offset","buf","rnds","random","FileOpenPreference","ActionObjectType","SecondaryM365ContentIdName","ErrorCode","DevicePermission","HostClientType","HostName","FrameContexts","TeamType","UserTeamRole","DialogDimension","ChannelType","TaskModuleDimension","errorNotSupportedOnPlatform","errorCode","NOT_SUPPORTED_ON_PLATFORM","minAdaptiveCardVersion","majorVersion","minorVersion","validateHostAgainstPattern","pattern","host","suffix","validateOrigin","messageOrigin","protocol","messageOriginHost","some","GlobalVars","domainOrPattern","getGenericOnCompleteHandler","errorMessage","success","reason","compareSDKVersions","v1","v2","NaN","v1parts","v2parts","isValidPart","x","every","generateGUID","freeze","callCallbackWithErrorOrResultFromPromiseAndReturnPromise","funcHelper","callback","p","then","result","catch","e","callCallbackWithSdkErrorFromPromiseAndReturnPromise","callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise","runWithTimeout","action","timeoutInMs","timeoutError","Promise","resolve","reject","timeoutHandle","setTimeout","clearTimeout","createTeamsAppLink","params","url","URL","encodeURIComponent","appId","pageId","webUrl","searchParams","append","channelId","subPageId","subEntityId","isHostAdaptiveCardSchemaVersionUnsupported","hostAdaptiveCardSchemaVersion","runtimeLogger","latestRuntimeApiVersion","isLatestRuntimeVersion","runtime","apiVersion","_uninitializedRuntime","supports","isRuntimeInitialized","teamsRuntimeConfig","hostVersionsInfo","isLegacyTeams","appInstallDialog","appEntity","chat","conversations","dialog","bot","update","logs","meetingRoom","menus","monetization","notifications","pages","appButton","tabs","config","backStack","fullTrust","remoteCamera","stageView","teams","teamsCore","video","v1HostClientTypes","desktop","web","android","ios","rigel","surfaceHub","teamsRoomsWindows","teamsRoomsAndroid","teamsPhones","teamsDisplays","fastForwardRuntime","outdatedRuntime","upgradeChain","upgrade","versionToUpgradeFrom","upgradeToNextVersion","previousVersionRuntime","card","versionConstants","capability","location","hostClientTypes","people","sharing","joinedTeams","webStorage","generateBackCompatRuntimeConfigLogger","generateBackCompatRuntimeConfig","highestSupportedVersion","newSupports","versionNumber","capabilityReqs","includes","hostClientType","backCompatRuntimeConfig","applyRuntimeConfigLogger","applyRuntimeConfig","runtimeConfig","ffRuntimeConfig","authentication","app","version","internalLogger","ensureInitializeCalledLogger","ensureInitializedLogger","ensureInitializeCalled","ensureInitialized","expectedFrameContexts","found","frameContext","isCurrentSDKVersionAtLeast","requiredVersion","clientSupportedSDKVersion","isNaN","isHostClientMobile","ipados","throwExceptionIfMobileApiIsNotSupported","OLD_PLATFORM","processAdditionalValidOrigins","validMessageOrigins","combinedOriginUrls","concat","filter","_origin","dedupUrls","_originUrl","transformLegacyContextToAppContext","legacyContext","actionInfo","locale","sessionId","appSessionId","theme","iconPositionVertical","appIconPosition","osLocaleInfo","parentMessageId","userClickTime","userFileOpenPreference","hostName","clientType","ringId","appLaunchId","page","id","entityId","isFullScreen","isMultiWindow","sourceOrigin","user","userObjectId","displayName","userDisplayName","isCallingAllowed","isPSTNCallingAllowed","licenseType","userLicenseType","loginHint","userPrincipalName","tenant","tid","teamsSku","tenantSKU","channel","channelName","relativeUrl","channelRelativeUrl","membershipType","channelType","defaultOneNoteSectionId","ownerGroupId","hostTeamGroupId","ownerTenantId","hostTeamTenantId","chatId","meeting","meetingId","sharepoint","team","teamId","internalId","teamName","teamType","groupId","templateId","teamTemplateId","isArchived","isTeamArchived","userRole","userTeamRole","sharePointSite","teamSiteUrl","teamSiteDomain","teamSitePath","mySitePath","mySiteDomain","teamSiteId","inServerSideRenderingEnvironment","authHandlers","authWindowMonitor","authParams","authenticateHelper","authenticateParameters","link","createElement","href","sendMessageToParentAsync","width","height","isExternal","response","fail","openAuthenticationWindow","getAuthTokenHelper","authTokenRequest","resources","claims","silent","getUserHelper","closeAuthenticationWindow","stopAuthenticationWindowMonitor","Communication","childWindow","close","childOrigin","min","currentWindow","outerWidth","outerHeight","left","screenLeft","screenX","top","screenTop","screenY","open","startAuthenticationWindowMonitor","handleFailure","clearInterval","removeHandler","setInterval","closed","savedChildOrigin","sendMessageEventToChild","registerHandler","handleSuccess","redirectIfWin32Outlook","callbackUrl","decodeURIComponent","search","indexOf","updateUrlParameter","assign","uri","substr","initialize","registerAuthenticationHandlers","authenticate","isDifferentParamsInCall","authenticateParams","content","sidePanel","settings","remove","task","stage","meetingStage","successCallback","err","failureCallback","getAuthToken","getUser","userRequest","notifySuccess","sendMessageToParent","waitForMessageQueue","parentWindow","notifyFailure","DataResidency","storedMessages","handleDialogMessage","isSupported","getDialogInfoFromUrlDialogInfo","urlDialogInfo","size","Small","title","fallbackUrl","getDialogInfoFromBotUrlDialogInfo","botUrlDialogInfo","dialogInfo","completionBotId","submitHandler","messageFromChildHandler","submit","appIds","Array","isArray","sendMessageToParentFromDialog","sendMessageToDialog","registerOnMessageFromParent","listener","reverse","pop","resize","dimensions","adaptiveCard","isAdaptiveCardVersionSupported","adaptiveCardSchemaVersion","getDialogInfoFromAdaptiveCardDialogInfo","adaptiveCardDialogInfo","getDialogInfoFromBotAdaptiveCardDialogInfo","botAdaptiveCardDialogInfo","getAdaptiveCardDialogInfoFromTaskInfo","taskInfo","getBotAdaptiveCardDialogInfoFromTaskInfo","DisplayMode","navBarMenuItemPressHandler","actionMenuItemPressHandler","viewConfigItemPressHandler","selected","handleViewConfigItemPress","handleNavBarMenuItemPress","handleActionMenuItemPress","MenuItem","MenuListType","setUpViews","viewConfig","handler","setNavBarMenu","items","showActionMenu","print","registerOnLoadHandlerHelper","versionSpecificHelper","registerBeforeUnloadHandlerHelper","enablePrintCapability","addEventListener","event","ctrlKey","metaKey","keyCode","cancelBubble","preventDefault","stopImmediatePropagation","registerOnLoadHandler","registerBeforeUnloadHandler","appLogger","Messages","AppLoaded","Success","Failure","ExpectedFailure","FailedReason","ExpectedFailureReason","isInitialized","getFrameContext","initializationTimeoutInMs","initializeLogger","initializeHelper","initializeHelperLogger","initializePromise","initializeCommunication","context","givenRuntimeConfig","SyntaxError","registerOnThemeChangeHandler","_initialize","hostWindow","_uninitialize","registerBackButtonHandler","registerFullScreenHandler","registerGetLogHandler","registerOnSaveHandler","registerOnRemoveHandler","uninitializeCommunication","getContext","sendAndUnwrap","notifyAppLoaded","appInitializationFailedRequest","notifyExpectedFailure","expectedFailureRequest","openLink","deepLink","setCurrentFrame","frameInfo","returnFocus","navigateForward","registerFocusEnterHandler","registerHandlerHelper","initializeWithFrameContext","getConfig","navigateCrossDomain","navigateToApp","shareDeepLink","deepLinkParameters","subPageLabel","subPageWebUrl","navigateToTab","tabInstance","getTabInstances","tabInstanceParameters","getMruTabInstances","saveHandler","registerOnSaveHandlerHelper","registerOnRemoveHandlerHelper","handleSave","saveEvent","SaveEventImpl","handleRemove","setValidityState","validityState","setConfig","instanceConfig","registerChangeConfigHandler","notified","ensureNotNotified","removeEvent","RemoveEventImpl","backButtonPressHandler","navigateBack","registerBackButtonHandlerHelper","handleBackButtonPress","enterFullscreen","exitFullscreen","onClick","onHoverEnter","onHoverLeave","currentApp","navigateTo","sendAndHandleSdkError","navigateToDefaultPage","handlersLogger","handlers","initializeHandlers","HandlersPrivate","handleThemeChange","handleLoad","handleBeforeUnload","callHandlerLogger","callHandler","sendMessage","doesHandlerExist","contexts","registrationHelper","themeChangeHandler","loadHandler","beforeUnloadHandler","readyToUnload","communicationLogger","parentMessageQueue","childMessageQueue","nextMessageId","callbacks","promiseCallbacks","CommunicationPrivate","messageListener","evt","processMessage","parent","opener","extendedWindow","nativeInterface","onNativeMessage","handleParentMessage","parentOrigin","removeEventListener","actionName","sendAndHandleStatusAndReason","status","sendAndHandleStatusAndReasonWithDefaultError","defaultError","waitForResponse","sendMessageToParentHelper","requestId","argsOrCallback","Function","request","sendMessageToParentHelperLogger","logger","targetWindow","createMessageRequest","framelessPostMessage","targetOrigin","getTargetOrigin","postMessage","getTargetMessageQueue","data","messageSource","source","originalEvent","origin","shouldProcessMessage","updateRelationships","handleChildMessage","flushMessageQueue","handleParentMessageLogger","isPartialResponse","promiseCallback","func","called","sendMessageResponseToChild","NotificationTypes","ViewerActionTypes","UserSettingTypes","flushMessageQueueLogger","targetMessageQueue","target","shift","messageQueueMonitor","createMessageResponse","customEvent","createMessageEvent","timestamp","now","uploadCustomApp","manifestBlob","onComplete","sendCustomMessage","sendCustomEvent","registerCustomHandler","customHandler","registerUserSettingsChangeHandler","settingTypes","openFilePreview","filePreviewParameters","description","objectUrl","downloadUrl","webPreviewUrl","webEditUrl","baseUrl","editFile","viewerAction","fileOpenPreference","conversationId","openConversation","openConversationRequest","sendPromise","onStartConversation","onCloseConversation","closeConversation","getChatMembers","teamsDeepLinkUrlPathForAppInstall","teamsDeepLinkUrlPathForCalendar","teamsDeepLinkAttendeesUrlParameterName","teamsDeepLinkStartTimeUrlParameterName","teamsDeepLinkEndTimeUrlParameterName","teamsDeepLinkSubjectUrlParameterName","teamsDeepLinkContentUrlParameterName","teamsDeepLinkUrlPathForCall","teamsDeepLinkSourceUrlParameterName","teamsDeepLinkWithVideoUrlParameterName","teamsDeepLinkUrlPathForChat","teamsDeepLinkUsersUrlParameterName","teamsDeepLinkTopicUrlParameterName","teamsDeepLinkMessageUrlParameterName","createTeamsDeepLinkForChat","users","topic","usersSearchParameter","topicSearchParameter","messageSearchParameter","createTeamsDeepLinkForCall","targets","withVideo","withVideoSearchParameter","sourceSearchParameter","createTeamsDeepLinkForCalendar","attendees","startTime","endTime","subject","attendeeSearchParameter","attendee","startTimeSearchParameter","endTimeSearchParameter","subjectSearchParameter","contentSearchParameter","createTeamsDeepLinkForAppInstallDialog","openAppInstallDialog","openAPPInstallDialogParams","media","barCode","geoLocation","createFile","assembleAttachment","mimeType","file","sequence","sort","a","b","item","Blob","decodeAttachment","attachment","decoded","atob","chunk","byteNumbers","byteArray","blob","chunkSequence","throwExceptionIfMediaCallIsNotSupportedOnMobile","mediaInputs","isMediaCallForVideoAndImageInputs","isMediaCallForNonFullScreenVideoMode","isMediaCallForImageOutputFormats","isVideoControllerRegistered","mediaType","MediaType","Video","videoProps","videoController","validateSelectMediaInputs","maxMediaCount","Image","imageProps","imageOutputFormats","VideoAndImage","videoAndImageProps","isFullScreenMode","validateGetMediaInputs","FileFormat","ID","validateViewImagesInput","uriList","validateScanBarCodeInput","barCodeConfig","timeOutIntervalInSec","validatePeoplePickerInput","peoplePickerInputs","setSelected","openOrgWideSearchInChatOrChannel","singleSelect","getAdaptiveCardSchemaVersion","File","captureImage","that","preview","getMedia","getMediaViaCallback","getMediaViaHandler","INVALID_ARGUMENTS","helper","mediaMimeType","mediaResult","mediaChunk","assemble","INTERNAL_ERROR","Media","MediaControllerEvent","getMediaType","notifyEventToApp","mediaEvent","controllerCallback","StartRecording","onRecordingStarted","notifyEventToHost","mediaControllerEvent","stop","StopRecording","VideoController","CameraStartMode","Source","ImageUriType","ImageOutputFormats","selectMedia","localAttachments","mediaArray","invalidInput","oldPlatformError","viewImages","scanBarCode","permissions","hasPermission","requestPermission","openChat","openChatRequest","members","openGroupChat","getCurrentLocation","allowChooseLocation","showMap","GeoLocation","chooseLocation","showLocation","_instance","getLocation","props","calendar","mail","profile","appInitialization","validateShowProfileRequest","showProfileRequest","modality","targetElementBoundingRect","triggerType","validatePersona","persona","identifiers","AadObjectId","Smtp","Upn","registerAppButtonClickHandler","registerAppButtonHoverEnterHandler","registerAppButtonHoverLeaveHandler","registerChangeSettingsHandler","tabInfo","subEntityLabel","subEntityWebUrl","executeDeepLink","setFrameContext","MicStateChangeReason","startAppAudioHandling","requestAppAudioHandlingParams","isAppHandlingAudio","isHostAudioless","micState","micMuteStateChangedCallback","newMicState","micStateDidUpdate","isMicMuted","setMicStateWithReason","HostInitiated","AppDeclinedToChange","AppFailedToChange","stopAppAudioHandling","MeetingReactionType","MeetingType","CallType","getIncomingClientAudioState","toggleIncomingClientAudio","getMeetingDetails","getAuthenticationTokenForAnonymousUser","getLiveStreamState","requestStartLiveStreaming","streamUrl","streamKey","requestStopLiveStreaming","registerLiveStreamChangedHandler","shareAppContentToStage","appContentUrl","getAppContentStageSharingCapabilities","stopSharingAppContentToStage","getAppContentStageSharingState","registerSpeakingStateChangeHandler","registerRaiseHandStateChangedHandler","registerMeetingReactionReceivedHandler","appShareButton","setOptions","shareInformation","contentUrl","requestAppAudioHandling","updateMicState","AppInitiated","openPurchaseExperience","param1","param2","planInfo","openCalendarItem","openCalendarItemParams","itemId","trim","composeMeeting","composeMeetingParams","openMailItem","openMailItemParams","composeMail","composeMailParams","ComposeMailType","selectPeopleHelper","selectPeople","showProfile","isValid","targetRectangle","EffectFailureReason","notifyVideoFrameProcessed","notifyError","VideoFrameFormat","EffectChangeType","registerForVideoFrame","frameCallback","videoFrame","notifySelectedVideoEffectChanged","effectChangeType","effectId","registerForVideoEffect","validReason","InitializationFailure","onChangeHandlerName","onClosedHandlerName","onExecutedHandlerName","registerHandlers","onClosedHandler","onExecuteHandler","onChangeHandler","unregisterHandlers","shareWebContentHelper","shareWebContentRequest","SharingAPIMessages","shareWebContent","validateNonEmptyContent","shareRequest","validateTypeConsistency","validateContentForSupportedTypes","stageViewParams","isWebStorageClearedOnUserLogOut","CallModalities","startCall","startCallParams","requestedModalities","getSettings","setSettings","instanceSettings","tasks","UserMeetingRole","ContainerState","getUrlDialogInfoFromTaskInfo","getBotUrlDialogInfoFromTaskInfo","getDefaultSizeIfNotProvided","startTask","dialogSubmitHandler","sdkResponse","ChildAppWindow","updateTask","extra","submitTask","files","videoEx","getFluidTenantInfo","getFluidToken","containerId","getFluidContainerId","setFluidContainerId","getNtpTime","registerClientId","clientId","getClientRoles","create","LiveShareHost","getSdkError","CloudStorageProvider","CloudStorageProviderType","SpecialDocumentLibraryType","DocumentLibraryAccessType","FileDownloadStatus","CloudStorageProviderFileAction","getCloudStorageFolders","addCloudStorageFolder","deleteCloudStorageFolder","folderToDelete","getCloudStorageFolderContents","folder","providerCode","isSubdirectory","openCloudStorageFile","getExternalProviders","excludeAddedProviders","copyMoveFiles","selectedFiles","destinationFolder","destinationProviderCode","isMove","getFileDownloads","openDownloadFolder","fileObjectId","addCloudStorageProvider","removeCloudStorageProvider","logoutRequest","addCloudStorageProviderFile","addNewFileRequest","renameCloudStorageProviderFile","renameFileRequest","deleteCloudStorageProviderFile","deleteFileRequest","itemList","downloadCloudStorageProviderFile","downloadFileRequest","uploadCloudStorageProviderFile","uploadFileRequest","registerCloudStorageProviderListChangeHandler","registerCloudStorageProviderContentChangeHandler","getPairedMeetingRoomInfo","sendCommandToPairedMeetingRoom","commandName","registerMeetingRoomCapabilitiesUpdateHandler","capabilities","registerMeetingRoomStatesUpdateHandler","states","showNotification","showNotificationParameters","ControlCommand","ErrorReason","SessionTerminatedReason","getCapableParticipants","requestControl","participant","sendControlCommand","terminateSession","registerOnCapableParticipantsChangeHandler","registerOnErrorHandler","registerOnDeviceStateChangeHandler","registerOnSessionStatusChangeHandler","selectAppEntity","threadId","categories","getTeamChannels","refreshSiteUrl","getUserJoinedTeams","teamInstanceParameters","getConfigSetting","ErrorLevel","errorLevel","Warn","effectParam","updatePersonalizedEffects","effects","notifyFatalError","Fatal"],"sourceRoot":""}
|