Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/teams-js

Package Overview
Dependencies
Maintainers
3
Versions
499
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/teams-js - npm Package Compare versions

Comparing version 2.30.0 to 2.31.0-beta.0

dist/esm/_virtual/__polyfill-node.os.js

2

dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/node.js

@@ -1,1 +0,1 @@

import{__module as t}from"../../../../../../_virtual/node.js";import e from"../../../../../../_virtual/__polyfill-node.tty.js";import s from"../../../../../../_virtual/__polyfill-node.util.js";import{__require as o}from"../../../../supports-color@8.1.1/node_modules/supports-color/browser.js";import{__require as r}from"./common.js";var n;function i(){return n||(n=1,function(t,n){const i=e,p=s;n.init=function(t){t.inspectOpts={};const e=Object.keys(n.inspectOpts);for(let s=0;s<e.length;s++)t.inspectOpts[e[s]]=n.inspectOpts[e[s]]},n.log=function(...t){return process.stderr.write(p.formatWithOptions(n.inspectOpts,...t)+"\n")},n.formatArgs=function(e){const{namespace:s,useColors:o}=this;if(o){const o=this.color,r="[3"+(o<8?o:"8;5;"+o),n=` ${r};1m${s} `;e[0]=n+e[0].split("\n").join("\n"+n),e.push(r+"m+"+t.exports.humanize(this.diff)+"")}else e[0]=function(){if(n.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+s+" "+e[0]},n.save=function(t){t?process.env.DEBUG=t:delete process.env.DEBUG},n.load=function(){return process.env.DEBUG},n.useColors=function(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):i.isatty(process.stderr.fd)},n.destroy=p.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{const t=o();t&&(t.stderr||t).level>=2&&(n.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}n.inspectOpts=Object.keys(process.env).filter((t=>/^debug_/i.test(t))).reduce(((t,e)=>{const s=e.substring(6).toLowerCase().replace(/_([a-z])/g,((t,e)=>e.toUpperCase()));let o=process.env[e];return o=!!/^(yes|on|true|enabled)$/i.test(o)||!/^(no|off|false|disabled)$/i.test(o)&&("null"===o?null:Number(o)),t[s]=o,t}),{}),t.exports=r()(n);const{formatters:c}=t.exports;c.o=function(t){return this.inspectOpts.colors=this.useColors,p.inspect(t,this.inspectOpts).split("\n").map((t=>t.trim())).join(" ")},c.O=function(t){return this.inspectOpts.colors=this.useColors,p.inspect(t,this.inspectOpts)}}(t,t.exports)),t.exports}export{i as __require};
import{__module as t}from"../../../../../../_virtual/node.js";import e from"../../../../../../_virtual/__polyfill-node.tty.js";import s from"../../../../../../_virtual/__polyfill-node.util.js";import{__require as o}from"../../../../supports-color@7.2.0/node_modules/supports-color/index.js";import{__require as r}from"./common.js";var n;function i(){return n||(n=1,function(t,n){const i=e,p=s;n.init=function(t){t.inspectOpts={};const e=Object.keys(n.inspectOpts);for(let s=0;s<e.length;s++)t.inspectOpts[e[s]]=n.inspectOpts[e[s]]},n.log=function(...t){return process.stderr.write(p.formatWithOptions(n.inspectOpts,...t)+"\n")},n.formatArgs=function(e){const{namespace:s,useColors:o}=this;if(o){const o=this.color,r="[3"+(o<8?o:"8;5;"+o),n=` ${r};1m${s} `;e[0]=n+e[0].split("\n").join("\n"+n),e.push(r+"m+"+t.exports.humanize(this.diff)+"")}else e[0]=function(){if(n.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+s+" "+e[0]},n.save=function(t){t?process.env.DEBUG=t:delete process.env.DEBUG},n.load=function(){return process.env.DEBUG},n.useColors=function(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):i.isatty(process.stderr.fd)},n.destroy=p.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{const t=o();t&&(t.stderr||t).level>=2&&(n.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}n.inspectOpts=Object.keys(process.env).filter((t=>/^debug_/i.test(t))).reduce(((t,e)=>{const s=e.substring(6).toLowerCase().replace(/_([a-z])/g,((t,e)=>e.toUpperCase()));let o=process.env[e];return o=!!/^(yes|on|true|enabled)$/i.test(o)||!/^(no|off|false|disabled)$/i.test(o)&&("null"===o?null:Number(o)),t[s]=o,t}),{}),t.exports=r()(n);const{formatters:c}=t.exports;c.o=function(t){return this.inspectOpts.colors=this.useColors,p.inspect(t,this.inspectOpts).split("\n").map((t=>t.trim())).join(" ")},c.O=function(t){return this.inspectOpts.colors=this.useColors,p.inspect(t,this.inspectOpts)}}(t,t.exports)),t.exports}export{i as __require};

@@ -1,1 +0,1 @@

export{logs}from"./private/logs.js";export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";export{conversations}from"./private/conversations.js";export{copilot}from"./private/copilot.js";export{externalAppAuthentication}from"./private/externalAppAuthentication.js";export{externalAppAuthenticationForCEA}from"./private/externalAppAuthenticationForCEA.js";export{externalAppCardActions}from"./private/externalAppCardActions.js";export{externalAppCardActionsForCEA}from"./private/externalAppCardActionsForCEA.js";export{externalAppCommands}from"./private/externalAppCommands.js";export{files}from"./private/files.js";export{meetingRoom}from"./private/meetingRoom.js";export{messageChannels}from"./private/messageChannels.js";export{notifications}from"./private/notifications.js";export{otherAppStateChange}from"./private/otherAppStateChange.js";export{remoteCamera}from"./private/remoteCamera.js";export{appEntity}from"./private/appEntity.js";export{teams}from"./private/teams.js";export{videoEffectsEx}from"./private/videoEffectsEx.js";export{hostEntity}from"./private/hostEntity.js";export{authentication}from"./public/authentication.js";export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,TaskModuleDimension,TeamType,UserTeamRole}from"./public/constants.js";export{ActionObjectType,ErrorCode,FileOpenPreference,SecondaryM365ContentIdName}from"./public/interfaces.js";export{app}from"./public/app.js";export{AppId}from"./public/appId.js";export{EmailAddress}from"./public/emailAddress.js";export{appInstallDialog}from"./public/appInstallDialog.js";export{barCode}from"./public/barCode.js";export{chat}from"./public/chat.js";export{clipboard}from"./public/clipboard.js";export{dialog}from"./public/dialog.js";export{nestedAppAuth}from"./public/nestedAppAuth.js";export{geoLocation}from"./public/geoLocation.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{pages}from"./public/pages.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{menus}from"./public/menus.js";export{media}from"./public/media.js";export{secondaryBrowser}from"./public/secondaryBrowser.js";export{location}from"./public/location.js";export{meeting}from"./public/meeting.js";export{monetization}from"./public/monetization.js";export{calendar}from"./public/calendar.js";export{mail}from"./public/mail.js";export{teamsCore}from"./public/teamsAPIs.js";export{people}from"./public/people.js";export{profile}from"./public/profile.js";export{videoEffects}from"./public/videoEffects.js";export{search}from"./public/search.js";export{sharing}from"./public/sharing.js";export{stageView}from"./public/stageView.js";export{version}from"./public/version.js";export{visualMedia}from"./public/visualMedia.js";export{webStorage}from"./public/webStorage.js";export{call}from"./public/call.js";export{appInitialization}from"./public/appInitialization.js";export{thirdPartyCloudStorage}from"./public/thirdPartyCloudStorage.js";export{enablePrintCapability,executeDeepLink,getContext,getMruTabInstances,getTabInstances,initialize,initializeWithFrameContext,print,registerAppButtonClickHandler,registerAppButtonHoverEnterHandler,registerAppButtonHoverLeaveHandler,registerBackButtonHandler,registerBeforeUnloadHandler,registerChangeSettingsHandler,registerFocusEnterHandler,registerFullScreenHandler,registerOnLoadHandler,registerOnThemeChangeHandler,setFrameContext,shareDeepLink}from"./public/publicAPIs.js";export{navigateBack,navigateCrossDomain,navigateToTab,returnFocus}from"./public/navigation.js";export{settings}from"./public/settings.js";export{tasks}from"./public/tasks.js";export{LiveShareHost,liveShare}from"./public/liveShareHost.js";export{marketplace}from"./public/marketplace.js";
export{logs}from"./private/logs.js";export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";export{conversations}from"./private/conversations.js";export{copilot}from"./private/copilot.js";export{externalAppAuthentication}from"./private/externalAppAuthentication.js";export{externalAppAuthenticationForCEA}from"./private/externalAppAuthenticationForCEA.js";export{externalAppCardActions}from"./private/externalAppCardActions.js";export{externalAppCardActionsForCEA}from"./private/externalAppCardActionsForCEA.js";export{externalAppCommands}from"./private/externalAppCommands.js";export{files}from"./private/files.js";export{meetingRoom}from"./private/meetingRoom.js";export{messageChannels}from"./private/messageChannels.js";export{notifications}from"./private/notifications.js";export{otherAppStateChange}from"./private/otherAppStateChange.js";export{remoteCamera}from"./private/remoteCamera.js";export{appEntity}from"./private/appEntity.js";export{teams}from"./private/teams.js";export{videoEffectsEx}from"./private/videoEffectsEx.js";export{hostEntity}from"./private/hostEntity.js";export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,DialogDimension as TaskModuleDimension,TeamType,UserTeamRole}from"./public/constants.js";export{ActionObjectType,ErrorCode,FileOpenPreference,SecondaryM365ContentIdName}from"./public/interfaces.js";export{AppId}from"./public/appId.js";export{EmailAddress}from"./public/emailAddress.js";export{chat}from"./public/chat.js";export{dialog}from"./public/dialog.js";export{nestedAppAuth}from"./public/nestedAppAuth.js";export{geoLocation}from"./public/geoLocation.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{pages}from"./public/pages.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{menus}from"./public/menus.js";export{media}from"./public/media.js";export{secondaryBrowser}from"./public/secondaryBrowser.js";export{location}from"./public/location.js";export{meeting}from"./public/meeting.js";export{monetization}from"./public/monetization.js";export{mail}from"./public/mail.js";export{teamsCore}from"./public/teamsAPIs.js";export{people}from"./public/people.js";export{profile}from"./public/profile.js";export{videoEffects}from"./public/videoEffects.js";export{search}from"./public/search.js";export{sharing}from"./public/sharing.js";export{stageView}from"./public/stageView.js";export{version}from"./public/version.js";export{visualMedia}from"./public/visualMedia.js";export{webStorage}from"./public/webStorage.js";export{thirdPartyCloudStorage}from"./public/thirdPartyCloudStorage.js";export{enablePrintCapability,executeDeepLink,getContext,getMruTabInstances,getTabInstances,initialize,initializeWithFrameContext,print,registerAppButtonClickHandler,registerAppButtonHoverEnterHandler,registerAppButtonHoverLeaveHandler,registerBackButtonHandler,registerBeforeUnloadHandler,registerChangeSettingsHandler,registerFocusEnterHandler,registerFullScreenHandler,registerOnLoadHandler,registerOnThemeChangeHandler,setFrameContext,shareDeepLink}from"./public/publicAPIs.js";export{navigateBack,navigateCrossDomain,navigateToTab,returnFocus}from"./public/navigation.js";export{tasks}from"./public/tasks.js";export{LiveShareHost,liveShare}from"./public/liveShareHost.js";export{marketplace}from"./public/marketplace.js";import*as e from"./public/authentication.js";export{e as authentication};import*as r from"./public/app.js";export{r as app};import*as t from"./public/appInstallDialog.js";export{t as appInstallDialog};import*as o from"./public/barCode.js";export{o as barCode};import*as p from"./public/clipboard.js";export{p as clipboard};import*as i from"./public/calendar.js";export{i as calendar};import*as a from"./public/call.js";export{a as call};import*as s from"./public/appInitialization.js";export{s as appInitialization};import*as n from"./public/settings.js";export{n as settings};

@@ -1,1 +0,1 @@

import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as t}from"./telemetry.js";import{latestRuntimeApiVersion as o}from"../public/runtime.js";import{version as s}from"../public/version.js";import{GlobalVars as r}from"./globalVars.js";import{callHandler as a}from"./handlers.js";import{serializeMessageRequest as d,deserializeMessageResponse as c,deserializeMessageRequest as u,serializeMessageResponse as l}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as g}from"./nestedAppAuthUtils.js";import{ssrSafeWindow as p}from"./utils.js";import{UUID as f}from"./uuidObject.js";import{validateOrigin as w}from"./validOrigins.js";const m=n("communication");class h{}class W{}function v(n,i){if(W.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void C("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,i=n.origin||n.originalEvent&&n.originalEvent.origin;return N(e,i).then((o=>{o?(function(e,n){r.isFramelessWindow||h.parentWindow&&!h.parentWindow.closed&&e!==h.parentWindow?h.childWindow&&!h.childWindow.closed&&e!==h.childWindow||(h.childWindow=e,h.childOrigin=n):(h.parentWindow=e,h.parentOrigin=n);h.parentWindow&&h.parentWindow.closed&&(h.parentWindow=null,h.parentOrigin=null);h.childWindow&&h.childWindow.closed&&(h.childWindow=null,h.childOrigin=null);K(h.parentWindow),K(h.childWindow)}(e,i),e===h.parentWindow?_(n):e===h.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const n=u(e.data),[i,o]=a(n.func,n.args);i&&void 0!==o?(z("Returning message %s from child back to child, action: %s.",Z(n),n.func),X(n.id,n.uuid,Array.isArray(o)?o:[o])):(z("Relaying message %s from child to parent, action: %s. Relayed message will have a new id.",Z(n),n.func),S(t("v2","tasks.startTask"),n.func,n.args,((...e)=>{if(h.childWindow){const i=e.pop();z("Message from parent being relayed to child, id: %s",Z(n)),X(n.id,n.uuid,e,i)}})))}}(n)):C("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",n,e,i)}))}))}(n),h.currentWindow=h.currentWindow||p(),h.parentWindow=h.currentWindow.parent!==h.currentWindow.self?h.currentWindow.parent:h.currentWindow.opener,h.topWindow=h.currentWindow.top,(h.parentWindow||n)&&h.currentWindow.addEventListener("message",W.messageListener,!1),!h.parentWindow){const e=h.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));r.isFramelessWindow=!0,e.onNativeMessage=_}try{return h.parentOrigin="*",T(i,"initialize",[s,o,n]).then((([e,n,i,t])=>(g(t,h.currentWindow,{onMessage:Q,sendPostMessage:R}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:t})))}finally{h.parentOrigin=null}}function M(){h.currentWindow&&h.currentWindow.removeEventListener("message",W.messageListener,!1),h.currentWindow=null,h.parentWindow=null,h.parentOrigin=null,h.childWindow=null,h.childOrigin=null,W.parentMessageQueue=[],W.childMessageQueue=[],W.nextMessageId=0,W.callbacks.clear(),W.promiseCallbacks.clear(),W.portCallbacks.clear(),W.legacyMessageIdsToUuidMap={}}function b(e,n,...i){return T(e,n,i).then((([e])=>e))}function y(e,n,...i){return T(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function k(e,n,i,...t){return T(e,n,t).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function I(e,n,...i){return T(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function T(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((i=>{const o=A(e,n,t);var s;i((s=o.uuid,new Promise((e=>{W.promiseCallbacks.set(s,e)}))))}))}function O(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const o=A(e,n,t);return s=o.uuid,new Promise(((e,n)=>{W.portCallbacks.set(s,((i,t)=>{i instanceof MessagePort?e(i):n(t&&t.length>0?t[0]:new Error("Host responded without port or error details."))}))}));var s}function S(e,n,t,o){let s;if(t instanceof Function?o=t:t instanceof Array&&(s=t),!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=A(e,n,s);o&&W.callbacks.set(r.uuid,o)}W.parentMessageQueue=[],W.childMessageQueue=[],W.topMessageQueue=[],W.nextMessageId=0,W.callbacks=new Map,W.promiseCallbacks=new Map,W.portCallbacks=new Map,W.legacyMessageIdsToUuidMap={};const j=m.extend("sendNestedAuthRequestToTopWindow");function R(e){const n=j,i=h.topWindow,t=function(e){const n=W.nextMessageId++,i=new f;return W.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),args:[],data:e}}(e);return n("Message %s information: %o",Z(t),{actionName:t.func}),P(i,t)}const x=m.extend("sendRequestToTargetWindowHelper");function P(e,n){const i=x,t=J(e),o=d(n);if(r.isFramelessWindow)h.currentWindow&&h.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",Z(o),t),h.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(o)));else{const s=H(e);e&&s?(i("Sending message %s to %s via postMessage",Z(o),t),e.postMessage(o,s)):(i("Adding message %s to %s message queue",Z(o),t),D(e).push(n))}return n}const E=m.extend("sendMessageToParentHelper");function A(e,n,i){const t=E,o=h.parentWindow,s=function(e,n,i){const t=W.nextMessageId++,o=new f;return W.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:n,timestamp:Date.now(),args:i||[],apiVersionTag:e}}(e,n,i);return t("Message %s information: %o",Z(s),{actionName:n,args:i}),P(o,s)}const C=m.extend("processIncomingMessage");const U=m.extend("processAuthBridgeMessage");function Q(e,n){var i,t;const o=U;if(!e||!e.data||"object"!=typeof e.data)return void o("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:s}=e.data,[,r]=null!=s?s:[],a=(()=>{try{return JSON.parse(r)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void o("Unrecognized data format received by app, message being ignored. Message: %o",e);const d=e.source||(null===(i=null==e?void 0:e.originalEvent)||void 0===i?void 0:i.source),c=e.origin||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.origin);d?N(d,c)?(h.topWindow&&!h.topWindow.closed&&d!==h.topWindow||(h.topWindow=d,h.topOrigin=c),h.topWindow&&h.topWindow.closed&&(h.topWindow=null,h.topOrigin=null),K(h.topWindow),n(r)):o("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):o("Message being ignored by app because it is coming for a target that is null")}const F=m.extend("shouldProcessIncomingMessage");function N(n,i){return e(this,void 0,void 0,(function*(){if(h.currentWindow&&n===h.currentWindow)return F("Should not process message because it is coming from the current window"),!1;if(h.currentWindow&&h.currentWindow.location&&i&&i===h.currentWindow.location.origin)return!0;{let e;try{e=new URL(i)}catch(e){return F("Message has an invalid origin of %s",i),!1}const n=yield w(e);return n||F("Message has an invalid origin of %s",i),n}}))}const $=m.extend("handleIncomingMessageFromParent");function L(e,n){if(n){const i=[...e].find((([e,i])=>e.toString()===n.toString()));if(i)return i[0]}}function V(e,n){const i=L(n,e.uuid);i&&n.delete(i),e.uuid?W.legacyMessageIdsToUuidMap={}:delete W.legacyMessageIdsToUuidMap[e.id]}function _(e){const n=$;if("id"in e.data&&"number"==typeof e.data.id){const i=e.data,t=c(i),o=function(e){const n=$;if(!e.uuid)return W.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,i=L(W.callbacks,n);if(i)return i;const t=L(W.promiseCallbacks,n);if(t)return t;const o=L(W.portCallbacks,n);if(o)return o}n("Received message %s that failed to produce a callbackId",Z(e))}(t);if(o){const i=W.callbacks.get(o);n("Received a response from parent for message %s",o.toString()),i&&(n("Invoking the registered callback for message %s with arguments %o",o.toString(),t.args),i.apply(null,[...t.args,t.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",o.toString()),V(t,W.callbacks)));const s=W.promiseCallbacks.get(o);s&&(n("Invoking the registered promise callback for message %s with arguments %o",o.toString(),t.args),s(t.args),n("Removing registered promise callback for message %s",o.toString()),V(t,W.promiseCallbacks));const r=W.portCallbacks.get(o);if(r){let i;n("Invoking the registered port callback for message %s with arguments %o",o.toString(),t.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),r(i,t.args),n("Removing registered port callback for message %s",o.toString()),V(t,W.portCallbacks)}t.uuid&&(W.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const i=e.data;n('Received a message from parent %s, action: "%s"',Z(i),i.func),a(i.func,i.args)}else n("Received an unknown message: %O",e)}const z=m.extend("handleIncomingMessageFromChild");function q(){return h.topWindow!==h.parentWindow}function D(e){return e===h.topWindow&&q()?W.topMessageQueue:e===h.parentWindow?W.parentMessageQueue:e===h.childWindow?W.childMessageQueue:[]}function H(e){return e===h.topWindow&&q()?h.topOrigin:e===h.parentWindow?h.parentOrigin:e===h.childWindow?h.childOrigin:null}function J(e){return e===h.topWindow&&q()?"top":e===h.parentWindow?"parent":e===h.childWindow?"child":null}const B=m.extend("flushMessageQueue");function K(e){const n=H(e),i=D(e),t=J(e);for(;e&&n&&i.length>0;){const o=i.shift();if(o){const i=d(o);B("Flushing message %s from %s message queue via postMessage.",Z(i),t),e.postMessage(i,n)}}}function G(e,n){let i;i=h.currentWindow.setInterval((()=>{0===D(e).length&&(clearInterval(i),n())}),100)}function X(e,n,i,t){const o=h.childWindow,s=function(e,n,i,t){return{id:e,uuid:n,args:i||[],isPartialResponse:t}}(e,n,i,t),r=l(s),a=H(o);o&&a&&o.postMessage(r,a)}function Y(e,n){const i=h.childWindow,t=function(e,n){return{func:e,args:n||[]}}(e,n),o=H(i);i&&o?i.postMessage(t,o):D(i).push(t)}function Z(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}export{h as Communication,v as initializeCommunication,O as requestPortFromParentWithVersion,I as sendAndHandleSdkError,y as sendAndHandleStatusAndReason,k as sendAndHandleStatusAndReasonWithDefaultError,b as sendAndUnwrap,Y as sendMessageEventToChild,S as sendMessageToParent,T as sendMessageToParentAsync,R as sendNestedAuthRequestToTopWindow,M as uninitializeCommunication,G as waitForMessageQueue};
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as t}from"./telemetry.js";import{isSdkError as o,ErrorCode as s}from"../public/interfaces.js";import{latestRuntimeApiVersion as r}from"../public/runtime.js";import{isSerializable as a}from"../public/serializable.interface.js";import{version as d}from"../public/version.js";import{GlobalVars as c}from"./globalVars.js";import{callHandler as u}from"./handlers.js";import{serializeMessageRequest as l,deserializeMessageResponse as g,deserializeMessageRequest as p,serializeMessageResponse as f}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as w}from"./nestedAppAuthUtils.js";import{ssrSafeWindow as m}from"./utils.js";import{UUID as h}from"./uuidObject.js";import{validateOrigin as W}from"./validOrigins.js";const v=n("communication");class M{}class b{}function y(n,i){if(b.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void F("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,i=n.origin||n.originalEvent&&n.originalEvent.origin;return q(e,i).then((o=>{o?(function(e,n){c.isFramelessWindow||M.parentWindow&&!M.parentWindow.closed&&e!==M.parentWindow?M.childWindow&&!M.childWindow.closed&&e!==M.childWindow||(M.childWindow=e,M.childOrigin=n):(M.parentWindow=e,M.parentOrigin=n);M.parentWindow&&M.parentWindow.closed&&(M.parentWindow=null,M.parentOrigin=null);M.childWindow&&M.childWindow.closed&&(M.childWindow=null,M.childOrigin=null);ne(M.parentWindow),ne(M.childWindow)}(e,i),e===M.parentWindow?B(n):e===M.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const n=p(e.data),[i,o]=u(n.func,n.args);i&&void 0!==o?(K("Returning message %s from child back to child, action: %s.",se(n),n.func),te(n.id,n.uuid,Array.isArray(o)?o:[o])):(K("Relaying message %s from child to parent, action: %s. Relayed message will have a new id.",se(n),n.func),C(t("v2","tasks.startTask"),n.func,n.args,((...e)=>{if(M.childWindow){const i=e.pop();K("Message from parent being relayed to child, id: %s",se(n)),te(n.id,n.uuid,e,i)}})))}}(n)):F("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",n,e,i)}))}))}(n),M.currentWindow=M.currentWindow||m(),M.parentWindow=M.currentWindow.parent!==M.currentWindow.self?M.currentWindow.parent:M.currentWindow.opener,M.topWindow=M.currentWindow.top,(M.parentWindow||n)&&M.currentWindow.addEventListener("message",b.messageListener,!1),!M.parentWindow){const e=M.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));c.isFramelessWindow=!0,e.onNativeMessage=B}try{return M.parentOrigin="*",T(i,"initialize",[d,r,n]).then((([e,n,i,t])=>(w(t,M.currentWindow,{onMessage:_,sendPostMessage:N}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:t})))}finally{M.parentOrigin=null}}function k(){M.currentWindow&&M.currentWindow.removeEventListener("message",b.messageListener,!1),M.currentWindow=null,M.parentWindow=null,M.parentOrigin=null,M.childWindow=null,M.childOrigin=null,b.parentMessageQueue=[],b.childMessageQueue=[],b.nextMessageId=0,b.callbacks.clear(),b.promiseCallbacks.clear(),b.portCallbacks.clear(),b.legacyMessageIdsToUuidMap={}}function I(e,n,...i){return T(e,n,i).then((([e])=>e))}function R(e,n,...i){return T(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function E(e,n,i,...t){return T(e,n,t).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function O(e,n,...i){return T(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function T(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((i=>{const o=z(e,n,t);var s;i((s=o.uuid,new Promise((e=>{b.promiseCallbacks.set(s,e)}))))}))}function S(e){return e.map((e=>a(e)?e.serialize():e))}function j(n,i,t,r,a){var d;return e(this,void 0,void 0,(function*(){const e=S(i),[c]=yield T(r,n,e);if(a&&a(c)||!a&&o(c))throw new Error(`${c.errorCode}, message: ${null!==(d=c.message)&&void 0!==d?d:"None"}`);if(t.validate(c))return t.deserialize(c);throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(c)}`)}))}function x(n,i,t,r){var a;return e(this,void 0,void 0,(function*(){const e=S(i),[d]=yield T(t,n,e);if(r&&r(d)||!r&&o(d))throw new Error(`${d.errorCode}, message: ${null!==(a=d.message)&&void 0!==a?a:"None"}`);if(void 0!==d)throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host`)}))}function A(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const o=z(e,n,t);return s=o.uuid,new Promise(((e,n)=>{b.portCallbacks.set(s,((i,t)=>{i instanceof MessagePort?e(i):n(t&&t.length>0?t[0]:new Error("Host responded without port or error details."))}))}));var s}function C(e,n,t,o){let s;if(t instanceof Function?o=t:t instanceof Array&&(s=t),!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=z(e,n,s);o&&b.callbacks.set(r.uuid,o)}b.parentMessageQueue=[],b.childMessageQueue=[],b.topMessageQueue=[],b.nextMessageId=0,b.callbacks=new Map,b.promiseCallbacks=new Map,b.portCallbacks=new Map,b.legacyMessageIdsToUuidMap={};const P=v.extend("sendNestedAuthRequestToTopWindow");function N(e){const n=P,i=M.topWindow,t=function(e){const n=b.nextMessageId++,i=new h;return b.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),args:[],data:e}}(e);return n("Message %s information: %o",se(t),{actionName:t.func}),U(i,t)}const $=v.extend("sendRequestToTargetWindowHelper");function U(e,n){const i=$,t=Z(e),o=l(n);if(c.isFramelessWindow)M.currentWindow&&M.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",se(o),t),M.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(o)));else{const s=Y(e);e&&s?(i("Sending message %s to %s via postMessage",se(o),t),e.postMessage(o,s)):(i("Adding message %s to %s message queue",se(o),t),X(e).push(n))}return n}const Q=v.extend("sendMessageToParentHelper");function z(e,n,i){const t=Q,o=M.parentWindow,s=function(e,n,i){const t=b.nextMessageId++,o=new h;return b.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:n,timestamp:Date.now(),args:i||[],apiVersionTag:e}}(e,n,i);return t("Message %s information: %o",se(s),{actionName:n,args:i}),U(o,s)}const F=v.extend("processIncomingMessage");const L=v.extend("processAuthBridgeMessage");function _(e,n){var i,t;const o=L;if(!e||!e.data||"object"!=typeof e.data)return void o("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:s}=e.data,[,r]=null!=s?s:[],a=(()=>{try{return JSON.parse(r)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void o("Unrecognized data format received by app, message being ignored. Message: %o",e);const d=e.source||(null===(i=null==e?void 0:e.originalEvent)||void 0===i?void 0:i.source),c=e.origin||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.origin);d?q(d,c)?(M.topWindow&&!M.topWindow.closed&&d!==M.topWindow||(M.topWindow=d,M.topOrigin=c),M.topWindow&&M.topWindow.closed&&(M.topWindow=null,M.topOrigin=null),ne(M.topWindow),n(r)):o("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):o("Message being ignored by app because it is coming for a target that is null")}const V=v.extend("shouldProcessIncomingMessage");function q(n,i){return e(this,void 0,void 0,(function*(){if(M.currentWindow&&n===M.currentWindow)return V("Should not process message because it is coming from the current window"),!1;if(M.currentWindow&&M.currentWindow.location&&i&&i===M.currentWindow.location.origin)return!0;{let e;try{e=new URL(i)}catch(e){return V("Message has an invalid origin of %s",i),!1}const n=yield W(e);return n||V("Message has an invalid origin of %s",i),n}}))}const D=v.extend("handleIncomingMessageFromParent");function H(e,n){if(n){const i=[...e].find((([e,i])=>e.toString()===n.toString()));if(i)return i[0]}}function J(e,n){const i=H(n,e.uuid);i&&n.delete(i),e.uuid?b.legacyMessageIdsToUuidMap={}:delete b.legacyMessageIdsToUuidMap[e.id]}function B(e){const n=D;if("id"in e.data&&"number"==typeof e.data.id){const i=e.data,t=g(i),o=function(e){const n=D;if(!e.uuid)return b.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,i=H(b.callbacks,n);if(i)return i;const t=H(b.promiseCallbacks,n);if(t)return t;const o=H(b.portCallbacks,n);if(o)return o}n("Received message %s that failed to produce a callbackId",se(e))}(t);if(o){const i=b.callbacks.get(o);n("Received a response from parent for message %s",o.toString()),i&&(n("Invoking the registered callback for message %s with arguments %o",o.toString(),t.args),i.apply(null,[...t.args,t.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",o.toString()),J(t,b.callbacks)));const s=b.promiseCallbacks.get(o);s&&(n("Invoking the registered promise callback for message %s with arguments %o",o.toString(),t.args),s(t.args),n("Removing registered promise callback for message %s",o.toString()),J(t,b.promiseCallbacks));const r=b.portCallbacks.get(o);if(r){let i;n("Invoking the registered port callback for message %s with arguments %o",o.toString(),t.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),r(i,t.args),n("Removing registered port callback for message %s",o.toString()),J(t,b.portCallbacks)}t.uuid&&(b.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const i=e.data;n('Received a message from parent %s, action: "%s"',se(i),i.func),u(i.func,i.args)}else n("Received an unknown message: %O",e)}const K=v.extend("handleIncomingMessageFromChild");function G(){return M.topWindow!==M.parentWindow}function X(e){return e===M.topWindow&&G()?b.topMessageQueue:e===M.parentWindow?b.parentMessageQueue:e===M.childWindow?b.childMessageQueue:[]}function Y(e){return e===M.topWindow&&G()?M.topOrigin:e===M.parentWindow?M.parentOrigin:e===M.childWindow?M.childOrigin:null}function Z(e){return e===M.topWindow&&G()?"top":e===M.parentWindow?"parent":e===M.childWindow?"child":null}const ee=v.extend("flushMessageQueue");function ne(e){const n=Y(e),i=X(e),t=Z(e);for(;e&&n&&i.length>0;){const o=i.shift();if(o){const i=l(o);ee("Flushing message %s from %s message queue via postMessage.",se(i),t),e.postMessage(i,n)}}}function ie(e,n){let i;i=M.currentWindow.setInterval((()=>{0===X(e).length&&(clearInterval(i),n())}),100)}function te(e,n,i,t){const o=M.childWindow,s=function(e,n,i,t){return{id:e,uuid:n,args:i||[],isPartialResponse:t}}(e,n,i,t),r=f(s),a=Y(o);o&&a&&o.postMessage(r,a)}function oe(e,n){const i=M.childWindow,t=function(e,n){return{func:e,args:n||[]}}(e,n),o=Y(i);i&&o?i.postMessage(t,o):X(i).push(t)}function se(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}export{M as Communication,x as callFunctionInHost,j as callFunctionInHostAndHandleResponse,y as initializeCommunication,A as requestPortFromParentWithVersion,O as sendAndHandleSdkError,R as sendAndHandleStatusAndReason,E as sendAndHandleStatusAndReasonWithDefaultError,I as sendAndUnwrap,oe as sendMessageEventToChild,C as sendMessageToParent,T as sendMessageToParentAsync,N as sendNestedAuthRequestToTopWindow,k as uninitializeCommunication,ie as waitForMessageQueue};

@@ -1,1 +0,1 @@

import{teamsDeepLinkProtocol as n,teamsDeepLinkHost as o}from"./constants.js";import{teamsDeepLinkUsersUrlParameterName as e,teamsDeepLinkUrlPathForChat as t,teamsDeepLinkUrlPathForCall as $,teamsDeepLinkAttendeesUrlParameterName as i,teamsDeepLinkUrlPathForCalendar as r,teamsDeepLinkUrlPathForAppInstall as d,teamsDeepLinkTopicUrlParameterName as p,teamsDeepLinkMessageUrlParameterName as c,teamsDeepLinkWithVideoUrlParameterName as a,teamsDeepLinkSourceUrlParameterName as m,teamsDeepLinkStartTimeUrlParameterName as s,teamsDeepLinkEndTimeUrlParameterName as C,teamsDeepLinkSubjectUrlParameterName as I,teamsDeepLinkContentUrlParameterName as l}from"./deepLinkConstants.js";function u($,i,r){if(0===$.length)throw new Error("Must have at least one user when creating a chat deep link");const d=`${e}=`+$.map((n=>encodeURIComponent(n))).join(","),a=void 0===i?"":`&${p}=${encodeURIComponent(i)}`,m=void 0===r?"":`&${c}=${encodeURIComponent(r)}`;return`${n}://${o}${t}?${d}${a}${m}`}function R(t,i,r){if(0===t.length)throw new Error("Must have at least one target when creating a call deep link");const d=`${e}=`+t.map((n=>encodeURIComponent(n))).join(","),p=void 0===i?"":`&${a}=${encodeURIComponent(i)}`,c=void 0===r?"":`&${m}=${encodeURIComponent(r)}`;return`${n}://${o}${$}?${d}${p}${c}`}function U(e,t,$,d,p){const c=void 0===e?"":`${i}=`+e.map((n=>encodeURIComponent(n))).join(","),a=void 0===t?"":`&${s}=${encodeURIComponent(t)}`,m=void 0===$?"":`&${C}=${encodeURIComponent($)}`,u=void 0===d?"":`&${I}=${encodeURIComponent(d)}`,R=void 0===p?"":`&${l}=${encodeURIComponent(p)}`;return`${n}://${o}${r}?${c}${a}${m}${u}${R}`}function h(e){if(!e)throw new Error("App ID must be set when creating an app install dialog deep link");return`${n}://${o}${d}${encodeURIComponent(e)}`}export{h as createTeamsDeepLinkForAppInstallDialog,U as createTeamsDeepLinkForCalendar,R as createTeamsDeepLinkForCall,u as createTeamsDeepLinkForChat};
import{teamsDeepLinkProtocol as n,teamsDeepLinkHost as o}from"./constants.js";import{teamsDeepLinkUsersUrlParameterName as e,teamsDeepLinkUrlPathForCall as t,teamsDeepLinkAttendeesUrlParameterName as $,teamsDeepLinkUrlPathForCalendar as i,teamsDeepLinkUrlPathForAppInstall as r,teamsDeepLinkUrlPathForChat as d,teamsDeepLinkWithVideoUrlParameterName as p,teamsDeepLinkSourceUrlParameterName as c,teamsDeepLinkStartTimeUrlParameterName as a,teamsDeepLinkEndTimeUrlParameterName as m,teamsDeepLinkSubjectUrlParameterName as s,teamsDeepLinkContentUrlParameterName as C,teamsDeepLinkTopicUrlParameterName as I,teamsDeepLinkMessageUrlParameterName as l}from"./deepLinkConstants.js";function u(t,$,i){if(0===t.length)throw new Error("Must have at least one user when creating a chat deep link");const r=`${e}=`+t.map((n=>encodeURIComponent(n))).join(","),p=void 0===$?"":`&${I}=${encodeURIComponent($)}`,c=void 0===i?"":`&${l}=${encodeURIComponent(i)}`;return`${n}://${o}${d}?${r}${p}${c}`}function R($,i,r){if(0===$.length)throw new Error("Must have at least one target when creating a call deep link");const d=`${e}=`+$.map((n=>encodeURIComponent(n))).join(","),a=void 0===i?"":`&${p}=${encodeURIComponent(i)}`,m=void 0===r?"":`&${c}=${encodeURIComponent(r)}`;return`${n}://${o}${t}?${d}${a}${m}`}function U(e,t,r,d,p){const c=void 0===e?"":`${$}=`+e.map((n=>encodeURIComponent(n))).join(","),I=void 0===t?"":`&${a}=${encodeURIComponent(t)}`,l=void 0===r?"":`&${m}=${encodeURIComponent(r)}`,u=void 0===d?"":`&${s}=${encodeURIComponent(d)}`,R=void 0===p?"":`&${C}=${encodeURIComponent(p)}`;return`${n}://${o}${i}?${c}${I}${l}${u}${R}`}function h(e){if(!e)throw new Error("App ID must be set when creating an app install dialog deep link");return`${n}://${o}${r}${encodeURIComponent(e)}`}export{h as createTeamsDeepLinkForAppInstallDialog,U as createTeamsDeepLinkForCalendar,R as createTeamsDeepLinkForCall,u as createTeamsDeepLinkForChat};

@@ -1,1 +0,1 @@

import{sendMessageToParentAsync as e}from"../internal/communication.js";import{ensureInitialized as t}from"../internal/internalAPIs.js";import{getApiVersionTag as n}from"../internal/telemetry.js";import{validateId as o,validateUrl as i}from"../internal/utils.js";import{FrameContexts as r,errorNotSupportedOnPlatform as s}from"../public/constants.js";import{runtime as a}from"../public/runtime.js";import{AppId as u}from"../public/appId.js";const c="v2";var h;!function(h){let p;var l;let f;function m(e){if(e.requestType===p.ActionExecuteInvokeRequest){const t=e;if(t.type!==h.ActionExecuteInvokeRequestType){throw{errorCode:f.INTERNAL_ERROR,message:`Invalid action type ${t.type}. Action type must be "${h.ActionExecuteInvokeRequestType}"`}}}else if(e.requestType===p.QueryMessageExtensionRequest){if(e.commandId.length>64)throw new Error("originalRequestInfo.commandId exceeds the maximum size of 64 characters");if(e.parameters.length>5)throw new Error("originalRequestInfo.parameters exceeds the maximum size of 5");for(const t of e.parameters){if(t.name.length>64)throw new Error("originalRequestInfo.parameters.name exceeds the maximum size of 64 characters");if(t.value.length>512)throw new Error("originalRequestInfo.parameters.value exceeds the maximum size of 512 characters")}}}function R(){return!(!t(a)||!a.supports.externalAppAuthentication)}h.isActionExecuteResponse=function(e){const t=e;return t.responseType===h.InvokeResponseType.ActionExecuteInvokeResponse&&void 0!==t.value&&void 0!==t.statusCode&&void 0!==t.type},h.ActionExecuteInvokeRequestType="Action.Execute",function(e){e.ActionExecuteInvokeRequest="ActionExecuteInvokeRequest",e.QueryMessageExtensionRequest="QueryMessageExtensionRequest"}(p=h.OriginalRequestType||(h.OriginalRequestType={})),(l=h.InvokeResponseType||(h.InvokeResponseType={})).ActionExecuteInvokeResponse="ActionExecuteInvokeResponse",l.QueryMessageExtensionResponse="QueryMessageExtensionResponse",h.isInvokeError=function(e){if("object"!=typeof e||null===e)return!1;const t=e;return Object.values(h.InvokeErrorCode).includes(t.errorCode)&&(void 0===t.message||"string"==typeof t.message)},function(e){e.INTERNAL_ERROR="INTERNAL_ERROR"}(f=h.InvokeErrorCode||(h.InvokeErrorCode={})),h.authenticateAndResendRequest=function(o,i,h){if(t(a,r.content),!R())throw s;const p=new u(o);return m(h),e(n(c,"externalAppAuthentication.authenticateAndResendRequest"),"externalAppAuthentication.authenticateAndResendRequest",[p.toString(),h,i.url.href,i.width,i.height,i.isExternal]).then((([e,t])=>{if(e&&null!=t.responseType)return t;throw t}))},h.authenticateWithSSO=function(o,i){if(t(a,r.content),!R())throw s;const h=new u(o);return e(n(c,"externalAppAuthentication.authenticateWithSSO"),"externalAppAuthentication.authenticateWithSSO",[h.toString(),i.claims,i.silent]).then((([e,t])=>{if(!e)throw t}))},h.authenticateWithSSOAndResendRequest=function(o,i,h){if(t(a,r.content),!R())throw s;const p=new u(o);return m(h),e(n(c,"externalAppAuthentication.authenticateWithSSOAndResendRequest"),"externalAppAuthentication.authenticateWithSSOAndResendRequest",[p.toString(),h,i.claims,i.silent]).then((([e,t])=>{if(e&&null!=t.responseType)return t;throw t}))},h.authenticateWithOauth2=function(i,u,h){if(t(a,r.content),!R())throw s;return o(i,new Error("titleId is Invalid.")),o(u,new Error("oauthConfigId is Invalid.")),e(n(c,"externalAppAuthentication.authenticateWithOauth2"),"externalAppAuthentication.authenticateWithOauth2",[i,u,h.width,h.height,h.isExternal]).then((([e,t])=>{if(!e)throw t}))},h.authenticateWithPowerPlatformConnectorPlugins=function(u,h,p){if(t(a,r.content),!R())throw s;return o(u,new Error("titleId is Invalid.")),h&&i(h),e(n(c,"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins"),"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",[u,null==h?void 0:h.toString(),null==p?void 0:p.width,null==p?void 0:p.height,null==p?void 0:p.isExternal]).then((([e,t])=>{if(!e)throw t}))},h.isSupported=R}(h||(h={}));export{h as externalAppAuthentication};
import{sendMessageToParentAsync as e}from"../internal/communication.js";import{ensureInitialized as t}from"../internal/internalAPIs.js";import{ResponseHandler as n}from"../internal/responseHandler.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{validateId as o,validateUrl as r}from"../internal/utils.js";import{FrameContexts as s,errorNotSupportedOnPlatform as a}from"../public/constants.js";import{runtime as u}from"../public/runtime.js";import{AppId as c}from"../public/appId.js";const h="v2";var l;!function(l){let p;var f;l.SerializableActionExecuteInvokeRequest=class{constructor(e){this.invokeRequest=e}serialize(){return this.invokeRequest}},l.isActionExecuteResponse=function(e){const t=e;return t.responseType===l.InvokeResponseType.ActionExecuteInvokeResponse&&void 0!==t.value&&void 0!==t.statusCode&&void 0!==t.type},l.ActionExecuteInvokeRequestType="Action.Execute",function(e){e.ActionExecuteInvokeRequest="ActionExecuteInvokeRequest",e.QueryMessageExtensionRequest="QueryMessageExtensionRequest"}(p=l.OriginalRequestType||(l.OriginalRequestType={})),(f=l.InvokeResponseType||(l.InvokeResponseType={})).ActionExecuteInvokeResponse="ActionExecuteInvokeResponse",f.QueryMessageExtensionResponse="QueryMessageExtensionResponse";let R;function d(e){if(e.requestType===p.ActionExecuteInvokeRequest){const t=e;if(t.type!==l.ActionExecuteInvokeRequestType){throw{errorCode:R.INTERNAL_ERROR,message:`Invalid action type ${t.type}. Action type must be "${l.ActionExecuteInvokeRequestType}"`}}}else if(e.requestType===p.QueryMessageExtensionRequest){if(e.commandId.length>64)throw new Error("originalRequestInfo.commandId exceeds the maximum size of 64 characters");if(e.parameters.length>5)throw new Error("originalRequestInfo.parameters exceeds the maximum size of 5");for(const t of e.parameters){if(t.name.length>64)throw new Error("originalRequestInfo.parameters.name exceeds the maximum size of 64 characters");if(t.value.length>512)throw new Error("originalRequestInfo.parameters.value exceeds the maximum size of 512 characters")}}}function m(){return!(!t(u)||!u.supports.externalAppAuthentication)}l.ActionExecuteResponseHandler=class extends n{validate(e){return l.isActionExecuteResponse(e)}deserialize(e){return e}},l.isInvokeError=function(e){if("object"!=typeof e||null===e)return!1;const t=e;return Object.values(l.InvokeErrorCode).includes(t.errorCode)&&(void 0===t.message||"string"==typeof t.message)},function(e){e.INTERNAL_ERROR="INTERNAL_ERROR"}(R=l.InvokeErrorCode||(l.InvokeErrorCode={})),l.authenticateAndResendRequest=function(n,o,r){if(t(u,s.content),!m())throw a;const l=new c(n);return d(r),e(i(h,"externalAppAuthentication.authenticateAndResendRequest"),"externalAppAuthentication.authenticateAndResendRequest",[l.toString(),r,o.url.href,o.width,o.height,o.isExternal]).then((([e,t])=>{if(e&&null!=t.responseType)return t;throw t}))},l.authenticateWithSSO=function(n,o){if(t(u,s.content),!m())throw a;const r=new c(n);return e(i(h,"externalAppAuthentication.authenticateWithSSO"),"externalAppAuthentication.authenticateWithSSO",[r.toString(),o.claims,o.silent]).then((([e,t])=>{if(!e)throw t}))},l.authenticateWithSSOAndResendRequest=function(n,o,r){if(t(u,s.content),!m())throw a;const l=new c(n);return d(r),e(i(h,"externalAppAuthentication.authenticateWithSSOAndResendRequest"),"externalAppAuthentication.authenticateWithSSOAndResendRequest",[l.toString(),r,o.claims,o.silent]).then((([e,t])=>{if(e&&null!=t.responseType)return t;throw t}))},l.authenticateWithOauth2=function(n,r,c){if(t(u,s.content),!m())throw a;return o(n,new Error("titleId is Invalid.")),o(r,new Error("oauthConfigId is Invalid.")),e(i(h,"externalAppAuthentication.authenticateWithOauth2"),"externalAppAuthentication.authenticateWithOauth2",[n,r,c.width,c.height,c.isExternal]).then((([e,t])=>{if(!e)throw t}))},l.authenticateWithPowerPlatformConnectorPlugins=function(n,c,l){if(t(u,s.content),!m())throw a;return o(n,new Error("titleId is Invalid.")),c&&r(c),e(i(h,"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins"),"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",[n,null==c?void 0:c.toString(),null==l?void 0:l.width,null==l?void 0:l.height,null==l?void 0:l.isExternal]).then((([e,t])=>{if(!e)throw t}))},l.isSupported=m}(l||(l={}));export{l as externalAppAuthentication};

@@ -1,1 +0,1 @@

import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendAndUnwrap as e}from"../internal/communication.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{validateId as o}from"../internal/utils.js";import{FrameContexts as r,errorNotSupportedOnPlatform as s}from"../public/constants.js";import{runtime as a}from"../public/runtime.js";import{externalAppAuthentication as u}from"./externalAppAuthentication.js";const c="v2";var h;!function(h){function p(){return!(!n(a)||!a.supports.externalAppAuthenticationForCEA)}function l(t){if(t.type!==u.ActionExecuteInvokeRequestType){throw{errorCode:u.InvokeErrorCode.INTERNAL_ERROR,message:`Invalid action type ${t.type}. Action type must be "${u.ActionExecuteInvokeRequestType}"`}}}h.authenticateWithSSO=function(u,h,l){return t(this,void 0,void 0,(function*(){if(n(a,r.content),!p())throw s;o(h,new Error("conversation id is not valid."));const t=yield e(i(c,"externalAppAuthenticationForCEA.authenticateWithSSO"),"externalAppAuthenticationForCEA.authenticateWithSSO",u.toString(),h,l.claims,l.silent);if(t)throw t}))},h.authenticateWithOauth=function(u,h,l){return t(this,void 0,void 0,(function*(){if(n(a,r.content),!p())throw s;o(h,new Error("conversation id is not valid."));const t=yield e(i(c,"externalAppAuthenticationForCEA.authenticateWithOauth"),"externalAppAuthenticationForCEA.authenticateWithOauth",u.toString(),h,l.url.href,l.width,l.height,l.isExternal);if(t)throw t}))},h.authenticateAndResendRequest=function(h,A,f,m){return t(this,void 0,void 0,(function*(){if(n(a,r.content),!p())throw s;o(A,new Error("conversation id is not valid.")),l(m);const t=yield e(i(c,"externalAppAuthenticationForCEA.authenticateAndResendRequest"),"externalAppAuthenticationForCEA.authenticateAndResendRequest",h.toString(),A,m,f.url.href,f.width,f.height,f.isExternal);if(u.isActionExecuteResponse(t))return t;throw u.isInvokeError(t)?t:d}))},h.authenticateWithSSOAndResendRequest=function(h,A,f,m){return t(this,void 0,void 0,(function*(){if(n(a,r.content),!p())throw s;o(A,new Error("conversation id is not valid.")),l(m);const t=yield e(i(c,"externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest"),"externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest",h.toString(),A,m,f.claims,f.silent);if(u.isActionExecuteResponse(t))return t;throw u.isInvokeError(t)?t:d}))},h.isSupported=p;const d={errorCode:u.InvokeErrorCode.INTERNAL_ERROR,message:"No valid response received"}}(h||(h={}));export{h as externalAppAuthenticationForCEA};
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHost as e,callFunctionInHostAndHandleResponse as n}from"../internal/communication.js";import{ensureInitialized as i}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{validateId as r}from"../internal/utils.js";import{FrameContexts as a,errorNotSupportedOnPlatform as u}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";import{externalAppAuthentication as c}from"./externalAppAuthentication.js";const p="v2";var h;!function(h){function l(){return!(!i(s)||!s.supports.externalAppAuthenticationForCEA)}function A(t){if(t.type!==c.ActionExecuteInvokeRequestType){throw{errorCode:c.InvokeErrorCode.INTERNAL_ERROR,message:`Invalid action type ${t.type}. Action type must be "${c.ActionExecuteInvokeRequestType}"`}}}h.authenticateWithSSO=function(n,h,A){return t(this,void 0,void 0,(function*(){if(i(s,a.content),!l())throw u;return r(h,new Error("conversation id is not valid.")),e("externalAppAuthenticationForCEA.authenticateWithSSO",[n,h,A.claims,A.silent],o(p,"externalAppAuthenticationForCEA.authenticateWithSSO"),c.isInvokeError)}))},h.authenticateWithOauth=function(n,h,A){return t(this,void 0,void 0,(function*(){if(i(s,a.content),!l())throw u;return r(h,new Error("conversation id is not valid.")),e("externalAppAuthenticationForCEA.authenticateWithOauth",[n,h,A.url.href,A.width,A.height,A.isExternal],o(p,"externalAppAuthenticationForCEA.authenticateWithOauth"),c.isInvokeError)}))},h.authenticateAndResendRequest=function(e,h,d,v){return t(this,void 0,void 0,(function*(){if(i(s,a.content),!l())throw u;return r(h,new Error("conversation id is not valid.")),A(v),n("externalAppAuthenticationForCEA.authenticateAndResendRequest",[e,h,new c.SerializableActionExecuteInvokeRequest(v),d.url.href,d.width,d.height,d.isExternal],new c.ActionExecuteResponseHandler,o(p,"externalAppAuthenticationForCEA.authenticateAndResendRequest"),c.isInvokeError)}))},h.authenticateWithSSOAndResendRequest=function(e,h,d,v){return t(this,void 0,void 0,(function*(){if(i(s,a.content),!l())throw u;return r(h,new Error("conversation id is not valid.")),A(v),n("externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest",[e,h,new c.SerializableActionExecuteInvokeRequest(v),d.claims,d.silent],new c.ActionExecuteResponseHandler,o(p,"externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest"),c.isInvokeError)}))},h.isSupported=l}(h||(h={}));export{h as externalAppAuthenticationForCEA};

@@ -1,1 +0,1 @@

import{sendMessageToParentAsync as r}from"../internal/communication.js";import{ensureInitialized as e}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{ErrorCode as t,isSdkError as n}from"../public/interfaces.js";import{runtime as a}from"../public/runtime.js";const s="v2";var i;!function(i){(i.AppTypes||(i.AppTypes={})).edu="EDU",function(d){function u(){var r;return!!(e(a)&&i.isSupported()&&(null===(r=a.supports.hostEntity)||void 0===r?void 0:r.tab))}function E(r){if(!r||0==r.length)throw new Error(`Error code: ${t.INVALID_ARGUMENTS}, message: ThreadId cannot be null or empty`)}function m(r){if(!(null==r?void 0:r.internalTabInstanceId)||0===r.internalTabInstanceId.length)throw new Error(`Error code: ${t.INVALID_ARGUMENTS}, message: TabId cannot be null or empty`)}d.addAndConfigure=function(i,d){if(e(a),!u())throw new Error(`Error code: ${t.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);if(E(i.threadId),d&&0===d.length)throw new Error(`Error code: ${t.INVALID_ARGUMENTS}, message: App types cannot be an empty array`);return r(o(s,"hostEntity.tab.addAndConfigure"),"hostEntity.tab.addAndConfigure",[i,d]).then((([r])=>{var e;if(n(r))throw new Error(`Error code: ${r.errorCode}, message: ${null!==(e=r.message)&&void 0!==e?e:"None"}`);return r}))},d.getAll=function(i){if(e(a),!u())throw new Error(`Error code: ${t.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return E(i.threadId),r(o(s,"hostEntity.tab.getAll"),"hostEntity.tab.getAll",[i]).then((([r])=>{var e;if(n(r))throw new Error(`Error code: ${r.errorCode}, message: ${null!==(e=r.message)&&void 0!==e?e:"None"}`);return r}))},d.reconfigure=function(i,d){if(e(a),!u())throw new Error(`Error code: ${t.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return m(i),E(d.threadId),r(o(s,"hostEntity.tab.reconfigure"),"hostEntity.tab.reconfigure",[i,d]).then((([r])=>{var e;if(n(r))throw new Error(`Error code: ${r.errorCode}, message: ${null!==(e=r.message)&&void 0!==e?e:"None"}`);return r}))},d.rename=function(i,d){if(e(a),!u())throw new Error(`Error code: ${t.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return m(i),E(d.threadId),r(o(s,"hostEntity.tab.rename"),"hostEntity.tab.rename",[i,d]).then((([r])=>{var e;if(n(r))throw new Error(`Error code: ${r.errorCode}, message: ${null!==(e=r.message)&&void 0!==e?e:"None"}`);return r}))},d.remove=function(i,d){if(e(a),!u())throw new Error(`Error code: ${t.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return E(d.threadId),m(i),r(o(s,"hostEntity.tab.remove"),"hostEntity.tab.remove",[i,d]).then((([r])=>{var e;if(n(r))throw new Error(`Error code: ${r.errorCode}, message: ${null!==(e=r.message)&&void 0!==e?e:"None"}`);return!0}))},d.isSupported=u}(i.tab||(i.tab={})),i.isSupported=function(){return!(!e(a)||!a.supports.hostEntity)}}(i||(i={}));export{i as hostEntity};
import{callFunctionInHostAndHandleResponse as t}from"../internal/communication.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{SimpleTypeResponseHandler as e,ResponseHandler as n}from"../internal/responseHandler.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{runtime as a}from"../public/runtime.js";import{ErrorCode as s}from"../public/interfaces.js";const i="v2";var u;!function(u){(u.AppTypes||(u.AppTypes={})).edu="EDU";class d{constructor(t){this.hostEntityId=t}serialize(){return this.hostEntityId}}!function(l){class c extends n{validate(t){return"ConfigurableTab"===t.tabType}deserialize(t){return t}}class p{constructor(t){this.configurableTabInstance=t}serialize(){return this.configurableTabInstance}}class f extends n{validate(t){return"ConfigurableTab"===t.tabType||"StaticTab"===t.tabType}deserialize(t){return t}}class E{constructor(t){this.hostEntityTabInstance=t}serialize(){return this.hostEntityTabInstance}}class h extends n{validate(t){return t.allTabs&&t.allTabs.forEach((t=>{})),!0}deserialize(t){return t}}function m(){var t;return!!(r(a)&&u.isSupported()&&(null===(t=a.supports.hostEntity)||void 0===t?void 0:t.tab))}function b(t){if(!t||0==t.length)throw new Error(`Error code: ${s.INVALID_ARGUMENTS}, message: ThreadId cannot be null or empty`)}function T(t){if(!(null==t?void 0:t.internalTabInstanceId)||0===t.internalTabInstanceId.length)throw new Error(`Error code: ${s.INVALID_ARGUMENTS}, message: TabId cannot be null or empty`)}l.addAndConfigure=function(e,n){if(r(a),!m())throw new Error(`Error code: ${s.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);if(b(e.threadId),n&&0===n.length)throw new Error(`Error code: ${s.INVALID_ARGUMENTS}, message: App types cannot be an empty array`);return t("hostEntity.tab.addAndConfigure",[new d(e),n],new f,o(i,"hostEntity.tab.addAndConfigure"))},l.getAll=function(e){if(r(a),!m())throw new Error(`Error code: ${s.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return b(e.threadId),t("hostEntity.tab.getAll",[new d(e)],new h,o(i,"hostEntity.tab.getAll"))},l.reconfigure=function(e,n){if(r(a),!m())throw new Error(`Error code: ${s.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return T(e),b(n.threadId),t("hostEntity.tab.reconfigure",[new p(e),new d(n)],new c,o(i,"hostEntity.tab.reconfigure"))},l.rename=function(e,n){if(r(a),!m())throw new Error(`Error code: ${s.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return T(e),b(n.threadId),t("hostEntity.tab.rename",[new p(e),new d(n)],new c,o(i,"hostEntity.tab.rename"))},l.remove=function(n,u){if(r(a),!m())throw new Error(`Error code: ${s.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return b(u.threadId),T(n),t("hostEntity.tab.remove",[new E(n),new d(u)],new e,o(i,"hostEntity.tab.remove"))},l.isSupported=m}(u.tab||(u.tab={})),u.isSupported=function(){return!(!r(a)||!a.supports.hostEntity)}}(u||(u={}));export{u as hostEntity};

@@ -1,1 +0,1 @@

import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParent as r}from"../internal/communication.js";import{registerHandler as i}from"../internal/handlers.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as t}from"../internal/telemetry.js";import{inServerSideRenderingEnvironment as n}from"../internal/utils.js";import{createEffectParameterChangeCallback as d,processMediaStreamWithMetadata as s,processMediaStream as a}from"../internal/videoEffectsUtils.js";import{VideoPerformanceMonitor as f}from"../internal/videoPerformanceMonitor.js";import{errorNotSupportedOnPlatform as m,FrameContexts as c}from"../public/constants.js";import{runtime as l}from"../public/runtime.js";import{videoEffects as u}from"../public/videoEffects.js";const v="v2";var p;!function(p){p.frameProcessingTimeoutInMs=2e3;const E=n()?void 0:new f(r);let F;function g(){const e=setTimeout((()=>{P(`Frame not processed in ${p.frameProcessingTimeoutInMs}ms`,F.Warn)}),p.frameProcessingTimeoutInMs);return function(){clearTimeout(e)}}function h(){return o(l),u.isSupported()}function P(e,i=F.Warn){r(t(v,"videoEffectsEx.notifyError"),"video.notifyError",[e,i])}!function(e){e.Fatal="fatal",e.Warn="warn"}(F=p.ErrorLevel||(p.ErrorLevel={})),p.registerForVideoFrame=function(n){var d,f;if(!h())throw m;if(!n.videoFrameHandler||!n.videoBufferHandler)throw new Error("Both videoFrameHandler and videoBufferHandler must be provided");if(o(l,c.sidePanel)){if(i(t(v,"videoEffectsEX.registerSetFrameProcessTimeLimitHandler"),"video.setFrameProcessTimeLimit",(e=>null==E?void 0:E.setFrameProcessTimeLimit(e)),!1),null===(d=l.supports.video)||void 0===d?void 0:d.mediaStream)i(t(v,"videoEffectsEX.registerStartVideoExtensibilityVideoStreamHandler"),"video.startVideoExtensibilityVideoStream",(r=>e(this,void 0,void 0,(function*(){const{streamId:i,metadataInTexture:o}=r,t=E?function(r,i){return o=>e(this,void 0,void 0,(function*(){const e=o.videoFrame;i.reportStartFrameProcessing(e.codedWidth,e.codedHeight);const t=g(),n=yield r(o);return t(),i.reportFrameProcessed(),n}))}(n.videoFrameHandler,E):n.videoFrameHandler;o?yield s(i,t,P,E):yield a(i,t,P,E)}))),!1),r(t(v,"videoEffectsEX.mediaStream.registerForVideoFrame"),"video.mediaStream.registerForVideoFrame",[n.config]);else{if(!(null===(f=l.supports.video)||void 0===f?void 0:f.sharedFrame))throw m;i(t(v,"videoEffectsEx.registerNewVideoFrameHandler"),"video.newVideoFrame",(e=>{if(e){null==E||E.reportStartFrameProcessing(e.width,e.height);const i=g(),o=e.timestamp;n.videoBufferHandler(function(e){return e.videoFrameBuffer=e.videoFrameBuffer||e.data,delete e.data,e}(e),(()=>{i(),null==E||E.reportFrameProcessed(),function(e){r(t(v,"videoEffectsEx.notifyVideoFrameProcessed"),"video.videoFrameProcessed",[e])}(o)}),P)}}),!1),r(t(v,"videoEffectsEx.registerForVideoFrame"),"video.registerForVideoFrame",[n.config])}null==E||E.startMonitorSlowFrameProcessing()}},p.notifySelectedVideoEffectChanged=function(e,i,n){if(o(l,c.sidePanel),!h())throw m;r(t(v,"videoEffectsEx.notifySelectedVideoEffectChanged"),"video.videoEffectChanged",[e,i,n])},p.registerForVideoEffect=function(e){if(o(l,c.sidePanel),!h())throw m;i(t(v,"videoEffectsEx.registerEffectParamterChangeHandler"),"video.effectParameterChange",d(e,E),!1),r(t(v,"videoEffectsEx.registerForVideoEffect"),"video.registerForVideoEffect")},p.updatePersonalizedEffects=function(e){if(o(l,c.sidePanel),!u.isSupported())throw m;r(t(v,"videoEffectsEx.updatePersonalizedEffects"),"video.personalizedEffectsChanged",[e])},p.isSupported=h,p.notifyFatalError=function(e){if(o(l),!u.isSupported())throw m;P(e,F.Fatal)}}(p||(p={}));export{p as videoEffectsEx};
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParent as r}from"../internal/communication.js";import{registerHandler as i}from"../internal/handlers.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as t}from"../internal/telemetry.js";import{inServerSideRenderingEnvironment as n}from"../internal/utils.js";import{processMediaStreamWithMetadata as d,processMediaStream as s,createEffectParameterChangeCallback as a}from"../internal/videoEffectsUtils.js";import{VideoPerformanceMonitor as f}from"../internal/videoPerformanceMonitor.js";import{errorNotSupportedOnPlatform as m,FrameContexts as c}from"../public/constants.js";import{runtime as l}from"../public/runtime.js";import{videoEffects as u}from"../public/videoEffects.js";const v="v2";var p;!function(p){p.frameProcessingTimeoutInMs=2e3;const E=n()?void 0:new f(r);let F;function g(){const e=setTimeout((()=>{P(`Frame not processed in ${p.frameProcessingTimeoutInMs}ms`,F.Warn)}),p.frameProcessingTimeoutInMs);return function(){clearTimeout(e)}}function h(){return o(l),u.isSupported()}function P(e,i=F.Warn){r(t(v,"videoEffectsEx.notifyError"),"video.notifyError",[e,i])}!function(e){e.Fatal="fatal",e.Warn="warn"}(F=p.ErrorLevel||(p.ErrorLevel={})),p.registerForVideoFrame=function(n){var a,f;if(!h())throw m;if(!n.videoFrameHandler||!n.videoBufferHandler)throw new Error("Both videoFrameHandler and videoBufferHandler must be provided");if(o(l,c.sidePanel)){if(i(t(v,"videoEffectsEX.registerSetFrameProcessTimeLimitHandler"),"video.setFrameProcessTimeLimit",(e=>null==E?void 0:E.setFrameProcessTimeLimit(e)),!1),null===(a=l.supports.video)||void 0===a?void 0:a.mediaStream)i(t(v,"videoEffectsEX.registerStartVideoExtensibilityVideoStreamHandler"),"video.startVideoExtensibilityVideoStream",(r=>e(this,void 0,void 0,(function*(){const{streamId:i,metadataInTexture:o}=r,t=E?function(r,i){return o=>e(this,void 0,void 0,(function*(){const e=o.videoFrame;i.reportStartFrameProcessing(e.codedWidth,e.codedHeight);const t=g(),n=yield r(o);return t(),i.reportFrameProcessed(),n}))}(n.videoFrameHandler,E):n.videoFrameHandler;o?yield d(i,t,P,E):yield s(i,t,P,E)}))),!1),r(t(v,"videoEffectsEX.mediaStream.registerForVideoFrame"),"video.mediaStream.registerForVideoFrame",[n.config]);else{if(!(null===(f=l.supports.video)||void 0===f?void 0:f.sharedFrame))throw m;i(t(v,"videoEffectsEx.registerNewVideoFrameHandler"),"video.newVideoFrame",(e=>{if(e){null==E||E.reportStartFrameProcessing(e.width,e.height);const i=g(),o=e.timestamp;n.videoBufferHandler(function(e){return e.videoFrameBuffer=e.videoFrameBuffer||e.data,delete e.data,e}(e),(()=>{i(),null==E||E.reportFrameProcessed(),function(e){r(t(v,"videoEffectsEx.notifyVideoFrameProcessed"),"video.videoFrameProcessed",[e])}(o)}),P)}}),!1),r(t(v,"videoEffectsEx.registerForVideoFrame"),"video.registerForVideoFrame",[n.config])}null==E||E.startMonitorSlowFrameProcessing()}},p.notifySelectedVideoEffectChanged=function(e,i,n){if(o(l,c.sidePanel),!h())throw m;r(t(v,"videoEffectsEx.notifySelectedVideoEffectChanged"),"video.videoEffectChanged",[e,i,n])},p.registerForVideoEffect=function(e){if(o(l,c.sidePanel),!h())throw m;i(t(v,"videoEffectsEx.registerEffectParamterChangeHandler"),"video.effectParameterChange",a(e,E),!1),r(t(v,"videoEffectsEx.registerForVideoEffect"),"video.registerForVideoEffect")},p.updatePersonalizedEffects=function(e){if(o(l,c.sidePanel),!u.isSupported())throw m;r(t(v,"videoEffectsEx.updatePersonalizedEffects"),"video.personalizedEffectsChanged",[e])},p.isSupported=h,p.notifyFatalError=function(e){if(o(l),!u.isSupported())throw m;P(e,F.Fatal)}}(p||(p={}));export{p as videoEffectsEx};

@@ -1,1 +0,1 @@

import{sendAndHandleStatusAndReason as e,Communication as i,uninitializeCommunication as t,sendAndUnwrap as n,sendMessageToParent as a,initializeCommunication as o}from"../internal/communication.js";import{defaultSDKVersionForCompatCheck as r}from"../internal/constants.js";import{GlobalVars as s}from"../internal/globalVars.js";import{registerOnThemeChangeHandler as l,registerBeforeSuspendOrTerminateHandler as m,registerOnResumeHandler as d,initializeHandlers as p,uninitializeHandlers as c}from"../internal/handlers.js";import{ensureInitializeCalled as u,ensureInitialized as f,processAdditionalValidOrigins as g}from"../internal/internalAPIs.js";import{getLogger as h,getApiVersionTag as y}from"../internal/telemetry.js";import{isNullOrUndefined as S}from"../internal/typeCheckUtilities.js";import{inServerSideRenderingEnvironment as I,runWithTimeout as C,compareSDKVersions as w}from"../internal/utils.js";import{prefetchOriginsFromCDN as T}from"../internal/validOrigins.js";import{messageChannels as v}from"../private/messageChannels.js";import{authentication as P}from"./authentication.js";import{FrameContexts as z,HostName as j,HostClientType as x}from"./constants.js";import{dialog as O}from"./dialog.js";import{menus as F}from"./menus.js";import{pages as N}from"./pages.js";import{runtime as b,applyRuntimeConfig as D,generateVersionBasedTeamsRuntimeConfig as L,mapTeamsVersionToSupportedCapabilities as E,versionAndPlatformAgnosticTeamsRuntimeConfig as A}from"./runtime.js";import{version as k}from"./version.js";const H="v2",R=h("app");function M(e,i){if(I()){return R.extend("initialize")("window object undefined at initialization"),Promise.resolve()}return C((()=>function(e,i){return new Promise((t=>{s.initializeCalled||(s.initializeCalled=!0,p(),s.initializePromise=o(i,e).then((({context:e,clientType:i,runtimeConfig:t,clientSupportedSDKVersion:n=r})=>{s.frameContext=e,s.hostClientType=i,s.clientSupportedSDKVersion=n;try{W("Parsing %s",t);const e=JSON.parse(t);if(W("Checking if %o is a valid runtime object",null!=e?e:"null"),!e||!e.apiVersion)throw new Error("Received runtime config is invalid");t&&D(e)}catch(e){if(!(e instanceof SyntaxError))throw e;try{W("Attempting to parse %s as an SDK version",t),isNaN(w(t,r))||(s.clientSupportedSDKVersion=t);const e=JSON.parse(n);if(W("givenRuntimeConfig parsed to %o",null!=e?e:"null"),!e)throw new Error("givenRuntimeConfig string was successfully parsed. However, it parsed to value of null");D(e)}catch(e){if(!(e instanceof SyntaxError))throw e;D(L(s.clientSupportedSDKVersion,A,E))}}s.initializeCompleted=!0})),P.initialize(),F.initialize(),N.config.initialize(),O.initialize()),Array.isArray(i)&&g(i),void 0!==s.initializePromise?t(s.initializePromise):W("GlobalVars.initializePromise is unexpectedly undefined")}))}(e,i)),5e3,new Error("SDK initialization timed out."))}function V(e){a(e,J.Messages.AppLoaded,[k])}function U(e,i){a(e,J.Messages.ExpectedFailure,[i.reason,i.message])}function K(e,i){a(e,J.Messages.Failure,[i.reason,i.message])}function B(e){a(e,J.Messages.Success,[k])}const W=R.extend("initializeHelper");function _(e,i){!S(i)&&u(),l(e,i)}function G(i,t){return new Promise((n=>{f(b,z.content,z.sidePanel,z.settings,z.task,z.stage,z.meetingStage),n(e(i,"executeDeepLink",t))}))}var J;!function(e){const a=h("app");var o,r,l;e.Messages={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"},(o=e.FailedReason||(e.FailedReason={})).AuthFailed="AuthFailed",o.Timeout="Timeout",o.Other="Other",(r=e.ExpectedFailureReason||(e.ExpectedFailureReason={})).PermissionError="PermissionError",r.NotFound="NotFound",r.Throttling="Throttling",r.Offline="Offline",r.Other="Other",e.isInitialized=function(){return s.initializeCompleted},e.getFrameContext=function(){return s.frameContext},a("teamsjs instance is version %s, starting at %s UTC (%s local)",k,(new Date).toISOString(),(new Date).toLocaleString()),function(){if(I())return;const e=document.getElementsByTagName("script"),i=e&&e[e.length-1]&&e[e.length-1].src,t="Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues";i&&0!==i.length?a("teamsjs is being used from %s. %s",i,t):a("teamsjs is being used from a script tag embedded directly in your html. %s",t)}(),e.initialize=function(e){return T(),M(y(H,"app.initialize"),e)},e._initialize=function(e){i.currentWindow=e},e._uninitialize=function(){s.initializeCalled&&(c(),s.initializeCalled=!1,s.initializeCompleted=!1,s.initializePromise=void 0,s.additionalValidOrigins=[],s.frameContext=void 0,s.hostClientType=void 0,s.isFramelessWindow=!1,v.telemetry._clearTelemetryPort(),v.dataLayer._clearDataLayerPort(),t())},e.getContext=function(){return new Promise((e=>{u(),e(n(y(H,"app.getContext"),"getContext"))})).then((e=>function(e){var i;const t={actionInfo:e.actionInfo,app:{locale:e.locale,sessionId:e.appSessionId?e.appSessionId:"",theme:e.theme?e.theme:"default",iconPositionVertical:e.appIconPosition,osLocaleInfo:e.osLocaleInfo,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:j.teams,clientType:e.hostClientType?e.hostClientType:x.web,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId},appLaunchId:e.appLaunchId},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:s.frameContext,subPageId:e.subEntityId,isFullScreen:e.isFullScreen,isMultiWindow:e.isMultiWindow,isBackgroundLoad:e.isBackgroundLoad,sourceOrigin:e.sourceOrigin},user:{id:null!==(i=e.userObjectId)&&void 0!==i?i:"",displayName:e.userDisplayName,isCallingAllowed:e.isCallingAllowed,isPSTNCallingAllowed:e.isPSTNCallingAllowed,licenseType:e.userLicenseType,loginHint:e.loginHint,userPrincipalName:e.userPrincipalName,tenant:e.tid?{id:e.tid,teamsSku:e.tenantSKU}:void 0},channel:e.channelId?{id:e.channelId,displayName:e.channelName,relativeUrl:e.channelRelativeUrl,membershipType:e.channelType,defaultOneNoteSectionId:e.defaultOneNoteSectionId,ownerGroupId:e.hostTeamGroupId,ownerTenantId:e.hostTeamTenantId}:void 0,chat:e.chatId?{id:e.chatId}:void 0,meeting:e.meetingId?{id:e.meetingId}:void 0,sharepoint:e.sharepoint,team:e.teamId?{internalId:e.teamId,displayName:e.teamName,type:e.teamType,groupId:e.groupId,templateId:e.teamTemplateId,isArchived:e.isTeamArchived,userRole:e.userTeamRole}:void 0,sharePointSite:e.teamSiteUrl||e.teamSiteDomain||e.teamSitePath||e.mySitePath||e.mySiteDomain?{teamSiteUrl:e.teamSiteUrl,teamSiteDomain:e.teamSiteDomain,teamSitePath:e.teamSitePath,teamSiteId:e.teamSiteId,mySitePath:e.mySitePath,mySiteDomain:e.mySiteDomain}:void 0,dialogParameters:e.dialogParameters||{}};return t}(e)))},e.notifyAppLoaded=function(){u(),V(y(H,"app.notifyAppLoaded"))},e.notifySuccess=function(){u(),B(y(H,"app.notifySuccess"))},e.notifyFailure=function(e){u(),K(y(H,"app.notifyFailure"),e)},e.notifyExpectedFailure=function(e){u(),U(y(H,"app.notifyExpectedFailure"),e)},e.registerOnThemeChangeHandler=function(e){_(y(H,"app.registerOnThemeChangeHandler"),e)},e.openLink=function(e){return G(y(H,"app.openLink"),e)},(l=e.lifecycle||(e.lifecycle={})).registerBeforeSuspendOrTerminateHandler=function(e){if(!e)throw new Error("[app.lifecycle.registerBeforeSuspendOrTerminateHandler] Handler cannot be null");f(b),m(e)},l.registerOnResumeHandler=function(e){if(!e)throw new Error("[app.lifecycle.registerOnResumeHandler] Handler cannot be null");f(b),d(e)}}(J||(J={}));export{J as app,M as appInitializeHelper,V as notifyAppLoadedHelper,U as notifyExpectedFailureHelper,K as notifyFailureHelper,B as notifySuccessHelper,G as openLinkHelper,_ as registerOnThemeChangeHandlerHelper};
import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,openLinkHelper as r}from"../internal/appHelpers.js";import{uninitializeCommunication as s,sendAndUnwrap as l,Communication as m}from"../internal/communication.js";import{GlobalVars as d}from"../internal/globalVars.js";import{uninitializeHandlers as p,registerBeforeSuspendOrTerminateHandler as u,registerOnResumeHandler as c}from"../internal/handlers.js";import{ensureInitializeCalled as f,ensureInitialized as h}from"../internal/internalAPIs.js";import{getLogger as g,getApiVersionTag as I}from"../internal/telemetry.js";import{inServerSideRenderingEnvironment as y}from"../internal/utils.js";import{prefetchOriginsFromCDN as S}from"../internal/validOrigins.js";import{messageChannels as T}from"../private/messageChannels.js";import{HostName as P,HostClientType as C}from"./constants.js";import{runtime as v}from"./runtime.js";import{version as w}from"./version.js";const O="v2",j=g("app"),N={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var b,F,L;function x(){return d.initializeCompleted}function A(){return d.frameContext}function D(i){return S(),e(I(O,"app.initialize"),i)}function z(e){m.currentWindow=e}function H(){d.initializeCalled&&(p(),d.initializeCalled=!1,d.initializeCompleted=!1,d.initializePromise=void 0,d.additionalValidOrigins=[],d.frameContext=void 0,d.hostClientType=void 0,d.isFramelessWindow=!1,T.telemetry._clearTelemetryPort(),T.dataLayer._clearDataLayerPort(),s())}function E(){return new Promise((e=>{f(),e(l(I(O,"app.getContext"),"getContext"))})).then((e=>function(e){var i;const t={actionInfo:e.actionInfo,app:{locale:e.locale,sessionId:e.appSessionId?e.appSessionId:"",theme:e.theme?e.theme:"default",iconPositionVertical:e.appIconPosition,osLocaleInfo:e.osLocaleInfo,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:P.teams,clientType:e.hostClientType?e.hostClientType:C.web,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId},appLaunchId:e.appLaunchId},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:d.frameContext,subPageId:e.subEntityId,isFullScreen:e.isFullScreen,isMultiWindow:e.isMultiWindow,isBackgroundLoad:e.isBackgroundLoad,sourceOrigin:e.sourceOrigin},user:{id:null!==(i=e.userObjectId)&&void 0!==i?i:"",displayName:e.userDisplayName,isCallingAllowed:e.isCallingAllowed,isPSTNCallingAllowed:e.isPSTNCallingAllowed,licenseType:e.userLicenseType,loginHint:e.loginHint,userPrincipalName:e.userPrincipalName,tenant:e.tid?{id:e.tid,teamsSku:e.tenantSKU}:void 0},channel:e.channelId?{id:e.channelId,displayName:e.channelName,relativeUrl:e.channelRelativeUrl,membershipType:e.channelType,defaultOneNoteSectionId:e.defaultOneNoteSectionId,ownerGroupId:e.hostTeamGroupId,ownerTenantId:e.hostTeamTenantId}:void 0,chat:e.chatId?{id:e.chatId}:void 0,meeting:e.meetingId?{id:e.meetingId}:void 0,sharepoint:e.sharepoint,team:e.teamId?{internalId:e.teamId,displayName:e.teamName,type:e.teamType,groupId:e.groupId,templateId:e.teamTemplateId,isArchived:e.isTeamArchived,userRole:e.userTeamRole}:void 0,sharePointSite:e.teamSiteUrl||e.teamSiteDomain||e.teamSitePath||e.mySitePath||e.mySiteDomain?{teamSiteUrl:e.teamSiteUrl,teamSiteDomain:e.teamSiteDomain,teamSitePath:e.teamSitePath,teamSiteId:e.teamSiteId,mySitePath:e.mySitePath,mySiteDomain:e.mySiteDomain}:void 0,dialogParameters:e.dialogParameters||{}};return t}(e)))}function k(){f(),i(I(O,"app.notifyAppLoaded"))}function U(){f(),t(I(O,"app.notifySuccess"))}function B(e){f(),n(I(O,"app.notifyFailure"),e)}function R(e){f(),a(I(O,"app.notifyExpectedFailure"),e)}function M(e){o(I(O,"app.registerOnThemeChangeHandler"),e)}function W(e){return r(I(O,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(b||(b={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(F||(F={})),j("teamsjs instance is version %s, starting at %s UTC (%s local)",w,(new Date).toISOString(),(new Date).toLocaleString()),function(){if(y())return;const e=document.getElementsByTagName("script"),i=e&&e[e.length-1]&&e[e.length-1].src,t="Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues";i&&0!==i.length?j("teamsjs is being used from %s. %s",i,t):j("teamsjs is being used from a script tag embedded directly in your html. %s",t)}(),function(e){e.registerBeforeSuspendOrTerminateHandler=function(e){if(!e)throw new Error("[app.lifecycle.registerBeforeSuspendOrTerminateHandler] Handler cannot be null");h(v),u(e)},e.registerOnResumeHandler=function(e){if(!e)throw new Error("[app.lifecycle.registerOnResumeHandler] Handler cannot be null");h(v),c(e)}}(L||(L={}));export{F as ExpectedFailureReason,b as FailedReason,N as Messages,z as _initialize,H as _uninitialize,E as getContext,A as getFrameContext,D as initialize,x as isInitialized,L as lifecycle,k as notifyAppLoaded,R as notifyExpectedFailure,B as notifyFailure,U as notifySuccess,W as openLink,M as registerOnThemeChangeHandler};

@@ -1,1 +0,1 @@

import{validateStringAsAppId as t}from"../internal/appIdValidation.js";class r{constructor(r){this.appIdAsString=r,t(r)}toString(){return this.appIdAsString}}export{r as AppId};
import{validateStringAsAppId as t}from"../internal/appIdValidation.js";class r{constructor(r){this.appIdAsString=r,t(r)}serialize(){return this.toString()}toString(){return this.appIdAsString}}export{r as AppId};

@@ -1,1 +0,1 @@

import{getApiVersionTag as i}from"../internal/telemetry.js";import{app as e,notifyAppLoadedHelper as n,notifySuccessHelper as t,notifyFailureHelper as a,notifyExpectedFailureHelper as o}from"./app.js";const p="v1";var s;!function(s){s.Messages=e.Messages,s.FailedReason=e.FailedReason,s.ExpectedFailureReason=e.ExpectedFailureReason,s.notifyAppLoaded=function(){n(i(p,"appInitialization.notifyAppLoaded"))},s.notifySuccess=function(){t(i(p,"appInitialization.notifySuccess"))},s.notifyFailure=function(e){a(i(p,"appInitialization.notifyFailure"),e)},s.notifyExpectedFailure=function(e){o(i(p,"appInitialization.notifyExpectedFailure"),e)}}(s||(s={}));export{s as appInitialization};
import{notifyAppLoadedHelper as i,notifySuccessHelper as n,notifyFailureHelper as t,notifyExpectedFailureHelper as a}from"../internal/appHelpers.js";import{getApiVersionTag as e}from"../internal/telemetry.js";export{ExpectedFailureReason,FailedReason,Messages}from"./app.js";const o="v1";function p(){i(e(o,"appInitialization.notifyAppLoaded"))}function r(){n(e(o,"appInitialization.notifySuccess"))}function l(i){t(e(o,"appInitialization.notifyFailure"),i)}function s(i){a(e(o,"appInitialization.notifyExpectedFailure"),i)}export{p as notifyAppLoaded,s as notifyExpectedFailure,l as notifyFailure,r as notifySuccess};

@@ -1,1 +0,1 @@

import{sendAndHandleStatusAndReason as t,sendMessageToParent as n}from"../internal/communication.js";import{createTeamsDeepLinkForAppInstallDialog as e}from"../internal/deepLinkUtilities.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{FrameContexts as r}from"./constants.js";import{runtime as p}from"./runtime.js";var a;!function(a){function s(){return!(!o(p)||!p.supports.appInstallDialog)}a.openAppInstallDialog=function(a){return new Promise((l=>{if(o(p,r.content,r.sidePanel,r.settings,r.task,r.stage,r.meetingStage),!s())throw new Error("Not supported");const m=i("v1","appInstallDialog.openAppInstallDialog");p.isLegacyTeams?l(t(m,"executeDeepLink",e(a.appId))):(n(m,"appInstallDialog.openAppInstallDialog",[a]),l())}))},a.isSupported=s}(a||(a={}));export{a as appInstallDialog};
import{sendAndHandleStatusAndReason as t,sendMessageToParent as n}from"../internal/communication.js";import{createTeamsDeepLinkForAppInstallDialog as e}from"../internal/deepLinkUtilities.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{FrameContexts as r}from"./constants.js";import{runtime as a}from"./runtime.js";function p(p){return new Promise((l=>{if(o(a,r.content,r.sidePanel,r.settings,r.task,r.stage,r.meetingStage),!s())throw new Error("Not supported");const m=i("v1","appInstallDialog.openAppInstallDialog");a.isLegacyTeams?l(t(m,"executeDeepLink",e(p.appId))):(n(m,"appInstallDialog.openAppInstallDialog",[p]),l())}))}function s(){return!(!o(a)||!a.supports.appInstallDialog)}export{s as isSupported,p as openAppInstallDialog};

@@ -1,1 +0,1 @@

import{sendMessageToParentAsync as t,Communication as e,sendMessageEventToChild as n,sendMessageToParent as i,waitForMessageQueue as r}from"../internal/communication.js";import{GlobalVars as a}from"../internal/globalVars.js";import{registerHandler as o,removeHandler as c}from"../internal/handlers.js";import{ensureInitialized as l,ensureInitializeCalled as u}from"../internal/internalAPIs.js";import{getApiVersionTag as s}from"../internal/telemetry.js";import{fullyQualifyUrlString as h,validateUrl as d}from"../internal/utils.js";import{FrameContexts as f,HostClientType as w}from"./constants.js";import{runtime as m}from"./runtime.js";const g="v1",b="v2";var W;!function(W){let C,k,y;function p(){v();try{e.childWindow&&e.childWindow.close()}finally{e.childWindow=null,e.childOrigin=null}}function v(){k&&(clearInterval(k),k=0),c("initialize"),c("navigateCrossDomain")}function T(t){try{C&&C.success(t)}finally{C=void 0,p()}}function j(t){try{C&&C.fail(new Error(t))}finally{C=void 0,p()}}var A;W.initialize=function(){o(s(g,"authentication.registerAuthenticateSuccessHandler"),"authentication.authenticate.success",T,!1),o(s(g,"authentication.registerAuthenticateFailureHandler"),"authentication.authenticate.failure",j,!1)},W.registerAuthenticationHandlers=function(t){y=t},W.authenticate=function(i){const r=void 0!==i,c=r?i:y;if(!c)throw new Error("No parameters are provided for authentication");return l(m,f.content,f.sidePanel,f.settings,f.remove,f.task,f.stage,f.meetingStage),function(i,r){return new Promise(((c,l)=>{if(a.hostClientType!==w.web){const e=h(r.url);d(e),c(t(i,"authentication.authenticate",[e.href,r.width,r.height,r.isExternal]).then((([t,e])=>{if(t)return e;throw new Error(e)})))}else C={success:c,fail:l},function(t){p();let i=t.width||600,r=t.height||400;i=Math.min(i,e.currentWindow.outerWidth-400),r=Math.min(r,e.currentWindow.outerHeight-200);const c=h(t.url.replace("{oauthRedirectMethod}","web"));d(c);let l=void 0!==e.currentWindow.screenLeft?e.currentWindow.screenLeft:e.currentWindow.screenX,u=void 0!==e.currentWindow.screenTop?e.currentWindow.screenTop:e.currentWindow.screenY;l+=e.currentWindow.outerWidth/2-i/2,u+=e.currentWindow.outerHeight/2-r/2,e.childWindow=e.currentWindow.open(c.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+u+", left="+l+", width="+i+", height="+r),e.childWindow?(v(),k=e.currentWindow.setInterval((()=>{if(!e.childWindow||e.childWindow.closed)j("CancelledByUser");else{const t=e.childOrigin;try{e.childOrigin="*",n("ping")}finally{e.childOrigin=t}}}),100),o(s(g,"authentication.authenticationWindow.registerInitializeHandler"),"initialize",(()=>[f.authentication,a.hostClientType])),o(s(g,"authentication.authenticationWindow.registerNavigateCrossDomainHandler"),"navigateCrossDomain",(()=>!1))):j("FailedToOpenWindow")}(r)}))}(c.successCallback||c.failureCallback?s(g,"authentication.authenticate"):s(b,"authentication.authenticate"),c).then((t=>{try{return c&&c.successCallback?(c.successCallback(t),""):t}finally{r||(y=void 0)}})).catch((t=>{try{if(c&&c.failureCallback)return c.failureCallback(t.message),"";throw t}finally{r||(y=void 0)}}))},W.getAuthToken=function(e){return u(),function(e,n){return new Promise((i=>{i(t(e,"authentication.getAuthToken",[null==n?void 0:n.resources,null==n?void 0:n.claims,null==n?void 0:n.silent,null==n?void 0:n.tenantId]))})).then((([t,e])=>{if(t)return e;throw new Error(e)}))}(e&&(e.successCallback||e.failureCallback)?s(g,"authentication.getAuthToken"):s(b,"authentication.getAuthToken"),e).then((t=>e&&e.successCallback?(e.successCallback(t),""):t)).catch((t=>{if(e&&e.failureCallback)return e.failureCallback(t.message),"";throw t}))},W.getUser=function(e){return u(),function(e){return new Promise((n=>{n(t(e,"authentication.getUser"))})).then((([t,e])=>{if(t)return e;throw e}))}(e&&(e.successCallback||e.failureCallback)?s(g,"authentication.getUser"):s(b,"authentication.getUser")).then((t=>e&&e.successCallback?(e.successCallback(t),null):t)).catch((t=>{const n=`Error returned, code = ${t.errorCode}, message = ${t.message}`;if(e&&e.failureCallback)return e.failureCallback(n),null;throw new Error(n)}))},W.notifySuccess=function(t,n){l(m,f.authentication);const a=s(n?g:b,"authentication.notifySuccess");i(a,"authentication.authenticate.success",[t]),r(e.parentWindow,(()=>setTimeout((()=>e.currentWindow.close()),200)))},W.notifyFailure=function(t,n){l(m,f.authentication);const a=s(n?g:b,"authentication.notifyFailure");i(a,"authentication.authenticate.failure",[t]),r(e.parentWindow,(()=>setTimeout((()=>e.currentWindow.close()),200)))},(A=W.DataResidency||(W.DataResidency={})).Public="public",A.EUDB="eudb",A.Other="other"}(W||(W={}));export{W as authentication};
import{sendMessageToParentAsync as t,Communication as e,sendMessageEventToChild as n,sendMessageToParent as i,waitForMessageQueue as r}from"../internal/communication.js";import{GlobalVars as a}from"../internal/globalVars.js";import{registerHandler as o,removeHandler as c}from"../internal/handlers.js";import{ensureInitialized as l,ensureInitializeCalled as u}from"../internal/internalAPIs.js";import{getApiVersionTag as s}from"../internal/telemetry.js";import{fullyQualifyUrlString as h,validateUrl as d}from"../internal/utils.js";import{FrameContexts as f,HostClientType as w}from"./constants.js";import{runtime as m}from"./runtime.js";const g="v1",b="v2";let W,C,k;function p(){o(s(g,"authentication.registerAuthenticateSuccessHandler"),"authentication.authenticate.success",P,!1),o(s(g,"authentication.registerAuthenticateFailureHandler"),"authentication.authenticate.failure",I,!1)}function v(t){k=t}function y(i){const r=void 0!==i,c=r?i:k;if(!c)throw new Error("No parameters are provided for authentication");l(m,f.content,f.sidePanel,f.settings,f.remove,f.task,f.stage,f.meetingStage);return function(i,r){return new Promise(((c,l)=>{if(a.hostClientType!==w.web){const e=h(r.url);d(e),c(t(i,"authentication.authenticate",[e.href,r.width,r.height,r.isExternal]).then((([t,e])=>{if(t)return e;throw new Error(e)})))}else W={success:c,fail:l},function(t){E();let i=t.width||600,r=t.height||400;i=Math.min(i,e.currentWindow.outerWidth-400),r=Math.min(r,e.currentWindow.outerHeight-200);const c=h(t.url.replace("{oauthRedirectMethod}","web"));d(c);let l=void 0!==e.currentWindow.screenLeft?e.currentWindow.screenLeft:e.currentWindow.screenX,u=void 0!==e.currentWindow.screenTop?e.currentWindow.screenTop:e.currentWindow.screenY;l+=e.currentWindow.outerWidth/2-i/2,u+=e.currentWindow.outerHeight/2-r/2,e.childWindow=e.currentWindow.open(c.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+u+", left="+l+", width="+i+", height="+r),e.childWindow?(A(),C=e.currentWindow.setInterval((()=>{if(!e.childWindow||e.childWindow.closed)I("CancelledByUser");else{const t=e.childOrigin;try{e.childOrigin="*",n("ping")}finally{e.childOrigin=t}}}),100),o(s(g,"authentication.authenticationWindow.registerInitializeHandler"),"initialize",(()=>[f.authentication,a.hostClientType])),o(s(g,"authentication.authenticationWindow.registerNavigateCrossDomainHandler"),"navigateCrossDomain",(()=>!1))):I("FailedToOpenWindow")}(r)}))}(c.successCallback||c.failureCallback?s(g,"authentication.authenticate"):s(b,"authentication.authenticate"),c).then((t=>{try{return c&&c.successCallback?(c.successCallback(t),""):t}finally{r||(k=void 0)}})).catch((t=>{try{if(c&&c.failureCallback)return c.failureCallback(t.message),"";throw t}finally{r||(k=void 0)}}))}function T(e){u();return function(e,n){return new Promise((i=>{i(t(e,"authentication.getAuthToken",[null==n?void 0:n.resources,null==n?void 0:n.claims,null==n?void 0:n.silent,null==n?void 0:n.tenantId]))})).then((([t,e])=>{if(t)return e;throw new Error(e)}))}(e&&(e.successCallback||e.failureCallback)?s(g,"authentication.getAuthToken"):s(b,"authentication.getAuthToken"),e).then((t=>e&&e.successCallback?(e.successCallback(t),""):t)).catch((t=>{if(e&&e.failureCallback)return e.failureCallback(t.message),"";throw t}))}function j(e){u();return function(e){return new Promise((n=>{n(t(e,"authentication.getUser"))})).then((([t,e])=>{if(t)return e;throw e}))}(e&&(e.successCallback||e.failureCallback)?s(g,"authentication.getUser"):s(b,"authentication.getUser")).then((t=>e&&e.successCallback?(e.successCallback(t),null):t)).catch((t=>{const n=`Error returned, code = ${t.errorCode}, message = ${t.message}`;if(e&&e.failureCallback)return e.failureCallback(n),null;throw new Error(n)}))}function E(){A();try{e.childWindow&&e.childWindow.close()}finally{e.childWindow=null,e.childOrigin=null}}function A(){C&&(clearInterval(C),C=0),c("initialize"),c("navigateCrossDomain")}function H(t,n){l(m,f.authentication);const a=s(n?g:b,"authentication.notifySuccess");i(a,"authentication.authenticate.success",[t]),r(e.parentWindow,(()=>setTimeout((()=>e.currentWindow.close()),200)))}function O(t,n){l(m,f.authentication);const a=s(n?g:b,"authentication.notifyFailure");i(a,"authentication.authenticate.failure",[t]),r(e.parentWindow,(()=>setTimeout((()=>e.currentWindow.close()),200)))}function P(t){try{W&&W.success(t)}finally{W=void 0,E()}}function I(t){try{W&&W.fail(new Error(t))}finally{W=void 0,E()}}var U;!function(t){t.Public="public",t.EUDB="eudb",t.Other="other"}(U||(U={}));export{U as DataResidency,y as authenticate,T as getAuthToken,j as getUser,p as initialize,O as notifyFailure,H as notifySuccess,v as registerAuthenticationHandlers};

@@ -1,1 +0,1 @@

import{sendAndHandleSdkError as r}from"../internal/communication.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{validateScanBarCodeInput as e}from"../internal/mediaUtil.js";import{getApiVersionTag as n}from"../internal/telemetry.js";import{FrameContexts as t,errorNotSupportedOnPlatform as s}from"./constants.js";import{ErrorCode as i,DevicePermission as m}from"./interfaces.js";import{runtime as a}from"./runtime.js";const c="v2";var f;!function(f){function p(){return!!(o(a)&&a.supports.barCode&&a.supports.permissions)}f.scanBarCode=function(m){return new Promise((f=>{if(o(a,t.content,t.task),!p())throw s;if(!e(m))throw{errorCode:i.INVALID_ARGUMENTS};f(r(n(c,"barCode.scanBarCode"),"media.scanBarCode",m))}))},f.hasPermission=function(){if(o(a,t.content,t.task),!p())throw s;const e=m.Media;return new Promise((o=>{o(r(n(c,"barCode.hasPermission"),"permissions.has",e))}))},f.requestPermission=function(){if(o(a,t.content,t.task),!p())throw s;const e=m.Media;return new Promise((o=>{o(r(n(c,"barCode.requestPermission"),"permissions.request",e))}))},f.isSupported=p}(f||(f={}));export{f as barCode};
import{sendAndHandleSdkError as r}from"../internal/communication.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{validateScanBarCodeInput as t}from"../internal/mediaUtil.js";import{getApiVersionTag as n}from"../internal/telemetry.js";import{FrameContexts as e,errorNotSupportedOnPlatform as s}from"./constants.js";import{ErrorCode as i,DevicePermission as m}from"./interfaces.js";import{runtime as a}from"./runtime.js";const c="v2";function f(m){return new Promise((f=>{if(o(a,e.content,e.task),!d())throw s;if(!t(m))throw{errorCode:i.INVALID_ARGUMENTS};f(r(n(c,"barCode.scanBarCode"),"media.scanBarCode",m))}))}function p(){if(o(a,e.content,e.task),!d())throw s;const t=m.Media;return new Promise((o=>{o(r(n(c,"barCode.hasPermission"),"permissions.has",t))}))}function u(){if(o(a,e.content,e.task),!d())throw s;const t=m.Media;return new Promise((o=>{o(r(n(c,"barCode.requestPermission"),"permissions.request",t))}))}function d(){return!!(o(a)&&a.supports.barCode&&a.supports.permissions)}export{p as hasPermission,d as isSupported,u as requestPermission,f as scanBarCode};

@@ -1,1 +0,1 @@

import{sendAndHandleStatusAndReason as e}from"../internal/communication.js";import{createTeamsDeepLinkForCalendar as t}from"../internal/deepLinkUtilities.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as r}from"../internal/telemetry.js";import{FrameContexts as o}from"./constants.js";import{runtime as i}from"./runtime.js";var m;!function(m){function a(){return!(!n(i)||!i.supports.calendar)}m.openCalendarItem=function(t){return new Promise((m=>{if(n(i,o.content),!a())throw new Error("Not supported");if(!t.itemId||!t.itemId.trim())throw new Error("Must supply an itemId to openCalendarItem");m(e(r("v2","calendar.openCalendarItem"),"calendar.openCalendarItem",t))}))},m.composeMeeting=function(m){return new Promise((s=>{if(n(i,o.content),!a())throw new Error("Not supported");const p=r("v2","calendar.composeMeeting");i.isLegacyTeams?s(e(p,"executeDeepLink",t(m.attendees,m.startTime,m.endTime,m.subject,m.content))):s(e(p,"calendar.composeMeeting",m))}))},m.isSupported=a}(m||(m={}));export{m as calendar};
import{sendAndHandleStatusAndReason as e}from"../internal/communication.js";import{createTeamsDeepLinkForCalendar as t}from"../internal/deepLinkUtilities.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{getApiVersionTag as r}from"../internal/telemetry.js";import{FrameContexts as o}from"./constants.js";import{runtime as i}from"./runtime.js";function m(t){return new Promise((m=>{if(n(i,o.content),!s())throw new Error("Not supported");if(!t.itemId||!t.itemId.trim())throw new Error("Must supply an itemId to openCalendarItem");m(e(r("v2","calendar.openCalendarItem"),"calendar.openCalendarItem",t))}))}function a(m){return new Promise((a=>{if(n(i,o.content),!s())throw new Error("Not supported");const p=r("v2","calendar.composeMeeting");i.isLegacyTeams?a(e(p,"executeDeepLink",t(m.attendees,m.startTime,m.endTime,m.subject,m.content))):a(e(p,"calendar.composeMeeting",m))}))}function s(){return!(!n(i)||!i.supports.calendar)}export{a as composeMeeting,s as isSupported,m as openCalendarItem};

@@ -1,1 +0,1 @@

import{sendAndUnwrap as t,sendMessageToParent as e}from"../internal/communication.js";import{errorCallNotStarted as n}from"../internal/constants.js";import{createTeamsDeepLinkForCall as r}from"../internal/deepLinkUtilities.js";import{ensureInitialized as i}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{FrameContexts as a,errorNotSupportedOnPlatform as s}from"./constants.js";import{runtime as l}from"./runtime.js";var m;!function(m){let u;function c(){return!(!i(l)||!l.supports.call)}!function(t){t.Unknown="unknown",t.Audio="audio",t.Video="video",t.VideoBasedScreenSharing="videoBasedScreenSharing",t.Data="data"}(u=m.CallModalities||(m.CallModalities={})),m.startCall=function(m){const d=o("v2","call.startCall");return new Promise((o=>{var f;if(i(l,a.content,a.task),!c())throw s;if(!l.isLegacyTeams)return e(d,"call.startCall",[m],o);o(t(d,"executeDeepLink",r(m.targets,null===(f=m.requestedModalities)||void 0===f?void 0:f.includes(u.Video),m.source)).then((t=>{if(!t)throw new Error(n);return t})))}))},m.isSupported=c}(m||(m={}));export{m as call};
import{sendAndUnwrap as t,sendMessageToParent as n}from"../internal/communication.js";import{errorCallNotStarted as r}from"../internal/constants.js";import{createTeamsDeepLinkForCall as e}from"../internal/deepLinkUtilities.js";import{ensureInitialized as i}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{FrameContexts as a,errorNotSupportedOnPlatform as s}from"./constants.js";import{runtime as l}from"./runtime.js";var m;function c(c){const d=o("v2","call.startCall");return new Promise((o=>{var f;if(i(l,a.content,a.task),!u())throw s;if(!l.isLegacyTeams)return n(d,"call.startCall",[c],o);o(t(d,"executeDeepLink",e(c.targets,null===(f=c.requestedModalities)||void 0===f?void 0:f.includes(m.Video),c.source)).then((t=>{if(!t)throw new Error(r);return t})))}))}function u(){return!(!i(l)||!l.supports.call)}!function(t){t.Unknown="unknown",t.Audio="audio",t.Video="video",t.VideoBasedScreenSharing="videoBasedScreenSharing",t.Data="data"}(m||(m={}));export{m as CallModalities,u as isSupported,c as startCall};

@@ -1,1 +0,1 @@

import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendAndHandleSdkError as r}from"../internal/communication.js";import{GlobalVars as e}from"../internal/globalVars.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{getBase64StringFromBlob as n,base64ToBlob as s}from"../internal/utils.js";import{FrameContexts as p,errorNotSupportedOnPlatform as a}from"./constants.js";import{ClipboardSupportedMimeType as l}from"./interfaces.js";import{runtime as m}from"./runtime.js";var c;!function(c){function d(){return e.isFramelessWindow?!(!o(m)||!m.supports.clipboard):!!(o(m)&&navigator&&navigator.clipboard&&m.supports.clipboard)}c.write=function(e){return t(this,void 0,void 0,(function*(){if(o(m,p.content,p.meetingStage,p.task,p.settings,p.stage,p.sidePanel),!d())throw a;if(!e.type||!Object.values(l).includes(e.type))throw new Error(`Blob type ${e.type} is not supported. Supported blob types are ${Object.values(l)}`);const t=yield n(e),s={mimeType:e.type,content:t};return r(i("v2","clipboard.write"),"clipboard.writeToClipboard",s)}))},c.read=function(){return t(this,void 0,void 0,(function*(){o(m,p.content,p.meetingStage,p.task,p.settings,p.stage,p.sidePanel);const t=i("v2","clipboard.read");if(!d())throw a;const e=yield r(t,"clipboard.readFromClipboard");if("string"==typeof e){const t=JSON.parse(e);return s(t.mimeType,t.content)}return e}))},c.isSupported=d}(c||(c={}));export{c as clipboard};
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendAndHandleSdkError as r}from"../internal/communication.js";import{GlobalVars as e}from"../internal/globalVars.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{getBase64StringFromBlob as n,base64ToBlob as s}from"../internal/utils.js";import{FrameContexts as p,errorNotSupportedOnPlatform as a}from"./constants.js";import{ClipboardSupportedMimeType as l}from"./interfaces.js";import{runtime as m}from"./runtime.js";function c(e){return t(this,void 0,void 0,(function*(){if(o(m,p.content,p.meetingStage,p.task,p.settings,p.stage,p.sidePanel),!u())throw a;if(!e.type||!Object.values(l).includes(e.type))throw new Error(`Blob type ${e.type} is not supported. Supported blob types are ${Object.values(l)}`);const t=yield n(e),s={mimeType:e.type,content:t};return r(i("v2","clipboard.write"),"clipboard.writeToClipboard",s)}))}function d(){return t(this,void 0,void 0,(function*(){o(m,p.content,p.meetingStage,p.task,p.settings,p.stage,p.sidePanel);const t=i("v2","clipboard.read");if(!u())throw a;const e=yield r(t,"clipboard.readFromClipboard");if("string"==typeof e){const t=JSON.parse(e);return s(t.mimeType,t.content)}return e}))}function u(){return e.isFramelessWindow?!(!o(m)||!m.supports.clipboard):!!(o(m)&&navigator&&navigator.clipboard&&m.supports.clipboard)}export{u as isSupported,d as read,c as write};

@@ -1,1 +0,1 @@

import{ErrorCode as e}from"./interfaces.js";var o,a,s,t,n,i;!function(e){e.desktop="desktop",e.web="web",e.android="android",e.ios="ios",e.ipados="ipados",e.macos="macos",e.rigel="rigel",e.surfaceHub="surfaceHub",e.teamsRoomsWindows="teamsRoomsWindows",e.teamsRoomsAndroid="teamsRoomsAndroid",e.teamsPhones="teamsPhones",e.teamsDisplays="teamsDisplays"}(o||(o={})),function(e){e.office="Office",e.outlook="Outlook",e.outlookWin32="OutlookWin32",e.orange="Orange",e.places="Places",e.teams="Teams",e.teamsModern="TeamsModern"}(a||(a={})),function(e){e.settings="settings",e.content="content",e.authentication="authentication",e.remove="remove",e.task="task",e.sidePanel="sidePanel",e.stage="stage",e.meetingStage="meetingStage"}(s||(s={})),function(e){e[e.Standard=0]="Standard",e[e.Edu=1]="Edu",e[e.Class=2]="Class",e[e.Plc=3]="Plc",e[e.Staff=4]="Staff"}(t||(t={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}(n||(n={})),function(e){e.Large="large",e.Medium="medium",e.Small="small"}(i||(i={}));var r,m=i;!function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(r||(r={}));const d={errorCode:e.NOT_SUPPORTED_ON_PLATFORM},u={majorVersion:1,minorVersion:5},l={adaptiveCardSchemaVersion:{majorVersion:1,minorVersion:5}},c=new Error("Invalid input count: Must supply a valid image count (limit of 10)."),f=new Error("Invalid response: Received more images than the specified max limit in the response.");export{r as ChannelType,i as DialogDimension,s as FrameContexts,o as HostClientType,a as HostName,m as TaskModuleDimension,t as TeamType,n as UserTeamRole,c as errorInvalidCount,f as errorInvalidResponse,d as errorNotSupportedOnPlatform,u as minAdaptiveCardVersion,l as teamsMinAdaptiveCardVersion};
import{ErrorCode as e}from"./interfaces.js";var o,a,s,n,i,t,r;!function(e){e.desktop="desktop",e.web="web",e.android="android",e.ios="ios",e.ipados="ipados",e.macos="macos",e.rigel="rigel",e.surfaceHub="surfaceHub",e.teamsRoomsWindows="teamsRoomsWindows",e.teamsRoomsAndroid="teamsRoomsAndroid",e.teamsPhones="teamsPhones",e.teamsDisplays="teamsDisplays"}(o||(o={})),function(e){e.office="Office",e.outlook="Outlook",e.outlookWin32="OutlookWin32",e.orange="Orange",e.places="Places",e.teams="Teams",e.teamsModern="TeamsModern"}(a||(a={})),function(e){e.settings="settings",e.content="content",e.authentication="authentication",e.remove="remove",e.task="task",e.sidePanel="sidePanel",e.stage="stage",e.meetingStage="meetingStage"}(s||(s={})),function(e){e[e.Standard=0]="Standard",e[e.Edu=1]="Edu",e[e.Class=2]="Class",e[e.Plc=3]="Plc",e[e.Staff=4]="Staff"}(n||(n={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}(i||(i={})),function(e){e.Large="large",e.Medium="medium",e.Small="small"}(t||(t={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(r||(r={}));const m={errorCode:e.NOT_SUPPORTED_ON_PLATFORM},d={majorVersion:1,minorVersion:5},u={adaptiveCardSchemaVersion:{majorVersion:1,minorVersion:5}},l=new Error("Invalid input count: Must supply a valid image count (limit of 10)."),c=new Error("Invalid response: Received more images than the specified max limit in the response.");export{r as ChannelType,t as DialogDimension,s as FrameContexts,o as HostClientType,a as HostName,t as TaskModuleDimension,n as TeamType,i as UserTeamRole,l as errorInvalidCount,c as errorInvalidResponse,m as errorNotSupportedOnPlatform,d as minAdaptiveCardVersion,u as teamsMinAdaptiveCardVersion};

@@ -1,1 +0,1 @@

import{sendAndHandleStatusAndReasonWithDefaultError as e,sendMessageToParent as t,sendAndUnwrap as n,sendAndHandleStatusAndReason as r,sendAndHandleSdkError as i,Communication as s,sendMessageEventToChild as o}from"../internal/communication.js";import{registerHandlerHelper as a,registerHandler as u}from"../internal/handlers.js";import{ensureInitialized as c}from"../internal/internalAPIs.js";import{getApiVersionTag as p}from"../internal/telemetry.js";import{isNullOrUndefined as g}from"../internal/typeCheckUtilities.js";import{createTeamsAppLink as f}from"../internal/utils.js";import{prefetchOriginsFromCDN as l}from"../internal/validOrigins.js";import{AppId as d}from"./appId.js";import{appInitializeHelper as m}from"./app.js";import{FrameContexts as v,errorNotSupportedOnPlatform as h}from"./constants.js";import{runtime as w}from"./runtime.js";const S="v2";function k(t,n){return new Promise((r=>{if(c(w,v.content,v.sidePanel,v.settings,v.remove,v.task,v.stage,v.meetingStage),!N.isSupported())throw h;r(e(t,"navigateCrossDomain","Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.",n))}))}function b(t){return new Promise((n=>{if(c(w),!N.backStack.isSupported())throw h;n(e(t,"navigateBack","Back navigation is not supported in the current client or context."))}))}function T(t,n){return new Promise((r=>{if(c(w),!N.tabs.isSupported())throw h;r(e(t,"navigateToTab","Invalid internalTabInstanceId and/or channelId were/was provided",n))}))}function F(e,n){if(c(w),!N.isSupported())throw h;t(e,"returnFocus",[n])}function y(e,t){return new Promise((r=>{if(c(w),!N.tabs.isSupported())throw h;r(n(e,"getTabInstances",t))}))}function P(e,t){return new Promise((r=>{if(c(w),!N.tabs.isSupported())throw h;r(n(e,"getMruTabInstances",t))}))}function H(e,n){if(c(w,v.content,v.sidePanel,v.meetingStage),!N.isSupported())throw h;t(e,"shareDeepLink",[n.subPageId,n.subPageLabel,n.subPageWebUrl])}function B(e,n){if(c(w,v.content),!N.isSupported())throw h;t(e,"setFrameContext",[n])}function C(e,n){if(c(w,v.settings,v.remove),!N.config.isSupported())throw h;t(e,"settings.setValidityState",[n])}function L(e){return new Promise((t=>{if(c(w,v.content,v.settings,v.remove,v.sidePanel),!N.isSupported())throw h;t(n(e,"settings.getSettings"))}))}function I(e,t){return new Promise((n=>{if(c(w,v.content,v.settings,v.sidePanel),!N.config.isSupported())throw h;n(r(e,"settings.setSettings",t))}))}var N;function E(e){return e.appId instanceof d}function j(e){return Object.assign(Object.assign({},e),{appId:new d(e.appId),webUrl:e.webUrl?new URL(e.webUrl):void 0})}function x(e){return Object.assign(Object.assign({},e),{appId:e.appId.toString(),webUrl:e.webUrl?e.webUrl.toString():void 0})}!function(e){var n,d,F;function N(e){B(p(S,"pages.setCurrentFrame"),e)}function A(){return!(!c(w)||!w.supports.pages)}(n=e.EnterFocusType||(e.EnterFocusType={}))[n.PreviousLandmark=0]="PreviousLandmark",n[n.NextLandmark=1]="NextLandmark",n[n.Read=2]="Read",n[n.Compose=3]="Compose",(d=e.ReturnFocusType||(e.ReturnFocusType={}))[d.PreviousLandmark=0]="PreviousLandmark",d[d.NextLandmark=1]="NextLandmark",d[d.GoToActivityFeed=2]="GoToActivityFeed",e.returnFocus=function(n){const r=p(S,"pages.returnFocus");if(c(w),!e.isSupported())throw h;if(void 0===n&&t(r,"returnFocus",[!1]),"boolean"==typeof n)t(r,"returnFocus",[n]);else switch(n){case e.ReturnFocusType.PreviousLandmark:case e.ReturnFocusType.GoToActivityFeed:t(r,"returnFocus",[!1,n]);break;case e.ReturnFocusType.NextLandmark:t(r,"returnFocus",[!0,n])}},e.registerFocusEnterHandler=function(e){a(p(S,"pages.registerFocusEnterHandler"),"focusEnter",e,[],(()=>{if(!A())throw h}))},e.setCurrentFrame=N,e.initializeWithFrameContext=function(e,t,n){l(),m(p(S,"pages.initializeWithFrameContext"),n).then((()=>t&&t())),N(e)},e.getConfig=function(){return L(p(S,"pages.getConfig."))},e.navigateCrossDomain=function(e){return k(p(S,"pages.navigateCrossDomain"),e)},e.navigateToApp=function(e){return new Promise((t=>{if(c(w,v.content,v.sidePanel,v.settings,v.task,v.stage,v.meetingStage),!A())throw h;const n=p(S,"pages.navigateToApp");if(w.isLegacyTeams){const i=E(e)?e:j(e);t(r(n,"executeDeepLink",f(i)))}else{const i=E(e)?x(e):e;t(r(n,"pages.navigateToApp",i))}}))},e.shareDeepLink=function(e){return H(p(S,"pages.shareDeepLink"),e)},e.registerFullScreenHandler=function(e){a(p(S,"pages.registerFullScreenHandler"),"fullScreenChange",e,[],(()=>{if(!g(e)&&!A())throw h}))},e.isSupported=A,(F=e.tabs||(e.tabs={})).navigateToTab=function(e){return T(p(S,"pages.tabs.navigateToTab"),e)},F.getTabInstances=function(e){return y(p(S,"pages.tabs.getTabInstances"),e)},F.getMruTabInstances=function(e){return P(p(S,"pages.tabs.getMruTabInstances"),e)},F.isSupported=function(){return!(!c(w)||!w.supports.pages||!w.supports.pages.tabs)},function(e){let n,r;function i(e,r,i){!g(r)&&c(w,v.settings),i&&i(),n=r,!g(r)&&t(e,"registerHandler",["save"])}function f(e,n,i){!g(n)&&c(w,v.remove,v.settings),i&&i(),r=n,!g(n)&&t(e,"registerHandler",["remove"])}function l(e){const t=new d(e);n?n(t):s.childWindow?o("settings.save",[e]):t.notifySuccess()}e.initialize=function(){u(p(S,"pages.config.registerSettingsSaveHandler"),"settings.save",l,!1),u(p(S,"pages.config.registerSettingsRemoveHandler"),"settings.remove",m,!1)},e.setValidityState=function(e){return C(p(S,"pages.config.setValidityState"),e)},e.setConfig=function(e){return I(p(S,"pages.config.setConfig"),e)},e.registerOnSaveHandler=function(e){i(p(S,"pages.config.registerOnSaveHandler"),e,(()=>{if(!g(e)&&!b())throw h}))},e.registerOnSaveHandlerHelper=i,e.registerOnRemoveHandler=function(e){f(p(S,"pages.config.registerOnRemoveHandler"),e,(()=>{if(!g(e)&&!b())throw h}))},e.registerOnRemoveHandlerHelper=f,e.registerChangeConfigHandler=function(e){a(p(S,"pages.config.registerChangeConfigHandler"),"changeSettings",e,[v.content],(()=>{if(!b())throw h}))};class d{constructor(e){this.notified=!1,this.result=e||{}}notifySuccess(){this.ensureNotNotified(),t(p(S,"pages.saveEvent.notifySuccess"),"settings.save.success"),this.notified=!0}notifyFailure(e){this.ensureNotNotified(),t(p(S,"pages.saveEvent.notifyFailure"),"settings.save.failure",[e]),this.notified=!0}ensureNotNotified(){if(this.notified)throw new Error("The SaveEvent may only notify success or failure once.")}}function m(){const e=new k;r?r(e):s.childWindow?o("settings.remove",[]):e.notifySuccess()}class k{constructor(){this.notified=!1}notifySuccess(){this.ensureNotNotified(),t(p(S,"pages.removeEvent.notifySuccess"),"settings.remove.success"),this.notified=!0}notifyFailure(e){this.ensureNotNotified(),t(p(S,"pages.removeEvent.notifyFailure"),"settings.remove.failure",[e]),this.notified=!0}ensureNotNotified(){if(this.notified)throw new Error("The removeEventType may only notify success or failure once.")}}function b(){return!(!c(w)||!w.supports.pages)&&!!w.supports.pages.config}e.isSupported=b}(e.config||(e.config={})),function(e){let n;function r(){return b(p(S,"pages.backStack.navigateBack"))}function i(e,r,i){!g(r)&&c(w),i&&i(),n=r,!g(r)&&t(e,"registerHandler",["backButton"])}function a(){n&&n()||(s.childWindow?o("backButtonPress",[]):r())}function f(){return!(!c(w)||!w.supports.pages)&&!!w.supports.pages.backStack}e._initialize=function(){u(p(S,"pages.backStack.registerBackButtonPressHandler"),"backButtonPress",a,!1)},e.navigateBack=r,e.registerBackButtonHandler=function(e){i(p(S,"pages.backStack.registerBackButtonHandler"),e,(()=>{if(!g(e)&&!f())throw h}))},e.registerBackButtonHandlerHelper=i,e.isSupported=f}(e.backStack||(e.backStack={})),function(e){function n(){return!(!c(w)||!w.supports.pages)&&!!w.supports.pages.fullTrust}e.enterFullscreen=function(){if(c(w,v.content),!n())throw h;t(p(S,"pages.fullTrust.enterFullscreen"),"enterFullscreen",[])},e.exitFullscreen=function(){if(c(w,v.content),!n())throw h;t(p(S,"pages.fullTrust.exitFullscreen"),"exitFullscreen",[])},e.isSupported=n}(e.fullTrust||(e.fullTrust={})),function(e){function t(){return!(!c(w)||!w.supports.pages)&&!!w.supports.pages.appButton}e.onClick=function(e){a(p(S,"pages.appButton.onClick"),"appButtonClick",e,[v.content],(()=>{if(!t())throw h}))},e.onHoverEnter=function(e){a(p(S,"pages.appButton.onHoverEnter"),"appButtonHoverEnter",e,[v.content],(()=>{if(!t())throw h}))},e.onHoverLeave=function(e){a(p(S,"pages.appButton.onHoverLeave"),"appButtonHoverLeave",e,[v.content],(()=>{if(!t())throw h}))},e.isSupported=t}(e.appButton||(e.appButton={})),function(e){function t(){return!(!c(w)||!w.supports.pages)&&!!w.supports.pages.currentApp}e.navigateTo=function(e){return new Promise((n=>{if(c(w,v.content,v.sidePanel,v.settings,v.task,v.stage,v.meetingStage),!t())throw h;n(i(p(S,"pages.currentApp.navigateTo"),"pages.currentApp.navigateTo",e))}))},e.navigateToDefaultPage=function(){return new Promise((e=>{if(c(w,v.content,v.sidePanel,v.settings,v.task,v.stage,v.meetingStage),!t())throw h;e(i(p(S,"pages.currentApp.navigateToDefaultPage"),"pages.currentApp.navigateToDefaultPage"))}))},e.isSupported=t}(e.currentApp||(e.currentApp={}))}(N||(N={}));export{b as backStackNavigateBackHelper,I as configSetConfigHelper,C as configSetValidityStateHelper,x as convertAppNavigationParametersToNavigateToAppParams,j as convertNavigateToAppParamsToAppNavigationParameters,L as getConfigHelper,P as getMruTabInstancesHelper,y as getTabInstancesHelper,E as isAppNavigationParametersObject,k as navigateCrossDomainHelper,N as pages,F as returnFocusHelper,B as setCurrentFrameHelper,H as shareDeepLinkHelper,T as tabsNavigateToTabHelper};
import{appInitializeHelper as e}from"../internal/appHelpers.js";import{sendAndHandleStatusAndReasonWithDefaultError as t,sendMessageToParent as n,sendAndUnwrap as r,sendAndHandleStatusAndReason as i,Communication as s,sendMessageEventToChild as o,sendAndHandleSdkError as a}from"../internal/communication.js";import{registerHandlerHelper as u,registerHandler as c}from"../internal/handlers.js";import{ensureInitialized as p}from"../internal/internalAPIs.js";import{getApiVersionTag as g}from"../internal/telemetry.js";import{isNullOrUndefined as f}from"../internal/typeCheckUtilities.js";import{createTeamsAppLink as l}from"../internal/utils.js";import{prefetchOriginsFromCDN as d}from"../internal/validOrigins.js";import{AppId as m}from"./appId.js";import{FrameContexts as v,errorNotSupportedOnPlatform as h}from"./constants.js";import{runtime as w}from"./runtime.js";const S="v2";function k(e,n){return new Promise((r=>{if(p(w,v.content,v.sidePanel,v.settings,v.remove,v.task,v.stage,v.meetingStage),!N.isSupported())throw h;r(t(e,"navigateCrossDomain","Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.",n))}))}function b(e){return new Promise((n=>{if(p(w),!N.backStack.isSupported())throw h;n(t(e,"navigateBack","Back navigation is not supported in the current client or context."))}))}function T(e,n){return new Promise((r=>{if(p(w),!N.tabs.isSupported())throw h;r(t(e,"navigateToTab","Invalid internalTabInstanceId and/or channelId were/was provided",n))}))}function F(e,t){if(p(w),!N.isSupported())throw h;n(e,"returnFocus",[t])}function y(e,t){return new Promise((n=>{if(p(w),!N.tabs.isSupported())throw h;n(r(e,"getTabInstances",t))}))}function P(e,t){return new Promise((n=>{if(p(w),!N.tabs.isSupported())throw h;n(r(e,"getMruTabInstances",t))}))}function H(e,t){if(p(w,v.content,v.sidePanel,v.meetingStage),!N.isSupported())throw h;n(e,"shareDeepLink",[t.subPageId,t.subPageLabel,t.subPageWebUrl])}function B(e,t){if(p(w,v.content),!N.isSupported())throw h;n(e,"setFrameContext",[t])}function C(e,t){if(p(w,v.settings,v.remove),!N.config.isSupported())throw h;n(e,"settings.setValidityState",[t])}function L(e){return new Promise((t=>{if(p(w,v.content,v.settings,v.remove,v.sidePanel),!N.isSupported())throw h;t(r(e,"settings.getSettings"))}))}function I(e,t){return new Promise((n=>{if(p(w,v.content,v.settings,v.sidePanel),!N.config.isSupported())throw h;n(i(e,"settings.setSettings",t))}))}var N;function E(e){return e.appId instanceof m}function j(e){return Object.assign(Object.assign({},e),{appId:new m(e.appId),webUrl:e.webUrl?new URL(e.webUrl):void 0})}function x(e){return Object.assign(Object.assign({},e),{appId:e.appId.toString(),webUrl:e.webUrl?e.webUrl.toString():void 0})}!function(t){var r,m,F;function N(e){B(g(S,"pages.setCurrentFrame"),e)}function A(){return!(!p(w)||!w.supports.pages)}(r=t.EnterFocusType||(t.EnterFocusType={}))[r.PreviousLandmark=0]="PreviousLandmark",r[r.NextLandmark=1]="NextLandmark",r[r.Read=2]="Read",r[r.Compose=3]="Compose",(m=t.ReturnFocusType||(t.ReturnFocusType={}))[m.PreviousLandmark=0]="PreviousLandmark",m[m.NextLandmark=1]="NextLandmark",m[m.GoToActivityFeed=2]="GoToActivityFeed",t.returnFocus=function(e){const r=g(S,"pages.returnFocus");if(p(w),!t.isSupported())throw h;if(void 0===e&&n(r,"returnFocus",[!1]),"boolean"==typeof e)n(r,"returnFocus",[e]);else switch(e){case t.ReturnFocusType.PreviousLandmark:case t.ReturnFocusType.GoToActivityFeed:n(r,"returnFocus",[!1,e]);break;case t.ReturnFocusType.NextLandmark:n(r,"returnFocus",[!0,e])}},t.registerFocusEnterHandler=function(e){u(g(S,"pages.registerFocusEnterHandler"),"focusEnter",e,[],(()=>{if(!A())throw h}))},t.setCurrentFrame=N,t.initializeWithFrameContext=function(t,n,r){d(),e(g(S,"pages.initializeWithFrameContext"),r).then((()=>n&&n())),N(t)},t.getConfig=function(){return L(g(S,"pages.getConfig."))},t.navigateCrossDomain=function(e){return k(g(S,"pages.navigateCrossDomain"),e)},t.navigateToApp=function(e){return new Promise((t=>{if(p(w,v.content,v.sidePanel,v.settings,v.task,v.stage,v.meetingStage),!A())throw h;const n=g(S,"pages.navigateToApp");if(w.isLegacyTeams){const r=E(e)?e:j(e);t(i(n,"executeDeepLink",l(r)))}else{const r=E(e)?x(e):e;t(i(n,"pages.navigateToApp",r))}}))},t.shareDeepLink=function(e){return H(g(S,"pages.shareDeepLink"),e)},t.registerFullScreenHandler=function(e){u(g(S,"pages.registerFullScreenHandler"),"fullScreenChange",e,[],(()=>{if(!f(e)&&!A())throw h}))},t.isSupported=A,(F=t.tabs||(t.tabs={})).navigateToTab=function(e){return T(g(S,"pages.tabs.navigateToTab"),e)},F.getTabInstances=function(e){return y(g(S,"pages.tabs.getTabInstances"),e)},F.getMruTabInstances=function(e){return P(g(S,"pages.tabs.getMruTabInstances"),e)},F.isSupported=function(){return!(!p(w)||!w.supports.pages||!w.supports.pages.tabs)},function(e){let t,r;function i(e,r,i){!f(r)&&p(w,v.settings),i&&i(),t=r,!f(r)&&n(e,"registerHandler",["save"])}function a(e,t,i){!f(t)&&p(w,v.remove,v.settings),i&&i(),r=t,!f(t)&&n(e,"registerHandler",["remove"])}function l(e){const n=new d(e);t?t(n):s.childWindow?o("settings.save",[e]):n.notifySuccess()}e.initialize=function(){c(g(S,"pages.config.registerSettingsSaveHandler"),"settings.save",l,!1),c(g(S,"pages.config.registerSettingsRemoveHandler"),"settings.remove",m,!1)},e.setValidityState=function(e){return C(g(S,"pages.config.setValidityState"),e)},e.setConfig=function(e){return I(g(S,"pages.config.setConfig"),e)},e.registerOnSaveHandler=function(e){i(g(S,"pages.config.registerOnSaveHandler"),e,(()=>{if(!f(e)&&!b())throw h}))},e.registerOnSaveHandlerHelper=i,e.registerOnRemoveHandler=function(e){a(g(S,"pages.config.registerOnRemoveHandler"),e,(()=>{if(!f(e)&&!b())throw h}))},e.registerOnRemoveHandlerHelper=a,e.registerChangeConfigHandler=function(e){u(g(S,"pages.config.registerChangeConfigHandler"),"changeSettings",e,[v.content],(()=>{if(!b())throw h}))};class d{constructor(e){this.notified=!1,this.result=e||{}}notifySuccess(){this.ensureNotNotified(),n(g(S,"pages.saveEvent.notifySuccess"),"settings.save.success"),this.notified=!0}notifyFailure(e){this.ensureNotNotified(),n(g(S,"pages.saveEvent.notifyFailure"),"settings.save.failure",[e]),this.notified=!0}ensureNotNotified(){if(this.notified)throw new Error("The SaveEvent may only notify success or failure once.")}}function m(){const e=new k;r?r(e):s.childWindow?o("settings.remove",[]):e.notifySuccess()}class k{constructor(){this.notified=!1}notifySuccess(){this.ensureNotNotified(),n(g(S,"pages.removeEvent.notifySuccess"),"settings.remove.success"),this.notified=!0}notifyFailure(e){this.ensureNotNotified(),n(g(S,"pages.removeEvent.notifyFailure"),"settings.remove.failure",[e]),this.notified=!0}ensureNotNotified(){if(this.notified)throw new Error("The removeEventType may only notify success or failure once.")}}function b(){return!(!p(w)||!w.supports.pages)&&!!w.supports.pages.config}e.isSupported=b}(t.config||(t.config={})),function(e){let t;function r(){return b(g(S,"pages.backStack.navigateBack"))}function i(e,r,i){!f(r)&&p(w),i&&i(),t=r,!f(r)&&n(e,"registerHandler",["backButton"])}function a(){t&&t()||(s.childWindow?o("backButtonPress",[]):r())}function u(){return!(!p(w)||!w.supports.pages)&&!!w.supports.pages.backStack}e._initialize=function(){c(g(S,"pages.backStack.registerBackButtonPressHandler"),"backButtonPress",a,!1)},e.navigateBack=r,e.registerBackButtonHandler=function(e){i(g(S,"pages.backStack.registerBackButtonHandler"),e,(()=>{if(!f(e)&&!u())throw h}))},e.registerBackButtonHandlerHelper=i,e.isSupported=u}(t.backStack||(t.backStack={})),function(e){function t(){return!(!p(w)||!w.supports.pages)&&!!w.supports.pages.fullTrust}e.enterFullscreen=function(){if(p(w,v.content),!t())throw h;n(g(S,"pages.fullTrust.enterFullscreen"),"enterFullscreen",[])},e.exitFullscreen=function(){if(p(w,v.content),!t())throw h;n(g(S,"pages.fullTrust.exitFullscreen"),"exitFullscreen",[])},e.isSupported=t}(t.fullTrust||(t.fullTrust={})),function(e){function t(){return!(!p(w)||!w.supports.pages)&&!!w.supports.pages.appButton}e.onClick=function(e){u(g(S,"pages.appButton.onClick"),"appButtonClick",e,[v.content],(()=>{if(!t())throw h}))},e.onHoverEnter=function(e){u(g(S,"pages.appButton.onHoverEnter"),"appButtonHoverEnter",e,[v.content],(()=>{if(!t())throw h}))},e.onHoverLeave=function(e){u(g(S,"pages.appButton.onHoverLeave"),"appButtonHoverLeave",e,[v.content],(()=>{if(!t())throw h}))},e.isSupported=t}(t.appButton||(t.appButton={})),function(e){function t(){return!(!p(w)||!w.supports.pages)&&!!w.supports.pages.currentApp}e.navigateTo=function(e){return new Promise((n=>{if(p(w,v.content,v.sidePanel,v.settings,v.task,v.stage,v.meetingStage),!t())throw h;n(a(g(S,"pages.currentApp.navigateTo"),"pages.currentApp.navigateTo",e))}))},e.navigateToDefaultPage=function(){return new Promise((e=>{if(p(w,v.content,v.sidePanel,v.settings,v.task,v.stage,v.meetingStage),!t())throw h;e(a(g(S,"pages.currentApp.navigateToDefaultPage"),"pages.currentApp.navigateToDefaultPage"))}))},e.isSupported=t}(t.currentApp||(t.currentApp={}))}(N||(N={}));export{b as backStackNavigateBackHelper,I as configSetConfigHelper,C as configSetValidityStateHelper,x as convertAppNavigationParametersToNavigateToAppParams,j as convertNavigateToAppParamsToAppNavigationParameters,L as getConfigHelper,P as getMruTabInstancesHelper,y as getTabInstancesHelper,E as isAppNavigationParametersObject,k as navigateCrossDomainHelper,N as pages,F as returnFocusHelper,B as setCurrentFrameHelper,H as shareDeepLinkHelper,T as tabsNavigateToTabHelper};

@@ -1,1 +0,1 @@

import{sendMessageToParent as e}from"../internal/communication.js";import{GlobalVars as t}from"../internal/globalVars.js";import{registerHandlerHelper as n}from"../internal/handlers.js";import{ensureInitializeCalled as r,ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{getGenericOnCompleteHandler as a}from"../internal/utils.js";import{appInitializeHelper as s,registerOnThemeChangeHandlerHelper as l,openLinkHelper as c}from"./app.js";import{FrameContexts as u}from"./constants.js";import{pages as f,getTabInstancesHelper as m,getMruTabInstancesHelper as p,shareDeepLinkHelper as g,setCurrentFrameHelper as d}from"./pages.js";import{runtime as H}from"./runtime.js";import{teamsCore as b}from"./teamsAPIs.js";const h="v1";function C(e,t){s(i(h,"initialize"),t).then((()=>{e&&e()}))}function B(){b.enablePrintCapability()}function j(){b.print()}function x(n){r(),e(i(h,"getContext"),"getContext",(e=>{e.frameContext||(e.frameContext=t.frameContext),n(e)}))}function k(e){l(i(h,"registerOnThemeChangeHandlerHelper"),e)}function L(e){n(i(h,"registerFullScreenHandler"),"fullScreenChange",e,[])}function v(e){n(i(h,"registerAppButtonClickHandler"),"appButtonClick",e,[u.content])}function E(e){n(i(h,"registerAppButtonHoverEnterHandler"),"appButtonHoverEnter",e,[u.content])}function P(e){n(i(h,"registerAppButtonHoverLeaveHandler"),"appButtonHoverLeave",e,[u.content])}function I(e){f.backStack.registerBackButtonHandlerHelper(i(h,"registerBackButtonHandler"),e)}function S(e){b.registerOnLoadHandlerHelper(i(h,"registerOnLoadHandler"),e)}function y(e){b.registerBeforeUnloadHandlerHelper(i(h,"registerBeforeUnloadHandler"),e)}function A(e){n(i(h,"registerFocusEnterHandler"),"focusEnter",e,[])}function F(e){n(i(h,"registerChangeSettingsHandler"),"changeSettings",e,[u.content])}function U(e,t){o(H),m(i(h,"getTabInstances"),t).then((t=>{e(t)}))}function O(e,t){o(H),p(i(h,"getMruTabInstances"),t).then((t=>{e(t)}))}function T(e){g(i(h,"shareDeepLink"),{subPageId:e.subEntityId,subPageLabel:e.subEntityLabel,subPageWebUrl:e.subEntityWebUrl})}function W(e,t){o(H,u.content,u.sidePanel,u.settings,u.task,u.stage,u.meetingStage);const n=null!=t?t:a();c(i(h,"executeDeepLink"),e).then((()=>{n(!0)})).catch((e=>{n(!1,e.message)}))}function z(e){d(i(h,"setFrameContext"),e)}function D(e,t,n){s(i(h,"initializeWithFrameContext"),n).then((()=>t&&t())),d(i(h,"setFrameContext"),e)}export{B as enablePrintCapability,W as executeDeepLink,x as getContext,O as getMruTabInstances,U as getTabInstances,C as initialize,D as initializeWithFrameContext,j as print,v as registerAppButtonClickHandler,E as registerAppButtonHoverEnterHandler,P as registerAppButtonHoverLeaveHandler,I as registerBackButtonHandler,y as registerBeforeUnloadHandler,F as registerChangeSettingsHandler,A as registerFocusEnterHandler,L as registerFullScreenHandler,S as registerOnLoadHandler,k as registerOnThemeChangeHandler,z as setFrameContext,T as shareDeepLink};
import{appInitializeHelper as e,registerOnThemeChangeHandlerHelper as t,openLinkHelper as n}from"../internal/appHelpers.js";import{sendMessageToParent as r}from"../internal/communication.js";import{GlobalVars as o}from"../internal/globalVars.js";import{registerHandlerHelper as i}from"../internal/handlers.js";import{ensureInitializeCalled as a,ensureInitialized as s}from"../internal/internalAPIs.js";import{getApiVersionTag as l}from"../internal/telemetry.js";import{getGenericOnCompleteHandler as c}from"../internal/utils.js";import{FrameContexts as u}from"./constants.js";import{pages as f,getTabInstancesHelper as m,getMruTabInstancesHelper as p,shareDeepLinkHelper as g,setCurrentFrameHelper as H}from"./pages.js";import{runtime as d}from"./runtime.js";import{teamsCore as b}from"./teamsAPIs.js";const h="v1";function C(t,n){e(l(h,"initialize"),n).then((()=>{t&&t()}))}function B(){b.enablePrintCapability()}function j(){b.print()}function x(e){a(),r(l(h,"getContext"),"getContext",(t=>{t.frameContext||(t.frameContext=o.frameContext),e(t)}))}function k(e){t(l(h,"registerOnThemeChangeHandlerHelper"),e)}function L(e){i(l(h,"registerFullScreenHandler"),"fullScreenChange",e,[])}function v(e){i(l(h,"registerAppButtonClickHandler"),"appButtonClick",e,[u.content])}function E(e){i(l(h,"registerAppButtonHoverEnterHandler"),"appButtonHoverEnter",e,[u.content])}function P(e){i(l(h,"registerAppButtonHoverLeaveHandler"),"appButtonHoverLeave",e,[u.content])}function I(e){f.backStack.registerBackButtonHandlerHelper(l(h,"registerBackButtonHandler"),e)}function S(e){b.registerOnLoadHandlerHelper(l(h,"registerOnLoadHandler"),e)}function y(e){b.registerBeforeUnloadHandlerHelper(l(h,"registerBeforeUnloadHandler"),e)}function A(e){i(l(h,"registerFocusEnterHandler"),"focusEnter",e,[])}function F(e){i(l(h,"registerChangeSettingsHandler"),"changeSettings",e,[u.content])}function U(e,t){s(d),m(l(h,"getTabInstances"),t).then((t=>{e(t)}))}function O(e,t){s(d),p(l(h,"getMruTabInstances"),t).then((t=>{e(t)}))}function T(e){g(l(h,"shareDeepLink"),{subPageId:e.subEntityId,subPageLabel:e.subEntityLabel,subPageWebUrl:e.subEntityWebUrl})}function W(e,t){s(d,u.content,u.sidePanel,u.settings,u.task,u.stage,u.meetingStage);const r=null!=t?t:c();n(l(h,"executeDeepLink"),e).then((()=>{r(!0)})).catch((e=>{r(!1,e.message)}))}function z(e){H(l(h,"setFrameContext"),e)}function D(t,n,r){e(l(h,"initializeWithFrameContext"),r).then((()=>n&&n())),H(l(h,"setFrameContext"),t)}export{B as enablePrintCapability,W as executeDeepLink,x as getContext,O as getMruTabInstances,U as getTabInstances,C as initialize,D as initializeWithFrameContext,j as print,v as registerAppButtonClickHandler,E as registerAppButtonHoverEnterHandler,P as registerAppButtonHoverLeaveHandler,I as registerBackButtonHandler,y as registerBeforeUnloadHandler,F as registerChangeSettingsHandler,A as registerFocusEnterHandler,L as registerFullScreenHandler,S as registerOnLoadHandler,k as registerOnThemeChangeHandler,z as setFrameContext,T as shareDeepLink};

@@ -1,1 +0,1 @@

import{ensureInitialized as e}from"../internal/internalAPIs.js";import{getApiVersionTag as t}from"../internal/telemetry.js";import{getGenericOnCompleteHandler as n}from"../internal/utils.js";import{FrameContexts as s}from"./constants.js";import{configSetValidityStateHelper as i,getConfigHelper as r,configSetConfigHelper as o,pages as a}from"./pages.js";import{runtime as g}from"./runtime.js";const l="v1";var m;!function(m){m.setValidityState=function(e){i(t(l,"settings.setValidityState"),e)},m.getSettings=function(n){e(g,s.content,s.settings,s.remove,s.sidePanel),r(t(l,"settings.getSettings")).then((e=>{n(e)}))},m.setSettings=function(i,r){e(g,s.content,s.settings,s.sidePanel);const a=null!=r?r:n();o(t(l,"settings.setSettings"),i).then((()=>{a(!0)})).catch((e=>{a(!1,e.message)}))},m.registerOnSaveHandler=function(e){a.config.registerOnSaveHandlerHelper(t(l,"settings.registerOnSaveHandler"),e)},m.registerOnRemoveHandler=function(e){a.config.registerOnRemoveHandlerHelper(t(l,"settings.registerOnRemoveHandler"),e)}}(m||(m={}));export{m as settings};
import{ensureInitialized as t}from"../internal/internalAPIs.js";import{getApiVersionTag as e}from"../internal/telemetry.js";import{getGenericOnCompleteHandler as n}from"../internal/utils.js";import{FrameContexts as s}from"./constants.js";import{configSetValidityStateHelper as i,getConfigHelper as r,configSetConfigHelper as o,pages as a}from"./pages.js";import{runtime as g}from"./runtime.js";const m="v1";function l(t){i(e(m,"settings.setValidityState"),t)}function c(n){t(g,s.content,s.settings,s.remove,s.sidePanel),r(e(m,"settings.getSettings")).then((t=>{n(t)}))}function f(i,r){t(g,s.content,s.settings,s.sidePanel);const a=null!=r?r:n();o(e(m,"settings.setSettings"),i).then((()=>{a(!0)})).catch((t=>{a(!1,t.message)}))}function p(t){a.config.registerOnSaveHandlerHelper(e(m,"settings.registerOnSaveHandler"),t)}function u(t){a.config.registerOnRemoveHandlerHelper(e(m,"settings.registerOnRemoveHandler"),t)}export{c as getSettings,u as registerOnRemoveHandler,p as registerOnSaveHandler,f as setSettings,l as setValidityState};

@@ -1,1 +0,1 @@

import{__rest as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParent as i}from"../internal/communication.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as r}from"../internal/telemetry.js";import{ChildAppWindow as e}from"./appWindow.js";import{FrameContexts as n,TaskModuleDimension as l}from"./constants.js";import{botUrlOpenHelper as a,urlOpenHelper as s,updateResizeHelper as d,urlSubmitHelper as u}from"./dialog.js";import{runtime as m}from"./runtime.js";const h="v1";var c;!function(c){function f(t){return t.height=t.height?t.height:l.Small,t.width=t.width?t.width:l.Small,t}c.startTask=function(t,d){const u=r(h,"tasks.startTask"),c=d?t=>{var i,o;return d(null!==(i=t.err)&&void 0!==i?i:"",null!==(o=t.result)&&void 0!==o?o:"")}:void 0;return void 0===t.card&&void 0===t.url||t.card?(o(m,n.content,n.sidePanel,n.meetingStage),i(u,"tasks.startTask",[t],d)):void 0!==t.completionBotId?a(u,function(t){if(void 0===t.url||void 0===t.completionBotId)throw new Error(`Both url ${t.url} and completionBotId ${t.completionBotId} are required for bot url dialog. At least one is undefined.`);const i={url:t.url,size:{height:t.height?t.height:l.Small,width:t.width?t.width:l.Small},title:t.title,fallbackUrl:t.fallbackUrl,completionBotId:t.completionBotId};return i}(t),c):s(u,function(t){if(void 0===t.url)throw new Error("url property of taskInfo object can't be undefined");const i={url:t.url,size:{height:t.height?t.height:l.Small,width:t.width?t.width:l.Small},title:t.title,fallbackUrl:t.fallbackUrl};return i}(t),c),new e},c.updateTask=function(i){i=f(i);const o=t(i,["width","height"]);if(Object.keys(o).length)throw new Error("resize requires a TaskInfo argument containing only width and height");d(r(h,"tasks.updateTask"),i)},c.submitTask=function(t,i){u(r(h,"tasks.submitTask"),t,i)},c.getDefaultSizeIfNotProvided=f}(c||(c={}));export{c as tasks};
import{__rest as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParent as i}from"../internal/communication.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as r}from"../internal/telemetry.js";import{ChildAppWindow as e}from"./appWindow.js";import{FrameContexts as n,DialogDimension as l}from"./constants.js";import{botUrlOpenHelper as a,urlOpenHelper as s,updateResizeHelper as d,urlSubmitHelper as u}from"./dialog.js";import{runtime as m}from"./runtime.js";const h="v1";var c;!function(c){function f(t){return t.height=t.height?t.height:l.Small,t.width=t.width?t.width:l.Small,t}c.startTask=function(t,d){const u=r(h,"tasks.startTask"),c=d?t=>{var i,o;return d(null!==(i=t.err)&&void 0!==i?i:"",null!==(o=t.result)&&void 0!==o?o:"")}:void 0;return void 0===t.card&&void 0===t.url||t.card?(o(m,n.content,n.sidePanel,n.meetingStage),i(u,"tasks.startTask",[t],d)):void 0!==t.completionBotId?a(u,function(t){if(void 0===t.url||void 0===t.completionBotId)throw new Error(`Both url ${t.url} and completionBotId ${t.completionBotId} are required for bot url dialog. At least one is undefined.`);const i={url:t.url,size:{height:t.height?t.height:l.Small,width:t.width?t.width:l.Small},title:t.title,fallbackUrl:t.fallbackUrl,completionBotId:t.completionBotId};return i}(t),c):s(u,function(t){if(void 0===t.url)throw new Error("url property of taskInfo object can't be undefined");const i={url:t.url,size:{height:t.height?t.height:l.Small,width:t.width?t.width:l.Small},title:t.title,fallbackUrl:t.fallbackUrl};return i}(t),c),new e},c.updateTask=function(i){i=f(i);const o=t(i,["width","height"]);if(Object.keys(o).length)throw new Error("resize requires a TaskInfo argument containing only width and height");d(r(h,"tasks.updateTask"),i)},c.submitTask=function(t,i){u(r(h,"tasks.submitTask"),t,i)},c.getDefaultSizeIfNotProvided=f}(c||(c={}));export{c as tasks};

@@ -1,1 +0,1 @@

const o="2.30.0";export{o as version};
const t="2.31.0-beta.0";export{t as version};

@@ -1,1 +0,1 @@

import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendAndUnwrap as e}from"../internal/communication.js";import{GlobalVars as o}from"../internal/globalVars.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{app as n}from"./app.js";import{errorNotSupportedOnPlatform as s,HostClientType as l,HostName as p}from"./constants.js";import{runtime as a}from"./runtime.js";var m;!function(m){function d(){return r(a)&&void 0!==a.supports.webStorage}m.isWebStorageClearedOnUserLogOut=function(){return t(this,void 0,void 0,(function*(){if(r(a),!d())throw s;return!(!a.isLegacyTeams||o.hostClientType!==l.android&&o.hostClientType!==l.ios&&o.hostClientType!==l.ipados||(yield function(){return t(this,void 0,void 0,(function*(){return null===u&&(u=(yield n.getContext()).app.host.name),u}))}())!==p.teams)||(yield e(i("v2","webStorage.isWebStorageClearedOnUserLogOut"),"webStorage.isWebStorageClearedOnUserLogOut"))}))},m.isSupported=d}(m||(m={}));let u=null;export{m as webStorage};
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendAndUnwrap as e}from"../internal/communication.js";import{GlobalVars as o}from"../internal/globalVars.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{getContext as n}from"./app.js";import{errorNotSupportedOnPlatform as s,HostClientType as l,HostName as p}from"./constants.js";import{runtime as a}from"./runtime.js";var m;!function(m){function d(){return r(a)&&void 0!==a.supports.webStorage}m.isWebStorageClearedOnUserLogOut=function(){return t(this,void 0,void 0,(function*(){if(r(a),!d())throw s;return!(!a.isLegacyTeams||o.hostClientType!==l.android&&o.hostClientType!==l.ios&&o.hostClientType!==l.ipados||(yield function(){return t(this,void 0,void 0,(function*(){return null===u&&(u=(yield n()).app.host.name),u}))}())!==p.teams)||(yield e(i("v2","webStorage.isWebStorageClearedOnUserLogOut"),"webStorage.isWebStorageClearedOnUserLogOut"))}))},m.isSupported=d}(m||(m={}));let u=null;export{m as webStorage};

@@ -1,51 +0,1 @@

{
"name": "@microsoft/teams-js",
"author": "Microsoft Teams",
"version": "2.30.0",
"description": "Microsoft Client SDK for building app for Microsoft hosts",
"repository": {
"directory": "packages/teams-js",
"type": "git",
"url": "https://github.com/OfficeDev/microsoft-teams-library-js"
},
"main": "./dist/umd/MicrosoftTeams.min.js",
"typings": "./dist/umd/MicrosoftTeams.d.ts",
"module": "./dist/esm/packages/teams-js/src/index.js",
"type": "module",
"scripts": {
"build": "pnpm clean && pnpm lint && pnpm build-rollup && pnpm build-webpack && pnpm docs:validate",
"build-rollup": "pnpm clean && rollup -c",
"build-webpack": "webpack",
"clean": "rimraf ./dist",
"docs": "pnpm typedoc",
"docs:validate": "pnpm typedoc --emit none",
"lint": "pnpm eslint ./src ./test --max-warnings 0 --fix --ext .ts",
"prettier": "prettier --write '**/*.{ts,js,css,html}'",
"test": "jest",
"test:verbose": "pnpm test -- --verbose false --silent false"
},
"dependencies": {
"base64-js": "^1.3.1",
"debug": "^4.3.3"
},
"devDependencies": {
"@types/debug": "^4.1.7"
},
"sideEffects": [
"src/internal/communication.ts",
"src/internal/nestedAppAuthUtils.ts",
"src/internal/utils.ts",
"src/internal/videoEffectsUtils.ts",
"src/private/constants.ts",
"src/private/interfaces.ts",
"src/public/constants.ts",
"src/public/handlers.ts",
"src/public/interfaces.ts"
],
"license": "MIT",
"files": [
"dist/**",
"LICENSE",
"README.md"
]
}
{"name":"@microsoft/teams-js","author":"Microsoft Teams","version":"2.31.0-beta.0","description":"Microsoft Client SDK for building app for Microsoft hosts","repository":{"directory":"packages/teams-js","type":"git","url":"https://github.com/OfficeDev/microsoft-teams-library-js"},"main":"./dist/umd/MicrosoftTeams.min.js","typings":"./dist/umd/MicrosoftTeams.d.ts","module":"./dist/esm/packages/teams-js/src/index.js","type":"module","scripts":{"build":"pnpm clean && pnpm lint && pnpm build-rollup && pnpm build-webpack && pnpm docs:validate","build-rollup":"pnpm clean && rollup -c","build-webpack":"webpack","clean":"rimraf ./dist","docs":"pnpm typedoc","docs:validate":"pnpm typedoc --emit none","lint":"pnpm eslint ./src ./test --max-warnings 0 --fix --ext .ts","prettier":"prettier --write '**/*.{ts,js,css,html}'","test":"jest","test:verbose":"pnpm test -- --verbose false --silent false"},"dependencies":{"base64-js":"^1.3.1","debug":"^4.3.3"},"devDependencies":{"@types/debug":"^4.1.7"},"sideEffects":["src/internal/communication.ts","src/internal/nestedAppAuthUtils.ts","src/internal/utils.ts","src/internal/videoEffectsUtils.ts","src/private/constants.ts","src/private/interfaces.ts","src/public/constants.ts","src/public/handlers.ts","src/public/interfaces.ts"],"license":"MIT","files":["dist/**","LICENSE","README.md"]}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc