@microsoft/teams-js 2.48.0 → 2.49.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +4 -4
  2. package/dist/esm/_virtual/_polyfill-node.buffer.js +1 -1
  3. package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js +1 -0
  4. package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js +1 -1
  5. package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/common.js +1 -1
  6. package/dist/esm/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js +1 -1
  7. package/dist/esm/packages/teams-js/dts/internal/constants.d.ts +0 -8
  8. package/dist/esm/packages/teams-js/dts/internal/urlPattern.d.ts +47 -0
  9. package/dist/esm/packages/teams-js/dts/public/app/app.d.ts +14 -1
  10. package/dist/esm/packages/teams-js/dts/public/stageView/stageView.d.ts +1 -1
  11. package/dist/esm/packages/teams-js/src/artifactsForCDN/validDomains.json.js +1 -1
  12. package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -1
  13. package/dist/esm/packages/teams-js/src/internal/childCommunication.js +1 -1
  14. package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
  15. package/dist/esm/packages/teams-js/src/internal/constants.js +1 -1
  16. package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -1
  17. package/dist/esm/packages/teams-js/src/internal/dialogHelpers.js +1 -1
  18. package/dist/esm/packages/teams-js/src/internal/handlers.js +1 -1
  19. package/dist/esm/packages/teams-js/src/internal/idValidation.js +1 -1
  20. package/dist/esm/packages/teams-js/src/internal/internalAPIs.js +1 -1
  21. package/dist/esm/packages/teams-js/src/internal/marketplaceUtils.js +1 -1
  22. package/dist/esm/packages/teams-js/src/internal/mediaUtil.js +1 -1
  23. package/dist/esm/packages/teams-js/src/internal/messageObjects.js +1 -1
  24. package/dist/esm/packages/teams-js/src/internal/pagesHelpers.js +1 -1
  25. package/dist/esm/packages/teams-js/src/internal/urlPattern.js +1 -0
  26. package/dist/esm/packages/teams-js/src/internal/utils.js +1 -1
  27. package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -1
  28. package/dist/esm/packages/teams-js/src/internal/videoEffectsUtils.js +1 -1
  29. package/dist/esm/packages/teams-js/src/internal/videoFrameTick.js +1 -1
  30. package/dist/esm/packages/teams-js/src/internal/videoPerformanceMonitor.js +1 -1
  31. package/dist/esm/packages/teams-js/src/internal/webStorageHelpers.js +1 -1
  32. package/dist/esm/packages/teams-js/src/private/conversations.js +1 -1
  33. package/dist/esm/packages/teams-js/src/private/copilot/customTelemetry.js +1 -1
  34. package/dist/esm/packages/teams-js/src/private/copilot/eligibility.js +1 -1
  35. package/dist/esm/packages/teams-js/src/private/copilot/sidePanel.js +1 -1
  36. package/dist/esm/packages/teams-js/src/private/copilot/view.js +1 -1
  37. package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
  38. package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
  39. package/dist/esm/packages/teams-js/src/private/externalAppCardActions.js +1 -1
  40. package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForCEA.js +1 -1
  41. package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForDA.js +1 -1
  42. package/dist/esm/packages/teams-js/src/private/externalAppCommands.js +1 -1
  43. package/dist/esm/packages/teams-js/src/private/hostEntity/tab.js +1 -1
  44. package/dist/esm/packages/teams-js/src/private/logs.js +1 -1
  45. package/dist/esm/packages/teams-js/src/private/meetingRoom.js +1 -1
  46. package/dist/esm/packages/teams-js/src/private/messageChannels/dataLayer.js +1 -1
  47. package/dist/esm/packages/teams-js/src/private/messageChannels/telemetry.js +1 -1
  48. package/dist/esm/packages/teams-js/src/private/privateAPIs.js +1 -1
  49. package/dist/esm/packages/teams-js/src/private/store.js +1 -1
  50. package/dist/esm/packages/teams-js/src/private/teams/fullTrust/fullTrust.js +1 -1
  51. package/dist/esm/packages/teams-js/src/private/teams/fullTrust/joinedTeams.js +1 -1
  52. package/dist/esm/packages/teams-js/src/private/videoEffectsEx.js +1 -1
  53. package/dist/esm/packages/teams-js/src/private/widgetHosting/widgetHosting.js +1 -1
  54. package/dist/esm/packages/teams-js/src/public/app/app.js +1 -1
  55. package/dist/esm/packages/teams-js/src/public/appInstallDialog.js +1 -1
  56. package/dist/esm/packages/teams-js/src/public/authentication.js +1 -1
  57. package/dist/esm/packages/teams-js/src/public/barCode.js +1 -1
  58. package/dist/esm/packages/teams-js/src/public/calendar.js +1 -1
  59. package/dist/esm/packages/teams-js/src/public/call.js +1 -1
  60. package/dist/esm/packages/teams-js/src/public/chat.js +1 -1
  61. package/dist/esm/packages/teams-js/src/public/clipboard.js +1 -1
  62. package/dist/esm/packages/teams-js/src/public/dialog/adaptiveCard/adaptiveCard.js +1 -1
  63. package/dist/esm/packages/teams-js/src/public/dialog/adaptiveCard/bot.js +1 -1
  64. package/dist/esm/packages/teams-js/src/public/dialog/url/parentCommunication.js +1 -1
  65. package/dist/esm/packages/teams-js/src/public/geoLocation/geoLocation.js +1 -1
  66. package/dist/esm/packages/teams-js/src/public/liveShareHost.js +1 -1
  67. package/dist/esm/packages/teams-js/src/public/mail/handoff.js +1 -1
  68. package/dist/esm/packages/teams-js/src/public/mail/mail.js +1 -1
  69. package/dist/esm/packages/teams-js/src/public/media.js +1 -1
  70. package/dist/esm/packages/teams-js/src/public/meeting/meeting.js +1 -1
  71. package/dist/esm/packages/teams-js/src/public/monetization.js +1 -1
  72. package/dist/esm/packages/teams-js/src/public/navigation.js +1 -1
  73. package/dist/esm/packages/teams-js/src/public/nestedAppAuth.js +1 -1
  74. package/dist/esm/packages/teams-js/src/public/pages/appButton.js +1 -1
  75. package/dist/esm/packages/teams-js/src/public/pages/backStack.js +1 -1
  76. package/dist/esm/packages/teams-js/src/public/pages/config.js +1 -1
  77. package/dist/esm/packages/teams-js/src/public/pages/currentApp.js +1 -1
  78. package/dist/esm/packages/teams-js/src/public/pages/pages.js +1 -1
  79. package/dist/esm/packages/teams-js/src/public/people.js +1 -1
  80. package/dist/esm/packages/teams-js/src/public/profile.js +1 -1
  81. package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
  82. package/dist/esm/packages/teams-js/src/public/runtime.js +1 -1
  83. package/dist/esm/packages/teams-js/src/public/search.js +1 -1
  84. package/dist/esm/packages/teams-js/src/public/settings.js +1 -1
  85. package/dist/esm/packages/teams-js/src/public/sharing/history.js +1 -1
  86. package/dist/esm/packages/teams-js/src/public/sharing/sharing.js +1 -1
  87. package/dist/esm/packages/teams-js/src/public/shortcutRelay.js +1 -1
  88. package/dist/esm/packages/teams-js/src/public/stageView/self.js +1 -1
  89. package/dist/esm/packages/teams-js/src/public/stageView/stageView.js +1 -1
  90. package/dist/esm/packages/teams-js/src/public/tasks.js +1 -1
  91. package/dist/esm/packages/teams-js/src/public/teamsAPIs.js +1 -1
  92. package/dist/esm/packages/teams-js/src/public/thirdPartyCloudStorage.js +1 -1
  93. package/dist/esm/packages/teams-js/src/public/uuidObject.js +1 -1
  94. package/dist/esm/packages/teams-js/src/public/version.js +1 -1
  95. package/dist/esm/packages/teams-js/src/public/videoEffects.js +1 -1
  96. package/dist/esm/packages/teams-js/src/public/visualMedia/image.js +1 -1
  97. package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
  98. package/dist/umd/MicrosoftTeams.js +669 -595
  99. package/dist/umd/MicrosoftTeams.js.map +1 -1
  100. package/dist/umd/MicrosoftTeams.min.js +1 -1
  101. package/dist/umd/MicrosoftTeams.min.js.map +1 -1
  102. package/package.json +1 -53
  103. package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js +0 -1
package/README.md CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
24
24
 
25
25
  ### Production
26
26
 
27
- You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.48.0/js/MicrosoftTeams.min.js) or point your package manager at them.
27
+ You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.48.1/js/MicrosoftTeams.min.js) or point your package manager at them.
28
28
 
29
29
  ## Usage
30
30
 
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
45
45
  ```html
46
46
  <!-- Microsoft Teams JavaScript API (via CDN) -->
47
47
  <script
48
- src="https://res.cdn.office.net/teams-js/2.48.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-/Wkorl2FOOvi9PzFSf8fmiTS8SFTMOlR3mKqmOI4Rc6tra6JqJvmlssRiYqDOMjD"
48
+ src="https://res.cdn.office.net/teams-js/2.48.1/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-opiKcSoAwE9QEI+cc408L9oI0NWev5vi/CLyCCX57M7GuRKrXlC4nOxJ9z6cBoXS"
50
50
  crossorigin="anonymous"
51
51
  ></script>
52
52
 
53
53
  <!-- Microsoft Teams JavaScript API (via npm) -->
54
- <script src="node_modules/@microsoft/teams-js@2.48.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.48.1/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -1 +1 @@
1
- import t from"./_polyfill-node.global.js";var r=[],e=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0;n<64;++n)r[n]=t[n],e[t.charCodeAt(n)]=n;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63}function u(t,e,n){for(var i,o,u=[],f=e;f<n;f+=3)i=(t[f]<<16)+(t[f+1]<<8)+t[f+2],u.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return u.join("")}function f(t){var e;i||o();for(var n=t.length,f=n%3,s="",h=[],a=16383,c=0,l=n-f;c<l;c+=a)h.push(u(t,c,c+a>l?l:c+a));return 1===f?(e=t[n-1],s+=r[e>>2],s+=r[e<<4&63],s+="=="):2===f&&(e=(t[n-2]<<8)+t[n-1],s+=r[e>>10],s+=r[e>>4&63],s+=r[e<<2&63],s+="="),h.push(s),h.join("")}function s(t,r,e,n,i){var o,u,f=8*i-n-1,s=(1<<f)-1,h=s>>1,a=-7,c=e?i-1:0,l=e?-1:1,p=t[r+c];for(c+=l,o=p&(1<<-a)-1,p>>=-a,a+=f;a>0;o=256*o+t[r+c],c+=l,a-=8);for(u=o&(1<<-a)-1,o>>=-a,a+=n;a>0;u=256*u+t[r+c],c+=l,a-=8);if(0===o)o=1-h;else{if(o===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),o-=h}return(p?-1:1)*u*Math.pow(2,o-n)}function h(t,r,e,n,i,o){var u,f,s,h=8*o-i-1,a=(1<<h)-1,c=a>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(f=isNaN(r)?1:0,u=a):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+c>=1?l/s:l*Math.pow(2,1-c))*s>=2&&(u++,s/=2),u+c>=a?(f=0,u=a):u+c>=1?(f=(r*s-1)*Math.pow(2,i),u+=c):(f=r*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[e+p]=255&f,p+=g,f/=256,i-=8);for(u=u<<i|f,h+=i;h>0;t[e+p]=255&u,p+=g,u/=256,h-=8);t[e+p-g]|=128*y}var a={}.toString,c=Array.isArray||function(t){return"[object Array]"==a.call(t)},l=50;function p(){return y.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(t,r){if(p()<r)throw new RangeError("Invalid typed array length");return y.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=y.prototype:(null===t&&(t=new y(r)),t.length=r),t}function y(t,r,e){if(!(y.TYPED_ARRAY_SUPPORT||this instanceof y))return new y(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return v(this,t)}return w(this,t,r,e)}function w(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);y.TYPED_ARRAY_SUPPORT?(t=r).__proto__=y.prototype:t=E(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!y.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|b(r,e);t=g(t,n);var i=t.write(r,e);i!==n&&(t=t.slice(0,i));return t}(t,r,e):function(t,r){if(R(r)){var e=0|A(r.length);return 0===(t=g(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?g(t,0):E(t,r);if("Buffer"===r.type&&c(r.data))return E(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function d(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function v(t,r){if(d(r),t=g(t,r<0?0:0|A(r)),!y.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function E(t,r){var e=r.length<0?0:0|A(r.length);t=g(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function A(t){if(t>=p())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p().toString(16)+" bytes");return 0|t}function R(t){return!(null==t||!t._isBuffer)}function b(t,r){if(R(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return Q(t).length;default:if(n)return K(t).length;r=(""+r).toLowerCase(),n=!0}}function m(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,r,e);case"utf8":case"utf-8":return L(this,r,e);case"ascii":return D(this,r,e);case"latin1":case"binary":return x(this,r,e);case"base64":return O(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function P(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=y.from(r,n)),R(r))return 0===r.length?-1:T(t,r,e,n,i);if("number"==typeof r)return r&=255,y.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):T(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function T(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function U(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function B(t,r,e,n){return W(K(r,t.length-e),t,e,n)}function S(t,r,e,n){return W(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function Y(t,r,e,n){return S(t,r,e,n)}function I(t,r,e,n){return W(Q(r),t,e,n)}function C(t,r,e,n){return W(function(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function O(t,r,e){return 0===r&&e===t.length?f(t):f(t.slice(r,e))}function L(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return function(t){var r=t.length;if(r<=M)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=M));return e}(n)}y.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT,p(),y.poolSize=8192,y._augment=function(t){return t.__proto__=y.prototype,t},y.from=function(t,r,e){return w(null,t,r,e)},y.TYPED_ARRAY_SUPPORT&&(y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&y[Symbol.species]),y.alloc=function(t,r,e){return function(t,r,e,n){return d(r),r<=0?g(t,r):void 0!==e?"string"==typeof n?g(t,r).fill(e,n):g(t,r).fill(e):g(t,r)}(null,t,r,e)},y.allocUnsafe=function(t){return v(null,t)},y.allocUnsafeSlow=function(t){return v(null,t)},y.isBuffer=X,y.compare=function(t,r){if(!R(t)||!R(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},y.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.concat=function(t,r){if(!c(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return y.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=y.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var o=t[e];if(!R(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},y.byteLength=b,y.prototype._isBuffer=!0,y.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)_(this,r,r+1);return this},y.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)_(this,r,r+3),_(this,r+1,r+2);return this},y.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)_(this,r,r+7),_(this,r+1,r+6),_(this,r+2,r+5),_(this,r+3,r+4);return this},y.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?L(this,0,t):m.apply(this,arguments)},y.prototype.equals=function(t){if(!R(t))throw new TypeError("Argument must be a Buffer");return this===t||0===y.compare(this,t)},y.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},y.prototype.compare=function(t,r,e,n,i){if(!R(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),f=Math.min(o,u),s=this.slice(n,i),h=t.slice(r,e),a=0;a<f;++a)if(s[a]!==h[a]){o=s[a],u=h[a];break}return o<u?-1:u<o?1:0},y.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},y.prototype.indexOf=function(t,r,e){return P(this,t,r,e,!0)},y.prototype.lastIndexOf=function(t,r,e){return P(this,t,r,e,!1)},y.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return U(this,t,r,e);case"utf8":case"utf-8":return B(this,t,r,e);case"ascii":return S(this,t,r,e);case"latin1":case"binary":return Y(this,t,r,e);case"base64":return I(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function x(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function k(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=H(t[o]);return i}function N(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function z(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function F(t,r,e,n,i,o){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function j(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function V(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function q(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function J(t,r,e,n,i){return i||q(t,0,e,4),h(t,r,e,n,23,4),e+4}function Z(t,r,e,n,i){return i||q(t,0,e,8),h(t,r,e,n,52,8),e+8}y.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),y.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=y.prototype;else{var i=r-t;e=new y(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},y.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},y.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},y.prototype.readUInt8=function(t,r){return r||z(t,1,this.length),this[t]},y.prototype.readUInt16LE=function(t,r){return r||z(t,2,this.length),this[t]|this[t+1]<<8},y.prototype.readUInt16BE=function(t,r){return r||z(t,2,this.length),this[t]<<8|this[t+1]},y.prototype.readUInt32LE=function(t,r){return r||z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},y.prototype.readUInt32BE=function(t,r){return r||z(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},y.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},y.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},y.prototype.readInt8=function(t,r){return r||z(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},y.prototype.readInt16LE=function(t,r){r||z(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},y.prototype.readInt16BE=function(t,r){r||z(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},y.prototype.readInt32LE=function(t,r){return r||z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},y.prototype.readInt32BE=function(t,r){return r||z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},y.prototype.readFloatLE=function(t,r){return r||z(t,4,this.length),s(this,t,!0,23,4)},y.prototype.readFloatBE=function(t,r){return r||z(t,4,this.length),s(this,t,!1,23,4)},y.prototype.readDoubleLE=function(t,r){return r||z(t,8,this.length),s(this,t,!0,52,8)},y.prototype.readDoubleBE=function(t,r){return r||z(t,8,this.length),s(this,t,!1,52,8)},y.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||F(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},y.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||F(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},y.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,1,255,0),y.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},y.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):j(this,t,r,!0),r+2},y.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):j(this,t,r,!1),r+2},y.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):V(this,t,r,!0),r+4},y.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):V(this,t,r,!1),r+4},y.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);F(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u|0)-f&255;return r+e},y.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);F(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u|0)-f&255;return r+e},y.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,1,127,-128),y.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},y.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):j(this,t,r,!0),r+2},y.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):j(this,t,r,!1),r+2},y.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,2147483647,-2147483648),y.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):V(this,t,r,!0),r+4},y.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):V(this,t,r,!1),r+4},y.prototype.writeFloatLE=function(t,r,e){return J(this,t,r,!0,e)},y.prototype.writeFloatBE=function(t,r,e){return J(this,t,r,!1,e)},y.prototype.writeDoubleLE=function(t,r,e){return Z(this,t,r,!0,e)},y.prototype.writeDoubleBE=function(t,r,e){return Z(this,t,r,!1,e)},y.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!y.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},y.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!y.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=R(t)?t:K(new y(t,n).toString()),f=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%f]}return this};var G=/[^+\/0-9A-Za-z-_]/g;function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function K(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function Q(t){return function(t){var r,u,f,s,h,a;i||o();var c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");h="="===t[c-2]?2:"="===t[c-1]?1:0,a=new n(3*c/4-h),f=h>0?c-4:c;var l=0;for(r=0,u=0;r<f;r+=4,u+=3)s=e[t.charCodeAt(r)]<<18|e[t.charCodeAt(r+1)]<<12|e[t.charCodeAt(r+2)]<<6|e[t.charCodeAt(r+3)],a[l++]=s>>16&255,a[l++]=s>>8&255,a[l++]=255&s;return 2===h?(s=e[t.charCodeAt(r)]<<2|e[t.charCodeAt(r+1)]>>4,a[l++]=255&s):1===h&&(s=e[t.charCodeAt(r)]<<10|e[t.charCodeAt(r+1)]<<4|e[t.charCodeAt(r+2)]>>2,a[l++]=s>>8&255,a[l++]=255&s),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function X(t){return null!=t&&(!!t._isBuffer||$(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&$(t.slice(0,0))}(t))}function $(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}export{y as Buffer,l as INSPECT_MAX_BYTES,X as isBuffer};
1
+ import t from"./_polyfill-node.global.js";var r=[],e=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0;n<64;++n)r[n]=t[n],e[t.charCodeAt(n)]=n;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63}function u(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function f(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(u(n));return i.join("")}function s(t){var e;i||o();for(var n=t.length,u=n%3,s="",h=[],a=16383,c=0,l=n-u;c<l;c+=a)h.push(f(t,c,c+a>l?l:c+a));return 1===u?(e=t[n-1],s+=r[e>>2],s+=r[e<<4&63],s+="=="):2===u&&(e=(t[n-2]<<8)+t[n-1],s+=r[e>>10],s+=r[e>>4&63],s+=r[e<<2&63],s+="="),h.push(s),h.join("")}function h(t,r,e,n,i){var o,u,f=8*i-n-1,s=(1<<f)-1,h=s>>1,a=-7,c=e?i-1:0,l=e?-1:1,p=t[r+c];for(c+=l,o=p&(1<<-a)-1,p>>=-a,a+=f;a>0;o=256*o+t[r+c],c+=l,a-=8);for(u=o&(1<<-a)-1,o>>=-a,a+=n;a>0;u=256*u+t[r+c],c+=l,a-=8);if(0===o)o=1-h;else{if(o===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),o-=h}return(p?-1:1)*u*Math.pow(2,o-n)}function a(t,r,e,n,i,o){var u,f,s,h=8*o-i-1,a=(1<<h)-1,c=a>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(f=isNaN(r)?1:0,u=a):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+c>=1?l/s:l*Math.pow(2,1-c))*s>=2&&(u++,s/=2),u+c>=a?(f=0,u=a):u+c>=1?(f=(r*s-1)*Math.pow(2,i),u+=c):(f=r*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[e+p]=255&f,p+=g,f/=256,i-=8);for(u=u<<i|f,h+=i;h>0;t[e+p]=255&u,p+=g,u/=256,h-=8);t[e+p-g]|=128*y}var c={}.toString,l=Array.isArray||function(t){return"[object Array]"==c.call(t)},p=50;function g(){return w.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(t,r){if(g()<r)throw new RangeError("Invalid typed array length");return w.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=w.prototype:(null===t&&(t=new w(r)),t.length=r),t}function w(t,r,e){if(!(w.TYPED_ARRAY_SUPPORT||this instanceof w))return new w(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return E(this,t)}return d(this,t,r,e)}function d(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);w.TYPED_ARRAY_SUPPORT?(t=r).__proto__=w.prototype:t=A(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!w.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|m(r,e);t=y(t,n);var i=t.write(r,e);i!==n&&(t=t.slice(0,i));return t}(t,r,e):function(t,r){if(b(r)){var e=0|R(r.length);return 0===(t=y(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?y(t,0):A(t,r);if("Buffer"===r.type&&l(r.data))return A(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function v(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function E(t,r){if(v(r),t=y(t,r<0?0:0|R(r)),!w.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function A(t,r){var e=r.length<0?0:0|R(r.length);t=y(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function R(t){if(t>=g())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+g().toString(16)+" bytes");return 0|t}function b(t){return!(null==t||!t._isBuffer)}function m(t,r){if(b(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return W(t).length;default:if(n)return Q(t).length;r=(""+r).toLowerCase(),n=!0}}function _(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,r,e);case"utf8":case"utf-8":return M(this,r,e);case"ascii":return x(this,r,e);case"latin1":case"binary":return k(this,r,e);case"base64":return L(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function P(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function T(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=w.from(r,n)),b(r))return 0===r.length?-1:U(t,r,e,n,i);if("number"==typeof r)return r&=255,w.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):U(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function U(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function B(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function S(t,r,e,n){return X(Q(r,t.length-e),t,e,n)}function Y(t,r,e,n){return X(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function I(t,r,e,n){return Y(t,r,e,n)}function C(t,r,e,n){return X(W(r),t,e,n)}function O(t,r,e,n){return X(function(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function L(t,r,e){return 0===r&&e===t.length?s(t):s(t.slice(r,e))}function M(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return function(t){var r=t.length;if(r<=D)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=D));return e}(n)}w.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT,g(),w.poolSize=8192,w._augment=function(t){return t.__proto__=w.prototype,t},w.from=function(t,r,e){return d(null,t,r,e)},w.TYPED_ARRAY_SUPPORT&&(w.prototype.__proto__=Uint8Array.prototype,w.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&w[Symbol.species]),w.alloc=function(t,r,e){return function(t,r,e,n){return v(r),r<=0?y(t,r):void 0!==e?"string"==typeof n?y(t,r).fill(e,n):y(t,r).fill(e):y(t,r)}(null,t,r,e)},w.allocUnsafe=function(t){return E(null,t)},w.allocUnsafeSlow=function(t){return E(null,t)},w.isBuffer=$,w.compare=function(t,r){if(!b(t)||!b(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},w.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},w.concat=function(t,r){if(!l(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return w.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=w.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var o=t[e];if(!b(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},w.byteLength=m,w.prototype._isBuffer=!0,w.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)P(this,r,r+1);return this},w.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)P(this,r,r+3),P(this,r+1,r+2);return this},w.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)P(this,r,r+7),P(this,r+1,r+6),P(this,r+2,r+5),P(this,r+3,r+4);return this},w.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?M(this,0,t):_.apply(this,arguments)},w.prototype.equals=function(t){if(!b(t))throw new TypeError("Argument must be a Buffer");return this===t||0===w.compare(this,t)},w.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},w.prototype.compare=function(t,r,e,n,i){if(!b(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),f=Math.min(o,u),s=this.slice(n,i),h=t.slice(r,e),a=0;a<f;++a)if(s[a]!==h[a]){o=s[a],u=h[a];break}return o<u?-1:u<o?1:0},w.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},w.prototype.indexOf=function(t,r,e){return T(this,t,r,e,!0)},w.prototype.lastIndexOf=function(t,r,e){return T(this,t,r,e,!1)},w.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return B(this,t,r,e);case"utf8":case"utf-8":return S(this,t,r,e);case"ascii":return Y(this,t,r,e);case"latin1":case"binary":return I(this,t,r,e);case"base64":return C(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function x(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function k(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function N(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=K(t[o]);return i}function z(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function F(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function j(t,r,e,n,i,o){if(!b(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function V(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function q(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function J(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Z(t,r,e,n,i){return i||J(t,0,e,4),a(t,r,e,n,23,4),e+4}function G(t,r,e,n,i){return i||J(t,0,e,8),a(t,r,e,n,52,8),e+8}w.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),w.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=w.prototype;else{var i=r-t;e=new w(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},w.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},w.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},w.prototype.readUInt8=function(t,r){return r||F(t,1,this.length),this[t]},w.prototype.readUInt16LE=function(t,r){return r||F(t,2,this.length),this[t]|this[t+1]<<8},w.prototype.readUInt16BE=function(t,r){return r||F(t,2,this.length),this[t]<<8|this[t+1]},w.prototype.readUInt32LE=function(t,r){return r||F(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},w.prototype.readUInt32BE=function(t,r){return r||F(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},w.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},w.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},w.prototype.readInt8=function(t,r){return r||F(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},w.prototype.readInt16LE=function(t,r){r||F(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},w.prototype.readInt16BE=function(t,r){r||F(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},w.prototype.readInt32LE=function(t,r){return r||F(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},w.prototype.readInt32BE=function(t,r){return r||F(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},w.prototype.readFloatLE=function(t,r){return r||F(t,4,this.length),h(this,t,!0,23,4)},w.prototype.readFloatBE=function(t,r){return r||F(t,4,this.length),h(this,t,!1,23,4)},w.prototype.readDoubleLE=function(t,r){return r||F(t,8,this.length),h(this,t,!0,52,8)},w.prototype.readDoubleBE=function(t,r){return r||F(t,8,this.length),h(this,t,!1,52,8)},w.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},w.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},w.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,255,0),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},w.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):V(this,t,r,!0),r+2},w.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):V(this,t,r,!1),r+2},w.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):q(this,t,r,!0),r+4},w.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):q(this,t,r,!1),r+4},w.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);j(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u|0)-f&255;return r+e},w.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);j(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u|0)-f&255;return r+e},w.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,127,-128),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},w.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):V(this,t,r,!0),r+2},w.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):V(this,t,r,!1),r+2},w.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),w.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):q(this,t,r,!0),r+4},w.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),w.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):q(this,t,r,!1),r+4},w.prototype.writeFloatLE=function(t,r,e){return Z(this,t,r,!0,e)},w.prototype.writeFloatBE=function(t,r,e){return Z(this,t,r,!1,e)},w.prototype.writeDoubleLE=function(t,r,e){return G(this,t,r,!0,e)},w.prototype.writeDoubleBE=function(t,r,e){return G(this,t,r,!1,e)},w.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!w.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},w.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!w.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=b(t)?t:Q(new w(t,n).toString()),f=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%f]}return this};var H=/[^+\/0-9A-Za-z-_]/g;function K(t){return t<16?"0"+t.toString(16):t.toString(16)}function Q(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function W(t){return function(t){var r,u,f,s,h,a;i||o();var c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");h="="===t[c-2]?2:"="===t[c-1]?1:0,a=new n(3*c/4-h),f=h>0?c-4:c;var l=0;for(r=0,u=0;r<f;r+=4,u+=3)s=e[t.charCodeAt(r)]<<18|e[t.charCodeAt(r+1)]<<12|e[t.charCodeAt(r+2)]<<6|e[t.charCodeAt(r+3)],a[l++]=s>>16&255,a[l++]=s>>8&255,a[l++]=255&s;return 2===h?(s=e[t.charCodeAt(r)]<<2|e[t.charCodeAt(r+1)]>>4,a[l++]=255&s):1===h&&(s=e[t.charCodeAt(r)]<<10|e[t.charCodeAt(r+1)]<<4|e[t.charCodeAt(r+2)]>>2,a[l++]=s>>8&255,a[l++]=255&s),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function X(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function $(t){return null!=t&&(!!t._isBuffer||tt(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&tt(t.slice(0,0))}(t))}function tt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}export{w as Buffer,p as INSPECT_MAX_BYTES,$ as isBuffer};
@@ -0,0 +1 @@
1
+ function t(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}function n(t,n,e,r){return new(e||(e=Promise))(function(o,c){function p(t){try{u(r.next(t))}catch(t){c(t)}}function f(t){try{u(r.throw(t))}catch(t){c(t)}}function u(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e(function(t){t(n)})).then(p,f)}u((r=r.apply(t,n||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;export{n as __awaiter,t as __rest};
@@ -1 +1 @@
1
- import{__module as e}from"../../../../../../_virtual/browser.js";import{c as o}from"./common.js";!function(e,C){C.formatArgs=function(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const C="color: "+this.color;o.splice(1,0,C,"color: inherit");let t=0,n=0;o[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(t++,"%c"===e&&(n=t))})),o.splice(n,0,C)},C.save=function(e){try{e?C.storage.setItem("debug",e):C.storage.removeItem("debug")}catch(e){}},C.load=function(){let e;try{e=C.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},C.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},C.storage=function(){try{return localStorage}catch(e){}}(),C.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),C.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],C.log=console.debug||console.log||(()=>{}),e.exports=o(C);const{formatters:t}=e.exports;t.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(e,e.exports);var C=e.exports;export{C as b};
1
+ import{__module as e}from"../../../../../../_virtual/browser.js";import{c as o}from"./common.js";!function(e,C){C.formatArgs=function(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const C="color: "+this.color;o.splice(1,0,C,"color: inherit");let t=0,n=0;o[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(t++,"%c"===e&&(n=t))}),o.splice(n,0,C)},C.save=function(e){try{e?C.storage.setItem("debug",e):C.storage.removeItem("debug")}catch(e){}},C.load=function(){let e;try{e=C.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},C.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},C.storage=function(){try{return localStorage}catch(e){}}(),C.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),C.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],C.log=console.debug||console.log||(()=>{}),e.exports=o(C);const{formatters:t}=e.exports;t.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(e,e.exports);var C=e.exports;export{C as b};
@@ -1 +1 @@
1
- import{__require as e}from"../../../../ms@2.1.2/node_modules/ms/index.js";var n=function(n){function t(e){let n,s,o,a=null;function l(...e){if(!l.enabled)return;const r=l,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,s)=>{if("%%"===n)return"%";a++;const o=t.formatters[s];if("function"==typeof o){const t=e[a];n=o.call(r,t),e.splice(a,1),a--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return l.namespace=e,l.useColors=t.useColors(),l.color=t.selectColor(e),l.extend=r,l.destroy=t.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(l),l}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(s),...t.skips.map(s).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),s=r.length;for(n=0;n<s;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=e(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(n).forEach((e=>{t[e]=n[e]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};export{n as c};
1
+ import{__require as e}from"../../../../ms@2.1.2/node_modules/ms/index.js";var n=function(n){function t(e){let n,s,o,a=null;function l(...e){if(!l.enabled)return;const r=l,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,s)=>{if("%%"===n)return"%";a++;const o=t.formatters[s];if("function"==typeof o){const t=e[a];n=o.call(r,t),e.splice(a,1),a--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return l.namespace=e,l.useColors=t.useColors(),l.color=t.selectColor(e),l.extend=r,l.destroy=t.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(l),l}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(s),...t.skips.map(s).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),s=r.length;for(n=0;n<s;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=e(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(n).forEach(e=>{t[e]=n[e]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};export{n as c};
@@ -1 +1 @@
1
- import r from"./native.js";import n from"./rng.js";import{unsafeStringify as o}from"./stringify.js";function t(t,m,i){if(r.randomUUID&&!m&&!t)return r.randomUUID();const f=(t=t||{}).random||(t.rng||n)();return f[6]=15&f[6]|64,f[8]=63&f[8]|128,o(f)}export{t as default};
1
+ import r from"./native.js";import n from"./rng.js";import{unsafeStringify as o}from"./stringify.js";function t(t,m,i){if(r.randomUUID&&!t)return r.randomUUID();const f=(t=t||{}).random||(t.rng||n)();return f[6]=15&f[6]|64,f[8]=63&f[8]|128,o(f)}export{t as default};
@@ -120,14 +120,6 @@ export declare const ORIGIN_LIST_FETCH_TIMEOUT_IN_MS: number;
120
120
  * Limited to Microsoft-internal use
121
121
  */
122
122
  export declare const validOriginsCdnEndpoint: URL;
123
- /**
124
- * @hidden
125
- * USer specified message origins should satisfy this test
126
- *
127
- * @internal
128
- * Limited to Microsoft-internal use
129
- */
130
- export declare const userOriginUrlValidationRegExp: RegExp;
131
123
  /**
132
124
  * @hidden
133
125
  * The protocol used for deep links into Teams
@@ -0,0 +1,47 @@
1
+ import { Debugger } from 'debug/src/browser';
2
+ /**
3
+ * @hidden
4
+ * @internal
5
+ * Limited to Microsoft-internal use.
6
+ *
7
+ * Implementation of URL pattern matching logic for validating origins against a list of allowed patterns.
8
+ */
9
+ export interface URLVerifier {
10
+ /**
11
+ * Checks if the given URL matches the pattern defined in the implementation.
12
+ * @param url - The URL to test against the pattern.
13
+ * @returns - True if the URL matches the pattern, false otherwise.
14
+ */
15
+ test: (url: URL) => boolean;
16
+ }
17
+ /**
18
+ * @param pattern - reference pattern
19
+ * @param host - candidate string
20
+ * @returns returns true if host matches pre-know valid pattern
21
+ *
22
+ * @example
23
+ * validateHostAgainstPattern('*.teams.microsoft.com', 'subdomain.teams.microsoft.com') returns true
24
+ * validateHostAgainstPattern('teams.microsoft.com', 'team.microsoft.com') returns false
25
+ *
26
+ * @internal
27
+ * Limited to Microsoft-internal use
28
+ */
29
+ export declare function validateHostAgainstPattern(pattern: string, host: string): boolean;
30
+ /**
31
+ * @hidden
32
+ * @internal
33
+ * Limited to Microsoft-internal use.
34
+ *
35
+ * Checks if the provided pattern is valid for checking against URLs.
36
+ * @param pattern - The pattern to validate.
37
+ * @returns - True if the pattern is valid, false otherwise.
38
+ */
39
+ export declare function isValidPatternUrl(pattern: string): boolean;
40
+ /**
41
+ * @hidden
42
+ * @internal
43
+ * Limited to Microsoft-internal use.
44
+ *
45
+ * Creates a URL verifier based on the provided pattern.
46
+ */
47
+ export declare function createURLVerifier(pattern: string, logger: Debugger): URLVerifier | undefined;
@@ -73,6 +73,11 @@ export interface IFailedRequest {
73
73
  * This property is currently unused.
74
74
  */
75
75
  message?: string;
76
+ /**
77
+ * Optional authorization header to be sent along with the failure notification.
78
+ * Currently only supported for SSR scenarios.
79
+ */
80
+ authHeader?: string;
76
81
  }
77
82
  /**
78
83
  * Represents the failure request sent during an erroneous app initialization.
@@ -482,7 +487,11 @@ export interface Context {
482
487
  */
483
488
  export type themeHandler = (theme: string) => void;
484
489
  /**
490
+ * @hidden
485
491
  * This function is passed to registerOnContextChangeHandler. It is called every time the user changes their context.
492
+ *
493
+ * @internal
494
+ * Limited to Microsoft-internal use
486
495
  */
487
496
  export type contextHandler = (context: Context) => void;
488
497
  /**
@@ -508,7 +517,7 @@ export declare function getFrameContext(): FrameContexts | undefined;
508
517
  * @param validMessageOrigins - Optionally specify a list of cross-frame message origins. This parameter is used if you know that your app
509
518
  * will be hosted on a custom domain (i.e., not a standard Microsoft 365 host like Teams, Outlook, etc.) Most apps will never need
510
519
  * to pass a value for this parameter.
511
- * Any domains passed in the array must have the https: protocol on the string otherwise they will be ignored. Example: https://www.example.com
520
+ * Any domains passed in the array must define a scheme to be able to be processed. Examples: https://www.example.com, chrome://
512
521
  * @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out
513
522
  */
514
523
  export declare function initialize(validMessageOrigins?: string[]): Promise<void>;
@@ -565,12 +574,16 @@ export declare function notifyExpectedFailure(expectedFailureRequest: IExpectedF
565
574
  */
566
575
  export declare function registerOnThemeChangeHandler(handler: themeHandler): void;
567
576
  /**
577
+ * @hidden
568
578
  * Registers a handler for content (context) changes.
569
579
  *
570
580
  * @remarks
571
581
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
572
582
  *
573
583
  * @param handler - The handler to invoke when the app's content context changes.
584
+ *
585
+ * @internal
586
+ * Limited to Microsoft-internal use
574
587
  */
575
588
  export declare function registerOnContextChangeHandler(handler: contextHandler): void;
576
589
  /**
@@ -20,7 +20,7 @@ export interface StageViewParams {
20
20
  /**
21
21
  * The chat or channel ID.
22
22
  */
23
- threadId: string;
23
+ threadId?: string;
24
24
  /**
25
25
  * The messageId identifies a particular channel meeting within the channel as specified by the threadId above. This should be used only when trying to open the stage view for a channel meeting. It will be a no-op for other scenarios
26
26
  */
@@ -1 +1 @@
1
- var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001"],c={validOrigins:o};export{c as default,o as validOrigins};
1
+ var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001","portal.officeppe.com","ignite.m365.admin.cloud.microsoft","ignite.admin.cloud.microsoft","sdf.m365.admin.cloud.microsoft","admin-sdf.microsoft.com","canary.m365.admin.cloud.microsoft","ring0.m365.admin.cloud.microsoft","portal.office365.us","portal.apps.mil","www.ohome.apps.mil","www.office365.us"],c={validOrigins:o};export{c as default,o as validOrigins};
@@ -1 +1 @@
1
- import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParent as e,sendAndHandleStatusAndReason as t,callFunctionInHostAndHandleResponse as n,initializeCommunication as o}from"./communication.js";import{errorLibraryNotInitialized as r,defaultSDKVersionForCompatCheck as s}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{registerOnThemeChangeHandler as a,registerOnContextChangeHandler as p,initializeHandlers as u}from"./handlers.js";import{ensureInitializeCalled as m,ensureInitialized as c,processAdditionalValidOrigins as f}from"./internalAPIs.js";import{getLogger as d}from"./telemetry.js";import{isNullOrUndefined as g}from"./typeCheckUtilities.js";import{inServerSideRenderingEnvironment as h,runWithTimeout as S,normalizeAgeGroupValue as j,compareSDKVersions as v}from"./utils.js";import{Messages as w}from"../public/app/app.js";import{FrameContexts as y}from"../public/constants.js";import{initialize as z}from"../public/dialog/dialog.js";import{initialize as b}from"../public/menus.js";import{runtime as P,applyRuntimeConfig as C,generateVersionBasedTeamsRuntimeConfig as x,mapTeamsVersionToSupportedCapabilities as D,versionAndPlatformAgnosticTeamsRuntimeConfig as E}from"../public/runtime.js";import{version as V}from"../public/version.js";import{SimpleTypeResponseHandler as K}from"./responseHandler.js";import{initialize as _}from"../public/pages/config.js";const k=d("app");function A(i,e){if(h()){return k.extend("initialize")("window object undefined at initialization"),Promise.resolve()}return S((()=>function(i,e){return new Promise((t=>{l.initializeCalled||(l.initializeCalled=!0,u(),l.initializePromise=o(e,i).then((({context:i,clientType:e,runtimeConfig:t,clientSupportedSDKVersion:n=s})=>{l.frameContext=i,l.hostClientType=e,l.clientSupportedSDKVersion=n;try{L("Parsing %s",t);let i=JSON.parse(t);if(L("Checking if %o is a valid runtime object",null!=i?i:"null"),!i||!i.apiVersion)throw new Error("Received runtime config is invalid");i=j(i),t&&C(i)}catch(i){if(!(i instanceof SyntaxError))throw i;try{L("Attempting to parse %s as an SDK version",t),isNaN(v(t,s))||(l.clientSupportedSDKVersion=t);let i=JSON.parse(n);if(L("givenRuntimeConfig parsed to %o",null!=i?i:"null"),!i)throw new Error("givenRuntimeConfig string was successfully parsed. However, it parsed to value of null");i=j(i),C(i)}catch(i){if(!(i instanceof SyntaxError))throw i;C(x(l.clientSupportedSDKVersion,E,D))}}l.initializeCompleted=!0})),b(),_(),z()),Array.isArray(e)&&f(e),void 0!==l.initializePromise?t(l.initializePromise):L("GlobalVars.initializePromise is unexpectedly undefined")}))}(i,e)),6e4,new Error("SDK initialization timed out."))}function F(i){e(i,w.AppLoaded,[V])}function N(i,t){e(i,w.ExpectedFailure,[t.reason,t.message])}function R(i,t){e(i,w.Failure,[t.reason,t.message])}function H(e){return i(this,void 0,void 0,(function*(){if(l.initializeCompleted)return J(e);if(!l.initializePromise)throw new Error(r);return l.initializePromise.then((()=>J(e)))}))}function J(t){return i(this,void 0,void 0,(function*(){return c(P)&&(null===(i=P.supports.app)||void 0===i?void 0:i.notifySuccessResponse)?n(w.Success,[V],new K,t).then((()=>({hasFinishedSuccessfully:!0}))):(e(t,w.Success,[V]),{hasFinishedSuccessfully:"unknown"});var i}))}const L=k.extend("initializeHelper");function O(i,e){!g(e)&&m(),a(i,e)}function T(i,e){!g(e)&&m(),p(i,e)}function G(i,e){return new Promise((n=>{c(P,y.content,y.sidePanel,y.settings,y.task,y.stage,y.meetingStage),n(t(i,"executeDeepLink",e))}))}export{A as appInitializeHelper,J as callNotifySuccessInHost,F as notifyAppLoadedHelper,N as notifyExpectedFailureHelper,R as notifyFailureHelper,H as notifySuccessHelper,G as openLinkHelper,T as registerOnContextChangeHandlerHelper,O as registerOnThemeChangeHandlerHelper};
1
+ import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendAndHandleStatusAndReason as e,sendMessageToParent as t,callFunctionInHostAndHandleResponse as n,initializeCommunication as o}from"./communication.js";import{errorLibraryNotInitialized as r,defaultSDKVersionForCompatCheck as s}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{registerOnThemeChangeHandler as a,registerOnContextChangeHandler as p,initializeHandlers as u}from"./handlers.js";import{ensureInitialized as m,ensureInitializeCalled as c,processAdditionalValidOrigins as f}from"./internalAPIs.js";import{getLogger as d}from"./telemetry.js";import{isNullOrUndefined as g}from"./typeCheckUtilities.js";import{inServerSideRenderingEnvironment as h,runWithTimeout as S,normalizeAgeGroupValue as j,compareSDKVersions as v}from"./utils.js";import{Messages as w}from"../public/app/app.js";import{FrameContexts as y}from"../public/constants.js";import{initialize as z}from"../public/dialog/dialog.js";import{initialize as b}from"../public/menus.js";import{runtime as P,applyRuntimeConfig as C,generateVersionBasedTeamsRuntimeConfig as x,mapTeamsVersionToSupportedCapabilities as D,versionAndPlatformAgnosticTeamsRuntimeConfig as E}from"../public/runtime.js";import{version as V}from"../public/version.js";import{SimpleTypeResponseHandler as K}from"./responseHandler.js";import{initialize as _}from"../public/pages/config.js";const k=d("app");function A(i,e){if(h()){return k.extend("initialize")("window object undefined at initialization"),Promise.resolve()}return S(()=>function(i,e){return new Promise(t=>{l.initializeCalled||(l.initializeCalled=!0,u(),l.initializePromise=o(e,i).then(({context:i,clientType:e,runtimeConfig:t,clientSupportedSDKVersion:n=s})=>{l.frameContext=i,l.hostClientType=e,l.clientSupportedSDKVersion=n;try{L("Parsing %s",t);let i=JSON.parse(t);if(L("Checking if %o is a valid runtime object",null!=i?i:"null"),!i||!i.apiVersion)throw new Error("Received runtime config is invalid");i=j(i),t&&C(i)}catch(i){if(!(i instanceof SyntaxError))throw i;try{L("Attempting to parse %s as an SDK version",t),isNaN(v(t,s))||(l.clientSupportedSDKVersion=t);let i=JSON.parse(n);if(L("givenRuntimeConfig parsed to %o",null!=i?i:"null"),!i)throw new Error("givenRuntimeConfig string was successfully parsed. However, it parsed to value of null");i=j(i),C(i)}catch(i){if(!(i instanceof SyntaxError))throw i;C(x(l.clientSupportedSDKVersion,E,D))}}l.initializeCompleted=!0}),b(),_(),z()),Array.isArray(e)&&f(e),void 0!==l.initializePromise?t(l.initializePromise):L("GlobalVars.initializePromise is unexpectedly undefined")})}(i,e),6e4,new Error("SDK initialization timed out."))}function F(i){t(i,w.AppLoaded,[V])}function H(i,e){t(i,w.ExpectedFailure,[e.reason,e.message])}function N(i,e){t(i,w.Failure,[e.reason,e.message,e.authHeader])}function R(e){return i(this,void 0,void 0,function*(){if(l.initializeCompleted)return J(e);if(!l.initializePromise)throw new Error(r);return l.initializePromise.then(()=>J(e))})}function J(e){return i(this,void 0,void 0,function*(){return m(P)&&(null===(i=P.supports.app)||void 0===i?void 0:i.notifySuccessResponse)?n(w.Success,[V],new K,e).then(()=>({hasFinishedSuccessfully:!0})):(t(e,w.Success,[V]),{hasFinishedSuccessfully:"unknown"});var i})}const L=k.extend("initializeHelper");function O(i,e){!g(e)&&c(),a(i,e)}function T(i,e){!g(e)&&c(),p(i,e)}function G(i,t){return new Promise(n=>{m(P,y.content,y.sidePanel,y.settings,y.task,y.stage,y.meetingStage),n(e(i,"executeDeepLink",t))})}export{A as appInitializeHelper,J as callNotifySuccessInHost,F as notifyAppLoadedHelper,H as notifyExpectedFailureHelper,N as notifyFailureHelper,R as notifySuccessHelper,G as openLinkHelper,T as registerOnContextChangeHandlerHelper,O as registerOnThemeChangeHandlerHelper};
@@ -1 +1 @@
1
- import{__awaiter as n}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{isChildProxyingEnabled as i,getCurrentFeatureFlagsState as o}from"../public/featureFlags.js";import{flushMessageQueue as s,getMessageIdsAsLogString as e}from"./communicationUtils.js";import{callHandler as r}from"./handlers.js";import{deserializeMessageRequest as t,serializeMessageResponse as d}from"./messageObjects.js";import{getLogger as a,getApiVersionTag as u}from"./telemetry.js";const c=a("childProxyingCommunication");class l{}function g(){l.window=null,l.origin=null,l.messageQueue=[]}function m(){return!!i()&&!!l.window}function f(n,o){return!!i()&&(l.window&&!l.window.closed&&n!==l.window||(l.window=n,l.origin=o),l.window&&l.window.closed?(l.window=null,l.origin=null,!1):l.window===n)}function w(i,d,a,c){return n(this,void 0,void 0,(function*(){l.window===d&&(s(l.window,l.origin,l.messageQueue,"child"),function(n,i,s){if(void 0===n.data.id||void 0===n.data.func)return;const d=t(n.data),[a,c]=r(d.func,d.args);if(a&&void 0!==c)return p("Handler called in response to message %s from child. Returning response from handler to child, action: %s.",e(d),d.func),void h(d.id,d.uuid,Array.isArray(c)?c:[c]);p("No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.",e(d),d.func),function(n,i,s){const r=i(u("v2","tasks.startTask"),n.func,n.args,!0,n.teamsJsInstanceId),t=l.origin;s(r.uuid,((...i)=>{if(!l.window)return;if(!o().disableEnforceOriginMatchForChildResponses&&t!==l.origin)return void p("Origin of child window has changed, not sending response back to child window");const s=i.pop();p("Message from parent being relayed to child, id: %s",e(n)),h(n.id,n.uuid,i,s)}))}(d,i,s)}(i,a,c))}))}l.messageQueue=[];const p=c.extend("handleIncomingMessageFromChild");function h(n,i,o,s){const r=l.window,t=function(n,i,o,s){return{id:n,uuid:i,args:o||[],isPartialResponse:s}}(n,i,o,s),a=d(t),u=l.origin;r&&u&&(p("Sending message %s to %s via postMessage, args = %o",e(a),"child",a.args),r.postMessage(a,u))}function v(n,i){const o=l.window,s=function(n,i){return{func:n,args:i||[]}}(n,i),e=l.origin;o&&e?o.postMessage(s,e):l.messageQueue.push(s)}export{w as handleIncomingMessageFromChild,v as sendMessageEventToChild,m as shouldEventBeRelayedToChild,f as shouldProcessChildMessage,g as uninitializeChildCommunication};
1
+ import{__awaiter as n}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{isChildProxyingEnabled as i,getCurrentFeatureFlagsState as o}from"../public/featureFlags.js";import{flushMessageQueue as s,getMessageIdsAsLogString as e}from"./communicationUtils.js";import{callHandler as r}from"./handlers.js";import{deserializeMessageRequest as t,serializeMessageResponse as d}from"./messageObjects.js";import{getLogger as a,getApiVersionTag as u}from"./telemetry.js";const c=a("childProxyingCommunication");class l{}function g(){l.window=null,l.origin=null,l.messageQueue=[]}function m(){return!!i()&&!!l.window}function f(n,o){return!!i()&&(l.window&&!l.window.closed&&n!==l.window||(l.window=n,l.origin=o),l.window&&l.window.closed?(l.window=null,l.origin=null,!1):l.window===n)}function w(i,d,a,c){return n(this,void 0,void 0,function*(){l.window===d&&(s(l.window,l.origin,l.messageQueue,"child"),function(n,i,s){if(void 0===n.data.id||void 0===n.data.func)return;const d=t(n.data),[a,c]=r(d.func,d.args);if(a&&void 0!==c)return p("Handler called in response to message %s from child. Returning response from handler to child, action: %s.",e(d),d.func),void h(d.id,d.uuid,Array.isArray(c)?c:[c]);p("No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.",e(d),d.func),function(n,i,s){const r=i(u("v2","tasks.startTask"),n.func,n.args,!0,n.teamsJsInstanceId),t=l.origin;s(r.uuid,(...i)=>{if(!l.window)return;if(!o().disableEnforceOriginMatchForChildResponses&&t!==l.origin)return void p("Origin of child window has changed, not sending response back to child window");const s=i.pop();p("Message from parent being relayed to child, id: %s",e(n)),h(n.id,n.uuid,i,s)})}(d,i,s)}(i,a,c))})}l.messageQueue=[];const p=c.extend("handleIncomingMessageFromChild");function h(n,i,o,s){const r=l.window,t=function(n,i,o,s){return{id:n,uuid:i,args:o||[],isPartialResponse:s}}(n,i,o,s),a=d(t),u=l.origin;r&&u&&(p("Sending message %s to %s via postMessage, args = %o",e(a),"child",a.args),r.postMessage(a,u))}function v(n,i){const o=l.window,s=function(n,i){return{func:n,args:i||[]}}(n,i),e=l.origin;o&&e?o.postMessage(s,e):l.messageQueue.push(s)}export{w as handleIncomingMessageFromChild,v as sendMessageEventToChild,m as shouldEventBeRelayedToChild,f as shouldProcessChildMessage,g as uninitializeChildCommunication};
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{isSdkError as n,ErrorCode as t}from"../public/interfaces.js";import{latestRuntimeApiVersion as o}from"../public/runtime.js";import{isSerializable as r}from"../public/serializable.interface.js";import{UUID as i}from"../public/uuidObject.js";import{version as s}from"../public/version.js";import{uninitializeChildCommunication as a,shouldProcessChildMessage as c,handleIncomingMessageFromChild as d}from"./childCommunication.js";import{getMessageIdsAsLogString as u,flushMessageQueue as l}from"./communicationUtils.js";import{GlobalVars as g}from"./globalVars.js";import{callHandler as p}from"./handlers.js";import f from"./hostToAppTelemetry.js";import{serializeMessageRequest as m,deserializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{getLogger as v,isFollowingApiVersionTagFormat as b}from"./telemetry.js";import{getCurrentTimestamp as W,ssrSafeWindow as M}from"./utils.js";import{validateOrigin as y}from"./validOrigins.js";const k=v("communication");class I{}class T{}function E(n,t){if(T.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void J("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,t=n.origin||n.originalEvent&&n.originalEvent.origin;return B(e,t).then((o=>{o?(!function(e,n){g.isFramelessWindow||I.parentWindow&&!I.parentWindow.closed&&e!==I.parentWindow||(I.parentWindow=e,I.parentOrigin=n);I.parentWindow&&I.parentWindow.closed&&(I.parentWindow=null,I.parentOrigin=null);l(I.parentWindow,I.parentOrigin,T.parentMessageQueue,"parent")}(e,t),e!==I.parentWindow?c(e,t)&&d(n,e,V,((e,n)=>T.callbacks.set(e,n))):Y(n)):J("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,t)}))}))}(n),I.currentWindow=I.currentWindow||M(),I.parentWindow=I.currentWindow.parent!==I.currentWindow.self?I.currentWindow.parent:I.currentWindow.opener,I.topWindow=I.currentWindow.top,(I.parentWindow||n)&&I.currentWindow.addEventListener("message",T.messageListener,!1),!I.parentWindow){const e=I.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));g.isFramelessWindow=!0,e.onNativeMessage=Y}try{return I.parentOrigin="*",S(t,"initialize",[s,o,n]).then((([e,n,t,o])=>(h(o,I.currentWindow,{onMessage:D,sendPostMessage:L}),{context:e,clientType:n,runtimeConfig:t,clientSupportedSDKVersion:o})))}finally{I.parentOrigin=null}}function j(){I.currentWindow&&I.currentWindow.removeEventListener("message",T.messageListener,!1),I.currentWindow=null,I.parentWindow=null,I.parentOrigin=null,T.parentMessageQueue=[],T.nextMessageId=0,T.callbacks.clear(),T.promiseCallbacks.clear(),T.portCallbacks.clear(),T.legacyMessageIdsToUuidMap={},f.clearMessages(),a()}function O(e,n,...t){return S(e,n,t).then((([e])=>e))}function R(e,n,...t){return S(e,n,t).then((([e,n])=>{if(!e)throw new Error(n)}))}function C(e,n,t,...o){return S(e,n,o).then((([e,n])=>{if(!e)throw new Error(n||t)}))}function P(e,n,...t){return S(e,n,t).then((([e,n])=>{if(e)throw e;return n}))}function S(e,n,t=void 0){if(!b(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((o=>{const r=V(e,n,t);var i;o((i=r.uuid,new Promise((e=>{T.promiseCallbacks.set(i,e)}))))}))}function x(e){return e.map((e=>r(e)?e.serialize():e))}function N(o,r,i,s,a){var c;return e(this,void 0,void 0,(function*(){const e=x(r),[d]=yield S(s,o,e);if(a&&a(d)||!a&&n(d))throw new Error(`${d.errorCode}, message: ${null!==(c=d.message)&&void 0!==c?c:"None"}`);if(i.validate(d))return i.deserialize(d);throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(d)}`)}))}function A(o,r,i,s){var a;return e(this,void 0,void 0,(function*(){const e=x(r),[c]=yield S(i,o,e);if(s&&s(c)||!s&&n(c))throw new Error(`${c.errorCode}, message: ${null!==(a=c.message)&&void 0!==a?a:"None"}`);if(void 0!==c)throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host`)}))}function U(e,n,t=void 0){if(!b(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=V(e,n,t);return r=o.uuid,new Promise(((e,n)=>{T.portCallbacks.set(r,((t,o)=>{t instanceof MessagePort?e(t):n(o&&o.length>0?o[0]:new Error("Host responded without port or error details."))}))}));var r}function $(e,n,t,o){let r;if(t instanceof Function?o=t:t instanceof Array&&(r=t),!b(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 i=V(e,n,r);o&&T.callbacks.set(i.uuid,o)}T.parentMessageQueue=[],T.topMessageQueue=[],T.nextMessageId=0,T.callbacks=new Map,T.promiseCallbacks=new Map,T.portCallbacks=new Map,T.legacyMessageIdsToUuidMap={};const z=k.extend("sendNestedAuthRequestToTopWindow");function L(e,n){const t=z,o=I.topWindow,r=function(e,n){const t=T.nextMessageId++,o=new i;return T.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),apiVersionTag:n,args:[],data:e}}(e,n);return t("Message %s information: %o",u(r),{actionName:r.func}),F(o,r)}const _=k.extend("sendRequestToTargetWindowHelper");function F(e,n){const t=_,o=function(e){return e===I.topWindow&&Z()?"top":e===I.parentWindow?"parent":null}(e),r=m(n);if(g.isFramelessWindow)I.currentWindow&&I.currentWindow.nativeInterface&&(t("Sending message %s to %s via framelessPostMessage interface",u(r),o),I.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(r)));else{const i=function(e){return e===I.topWindow&&Z()?I.topOrigin:e===I.parentWindow?I.parentOrigin:null}(e);e&&i?(t("Sending message %s to %s via postMessage",u(r),o),e.postMessage(r,i)):(t("Adding message %s to %s message queue",u(r),o),ee(e).push(n))}return n}const Q=k.extend("sendMessageToParentHelper");function V(e,n,t,o,r){const s=Q,a=I.parentWindow,c=function(e,n,t,o,r){const s=T.nextMessageId++,a=new i;T.legacyMessageIdsToUuidMap[s]=a;const c=!0===o?r:g.teamsJsInstanceId;return{id:s,uuid:a,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:t||[],apiVersionTag:e,isProxiedFromChild:null!=o&&o,teamsJsInstanceId:c}}(e,n,t,o,r);return f.storeCallbackInformation(c.uuid,{name:n,calledAt:c.timestamp}),s("Message %s information: %o",u(c),{actionName:n,args:t}),F(a,c)}const J=k.extend("processIncomingMessage");const q=k.extend("processAuthBridgeMessage");function D(e,n){var t,o;const r=q;if(!e||!e.data||"object"!=typeof e.data)return void r("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:i}=e.data,[,s]=null!=i?i:[],a=(()=>{try{return JSON.parse(s)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void r("Unrecognized data format received by app, message being ignored. Message: %o",e);const c=e.source||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.source),d=e.origin||(null===(o=null==e?void 0:e.originalEvent)||void 0===o?void 0:o.origin);c?B(c,d)?(I.topWindow&&!I.topWindow.closed&&c!==I.topWindow||(I.topWindow=c,I.topOrigin=d),I.topWindow&&I.topWindow.closed&&(I.topWindow=null,I.topOrigin=null),l(I.topWindow,I.topOrigin,T.topMessageQueue,"top"),n(s)):r("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):r("Message being ignored by app because it is coming for a target that is null")}const H=k.extend("shouldProcessIncomingMessage");function B(n,t){return e(this,void 0,void 0,(function*(){if(I.currentWindow&&n===I.currentWindow)return H("Should not process message because it is coming from the current window"),!1;if(I.currentWindow&&I.currentWindow.location&&t&&t===I.currentWindow.location.origin)return!0;{let e;try{e=new URL(t)}catch(e){return H("Message has an invalid origin of %s",t),!1}const n=yield y(e);return n||H("Message has an invalid origin of %s",t),n}}))}const K=k.extend("handleIncomingMessageFromParent");function G(e,n){if(n){const t=[...e].find((([e,t])=>e.toString()===n.toString()));if(t)return t[0]}}function X(e,n){const t=G(n,e.uuid);t&&n.delete(t),e.uuid?T.legacyMessageIdsToUuidMap={}:delete T.legacyMessageIdsToUuidMap[e.id]}function Y(e){const n=K,t=W();if("id"in e.data&&"number"==typeof e.data.id){const o=e.data,r=w(o),i=function(e){const n=K;if(!e.uuid)return T.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,t=G(T.callbacks,n);if(t)return t;const o=G(T.promiseCallbacks,n);if(o)return o;const r=G(T.portCallbacks,n);if(r)return r}n("Received message %s that failed to produce a callbackId",u(e))}(r);if(i){const o=T.callbacks.get(i);n("Received a response from parent for message %s",i.toString()),f.handlePerformanceMetrics(i,r,n,t),o&&(n("Invoking the registered callback for message %s with arguments %o",i.toString(),r.args),o.apply(null,[...r.args,r.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",i.toString()),X(r,T.callbacks)));const s=T.promiseCallbacks.get(i);s&&(n("Invoking the registered promise callback for message %s with arguments %o",i.toString(),r.args),s(r.args),n("Removing registered promise callback for message %s",i.toString()),X(r,T.promiseCallbacks));const a=T.portCallbacks.get(i);if(a){let t;n("Invoking the registered port callback for message %s with arguments %o",i.toString(),r.args),e.ports&&e.ports[0]instanceof MessagePort&&(t=e.ports[0]),a(t,r.args),n("Removing registered port callback for message %s",i.toString()),X(r,T.portCallbacks)}r.uuid&&(T.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const o=e.data;f.handleOneWayPerformanceMetrics(o,n,t),n('Received a message from parent %s, action: "%s"',u(o),o.func),p(o.func,o.args)}else n("Received an unknown message: %O",e)}function Z(){return I.topWindow!==I.parentWindow}function ee(e){return e===I.topWindow&&Z()?T.topMessageQueue:e===I.parentWindow?T.parentMessageQueue:[]}function ne(e,n){let t;t=I.currentWindow.setInterval((()=>{0===ee(e).length&&(clearInterval(t),n())}),100)}export{I as Communication,A as callFunctionInHost,N as callFunctionInHostAndHandleResponse,E as initializeCommunication,U as requestPortFromParentWithVersion,P as sendAndHandleSdkError,R as sendAndHandleStatusAndReason,C as sendAndHandleStatusAndReasonWithDefaultError,O as sendAndUnwrap,$ as sendMessageToParent,S as sendMessageToParentAsync,L as sendNestedAuthRequestToTopWindow,j as uninitializeCommunication,ne as waitForMessageQueue};
1
+ import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{isSdkError as n,ErrorCode as t}from"../public/interfaces.js";import{latestRuntimeApiVersion as o}from"../public/runtime.js";import{isSerializable as r}from"../public/serializable.interface.js";import{UUID as i}from"../public/uuidObject.js";import{version as s}from"../public/version.js";import{uninitializeChildCommunication as a,shouldProcessChildMessage as c,handleIncomingMessageFromChild as d}from"./childCommunication.js";import{getMessageIdsAsLogString as u,flushMessageQueue as l}from"./communicationUtils.js";import{GlobalVars as g}from"./globalVars.js";import{callHandler as p}from"./handlers.js";import f from"./hostToAppTelemetry.js";import{serializeMessageRequest as m,deserializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{isFollowingApiVersionTagFormat as v,getLogger as b}from"./telemetry.js";import{getCurrentTimestamp as W,ssrSafeWindow as M}from"./utils.js";import{validateOrigin as y}from"./validOrigins.js";const k=b("communication");class I{}class T{}function E(n,t){if(T.messageListener=n=>function(n){return e(this,void 0,void 0,function*(){if(!n||!n.data||"object"!=typeof n.data)return void J("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,t=n.origin||n.originalEvent&&n.originalEvent.origin;return B(e,t).then(o=>{o?(!function(e,n){g.isFramelessWindow||I.parentWindow&&!I.parentWindow.closed&&e!==I.parentWindow||(I.parentWindow=e,I.parentOrigin=n);I.parentWindow&&I.parentWindow.closed&&(I.parentWindow=null,I.parentOrigin=null);l(I.parentWindow,I.parentOrigin,T.parentMessageQueue,"parent")}(e,t),e!==I.parentWindow?c(e,t)&&d(n,e,V,(e,n)=>T.callbacks.set(e,n)):Y(n)):J("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,t)})})}(n),I.currentWindow=I.currentWindow||M(),I.parentWindow=I.currentWindow.parent!==I.currentWindow.self?I.currentWindow.parent:I.currentWindow.opener,I.topWindow=I.currentWindow.top,(I.parentWindow||n)&&I.currentWindow.addEventListener("message",T.messageListener,!1),!I.parentWindow){const e=I.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));g.isFramelessWindow=!0,e.onNativeMessage=Y}try{return I.parentOrigin="*",S(t,"initialize",[s,o,n]).then(([e,n,t,o])=>(h(o,I.currentWindow,{onMessage:D,sendPostMessage:L}),{context:e,clientType:n,runtimeConfig:t,clientSupportedSDKVersion:o}))}finally{I.parentOrigin=null}}function j(){I.currentWindow&&I.currentWindow.removeEventListener("message",T.messageListener,!1),I.currentWindow=null,I.parentWindow=null,I.parentOrigin=null,T.parentMessageQueue=[],T.nextMessageId=0,T.callbacks.clear(),T.promiseCallbacks.clear(),T.portCallbacks.clear(),T.legacyMessageIdsToUuidMap={},f.clearMessages(),a()}function O(e,n,...t){return S(e,n,t).then(([e])=>e)}function R(e,n,...t){return S(e,n,t).then(([e,n])=>{if(!e)throw new Error(n)})}function C(e,n,t,...o){return S(e,n,o).then(([e,n])=>{if(!e)throw new Error(n||t)})}function P(e,n,...t){return S(e,n,t).then(([e,n])=>{if(e)throw e;return n})}function S(e,n,t=void 0){if(!v(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(o=>{const r=V(e,n,t);var i;o((i=r.uuid,new Promise(e=>{T.promiseCallbacks.set(i,e)})))})}function x(e){return e.map(e=>r(e)?e.serialize():e)}function N(o,r,i,s,a){var c;return e(this,void 0,void 0,function*(){const e=x(r),[d]=yield S(s,o,e);if(a&&a(d)||!a&&n(d))throw new Error(`${d.errorCode}, message: ${null!==(c=d.message)&&void 0!==c?c:"None"}`);if(i.validate(d))return i.deserialize(d);throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(d)}`)})}function A(o,r,i,s){var a;return e(this,void 0,void 0,function*(){const e=x(r),[c]=yield S(i,o,e);if(s&&s(c)||!s&&n(c))throw new Error(`${c.errorCode}, message: ${null!==(a=c.message)&&void 0!==a?a:"None"}`);if(void 0!==c)throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host`)})}function U(e,n,t=void 0){if(!v(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=V(e,n,t);return r=o.uuid,new Promise((e,n)=>{T.portCallbacks.set(r,(t,o)=>{t instanceof MessagePort?e(t):n(o&&o.length>0?o[0]:new Error("Host responded without port or error details."))})});var r}function $(e,n,t,o){let r;if(t instanceof Function?o=t:t instanceof Array&&(r=t),!v(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 i=V(e,n,r);o&&T.callbacks.set(i.uuid,o)}T.parentMessageQueue=[],T.topMessageQueue=[],T.nextMessageId=0,T.callbacks=new Map,T.promiseCallbacks=new Map,T.portCallbacks=new Map,T.legacyMessageIdsToUuidMap={};const z=k.extend("sendNestedAuthRequestToTopWindow");function L(e,n){const t=z,o=I.topWindow,r=function(e,n){const t=T.nextMessageId++,o=new i;return T.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),apiVersionTag:n,args:[],data:e}}(e,n);return t("Message %s information: %o",u(r),{actionName:r.func}),F(o,r)}const _=k.extend("sendRequestToTargetWindowHelper");function F(e,n){const t=_,o=function(e){return e===I.topWindow&&Z()?"top":e===I.parentWindow?"parent":null}(e),r=m(n);if(g.isFramelessWindow)I.currentWindow&&I.currentWindow.nativeInterface&&(t("Sending message %s to %s via framelessPostMessage interface",u(r),o),I.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(r)));else{const i=function(e){return e===I.topWindow&&Z()?I.topOrigin:e===I.parentWindow?I.parentOrigin:null}(e);e&&i?(t("Sending message %s to %s via postMessage",u(r),o),e.postMessage(r,i)):(t("Adding message %s to %s message queue",u(r),o),ee(e).push(n))}return n}const Q=k.extend("sendMessageToParentHelper");function V(e,n,t,o,r){const s=Q,a=I.parentWindow,c=function(e,n,t,o,r){const s=T.nextMessageId++,a=new i;T.legacyMessageIdsToUuidMap[s]=a;const c=!0===o?r:g.teamsJsInstanceId;return{id:s,uuid:a,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:t||[],apiVersionTag:e,isProxiedFromChild:null!=o&&o,teamsJsInstanceId:c}}(e,n,t,o,r);return f.storeCallbackInformation(c.uuid,{name:n,calledAt:c.timestamp}),s("Message %s information: %o",u(c),{actionName:n,args:t}),F(a,c)}const J=k.extend("processIncomingMessage");const q=k.extend("processAuthBridgeMessage");function D(e,n){var t,o;const r=q;if(!e||!e.data||"object"!=typeof e.data)return void r("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:i}=e.data,[,s]=null!=i?i:[],a=(()=>{try{return JSON.parse(s)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void r("Unrecognized data format received by app, message being ignored. Message: %o",e);const c=e.source||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.source),d=e.origin||(null===(o=null==e?void 0:e.originalEvent)||void 0===o?void 0:o.origin);c?B(c,d)?(I.topWindow&&!I.topWindow.closed&&c!==I.topWindow||(I.topWindow=c,I.topOrigin=d),I.topWindow&&I.topWindow.closed&&(I.topWindow=null,I.topOrigin=null),l(I.topWindow,I.topOrigin,T.topMessageQueue,"top"),n(s)):r("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):r("Message being ignored by app because it is coming for a target that is null")}const H=k.extend("shouldProcessIncomingMessage");function B(n,t){return e(this,void 0,void 0,function*(){if(I.currentWindow&&n===I.currentWindow)return H("Should not process message because it is coming from the current window"),!1;if(I.currentWindow&&I.currentWindow.location&&t&&t===I.currentWindow.location.origin)return!0;{let e;try{e=new URL(t)}catch(e){return H("Message has an invalid origin of %s",t),!1}const n=yield y(e);return n||H("Message has an invalid origin of %s",t),n}})}const K=k.extend("handleIncomingMessageFromParent");function G(e,n){if(n){const t=[...e].find(([e,t])=>e.toString()===n.toString());if(t)return t[0]}}function X(e,n){const t=G(n,e.uuid);t&&n.delete(t),e.uuid?T.legacyMessageIdsToUuidMap={}:delete T.legacyMessageIdsToUuidMap[e.id]}function Y(e){const n=K,t=W();if("id"in e.data&&"number"==typeof e.data.id){const o=e.data,r=w(o),i=function(e){const n=K;if(!e.uuid)return T.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,t=G(T.callbacks,n);if(t)return t;const o=G(T.promiseCallbacks,n);if(o)return o;const r=G(T.portCallbacks,n);if(r)return r}n("Received message %s that failed to produce a callbackId",u(e))}(r);if(i){const o=T.callbacks.get(i);n("Received a response from parent for message %s",i.toString()),f.handlePerformanceMetrics(i,r,n,t),o&&(n("Invoking the registered callback for message %s with arguments %o",i.toString(),r.args),o.apply(null,[...r.args,r.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",i.toString()),X(r,T.callbacks)));const s=T.promiseCallbacks.get(i);s&&(n("Invoking the registered promise callback for message %s with arguments %o",i.toString(),r.args),s(r.args),n("Removing registered promise callback for message %s",i.toString()),X(r,T.promiseCallbacks));const a=T.portCallbacks.get(i);if(a){let t;n("Invoking the registered port callback for message %s with arguments %o",i.toString(),r.args),e.ports&&e.ports[0]instanceof MessagePort&&(t=e.ports[0]),a(t,r.args),n("Removing registered port callback for message %s",i.toString()),X(r,T.portCallbacks)}r.uuid&&(T.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const o=e.data;f.handleOneWayPerformanceMetrics(o,n,t),n('Received a message from parent %s, action: "%s"',u(o),o.func),p(o.func,o.args)}else n("Received an unknown message: %O",e)}function Z(){return I.topWindow!==I.parentWindow}function ee(e){return e===I.topWindow&&Z()?T.topMessageQueue:e===I.parentWindow?T.parentMessageQueue:[]}function ne(e,n){let t;t=I.currentWindow.setInterval(()=>{0===ee(e).length&&(clearInterval(t),n())},100)}export{I as Communication,A as callFunctionInHost,N as callFunctionInHostAndHandleResponse,E as initializeCommunication,U as requestPortFromParentWithVersion,P as sendAndHandleSdkError,R as sendAndHandleStatusAndReason,C as sendAndHandleStatusAndReasonWithDefaultError,O as sendAndUnwrap,$ as sendMessageToParent,S as sendMessageToParentAsync,L as sendNestedAuthRequestToTopWindow,j as uninitializeCommunication,ne as waitForMessageQueue};
@@ -1 +1 @@
1
- import*as t from"../artifactsForCDN/validDomains.json.js";const i="2.0.1",s="2.0.2",e="2.0.3",n="2.0.4",o="2.0.1",a="1.9.0",r="2.0.0",m="1.7.0",l="1.8.0",d="2.0.0",h="1.9.0",p=t.validOrigins,c=1500,f=new URL("https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json"),j=/^https:\/\//,v="https",y="teams.microsoft.com",D="The library has not yet been initialized",T="The runtime has not yet been initialized",b="The runtime version is not supported",u="The call was not properly started";export{c as ORIGIN_LIST_FETCH_TIMEOUT_IN_MS,m as captureImageMobileSupportVersion,i as defaultSDKVersionForCompatCheck,u as errorCallNotStarted,D as errorLibraryNotInitialized,T as errorRuntimeNotInitialized,b as errorRuntimeNotSupported,d as getMediaCallbackSupportVersion,o as getUserJoinedTeamsSupportedAndroidClientVersion,n as imageOutputFormatsAPISupportVersion,a as locationAPIsRequiredVersion,l as mediaAPISupportVersion,e as nonFullScreenVideoModeAPISupportVersion,r as peoplePickerRequiredVersion,h as scanBarCodeAPIMobileSupportVersion,y as teamsDeepLinkHost,v as teamsDeepLinkProtocol,j as userOriginUrlValidationRegExp,f as validOriginsCdnEndpoint,p as validOriginsFallback,s as videoAndImageMediaAPISupportVersion};
1
+ import*as i from"../artifactsForCDN/validDomains.json.js";const t="2.0.1",e="2.0.2",s="2.0.3",n="2.0.4",o="2.0.1",a="1.9.0",r="2.0.0",m="1.7.0",l="1.8.0",d="2.0.0",h="1.9.0",p=i.validOrigins,c=1500,f=new URL("https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json"),j="https",v="teams.microsoft.com",y="The library has not yet been initialized",D="The runtime has not yet been initialized",T="The runtime version is not supported",b="The call was not properly started";export{c as ORIGIN_LIST_FETCH_TIMEOUT_IN_MS,m as captureImageMobileSupportVersion,t as defaultSDKVersionForCompatCheck,b as errorCallNotStarted,y as errorLibraryNotInitialized,D as errorRuntimeNotInitialized,T as errorRuntimeNotSupported,d as getMediaCallbackSupportVersion,o as getUserJoinedTeamsSupportedAndroidClientVersion,n as imageOutputFormatsAPISupportVersion,a as locationAPIsRequiredVersion,l as mediaAPISupportVersion,s as nonFullScreenVideoModeAPISupportVersion,r as peoplePickerRequiredVersion,h as scanBarCodeAPIMobileSupportVersion,v as teamsDeepLinkHost,j as teamsDeepLinkProtocol,f as validOriginsCdnEndpoint,p as validOriginsFallback,e as videoAndImageMediaAPISupportVersion};
@@ -1 +1 @@
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};
1
+ import{teamsDeepLinkProtocol as n,teamsDeepLinkHost as o}from"./constants.js";import{teamsDeepLinkUrlPathForAppInstall as e,teamsDeepLinkUsersUrlParameterName as t,teamsDeepLinkUrlPathForChat as $,teamsDeepLinkTopicUrlParameterName as i,teamsDeepLinkMessageUrlParameterName as r,teamsDeepLinkAttendeesUrlParameterName as d,teamsDeepLinkUrlPathForCalendar as p,teamsDeepLinkStartTimeUrlParameterName as c,teamsDeepLinkEndTimeUrlParameterName as a,teamsDeepLinkSubjectUrlParameterName as m,teamsDeepLinkContentUrlParameterName as s,teamsDeepLinkUrlPathForCall as C,teamsDeepLinkWithVideoUrlParameterName as I,teamsDeepLinkSourceUrlParameterName as l}from"./deepLinkConstants.js";function u(e,d,p){if(0===e.length)throw new Error("Must have at least one user when creating a chat deep link");const c=`${t}=`+e.map(n=>encodeURIComponent(n)).join(","),a=void 0===d?"":`&${i}=${encodeURIComponent(d)}`,m=void 0===p?"":`&${r}=${encodeURIComponent(p)}`;return`${n}://${o}${$}?${c}${a}${m}`}function R(e,$,i){if(0===e.length)throw new Error("Must have at least one target when creating a call deep link");const r=`${t}=`+e.map(n=>encodeURIComponent(n)).join(","),d=void 0===$?"":`&${I}=${encodeURIComponent($)}`,p=void 0===i?"":`&${l}=${encodeURIComponent(i)}`;return`${n}://${o}${C}?${r}${d}${p}`}function U(e,t,$,i,r){const C=void 0===e?"":`${d}=`+e.map(n=>encodeURIComponent(n)).join(","),I=void 0===t?"":`&${c}=${encodeURIComponent(t)}`,l=void 0===$?"":`&${a}=${encodeURIComponent($)}`,u=void 0===i?"":`&${m}=${encodeURIComponent(i)}`,R=void 0===r?"":`&${s}=${encodeURIComponent(r)}`;return`${n}://${o}${p}?${C}${I}${l}${u}${R}`}function h(t){if(!t)throw new Error("App ID must be set when creating an app install dialog deep link");return`${n}://${o}${e}${encodeURIComponent(t)}`}export{h as createTeamsDeepLinkForAppInstallDialog,U as createTeamsDeepLinkForCalendar,R as createTeamsDeepLinkForCall,u as createTeamsDeepLinkForChat};
@@ -1 +1 @@
1
- import{ensureInitialized as t}from"./internalAPIs.js";import{FrameContexts as e,errorNotSupportedOnPlatform as o,DialogDimension as r}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";import{sendMessageToParent as i}from"./communication.js";import{GlobalVars as n}from"./globalVars.js";import{registerHandler as a,removeHandler as l}from"./handlers.js";import{getApiVersionTag as m}from"./telemetry.js";import{isSupported as c}from"../public/dialog/update.js";import{isSupported as u,getDialogInfoFromUrlDialogInfo as d,getDialogInfoFromBotUrlDialogInfo as g}from"../public/dialog/url/url.js";import{isSupported as f}from"../public/dialog/url/bot.js";const p="v2";function h(r,n){if(t(s,e.content,e.sidePanel,e.task,e.meetingStage),!c())throw o;i(r,"tasks.updateTask",[n])}function b(r,n,c,g){if(t(s,e.content,e.sidePanel,e.meetingStage),!u())throw o;g&&a(m(p,"dialog.url.registerMessageForParentHandler"),"messageForParent",g);const f=d(n);i(r,"tasks.startTask",[f],((t,e)=>{null==c||c({err:t,result:e}),l("messageForParent")}))}function k(r,n,c,u){if(t(s,e.content,e.sidePanel,e.meetingStage),!f())throw o;u&&a(m(p,"dialog.url.bot.registerMessageForParentHandler"),"messageForParent",u);const d=g(n);i(r,"tasks.startTask",[d],((t,e)=>{null==c||c({err:t,result:e}),l("messageForParent")}))}function j(r,a,l){if(t(s,e.content,e.task),!u())throw o;n.frameContext===e.content&&console.warn("dialog.submit should not be called from FrameContext.content.\nIf dialog.submit was called from inside the dialog, please disregard this message.\nThis issue occurs due to a bug in Teams mobile where the dialog is incorrectly identified as being in the content FrameContext.\nWe are working to resolve this."),i(r,"tasks.completeTask",[a,l?Array.isArray(l)?l:[l]:[]])}function w(t){return{card:t.card,height:t.size?t.size.height:r.Small,width:t.size?t.size.width:r.Small,title:t.title}}function P(t){const e=w(t);return e.completionBotId=t.completionBotId,e}const F=[];function S(t){n.frameContext&&(n.frameContext===e.task?F.push(t):l("messageForChild"))}export{k as botUrlOpenHelper,p as dialogTelemetryVersionNumber,w as getDialogInfoFromAdaptiveCardDialogInfo,P as getDialogInfoFromBotAdaptiveCardDialogInfo,S as handleDialogMessage,F as storedMessages,h as updateResizeHelper,b as urlOpenHelper,j as urlSubmitHelper};
1
+ import{ensureInitialized as t}from"./internalAPIs.js";import{DialogDimension as e,FrameContexts as o,errorNotSupportedOnPlatform as r}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";import{sendMessageToParent as i}from"./communication.js";import{GlobalVars as n}from"./globalVars.js";import{registerHandler as a,removeHandler as l}from"./handlers.js";import{getApiVersionTag as m}from"./telemetry.js";import{isSupported as c,getDialogInfoFromUrlDialogInfo as u,getDialogInfoFromBotUrlDialogInfo as d}from"../public/dialog/url/url.js";import{isSupported as g}from"../public/dialog/url/bot.js";import{isSupported as f}from"../public/dialog/update.js";const p="v2";function h(e,n){if(t(s,o.content,o.sidePanel,o.task,o.meetingStage),!f())throw r;i(e,"tasks.updateTask",[n])}function b(e,n,d,g){if(t(s,o.content,o.sidePanel,o.meetingStage),!c())throw r;g&&a(m(p,"dialog.url.registerMessageForParentHandler"),"messageForParent",g);const f=u(n);i(e,"tasks.startTask",[f],(t,e)=>{null==d||d({err:t,result:e}),l("messageForParent")})}function k(e,n,c,u){if(t(s,o.content,o.sidePanel,o.meetingStage),!g())throw r;u&&a(m(p,"dialog.url.bot.registerMessageForParentHandler"),"messageForParent",u);const f=d(n);i(e,"tasks.startTask",[f],(t,e)=>{null==c||c({err:t,result:e}),l("messageForParent")})}function j(e,a,l){if(t(s,o.content,o.task),!c())throw r;n.frameContext===o.content&&console.warn("dialog.submit should not be called from FrameContext.content.\nIf dialog.submit was called from inside the dialog, please disregard this message.\nThis issue occurs due to a bug in Teams mobile where the dialog is incorrectly identified as being in the content FrameContext.\nWe are working to resolve this."),i(e,"tasks.completeTask",[a,l?Array.isArray(l)?l:[l]:[]])}function w(t){return{card:t.card,height:t.size?t.size.height:e.Small,width:t.size?t.size.width:e.Small,title:t.title}}function P(t){const e=w(t);return e.completionBotId=t.completionBotId,e}const F=[];function S(t){n.frameContext&&(n.frameContext===o.task?F.push(t):l("messageForChild"))}export{k as botUrlOpenHelper,p as dialogTelemetryVersionNumber,w as getDialogInfoFromAdaptiveCardDialogInfo,P as getDialogInfoFromBotAdaptiveCardDialogInfo,S as handleDialogMessage,F as storedMessages,h as updateResizeHelper,b as urlOpenHelper,j as urlSubmitHelper};
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getLogger as n,getApiVersionTag as r}from"./telemetry.js";import{runtime as l}from"../public/runtime.js";import{shouldEventBeRelayedToChild as a,sendMessageEventToChild as t}from"./childCommunication.js";import{sendMessageToParent as o}from"./communication.js";import{ensureInitialized as d}from"./internalAPIs.js";import{initializeBackStackHelper as i}from"./pagesHelpers.js";import{isNullOrUndefined as s}from"./typeCheckUtilities.js";const u=n("handlers");class c{static initializeHandlers(){c.handlers.themeChange=x,c.handlers.contextChange=v,c.handlers.load=S,c.handlers.beforeUnload=A,i()}static uninitializeHandlers(){c.handlers={},c.themeChangeHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.contextChangeHandler=null}}function f(){c.initializeHandlers()}function m(){c.uninitializeHandlers()}c.handlers={},c.themeChangeHandler=null,c.loadHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.hostToAppPerformanceMetricsHandler=null,c.contextChangeHandler=null;const H=u.extend("callHandler");function h(e,n){const r=c.handlers[e];if(r){H("Invoking the registered handler for message %s with arguments %o",e,n);return[!0,r.apply(this,n)]}return a()?(t(e,n),[!1,void 0]):(H("Handler for action message %s not found.",e),[!1,void 0])}function p(e,n,r,l=!0,a=[]){r?(c.handlers[n]=r,l&&o(e,"registerHandler",[n,...a])):delete c.handlers[n]}function g(e){delete c.handlers[e]}function b(e){return null!=c.handlers[e]}function C(e,n,r,a,t){r&&d(l,...a),t&&t(),p(e,n,r)}function U(e,n){c.themeChangeHandler=n,!s(n)&&o(e,"registerHandler",["themeChange"])}function T(e,n){c.contextChangeHandler=n,!s(n)&&o(e,"registerHandler",["contextChange"])}function x(e){c.themeChangeHandler&&c.themeChangeHandler(e),a()&&t("themeChange",[e])}function v(e){c.contextChangeHandler&&c.contextChangeHandler(e),a()&&t("contextChange",[e])}function y(e){c.hostToAppPerformanceMetricsHandler=e}function j(e){c.hostToAppPerformanceMetricsHandler&&c.hostToAppPerformanceMetricsHandler(e)}function O(e,n){c.loadHandler=n,!s(n)&&o(e,"registerHandler",["load"])}function S(e){const n={entityId:(r=e).entityId,contentUrl:new URL(r.contentUrl)};var r;c.resumeHandler?(c.resumeHandler(n),a()&&t("load",[n])):c.loadHandler&&(c.loadHandler(e),a()&&t("load",[e]))}function _(e,n){c.beforeUnloadHandler=n,!s(n)&&o(e,"registerHandler",["beforeUnload"])}function A(){return e(this,void 0,void 0,(function*(){const e=()=>{o(r("v2","handleBeforeUnload"),"readyToUnload",[])};c.beforeSuspendOrTerminateHandler?(yield c.beforeSuspendOrTerminateHandler(),a()?t("beforeUnload"):e()):c.beforeUnloadHandler&&c.beforeUnloadHandler(e)||(a()?t("beforeUnload"):e())}))}function P(e){c.beforeSuspendOrTerminateHandler=e,!s(e)&&o(r("v2","registerBeforeSuspendOrTerminateHandler"),"registerHandler",["beforeUnload"])}function z(e){c.resumeHandler=e,!s(e)&&o(r("v2","registerOnResumeHandler"),"registerHandler",["load"])}export{h as callHandler,b as doesHandlerExist,v as handleContextChange,j as handleHostToAppPerformanceMetrics,x as handleThemeChange,f as initializeHandlers,P as registerBeforeSuspendOrTerminateHandler,_ as registerBeforeUnloadHandler,p as registerHandler,C as registerHandlerHelper,y as registerHostToAppPerformanceMetricsHandler,T as registerOnContextChangeHandler,O as registerOnLoadHandler,z as registerOnResumeHandler,U as registerOnThemeChangeHandler,g as removeHandler,m as uninitializeHandlers};
1
+ import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getApiVersionTag as n,getLogger as r}from"./telemetry.js";import{runtime as l}from"../public/runtime.js";import{shouldEventBeRelayedToChild as a,sendMessageEventToChild as t}from"./childCommunication.js";import{sendMessageToParent as o}from"./communication.js";import{ensureInitialized as d}from"./internalAPIs.js";import{initializeBackStackHelper as i}from"./pagesHelpers.js";import{isNullOrUndefined as s}from"./typeCheckUtilities.js";const u=r("handlers");class c{static initializeHandlers(){c.handlers.themeChange=x,c.handlers.contextChange=v,c.handlers.load=S,c.handlers.beforeUnload=A,i()}static uninitializeHandlers(){c.handlers={},c.themeChangeHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.contextChangeHandler=null}}function f(){c.initializeHandlers()}function m(){c.uninitializeHandlers()}c.handlers={},c.themeChangeHandler=null,c.loadHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.hostToAppPerformanceMetricsHandler=null,c.contextChangeHandler=null;const H=u.extend("callHandler");function h(e,n){const r=c.handlers[e];if(r){H("Invoking the registered handler for message %s with arguments %o",e,n);return[!0,r.apply(this,n)]}return a()?(t(e,n),[!1,void 0]):(H("Handler for action message %s not found.",e),[!1,void 0])}function p(e,n,r,l=!0,a=[]){r?(c.handlers[n]=r,l&&o(e,"registerHandler",[n,...a])):delete c.handlers[n]}function g(e){delete c.handlers[e]}function b(e){return null!=c.handlers[e]}function C(e,n,r,a,t){r&&d(l,...a),t&&t(),p(e,n,r)}function U(e,n){c.themeChangeHandler=n,!s(n)&&o(e,"registerHandler",["themeChange"])}function T(e,n){c.contextChangeHandler=n,!s(n)&&o(e,"registerHandler",["contextChange"])}function x(e){c.themeChangeHandler&&c.themeChangeHandler(e),a()&&t("themeChange",[e])}function v(e){c.contextChangeHandler&&c.contextChangeHandler(e),a()&&t("contextChange",[e])}function y(e){c.hostToAppPerformanceMetricsHandler=e}function j(e){c.hostToAppPerformanceMetricsHandler&&c.hostToAppPerformanceMetricsHandler(e)}function O(e,n){c.loadHandler=n,!s(n)&&o(e,"registerHandler",["load"])}function S(e){const n={entityId:(r=e).entityId,contentUrl:new URL(r.contentUrl)};var r;c.resumeHandler?(c.resumeHandler(n),a()&&t("load",[n])):c.loadHandler&&(c.loadHandler(e),a()&&t("load",[e]))}function _(e,n){c.beforeUnloadHandler=n,!s(n)&&o(e,"registerHandler",["beforeUnload"])}function A(){return e(this,void 0,void 0,function*(){const e=()=>{o(n("v2","handleBeforeUnload"),"readyToUnload",[])};c.beforeSuspendOrTerminateHandler?(yield c.beforeSuspendOrTerminateHandler(),a()?t("beforeUnload"):e()):c.beforeUnloadHandler&&c.beforeUnloadHandler(e)||(a()?t("beforeUnload"):e())})}function P(e){c.beforeSuspendOrTerminateHandler=e,!s(e)&&o(n("v2","registerBeforeSuspendOrTerminateHandler"),"registerHandler",["beforeUnload"])}function z(e){c.resumeHandler=e,!s(e)&&o(n("v2","registerOnResumeHandler"),"registerHandler",["load"])}export{h as callHandler,b as doesHandlerExist,v as handleContextChange,j as handleHostToAppPerformanceMetrics,x as handleThemeChange,f as initializeHandlers,P as registerBeforeSuspendOrTerminateHandler,_ as registerBeforeUnloadHandler,p as registerHandler,C as registerHandlerHelper,y as registerHostToAppPerformanceMetricsHandler,T as registerOnContextChangeHandler,O as registerOnLoadHandler,z as registerOnResumeHandler,U as registerOnThemeChangeHandler,g as removeHandler,m as uninitializeHandlers};
@@ -1 +1 @@
1
- import{AppId as i}from"../public/appId.js";import{hasScriptTags as t}from"./utils.js";function n(i){if(!e(i))throw new Error(`Potential app id (${i}) is invalid; its length ${i.length} is not within the length limits (${r}-${a}).`)}function o(i){if(t(i))throw new Error(`Potential app id (${i}) is invalid; it contains script tags.`);if(s(i))throw new Error(`Potential app id (${i}) is invalid; it contains non-printable characters.`)}const r=4,a=256;function e(i){return i.length<a&&i.length>r}function s(i){return[...i].some((i=>{const t=i.charCodeAt(0);return t<32||t>126}))}function l(t){if(!(t instanceof i))throw new Error(`Potential app id (${t}) is invalid; it is not an instance of AppId class.`)}export{s as doesStringContainNonPrintableCharacters,e as isStringWithinAppIdLengthLimits,a as maximumValidAppIdLength,r as minimumValidAppIdLength,l as validateAppIdInstance,o as validateSafeContent,n as validateStringLength};
1
+ import{AppId as i}from"../public/appId.js";import{hasScriptTags as t}from"./utils.js";function n(i){if(!e(i))throw new Error(`Potential app id (${i}) is invalid; its length ${i.length} is not within the length limits (${r}-${a}).`)}function o(i){if(t(i))throw new Error(`Potential app id (${i}) is invalid; it contains script tags.`);if(s(i))throw new Error(`Potential app id (${i}) is invalid; it contains non-printable characters.`)}const r=4,a=256;function e(i){return i.length<a&&i.length>r}function s(i){return[...i].some(i=>{const t=i.charCodeAt(0);return t<32||t>126})}function l(t){if(!(t instanceof i))throw new Error(`Potential app id (${t}) is invalid; it is not an instance of AppId class.`)}export{s as doesStringContainNonPrintableCharacters,e as isStringWithinAppIdLengthLimits,a as maximumValidAppIdLength,r as minimumValidAppIdLength,l as validateAppIdInstance,o as validateSafeContent,n as validateStringLength};
@@ -1 +1 @@
1
- import{HostClientType as i}from"../public/constants.js";import{ErrorCode as t}from"../public/interfaces.js";import{isRuntimeInitialized as e}from"../public/runtime.js";import{errorLibraryNotInitialized as n,defaultSDKVersionForCompatCheck as o,userOriginUrlValidationRegExp as r}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{getLogger as s}from"./telemetry.js";import{compareSDKVersions as a}from"./utils.js";const f=s("internal"),c=f.extend("ensureInitializeCalled"),d=f.extend("ensureInitialized");function p(){if(!l.initializeCalled)throw c(n),new Error(n)}function m(i,...t){if(!l.initializeCompleted)throw d("%s. initializeCalled: %s",n,l.initializeCalled.toString()),new Error(n);if(t&&t.length>0){let i=!1;for(let e=0;e<t.length;e++)if(t[e]===l.frameContext){i=!0;break}if(!i)throw new Error(`This call is only allowed in following contexts: ${JSON.stringify(t)}. Current context: "${l.frameContext}".`)}return e(i)}function u(i=o){const t=a(l.clientSupportedSDKVersion,i);return!isNaN(t)&&t>=0}function C(){return l.hostClientType==i.android||l.hostClientType==i.ios||l.hostClientType==i.ipados||l.hostClientType==i.visionOS}function h(i=o){if(!C()){throw{errorCode:t.NOT_SUPPORTED_ON_PLATFORM}}if(!u(i)){throw{errorCode:t.OLD_PLATFORM}}}function w(i){let t=l.additionalValidOrigins.concat(i.filter((i=>"string"==typeof i&&r.test(i))));const e={};t=t.filter((i=>!e[i]&&(e[i]=!0,!0))),l.additionalValidOrigins=t}export{p as ensureInitializeCalled,m as ensureInitialized,u as isCurrentSDKVersionAtLeast,C as isHostClientMobile,w as processAdditionalValidOrigins,h as throwExceptionIfMobileApiIsNotSupported};
1
+ import{HostClientType as i}from"../public/constants.js";import{ErrorCode as t}from"../public/interfaces.js";import{isRuntimeInitialized as r}from"../public/runtime.js";import{defaultSDKVersionForCompatCheck as e,errorLibraryNotInitialized as n}from"./constants.js";import{GlobalVars as o}from"./globalVars.js";import{getLogger as l}from"./telemetry.js";import{isValidPatternUrl as s}from"./urlPattern.js";import{compareSDKVersions as a}from"./utils.js";const f=l("internal"),c=f.extend("ensureInitializeCalled"),d=f.extend("ensureInitialized");function m(){if(!o.initializeCalled)throw c(n),new Error(n)}function p(i,...t){if(!o.initializeCompleted)throw d("%s. initializeCalled: %s",n,o.initializeCalled.toString()),new Error(n);if(t&&t.length>0){let i=!1;for(let r=0;r<t.length;r++)if(t[r]===o.frameContext){i=!0;break}if(!i)throw new Error(`This call is only allowed in following contexts: ${JSON.stringify(t)}. Current context: "${o.frameContext}".`)}return r(i)}function u(i=e){const t=a(o.clientSupportedSDKVersion,i);return!isNaN(t)&&t>=0}function C(){return o.hostClientType==i.android||o.hostClientType==i.ios||o.hostClientType==i.ipados||o.hostClientType==i.visionOS}function h(i=e){if(!C()){throw{errorCode:t.NOT_SUPPORTED_ON_PLATFORM}}if(!u(i)){throw{errorCode:t.OLD_PLATFORM}}}function w(i){let t=o.additionalValidOrigins.concat(i.filter(i=>"string"==typeof i&&s(i)));const r={};t=t.filter(i=>!r[i]&&(r[i]=!0,!0)),o.additionalValidOrigins=t}export{m as ensureInitializeCalled,p as ensureInitialized,u as isCurrentSDKVersionAtLeast,C as isHostClientMobile,w as processAdditionalValidOrigins,h as throwExceptionIfMobileApiIsNotSupported};
@@ -1 +1 @@
1
- import{__rest as r}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{CartStatus as e}from"../public/marketplace.js";import t from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function o(r){try{return r.cartItems=s(r.cartItems),r}catch(r){throw new Error("Error deserializing cart")}}function s(r){return r.map((r=>{if(r.imageURL){const e=new URL(r.imageURL);r.imageURL=e}return r.accessories&&(r.accessories=s(r.accessories)),r}))}const i=e=>{try{return e.map((e=>{const{imageURL:t,accessories:o}=e,s=r(e,["imageURL","accessories"]),n=Object.assign({},s);return t&&(n.imageURL=t.href),o&&(n.accessories=i(o)),n}))}catch(r){throw new Error("Error serializing cart items")}};function n(r){if(!Array.isArray(r)||0===r.length)throw new Error("cartItems must be a non-empty array");for(const e of r)c(e),a(e.accessories)}function a(r){if(null!=r){if(!Array.isArray(r)||0===r.length)throw new Error("CartItem.accessories must be a non-empty array");for(const e of r){if(e.accessories)throw new Error("Item in CartItem.accessories cannot have accessories");c(e)}}}function c(r){if(!r.id)throw new Error("cartItem.id must not be empty");if(!r.name)throw new Error("cartItem.name must not be empty");u(r.price),f(r.quantity)}function m(r){if(null!=r){if(!r)throw new Error("id must not be empty");if(!1===t(r))throw new Error("id must be a valid UUID")}}function u(r){if("number"!=typeof r||r<0)throw new Error(`price ${r} must be a number not less than 0`);if(parseFloat(r.toFixed(3))!==r)throw new Error(`price ${r} must have at most 3 decimal places`)}function f(r){if("number"!=typeof r||r<=0||parseInt(r.toString())!==r)throw new Error(`quantity ${r} must be an integer greater than 0`)}function p(r){if(!Object.values(e).includes(r))throw new Error(`cartStatus ${r} is not valid`)}export{o as deserializeCart,s as deserializeCartItems,i as serializeCartItems,a as validateAccessoryItems,c as validateBasicCartItem,n as validateCartItems,p as validateCartStatus,u as validatePrice,f as validateQuantity,m as validateUuid};
1
+ import{__rest as r}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{CartStatus as e}from"../public/marketplace.js";import t from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function o(r){try{return r.cartItems=s(r.cartItems),r}catch(r){throw new Error("Error deserializing cart")}}function s(r){return r.map(r=>{if(r.imageURL){const e=new URL(r.imageURL);r.imageURL=e}return r.accessories&&(r.accessories=s(r.accessories)),r})}const i=e=>{try{return e.map(e=>{const{imageURL:t,accessories:o}=e,s=r(e,["imageURL","accessories"]),n=Object.assign({},s);return t&&(n.imageURL=t.href),o&&(n.accessories=i(o)),n})}catch(r){throw new Error("Error serializing cart items")}};function n(r){if(!Array.isArray(r)||0===r.length)throw new Error("cartItems must be a non-empty array");for(const e of r)c(e),a(e.accessories)}function a(r){if(null!=r){if(!Array.isArray(r)||0===r.length)throw new Error("CartItem.accessories must be a non-empty array");for(const e of r){if(e.accessories)throw new Error("Item in CartItem.accessories cannot have accessories");c(e)}}}function c(r){if(!r.id)throw new Error("cartItem.id must not be empty");if(!r.name)throw new Error("cartItem.name must not be empty");u(r.price),f(r.quantity)}function m(r){if(null!=r){if(!r)throw new Error("id must not be empty");if(!1===t(r))throw new Error("id must be a valid UUID")}}function u(r){if("number"!=typeof r||r<0)throw new Error(`price ${r} must be a number not less than 0`);if(parseFloat(r.toFixed(3))!==r)throw new Error(`price ${r} must have at most 3 decimal places`)}function f(r){if("number"!=typeof r||r<=0||parseInt(r.toString())!==r)throw new Error(`quantity ${r} must be an integer greater than 0`)}function p(r){if(!Object.values(e).includes(r))throw new Error(`cartStatus ${r} is not valid`)}export{o as deserializeCart,s as deserializeCartItems,i as serializeCartItems,a as validateAccessoryItems,c as validateBasicCartItem,n as validateCartItems,p as validateCartStatus,u as validatePrice,f as validateQuantity,m as validateUuid};
@@ -1 +1 @@
1
- import{MediaType as e,FileFormat as n}from"../public/media.js";import{videoAndImageMediaAPISupportVersion as t,nonFullScreenVideoModeAPISupportVersion as r,imageOutputFormatsAPISupportVersion as l}from"./constants.js";import{throwExceptionIfMobileApiIsNotSupported as o}from"./internalAPIs.js";function u(e,n){if(null==e||null==n||e.length<=0)return null;let t=null,r=1;return e.sort(((e,n)=>e.sequence>n.sequence?1:-1)),e.forEach((e=>{e.sequence==r&&(t=t?new Blob([t,e.file],{type:n}):new Blob([e.file],{type:n}),r++)})),t}function i(e,n){if(null==e||null==n)return null;const t=atob(e.chunk),r=new Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);const l=new Uint8Array(r),o=new Blob([l],{type:n});return{sequence:e.chunkSequence,file:o}}function c(e){s(e)?o(t):p(e)?o(r):d(e)&&o(l)}function a(n){return!(n.mediaType!=e.Video||!n.videoProps||!n.videoProps.videoController)}function f(e){return!(null==e||e.maxMediaCount>10)}function d(n){var t;return!((null==n?void 0:n.mediaType)!=e.Image||!(null===(t=null==n?void 0:n.imageProps)||void 0===t?void 0:t.imageOutputFormats))}function s(n){return!(!n||n.mediaType!=e.VideoAndImage&&!n.videoAndImageProps)}function p(n){return!(!n||n.mediaType!=e.Video||!n.videoProps||n.videoProps.isFullScreenMode)}function m(e,t,r){return null!=e&&null!=t&&t==n.ID&&null!=r}function I(e){return!(null==e||e.length<=0||e.length>10)}function v(e){return!e||!(null===e.timeOutIntervalInSec||null!=e.timeOutIntervalInSec&&e.timeOutIntervalInSec<=0||null!=e.timeOutIntervalInSec&&e.timeOutIntervalInSec>60)}function g(e){if(e){if(e.title&&"string"!=typeof e.title)return!1;if(e.setSelected&&"object"!=typeof e.setSelected)return!1;if(e.openOrgWideSearchInChatOrChannel&&"boolean"!=typeof e.openOrgWideSearchInChatOrChannel)return!1;if(e.singleSelect&&"boolean"!=typeof e.singleSelect)return!1}return!0}export{u as createFile,i as decodeAttachment,d as isMediaCallForImageOutputFormats,p as isMediaCallForNonFullScreenVideoMode,s as isMediaCallForVideoAndImageInputs,a as isVideoControllerRegistered,c as throwExceptionIfMediaCallIsNotSupportedOnMobile,m as validateGetMediaInputs,g as validatePeoplePickerInput,v as validateScanBarCodeInput,f as validateSelectMediaInputs,I as validateViewImagesInput};
1
+ import{FileFormat as e,MediaType as n}from"../public/media.js";import{videoAndImageMediaAPISupportVersion as t,nonFullScreenVideoModeAPISupportVersion as r,imageOutputFormatsAPISupportVersion as l}from"./constants.js";import{throwExceptionIfMobileApiIsNotSupported as o}from"./internalAPIs.js";function u(e,n){if(null==e||null==n||e.length<=0)return null;let t=null,r=1;return e.sort((e,n)=>e.sequence>n.sequence?1:-1),e.forEach(e=>{e.sequence==r&&(t=t?new Blob([t,e.file],{type:n}):new Blob([e.file],{type:n}),r++)}),t}function i(e,n){if(null==e||null==n)return null;const t=atob(e.chunk),r=new Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);const l=new Uint8Array(r),o=new Blob([l],{type:n});return{sequence:e.chunkSequence,file:o}}function c(e){s(e)?o(t):p(e)?o(r):d(e)&&o(l)}function a(e){return!(e.mediaType!=n.Video||!e.videoProps||!e.videoProps.videoController)}function f(e){return!(null==e||e.maxMediaCount>10)}function d(e){var t;return!((null==e?void 0:e.mediaType)!=n.Image||!(null===(t=null==e?void 0:e.imageProps)||void 0===t?void 0:t.imageOutputFormats))}function s(e){return!(!e||e.mediaType!=n.VideoAndImage&&!e.videoAndImageProps)}function p(e){return!(!e||e.mediaType!=n.Video||!e.videoProps||e.videoProps.isFullScreenMode)}function m(n,t,r){return null!=n&&null!=t&&t==e.ID&&null!=r}function I(e){return!(null==e||e.length<=0||e.length>10)}function v(e){return!e||!(null===e.timeOutIntervalInSec||null!=e.timeOutIntervalInSec&&e.timeOutIntervalInSec<=0||null!=e.timeOutIntervalInSec&&e.timeOutIntervalInSec>60)}function g(e){if(e){if(e.title&&"string"!=typeof e.title)return!1;if(e.setSelected&&"object"!=typeof e.setSelected)return!1;if(e.openOrgWideSearchInChatOrChannel&&"boolean"!=typeof e.openOrgWideSearchInChatOrChannel)return!1;if(e.singleSelect&&"boolean"!=typeof e.singleSelect)return!1}return!0}export{u as createFile,i as decodeAttachment,d as isMediaCallForImageOutputFormats,p as isMediaCallForNonFullScreenVideoMode,s as isMediaCallForVideoAndImageInputs,a as isVideoControllerRegistered,c as throwExceptionIfMediaCallIsNotSupportedOnMobile,m as validateGetMediaInputs,g as validatePeoplePickerInput,v as validateScanBarCodeInput,f as validateSelectMediaInputs,I as validateViewImagesInput};
@@ -1 +1 @@
1
- import{__rest as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{UUID as t}from"../public/uuidObject.js";const u=t=>{const{uuid:u}=t,s=i(t,["uuid"]),n=null==u?void 0:u.toString();return Object.assign(Object.assign({},s),{uuidAsString:n})},s=u=>{const{uuidAsString:s}=u,n=i(u,["uuidAsString"]);return Object.assign(Object.assign({},n),{uuid:s?new t(s):void 0})},n=u=>{const{uuidAsString:s}=u,n=i(u,["uuidAsString"]);return Object.assign(Object.assign({},n),{uuid:s?new t(s):void 0})},r=t=>{const{uuid:u}=t,s=i(t,["uuid"]),n=null==u?void 0:u.toString();return Object.assign(Object.assign({},s),{uuidAsString:n})};export{s as deserializeMessageRequest,n as deserializeMessageResponse,u as serializeMessageRequest,r as serializeMessageResponse};
1
+ import{__rest as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{UUID as t}from"../public/uuidObject.js";const u=t=>{const{uuid:u}=t,s=i(t,["uuid"]),n=null==u?void 0:u.toString();return Object.assign(Object.assign({},s),{uuidAsString:n})},s=u=>{const{uuidAsString:s}=u,n=i(u,["uuidAsString"]);return Object.assign(Object.assign({},n),{uuid:s?new t(s):void 0})},n=u=>{const{uuidAsString:s}=u,n=i(u,["uuidAsString"]);return Object.assign(Object.assign({},n),{uuid:s?new t(s):void 0})},r=t=>{const{uuid:u}=t,s=i(t,["uuid"]),n=null==u?void 0:u.toString();return Object.assign(Object.assign({},s),{uuidAsString:n})};export{s as deserializeMessageRequest,n as deserializeMessageResponse,u as serializeMessageRequest,r as serializeMessageResponse};
@@ -1 +1 @@
1
- import{AppId as t}from"../public/appId.js";import{FrameContexts as e,errorNotSupportedOnPlatform as n}from"../public/constants.js";import{isSupported as i}from"../public/pages/pages.js";import{runtime as r}from"../public/runtime.js";import{shouldEventBeRelayedToChild as o,sendMessageEventToChild as s}from"./childCommunication.js";import{sendAndHandleStatusAndReasonWithDefaultError as a,sendAndUnwrap as c,sendMessageToParent as u,sendAndHandleStatusAndReason as p}from"./communication.js";import{registerHandler as m}from"./handlers.js";import{ensureInitialized as f}from"./internalAPIs.js";import{getApiVersionTag as g}from"./telemetry.js";import{isSupported as b,navigateBack as l}from"../public/pages/backStack.js";import{isSupported as d}from"../public/pages/tabs.js";import{isSupported as w}from"../public/pages/config.js";const h="v2";function P(t,o){return new Promise((s=>{if(f(r,e.content,e.sidePanel,e.settings,e.remove,e.task,e.stage,e.meetingStage),!i())throw n;s(a(t,"navigateCrossDomain","Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.",o))}))}function j(t){return new Promise((e=>{if(f(r),!b())throw n;e(a(t,"navigateBack","Back navigation is not supported in the current client or context."))}))}function v(t,e){return new Promise((i=>{if(f(r),!d())throw n;i(a(t,"navigateToTab","Invalid internalTabInstanceId and/or channelId were/was provided",e))}))}function I(t,e){if(f(r),!i())throw n;u(t,"returnFocus",[e])}function S(t,e){return new Promise((i=>{if(f(r),!d())throw n;i(c(t,"getTabInstances",e))}))}function k(t,e){return new Promise((i=>{if(f(r),!d())throw n;i(c(t,"getMruTabInstances",e))}))}function U(t,o){if(f(r,e.content,e.sidePanel,e.meetingStage),!i())throw n;u(t,"shareDeepLink",[o.subPageId,o.subPageLabel,o.subPageWebUrl])}function B(t,o){if(f(r,e.content),!i())throw n;u(t,"setFrameContext",[o])}function T(t,i){if(f(r,e.settings,e.remove),!w())throw n;u(t,"settings.setValidityState",[i])}function C(t){return new Promise((o=>{if(f(r,e.content,e.settings,e.remove,e.sidePanel),!i())throw n;o(c(t,"settings.getSettings"))}))}function L(t,i){return new Promise((o=>{if(f(r,e.content,e.settings,e.sidePanel),!w())throw n;o(p(t,"settings.setSettings",i))}))}function O(e){return e.appId instanceof t}function x(e){return Object.assign(Object.assign({},e),{appId:new t(e.appId),webUrl:e.webUrl?new URL(e.webUrl):void 0})}function y(t){return Object.assign(Object.assign({},t),{appId:t.appId.toString(),webUrl:t.webUrl?t.webUrl.toString():void 0})}let D;function F(t){D=t}function R(){m(g("v2","pages.backStack.registerBackButtonPressHandler"),"backButtonPress",A,!1)}function A(){D&&D()||(o()?s("backButtonPress",[]):l())}export{j as backStackNavigateBackHelper,L as configSetConfigHelper,T as configSetValidityStateHelper,y as convertAppNavigationParametersToNavigateToAppParams,x as convertNavigateToAppParamsToAppNavigationParameters,C as getConfigHelper,k as getMruTabInstancesHelper,S as getTabInstancesHelper,R as initializeBackStackHelper,O as isAppNavigationParametersObject,P as navigateCrossDomainHelper,h as pagesTelemetryVersionNumber,I as returnFocusHelper,F as setBackButtonPressHandler,B as setCurrentFrameHelper,U as shareDeepLinkHelper,v as tabsNavigateToTabHelper};
1
+ import{AppId as t}from"../public/appId.js";import{errorNotSupportedOnPlatform as e,FrameContexts as n}from"../public/constants.js";import{isSupported as i}from"../public/pages/pages.js";import{runtime as r}from"../public/runtime.js";import{shouldEventBeRelayedToChild as o,sendMessageEventToChild as s}from"./childCommunication.js";import{sendAndUnwrap as a,sendMessageToParent as c,sendAndHandleStatusAndReasonWithDefaultError as u,sendAndHandleStatusAndReason as p}from"./communication.js";import{registerHandler as m}from"./handlers.js";import{ensureInitialized as f}from"./internalAPIs.js";import{getApiVersionTag as g}from"./telemetry.js";import{isSupported as b}from"../public/pages/tabs.js";import{isSupported as l,navigateBack as d}from"../public/pages/backStack.js";import{isSupported as w}from"../public/pages/config.js";const h="v2";function P(t,o){return new Promise(s=>{if(f(r,n.content,n.sidePanel,n.settings,n.remove,n.task,n.stage,n.meetingStage),!i())throw e;s(u(t,"navigateCrossDomain","Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.",o))})}function j(t){return new Promise(n=>{if(f(r),!l())throw e;n(u(t,"navigateBack","Back navigation is not supported in the current client or context."))})}function v(t,n){return new Promise(i=>{if(f(r),!b())throw e;i(u(t,"navigateToTab","Invalid internalTabInstanceId and/or channelId were/was provided",n))})}function I(t,n){if(f(r),!i())throw e;c(t,"returnFocus",[n])}function S(t,n){return new Promise(i=>{if(f(r),!b())throw e;i(a(t,"getTabInstances",n))})}function k(t,n){return new Promise(i=>{if(f(r),!b())throw e;i(a(t,"getMruTabInstances",n))})}function U(t,o){if(f(r,n.content,n.sidePanel,n.meetingStage),!i())throw e;c(t,"shareDeepLink",[o.subPageId,o.subPageLabel,o.subPageWebUrl])}function B(t,o){if(f(r,n.content),!i())throw e;c(t,"setFrameContext",[o])}function T(t,i){if(f(r,n.settings,n.remove),!w())throw e;c(t,"settings.setValidityState",[i])}function C(t){return new Promise(o=>{if(f(r,n.content,n.settings,n.remove,n.sidePanel),!i())throw e;o(a(t,"settings.getSettings"))})}function L(t,i){return new Promise(o=>{if(f(r,n.content,n.settings,n.sidePanel),!w())throw e;o(p(t,"settings.setSettings",i))})}function O(e){return e.appId instanceof t}function x(e){return Object.assign(Object.assign({},e),{appId:new t(e.appId),webUrl:e.webUrl?new URL(e.webUrl):void 0})}function y(t){return Object.assign(Object.assign({},t),{appId:t.appId.toString(),webUrl:t.webUrl?t.webUrl.toString():void 0})}let D;function F(t){D=t}function R(){m(g("v2","pages.backStack.registerBackButtonPressHandler"),"backButtonPress",A,!1)}function A(){D&&D()||(o()?s("backButtonPress",[]):d())}export{j as backStackNavigateBackHelper,L as configSetConfigHelper,T as configSetValidityStateHelper,y as convertAppNavigationParametersToNavigateToAppParams,x as convertNavigateToAppParamsToAppNavigationParameters,C as getConfigHelper,k as getMruTabInstancesHelper,S as getTabInstancesHelper,R as initializeBackStackHelper,O as isAppNavigationParametersObject,P as navigateCrossDomainHelper,h as pagesTelemetryVersionNumber,I as returnFocusHelper,F as setBackButtonPressHandler,B as setCurrentFrameHelper,U as shareDeepLinkHelper,v as tabsNavigateToTabHelper};
@@ -0,0 +1 @@
1
+ const t=/^[A-Za-z][A-Za-z\d+.-]*:\/\//;function s(t,s){const n=t.substring(1);return t===s||"*."===t.substring(0,2)&&s.length>n.length&&s.split(".").length===n.split(".").length&&s.substring(s.length-n.length)===n}class n{constructor(t,s,n){this.protocol=t,this.host=s,this.logger=n}static canUse(s){return t.test(s)}static create(t,s){const e=t.split("://");return new n(e[0],e[1],s.extend("InternalURLPattern"))}test(t){return this.logger("Testing URL %s against pattern protocol: %s, host: %s",t,this.protocol,this.host),t.protocol===`${this.protocol}:`&&(!t.host||s(this.host,t.host))}}function e(t){return n.canUse(t)}function o(t,s){if(n.canUse(t))return n.create(t,s);s("No URL verifier available for pattern: %s",t)}export{o as createURLVerifier,e as isValidPatternUrl,s as validateHostAgainstPattern};