@googleworkspace/meet-addons 0.9.1-667741765 → 0.9.1-668624766
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.
- package/meet.addons.d.ts +2 -0
- package/meet.addons.js +37 -36
- package/package.json +1 -1
package/meet.addons.d.ts
CHANGED
|
@@ -363,6 +363,7 @@ export type ErrorType =
|
|
|
363
363
|
| 'DestinationNotReady'
|
|
364
364
|
| 'InternalError'
|
|
365
365
|
| 'InvalidActivityStartingState'
|
|
366
|
+
| 'InvalidAddonStartingState'
|
|
366
367
|
| 'InvalidCloudProjectNumber'
|
|
367
368
|
| 'MissingUrlParameter'
|
|
368
369
|
| 'NeedsMainStageContext'
|
|
@@ -371,6 +372,7 @@ export type ErrorType =
|
|
|
371
372
|
| 'NotSupportedInStandalone'
|
|
372
373
|
| 'RequiresEapEnrollment'
|
|
373
374
|
| 'SizeLimitExceededActivityStartingState'
|
|
375
|
+
| 'SizeLimitExceededAddonStartingState'
|
|
374
376
|
| 'SizeLimitExceededFrameToFrameMessage'
|
|
375
377
|
| 'UserCancelled'
|
|
376
378
|
| 'UserNotInitiator';
|
package/meet.addons.js
CHANGED
|
@@ -32,41 +32,42 @@ xc={errorType:"ActivityStartingStateUnrecognizedAttributes",message:"The supplie
|
|
|
32
32
|
zc={errorType:"AddonStartingStateUnrecognizedAttributes",message:"The supplied AddonStartingState object contains attributes that are not recognized.",g:"Ensure that the AddonStartingState object has only the following attributes: sidePanelUrl, additionalData."},Ac=a=>({errorType:"ArgumentNullError",message:`The argument supplied for '${a}' was 'null' but a value was expected.`,g:"Ensure you are passing a value of the expected type for the argument."}),M=(a,b,c)=>({errorType:"ArgumentTypeError",message:`The type '${b}' of argument supplied for '${a}' did not match the expected type '${c}'.`,
|
|
33
33
|
g:"Ensure the type of the argument provided matches the expected type."}),Bc=a=>({errorType:"InternalError",message:`Could not connect to ${a} channel. Unknown error`,g:"No further information is available."}),Cc={errorType:"ActivityIsOngoing",message:"Operation cannot be performed while an activity is ongoing.",g:"Ensure that no activity is ongoing."},Dc={errorType:"InternalError",message:"Frame message missing required Meet SDK command.",g:"Send one of the available commands in the frame message."},
|
|
34
34
|
Ec={errorType:"RequiresEapEnrollment",message:"This feature is only available to early access partners.",g:"Meet add-on early access enrollment is currently closed."},Fc={errorType:"UserNotInitiator",message:"Operation cannot be performed because the user is not the initiator of the current activity.",g:"Ensure that the user is the initiator of the current activity or that the activity has ended."},Gc={errorType:"SizeLimitExceededActivityStartingState",message:"The size of the activityStartingState URLs and/or its data exceed the limits allowed.",
|
|
35
|
-
g:"Ensure that the activityStartingState URL size is less than 512 characters and the data size is less than 4096 characters."},Hc={errorType:"SizeLimitExceededFrameToFrameMessage",message:"The size of the frame to frame message exceeds the limits allowed.",g:"Ensure that the frame to frame message size is less than 1,000,000 characters."},Ic={errorType:"AddonSessionAlreadyCreated",message:"The addon session has already been created.",g:"Only instantiate the AddonSession once."},Jc={errorType:"UserCancelled",
|
|
36
|
-
message:"The user cancelled starting an activity.",g:"The user needs to click continue to start the activity."},Kc={errorType:"NotSupportedInMeetCall",message:"This method is not supported during a Meet call.",g:"Do not call this method during a Meet call."}
|
|
37
|
-
|
|
38
|
-
function
|
|
35
|
+
g:"Ensure that the activityStartingState URL size is less than 512 characters and the additional data size is less than 4096 characters."},Hc={errorType:"SizeLimitExceededFrameToFrameMessage",message:"The size of the frame to frame message exceeds the limits allowed.",g:"Ensure that the frame to frame message size is less than 1,000,000 characters."},Ic={errorType:"AddonSessionAlreadyCreated",message:"The addon session has already been created.",g:"Only instantiate the AddonSession once."},Jc={errorType:"UserCancelled",
|
|
36
|
+
message:"The user cancelled starting an activity.",g:"The user needs to click continue to start the activity."},Kc={errorType:"NotSupportedInMeetCall",message:"This method is not supported during a Meet call.",g:"Do not call this method during a Meet call."},Lc={errorType:"InvalidAddonStartingState",message:"Origin of the AddonStartingState iframeURLs does not match the origin of the URLs provided in the Add-on manifest.",g:"Ensure that the AddonStartingState iframeURL origins match the origins of the URLs provided in the Add-on manifest."},
|
|
37
|
+
Mc={errorType:"SizeLimitExceededAddonStartingState",message:"The size of the AddonStartingState URLs and/or its data exceed the limits allowed.",g:"Ensure that the AddonStartingState URL size is less than 512 characters and the additional data size is less than 4096 characters."};
|
|
38
|
+
function Nc(a){switch(a){case 0:return lc;case 1:return tc;case 2:return vc;case 3:return Cc;case 4:return Dc;case 5:return Ec;case 6:return qc;case 7:return Fc;case 8:return Gc;case 9:return Hc;case 10:return Jc;case 11:return Kc;case 12:return Lc;case 13:return Mc;default:return mc}}
|
|
39
|
+
function Oc(a){let b;var c=(b=H(a,1))!=null?b:0;a=Pc(a.Aa());switch(c){case 1:return{errorType:"InternalError",message:`Could not connect to ${a} channel. Meet did not respond with a MessagePort.`,g:"No further information is available."};case 2:return{errorType:"InternalError",message:`Could not connect to ${a}. A conflicting ${a} exists.`,g:"No further information is available."};case 3:return{errorType:"InternalError",message:`Could not connect to ${a} channel. The addon does not have permission to open a ${a}.`,
|
|
39
40
|
g:"No further information is available."};case 4:return{errorType:"InternalError",message:`Could not connect to ${a} channel. The addon is not authorized for this ${a}.`,g:"No further information is available."};case 0:return Bc(a);case 5:a:switch(a){case "coActivity":c={errorType:"InternalError",message:`Could not connect to ${a} channel. The coActivity was not found.`,g:`Consider starting the ${a} only after after the startActivity promise returns.`};break a;default:c={errorType:"InternalError",
|
|
40
|
-
message:`Could not connect to ${a} channel.`,g:"No further information is available."}}return c;default:return Bc(a)}}function
|
|
41
|
-
typeof a.additionalData!=="string")throw new L(M("additionalData",typeof a.additionalData,"string | undefined"));if(Object.keys(a).length!==+!!a.mainStageUrl+ +!!a.sidePanelUrl+ +!!a.additionalData)throw new L(xc);if(Object.keys(a).length===0)throw new L(wc);}},
|
|
42
|
-
this.Fa.frameToFrameMessage;b=J(b.content,
|
|
43
|
-
const b=a==null?void 0:a.ia().find(c=>c.getFrameType()===2);a=a==null?void 0:a.ia().find(c=>c.getFrameType()===1);return{mainStageUrl:(b==null?void 0:G(b,2))||void 0,sidePanelUrl:(a==null?void 0:G(a,2))||void 0,additionalData:(a==null?void 0:G(a,3))||void 0}}async setActivityStartingState(a){
|
|
44
|
-
1)),!1)}}async closeAddon(){await
|
|
45
|
-
e,!1);this.port1={};this.port2={postMessage:function(){f.postMessage(g,h)}}});if(typeof a!=="undefined"){var b=new a,c={},d=c;b.port1.onmessage=function(){if(c.next!==void 0){c=c.next;var e=c.wa;c.wa=null;e()}};return function(e){d.next={wa:e};d=d.next;b.port2.postMessage(0)}}return function(e){k.setTimeout(e,0)}};class
|
|
46
|
-
var
|
|
47
|
-
R.prototype.cancel=function(a){if(this.l==0){var b=new S(a);
|
|
48
|
-
var
|
|
49
|
-
h);m===void 0&&h instanceof S?g(h):f(m)}catch(p){g(p)}}:g});e.v.B=a;
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
{a.j.delete(b);const f=
|
|
55
|
-
this.va&&this.Ea)c.resolve(this.ab);else if(this.I.add(c),
|
|
56
|
-
async function
|
|
57
|
-
var
|
|
58
|
-
W,d=new Q;b=E(d,15,O,b);await c(a,T(b))},
|
|
59
|
-
` ${JSON.stringify(b)}. ${JSON.stringify(d)}`)}(b=J(c,
|
|
60
|
-
|
|
61
|
-
class
|
|
62
|
-
function
|
|
63
|
-
const
|
|
64
|
-
function
|
|
65
|
-
class
|
|
66
|
-
this.s=null;this.oa=0;d&&
|
|
41
|
+
message:`Could not connect to ${a} channel.`,g:"No further information is available."}}return c;default:return Bc(a)}}function Pc(a){switch(a){case 2:return"coActivity";case 3:return"guaranteed delivery";case 0:return"unknown";default:return"unknown"}}function Qc({errorType:a,message:b,g:c},d=""){throw new L({errorType:a,message:d?`${b} ${d}`:b,g:c});}function Rc(a,b){Qc({...nc,message:`${nc.message}: ${a}. In URL ${b}`})};var Sc=function(a){var b=new Yb;return C(b,1,w(a),0)},Tc=function(a,b){return C(a,2,x(b),"")},Uc=function(a,b){return C(a,3,x(b),"")},Yb=class extends K{getFrameType(){return H(this,1)}};var Vc=class extends K{ia(){return $b(this)}X(a){return ac(this,a)}};var Wc=class extends K{constructor(){super()}};var Yc=function(a){var b=new Xc;return C(b,1,w(a),0)},Xc=class extends K{constructor(){super()}};var Zc=class extends K{La(a){return C(this,2,x(a),"")}};var $c=class extends K{};var ad=class extends K{};var cd=class extends K{S(){return A(this,bd)}la(){return J(this,Vc,2,bd)}aa(a){return E(this,2,bd,a)}getMeetingInfo(){return J(this,ad,3,bd)}getMeetPlatformInfo(){return J(this,$c,4,bd)}},bd=[2,3,4,5];var ed=class extends K{Ba(){return A(this,dd)}},dd=[1,4,5,6,7,8,9,10,11,12,13,14,15,16,17];var fd=class extends K{constructor(){super()}la(){return Wb(this,Vc,1)}aa(a){return D(this,1,a)}};var gd=class extends K{constructor(){super()}la(){return Wb(this,Vc,1)}aa(a){return D(this,1,a)}};var hd=new Map([[2,"MAIN_STAGE"],[1,"SIDE_PANEL"]]),id=new Map([[0,"UNKNOWN"],[1,"OPEN_ADDON"],[2,"START_ACTIVITY"],[3,"JOIN_ACTIVITY"]]);function jd(a){a&&typeof a.dispose=="function"&&a.dispose()};var N=function(){this.o=this.o;this.A=this.A};N.prototype.o=!1;N.prototype.dispose=function(){this.o||(this.o=!0,this.fa())};N.prototype[Symbol.dispose]=function(){this.dispose()};var kd=function(a,b){a.o?b():(a.A||(a.A=[]),a.A.push(b))};N.prototype.fa=function(){if(this.A)for(;this.A.length;)this.A.shift()()};var ld=function({ta:a,Ha:b}){if(a===null)throw new L(Ac("activityStartingState"));if(b||a!==void 0){if(typeof a!=="object")throw new L(M("activityStartingState",typeof a,`object${b?"":" | undefined"}`));if(a.mainStageUrl!==void 0&&typeof a.mainStageUrl!=="string")throw new L(M("mainStageUrl",typeof a.mainStageUrl,"string | undefined"));if(a.sidePanelUrl!==void 0&&typeof a.sidePanelUrl!=="string")throw new L(M("sidePanelUrl",typeof a.sidePanelUrl,"string | undefined"));if(a.additionalData!==void 0&&
|
|
42
|
+
typeof a.additionalData!=="string")throw new L(M("additionalData",typeof a.additionalData,"string | undefined"));if(Object.keys(a).length!==+!!a.mainStageUrl+ +!!a.sidePanelUrl+ +!!a.additionalData)throw new L(xc);if(Object.keys(a).length===0)throw new L(wc);}},md=function(a){const b=[];b.push(Uc(Tc(Sc(2),a.mainStageUrl),a.additionalData));b.push(Uc(Tc(Sc(1),a.sidePanelUrl),a.additionalData));return b},ud=class extends N{constructor(a){super();this.context=a;this.Fa={};nd(this.context.i.hb,b=>{switch(b.content.Ba()){case 7:const d=
|
|
43
|
+
this.Fa.frameToFrameMessage;b=J(b.content,Zc,7,dd);if(d&&b){var c=H(b,1);c=hd.get(c);if(c===void 0)throw Error("Unknown frame type.");d({originator:c,payload:G(b,2)})}break;case 16:od(this.context.i)}})}async getMeetingInfo(){const a=await pd(this.context.i,Yc(2));return{meetingId:G(a.getMeetingInfo(),1)}}async getFrameOpenReason(){let a;const b=(a=this.context.P.Wa)!=null?a:0;let c;return(c=id.get(b))!=null?c:"UNKNOWN"}async getActivityStartingState(){var a=(await pd(this.context.i,Yc(1))).la();
|
|
44
|
+
const b=a==null?void 0:a.ia().find(c=>c.getFrameType()===2);a=a==null?void 0:a.ia().find(c=>c.getFrameType()===1);return{mainStageUrl:(b==null?void 0:G(b,2))||void 0,sidePanelUrl:(a==null?void 0:G(a,2))||void 0,additionalData:(a==null?void 0:G(a,3))||void 0}}async setActivityStartingState(a){ld({ta:a,Ha:!0});a=md(a);await qd(this.context.i,(new fd).aa((new Vc).X(a)))}on(a,b){this.Fa[a]=b}async getMeetPlatformInfo(){const a=await pd(this.context.i,Yc(3));return{isMeetHardware:F(qb(Pb(a.getMeetPlatformInfo(),
|
|
45
|
+
1)),!1)}}async closeAddon(){await rd(this.context.i)}async startActivity(a){ld({ta:a,Ha:!1});const b=new gd;a&&(a=md(a),b.aa((new Vc).X(a)));await sd(this.context.i,b)}async endActivity(a){var b=td,c=this.context.i,d=new Wc;a=C(d,1,w(a==="aab61ee0-51b4-475d-aa4d-849f2498640d"?999:0),0);await b(c,a)}};var vd=fc(class extends K{getFrameOpenReason(){return H(this,5)}});function wd(){var a=window.location.href;var b=window.location.href;var c=(new URL(b)).searchParams.get("meet_sdk");c?b=vd(atob(c)):(Rc("meet_sdk",b),b=void 0);(c=G(b,1))||Rc("meet_addon_frame_type",a);c=Number(c);if(c!==2&&c!==1)throw new L(rc);const d=G(b,2);d||Rc("meet_control_channel_name",a);const e=G(b,4);e||Rc("addon_cloud_project_number",a);var f;a=(f=b.getFrameOpenReason())!=null?f:0;f=G(b,3)||"https://meet.google.com";return{Wa:a,frameType:c,Sa:d,cloudProjectNumber:e,Ia:f}};var xd=class extends K{constructor(){super()}};var yd=class extends K{constructor(){super()}};var Bd=function(){var a=new zd,b=new yd;return E(a,1,Ad,b)},zd=class extends K{constructor(){super()}Aa(){return A(this,Ad)}},Ad=[1,2];var Cd=class extends K{constructor(){super()}};var Dd=class extends K{constructor(){super()}};var Ed=class extends K{constructor(){super()}La(a){return C(this,2,x(a),"")}};var Fd=class extends K{constructor(){super()}};var Gd=class extends K{constructor(){super()}ia(){return $b(this)}X(a){return ac(this,a)}};var Hd=class extends K{constructor(){super()}setAddonStartingState(a){return D(this,1,a)}};var Id=class extends K{constructor(){super()}};var Q=class extends K{constructor(){super()}Ba(){return A(this,O)}},O=[1,2,5,6,7,8,9,10,11,13,14,15,16];var Jd=class extends K{},Kd=fc(Jd),Ld=[1,2];class Md{constructor(a,b){this.data=a;this.channel=b}};var Nd=Promise;var Pd=function(a){const b=new MessageChannel;Od(b.port1,a);return b},Rd=function(a,b){Od(a,b);return new Qd(a)};class Qd{constructor(a){this.jb=a}send(a,b,c=[]){b=Pd(b);this.jb.postMessage(a,[b.port2].concat(c))}O(a,b){return new Nd(c=>{this.send(a,c,b)})}}const Od=function(a,b){b&&(a.onmessage=c=>{var d=c.data;c=Rd(c.ports[0]);b(new Md(d,c))})};class Sd{constructor(a,b){this.bb=100;this.Ta=a;this.mb=b;this.W=0;this.V=null}get(){let a;this.W>0?(this.W--,a=this.V,this.V=a.next,a.next=null):a=this.Ta();return a}put(a){this.mb(a);this.W<this.bb&&(this.W++,a.next=this.V,this.V=a)}};var Td=function(){var a=document;var b="IFRAME";a.contentType==="application/xhtml+xml"&&(b=b.toLowerCase());return a.createElement(b)};var Ud=function(){};var Vd,Wd=function(){var a=k.MessageChannel;typeof a==="undefined"&&typeof window!=="undefined"&&window.postMessage&&window.addEventListener&&!n("Presto")&&(a=function(){var e=Td();e.style.display="none";document.documentElement.appendChild(e);var f=e.contentWindow;e=f.document;e.open();e.close();var g="callImmediate"+Math.random(),h=f.location.protocol=="file:"?"*":f.location.protocol+"//"+f.location.host;e=ha(function(m){if((h=="*"||m.origin==h)&&m.data==g)this.port1.onmessage()},this);f.addEventListener("message",
|
|
46
|
+
e,!1);this.port1={};this.port2={postMessage:function(){f.postMessage(g,h)}}});if(typeof a!=="undefined"){var b=new a,c={},d=c;b.port1.onmessage=function(){if(c.next!==void 0){c=c.next;var e=c.wa;c.wa=null;e()}};return function(e){d.next={wa:e};d=d.next;b.port2.postMessage(0)}}return function(e){k.setTimeout(e,0)}};class Xd{constructor(){this.ca=this.J=null}add(a,b){const c=Yd.get();c.set(a,b);this.ca?this.ca.next=c:this.J=c;this.ca=c}remove(){let a=null;this.J&&(a=this.J,this.J=this.J.next,this.J||(this.ca=null),a.next=null);return a}}var Yd=new Sd(()=>new Zd,a=>a.reset());class Zd{constructor(){this.next=this.scope=this.ha=null}set(a,b){this.ha=a;this.scope=b;this.next=null}reset(){this.next=this.scope=this.ha=null}};let $d,ae=!1,be=new Xd,de=(a,b)=>{$d||ce();ae||($d(),ae=!0);be.add(a,b)},ce=()=>{if(k.Promise&&k.Promise.resolve){const a=k.Promise.resolve(void 0);$d=()=>{a.then(ee)}}else $d=()=>{var a=ee;typeof k.setImmediate!=="function"||k.Window&&k.Window.prototype&&k.Window.prototype.setImmediate==k.setImmediate?(Vd||(Vd=Wd()),Vd(a)):k.setImmediate(a)}};var ee=()=>{let a;for(;a=be.remove();){try{a.ha.call(a.scope)}catch(b){l(b)}Yd.put(a)}ae=!1};var R=function(a){this.l=0;this.Ja=void 0;this.C=this.u=this.B=null;this.T=this.ga=!1;if(a!=Ud)try{var b=this;a.call(void 0,function(c){fe(b,2,c)},function(c){fe(b,3,c)})}catch(c){fe(this,3,c)}},ge=function(){this.next=this.context=this.H=this.N=this.v=null;this.L=!1};ge.prototype.reset=function(){this.context=this.H=this.N=this.v=null;this.L=!1};
|
|
47
|
+
var he=new Sd(function(){return new ge},function(a){a.reset()}),ie=function(a,b,c){var d=he.get();d.N=a;d.H=b;d.context=c;return d},ke=function(){var a,b,c=new R(function(d,e){a=d;b=e});return new je(c,a,b)};R.prototype.then=function(a,b,c){return le(this,typeof a==="function"?a:null,typeof b==="function"?b:null,c)};R.prototype.$goog_Thenable=!0;var ne=function(a,b){b=ie(b,b);b.L=!0;me(a,b)};R.prototype.nb=function(a,b){return le(this,null,a,b)};R.prototype.catch=R.prototype.nb;
|
|
48
|
+
R.prototype.cancel=function(a){if(this.l==0){var b=new S(a);de(function(){oe(this,b)},this)}};
|
|
49
|
+
var oe=function(a,b){if(a.l==0)if(a.B){var c=a.B;if(c.u){for(var d=0,e=null,f=null,g=c.u;g&&(g.L||(d++,g.v==a&&(e=g),!(e&&d>1)));g=g.next)e||(f=g);e&&(c.l==0&&d==1?oe(c,b):(f?(d=f,d.next==c.C&&(c.C=d),d.next=d.next.next):pe(c),qe(c,e,3,b)))}a.B=null}else fe(a,3,b)},me=function(a,b){a.u||a.l!=2&&a.l!=3||re(a);a.C?a.C.next=b:a.u=b;a.C=b},le=function(a,b,c,d){var e=ie(null,null,null);e.v=new R(function(f,g){e.N=b?function(h){try{var m=b.call(d,h);f(m)}catch(p){g(p)}}:f;e.H=c?function(h){try{var m=c.call(d,
|
|
50
|
+
h);m===void 0&&h instanceof S?g(h):f(m)}catch(p){g(p)}}:g});e.v.B=a;me(a,e);return e.v};R.prototype.ob=function(a){this.l=0;fe(this,2,a)};R.prototype.pb=function(a){this.l=0;fe(this,3,a)};
|
|
51
|
+
var fe=function(a,b,c){if(a.l==0){a===c&&(b=3,c=new TypeError("Promise cannot resolve to itself"));a.l=1;a:{var d=c,e=a.ob,f=a.pb;if(d instanceof R){me(d,ie(e||Ud,f||null,a));var g=!0}else{if(d)try{var h=!!d.$goog_Thenable}catch(p){h=!1}else h=!1;if(h)d.then(e,f,a),g=!0;else{h=typeof d;if(h=="object"&&d!=null||h=="function")try{var m=d.then;if(typeof m==="function"){se(d,m,e,f,a);g=!0;break a}}catch(p){f.call(a,p);g=!0;break a}g=!1}}}g||(a.Ja=c,a.l=b,a.B=null,re(a),b!=3||c instanceof S||te(a,c))}},
|
|
52
|
+
se=function(a,b,c,d,e){var f=!1,g=function(m){f||(f=!0,c.call(e,m))},h=function(m){f||(f=!0,d.call(e,m))};try{b.call(a,g,h)}catch(m){h(m)}},re=function(a){a.ga||(a.ga=!0,de(a.Va,a))},pe=function(a){var b=null;a.u&&(b=a.u,a.u=b.next,b.next=null);a.u||(a.C=null);return b};R.prototype.Va=function(){for(var a;a=pe(this);)qe(this,a,this.l,this.Ja);this.ga=!1};
|
|
53
|
+
var qe=function(a,b,c,d){if(c==3&&b.H&&!b.L)for(;a&&a.T;a=a.B)a.T=!1;if(b.v)b.v.B=null,ue(b,c,d);else try{b.L?b.N.call(b.context):ue(b,c,d)}catch(e){ve.call(null,e)}he.put(b)},ue=function(a,b,c){b==2?a.N.call(a.context,c):a.H&&a.H.call(a.context,c)},te=function(a,b){a.T=!0;de(function(){a.T&&ve.call(null,b)})},ve=l,S=function(a){ka.call(this,a)};ja(S,ka);S.prototype.name="cancel";var je=function(a,b,c){this.promise=a;this.resolve=b;this.reject=c};let we=1,xe=new WeakMap;
|
|
54
|
+
var ze=function(a,b,c){var d=ye;a.Oa.has(b);d(b,c)},Be=class extends N{constructor(){super();this.Oa=new Set}signal(){const a=new Ae;this.Oa.add(a);kd(this,ia(jd,a));return a}},ye=function(a,b){return new Promise(c=>{Ce(()=>{a.va&&(a.ab=b,a.Ea=!0);for(const {sa:d,slot:e}of a.j.values())try{e(b,{signal:a,sa:d})}catch(f){l(f)}for(const d of a.I)d.resolve(b);a.I.clear();c()})})},nd=function(a,b,c){const d=we++;Ce(()=>{De(a,d,b,c)});return d},De=function(a,b,c,d){if(!a.o)if(d){if(!d.o){const e=()=>{Ce(()=>
|
|
55
|
+
{a.j.delete(b);const f=xe.get(d);f&&ra(f,e)})};a.j.set(b,{sa:b,slot:c,ea:e});Ee(d,e)}}else a.j.set(b,{sa:b,slot:c,ea:()=>a.j.delete(b)})},Ae=class extends N{constructor(){super();this.va=!1;this.j=new Map;this.I=new Set;this.Ea=!1}detach(a){Ce(()=>{const b=this.j.get(a);b&&b.ea()})}value(a){return this.promise(!0,a)}next(a){return this.promise(!1,a)}promise(a,b){const c=ke();Ce(()=>{if(this.o)c.reject(new S("Signal initially disposed"));else if(b&&b.o)c.reject(new S("Owner initially disposed"));else if(a&&
|
|
56
|
+
this.va&&this.Ea)c.resolve(this.ab);else if(this.I.add(c),ne(c.promise,()=>{this.I.delete(c)}),b){const d=()=>{c.reject(new S("Owner asynchronously disposed"))};ne(c.promise,()=>{const e=xe.get(b);e&&ra(e,d)});Ee(b,d)}});return c.promise}fa(){super.fa();Ce(()=>{for(const {ea:a}of this.j.values())a();this.j.clear();for(const a of this.I)a.reject(new S("Signal asynchronously disposed"));this.I.clear()})}};const Fe=[];let Ge=!1;function Ce(a){Fe.push(a);He()}
|
|
57
|
+
async function He(){if(!Ge)try{Ge=!0;let a=Ie(0);for(;a<Fe.length;)await Promise.resolve(),a=Ie(a)}catch(a){l(a)}finally{Fe.length=0,Ge=!1}}function Ie(a){const b=a+100;for(;a<b&&a<Fe.length;)try{Fe[a++]()}catch(c){l(c)}return a}function Ee(a,b){if(a.o)b();else{var c=xe.get(a);if(c)c.push(b);else{const d=[b];xe.set(a,d);kd(a,()=>{for(const e of[...d])e();xe.delete(a)})}}};function T(a){var b=new Jd;a=E(b,1,Ld,a);return{content:ec(a)}}const Je=new Be;function Ke(a,b){const c=Je.signal();return{channel:Rd(a,d=>{const e=b(d.data);ze(Je,c,{content:e,lb:d})}),signal:c}};let Le;var U=class extends K{getState(){const a=this.h;let b=a[r];const c=y(a,b,1),d=Ra(c,!0,!!(b&34));d!=null&&d!==c&&z(a,b,1,d);return d==null?Ba():d}};var V=class extends K{};var Ne=class extends K{ja(){return J(this,U,2,Me)}Y(a){E(this,2,Me,a)}U(){return B(this,U,2,Me)}ka(){return J(this,V,3,Me)}Z(a){E(this,3,Me,a)}ma(){return B(this,V,3,Me)}},Me=[2,3];var Oe=fc(class extends K{});var Qe=fc(class extends K{S(){return A(this,Pe)}}),Pe=[1,2];var Re=({destination:a,origin:b,vb:c,Pa:d="ZNWN1d",onMessage:e})=>{if(b==="*")throw Error("Sending to wildcard origin not allowed.");const f=Pd(e);a.postMessage(c?{n:d,t:c}:d,b,[f.port2]);return Rd(f.port1,e)};function Se(a,b,c){const d=new Be,e=d.signal();a=Re({destination:window.parent,origin:b,Pa:a,onMessage:f=>{const g=Kd(f.data.content);A(g,Ld)===2&&ze(d,e,{content:J(g,ed,2,Ld),lb:f,messagePort:f.data.messagePort})}});return new Te(e,a,c)}
|
|
58
|
+
var od=async function(a){a=a.channel;var b=a.O;var c=new Q;var d=new Fd;c=E(c,13,O,d);await b.call(a,T(c))},pd=async function(a,b){var c=W,d=new Q;b=E(d,9,O,b);a=await c(a,T(b));let e;return(e=J(Kd(a.data.content),ed,2,Ld))==null?void 0:J(e,cd,9,dd)},qd=async function(a,b){var c=W,d=new Q;b=E(d,8,O,b);await c(a,T(b))},rd=async function(a){var b=W;var c=new Q;var d=new xd;c=E(c,11,O,d);await b(a,T(c))},sd=async function(a,b){var c=W,d=new Q;b=E(d,14,O,b);await c(a,T(b))},td=async function(a,b){var c=
|
|
59
|
+
W,d=new Q;b=E(d,15,O,b);await c(a,T(b))},Ue=async function(a){setInterval(async()=>{await od(a)},1E3)},W=async function(a,b){(a=await a.channel.O(b))||Qc(mc,"Falsy response received from the message channel."+` ${JSON.stringify(a)}`);(b=a.data)||Qc(mc,"Data field in the response from the message channel is falsy."+` ${JSON.stringify(b)}`);(b=b.content)||Qc(mc,"Content field in the response from the message channel is falsy."+` ${JSON.stringify(b)}`);let c=void 0;try{c=Kd(b)}catch(d){Qc(mc,"The ControlMessage can't be deserialized."+
|
|
60
|
+
` ${JSON.stringify(b)}. ${JSON.stringify(d)}`)}(b=J(c,ed,2,Ld))||Qc(mc,"MeetToAddonMessage field on ControlMessage is falsy."+` ${JSON.stringify(b)}`);b=b==null?void 0:J(b,kc,10,dd);if((b==null?void 0:H(b,1))!==void 0)throw new L(Nc(H(b,1)));return a},Ve=async function(a,b,c){var d=W,e=new Q;b=E(e,1,O,b);d=await d(a,T(b));a=d.data.messagePort;var f;(d=(f=J(Kd(d.data.content),ed,2,Ld))==null?void 0:J(f,jc,1,dd))!=null?f=d:(f=new jc,f=C(f,1,w(0),0));return{channel:a?Ke(a,c):void 0,response:f}},We=async function(a){const b=
|
|
61
|
+
Bd(),{channel:c,response:d}=await Ve(a,b,e=>Qe(e));if(!c)throw new L(Oc(d));return c},Xe=async function(a){var b=W;var c=new Q;var d=new Id;c=E(c,5,O,d);await b(a,T(c))},Ye=async function(a){var b=W;var c=new Q;var d=new Dd;c=E(c,6,O,d);await b(a,T(c))},Ze=async function(a,b,c){var d=W,e=new Q,f=new Ed;b=C(f,1,w(b),0).La(c);e=E(e,7,O,b);await d(a,T(e))},$e=async function(a,b){var c=W,d=new Q;b=E(d,16,O,b);await c(a,T(b))};
|
|
62
|
+
class Te extends N{constructor(a,b,c){super();this.hb=a;this.channel=b;a=Le||(Le=gc("[0,9,1]"));a=Ob(a);a=Rb(a,4,x("668624766"));b=a.h;var d=b[r];b=d&2?a:Fb(a.constructor,Nb(b,d,!0));a=new Q;d=new Cd;b=D(d,2,b);c=C(b,3,x(c),"");c=E(a,2,O,c);this.channel.send(T(c));Ue(this)}};let af;var bf=class{constructor(a){var b=af;this.P=a;this.i=b}delete(){throw Error("Not implemented.");}};var df=class extends K{constructor(){super()}ra(a){return C(this,1,a==null?a:tb(a),"0")}ja(){return J(this,U,2,cf)}Y(a){E(this,2,cf,a)}U(){return B(this,U,2,cf)}ka(){return J(this,V,3,cf)}Z(a){E(this,3,cf,a)}ma(){return B(this,V,3,cf)}},cf=[2,3];var ef=class extends K{constructor(){super()}};var ff=class extends K{constructor(){super()}};var gf=class extends K{constructor(){super()}qa(a){return Rb(this,4,x(a))}};var jf=class extends K{constructor(){super()}ra(a){return C(this,1,a==null?a:tb(a),"0")}ja(){return J(this,U,2,hf)}Y(a){E(this,2,hf,a)}U(){return B(this,U,2,hf)}ka(){return J(this,V,3,hf)}Z(a){E(this,3,hf,a)}ma(){return B(this,V,3,hf)}},hf=[2,3],kf=[5,6];var lf=class extends K{constructor(){super()}qa(a){return C(this,1,x(a),"")}};var nf=class extends K{constructor(){super()}S(){return A(this,mf)}},mf=[1,2,3];function of(a){var b=new pf;let c=0,d;return(...e)=>{if(qf(b)){rf(b);var f=!0}else f=!1;f?a(...e):(d=()=>void a(...e),c||(c=setTimeout(()=>{c=0;let g;(g=d)==null||g()},sf(b))))}};var sf=function(a){const b=a.ya;let c;a=Date.now()-((c=a.na[a.index])!=null?c:0);return a>=b?0:b-a},qf=function(a){const b=a.ya;let c;return Date.now()-((c=a.na[a.index])!=null?c:0)>=b},rf=function(a){a.na[a.index]=Date.now();a.index=(a.index+1)%a.cb},pf=class{constructor(){this.cb=1;this.ya=500;this.na=[];this.index=0}};var tf=class extends Error{constructor(){super("Failed to create CoActivity: Connection refused - Meet refused to begin Live Sharing")}};var uf=class{constructor(a){this.config=a}start(){this.Ga!=null||(this.Ga=setInterval(()=>{this.config.gb()},this.config.Ya));return this}shutdown(){clearInterval(this.Ga)}};function vf(){const a=new Map,b={set(c,d){a.set(c,d);return b},da:()=>a};return b};function wf(a){if(a.U()){var b=a.ja().getState();a=Uint8Array;za(xa);var c=b.ba;if(c!=null&&!wa(c))if(typeof c==="string"){ta.test(c)&&(c=c.replace(ta,va));c=atob(c);const d=new Uint8Array(c.length);for(let e=0;e<c.length;e++)d[e]=c.charCodeAt(e);c=d}else c=null;b=c==null?c:b.ba=c;return{bytes:new a(b||0)}}}function xf(a,b){a.Y(yf(b));return a}function zf(a,b){a.Y(yf(b));return a}function yf(a){var b=new U;return C(b,1,Ra(a.bytes,!1,!1),Ba())}
|
|
63
|
+
function Af(a){if(a.ma()){a=a.ka();var b,c,d=G(a,1),e=(c=(b=Wb(a,hc,2))==null?void 0:bc(b))!=null?c:0;c=a.h;let f=c[r];const g=y(c,f,4);b=g==null||typeof g==="number"?g:g==="NaN"||g==="Infinity"||g==="-Infinity"?Number(g):void 0;b!=null&&b!==g&&z(c,f,4,b);return{mediaId:d,mediaPlayoutPosition:e,mediaPlayoutRate:F(b,0),playbackState:Bf.get(H(a,3))}}}function Cf(a,b){a.Z(Df(b));return a}function Ef(a,b){a.Z(Df(b));return a}
|
|
64
|
+
const Bf=vf().set(0,"INVALID").set(1,"BUFFERING").set(2,"PLAY").set(3,"PAUSE").set(4,"ENDED").da(),Ff=vf().set("INVALID",0).set("BUFFERING",1).set("PLAY",2).set("PAUSE",3).set("ENDED",4).da();
|
|
65
|
+
function Df(a){var b=new V;b=C(b,1,x(a.mediaId),"");var c=a.mediaPlayoutRate;if(c!=null&&typeof c!=="number")throw Error(`Value of float/double field must be a number, found ${typeof c}: ${c}`);b=C(b,4,c,0);c=(new hc).setSeconds(a.mediaPlayoutPosition);b=D(b,2,c);a=Ff.get(a.playbackState);return C(b,3,w(a),0)}function Gf({activityTitle:a}){return(new gf).qa(a)}function Hf(a,b){var c=new ff;b=C(c,1,w(b.G),0);E(a,6,kf,b);return a}function If(a){var b=new ef;E(a,5,kf,b);return a};const Jf=vf().set("co-doing",1).set("co-watching",2).da();async function Kf(a,b,c){var d=b.O,e=new nf;var f=(new lf).qa(a.activityTitle);var g=Jf.get(a.ua);f=C(f,2,w(g),0);e=E(e,3,mf,f);d=await d.call(b,e,Oe);let h;if((h=F(qb(Pb(d,1)),!1))!=null&&h)return new Lf(a,b,c,Wb(d,Ne,2));throw new tf;}var Mf=function(a,b){const c=a.config.Ca(b);c&&!a.config.za(a.s,c)&&(a.s=c,a.oa=bc(b),a.Ua(a.s))},X=function(a,b){const {state:c,eb:d,context:e}=b(a.s);a.s=c;a.notify(a.s,e,d)};
|
|
66
|
+
class Lf{constructor(a,b,c,d){this.xa=a;this.R=b;this.config=c;this.Ua=of(e=>void this.xa.Da(e));Nf(this.R,e=>{const f=e.S();switch(f){case 1:Mf(this,J(e,Ne,1,Pe));break;case 2:case 0:console.warn(`IllegalMessage: ${f} - ${"Unhandled message"} - ${"Please raise a bug with the MeetJS team"}`)}});this.Xa=(new uf({Ya:1E3,gb:()=>{var e,f;const g=(f=(e=this.xa).kb)==null?void 0:f.call(e);this.s!==null&&(this.s={...this.s,...g},e=new nf,f=this.config.Ma((new df).ra(this.oa),this.s),e=E(e,1,mf,f),this.R.send(e))}})).start();
|
|
67
|
+
this.s=null;this.oa=0;d&&Mf(this,d)}disconnect(){this.R.shutdown();this.Xa.shutdown()}notify(a,b,c){var d=c?Gf(c):void 0;c=this.config;var e=c.Na,f=(new jf).ra(this.oa);d=D(f,4,d);a=e.call(c,d,a);a=this.config.Ka(a,b);b=this.R;c=b.send;e=new nf;a=E(e,2,mf,a);c.call(b,a)}};var Of=class{constructor(a){this.m=a}broadcastStateUpdate(a){X(this.m,()=>({state:a,context:{}}))}disconnect(){this.m.disconnect()}};function Pf(a,b){return a==null||b==null?!1:a.bytes.length===b.bytes.length&&a.bytes.every((c,d)=>c===b.bytes[d])};var Qf=class{constructor(a){this.m=a}notifySwitchedToMedia(a,b,c){X(this.m,()=>({state:{mediaId:b,mediaPlayoutRate:1,mediaPlayoutPosition:c,playbackState:"PLAY"},eb:{activityTitle:a},context:{G:1}}))}notifyPauseState(a,b){X(this.m,c=>{if(c==null)throw Error("Invalid before coWatchingState");return{state:{...c,playbackState:a?"PAUSE":"PLAY",mediaPlayoutPosition:b},context:{G:3}}})}notifySeekToTimestamp(a){X(this.m,b=>{if(b==null)throw Error("Invalid before coWatchingState");return{state:{...b,mediaPlayoutPosition:a},
|
|
67
68
|
context:{G:2}}})}notifyPlayoutRate(a){X(this.m,b=>{if(b==null)throw Error("Invalid before coWatchingState");return{state:{...b,mediaPlayoutRate:a},context:{G:4}}})}notifyBuffering(a){X(this.m,b=>{if(b==null)throw Error("Invalid before coWatchingState");return{state:{...b,mediaPlayoutPosition:a,playbackState:"BUFFERING"},context:{G:3}}})}notifyReady(a){X(this.m,b=>{if(b==null)throw Error("Invalid before coWatchingState");return{state:{...b,mediaPlayoutPosition:a},context:{G:3}}})}disconnect(){this.m.disconnect()}};
|
|
68
|
-
function
|
|
69
|
-
async function
|
|
70
|
-
+!!a.additionalData)throw new L(zc);if(Object.keys(a).length===0)throw new L(yc);const b=[];b.push(
|
|
71
|
-
a)}async createRoomsStandaloneClient(){var a=this.K;if(a.P.frameType!==2)throw new L(oc);return await Promise.resolve(new
|
|
72
|
-
return
|
|
69
|
+
function Rf(a,b){if(a==null||b==null)return!1;const c=a.playbackState==="PLAY"?3*Math.max(a.mediaPlayoutRate,1):0,d=Math.abs(a.mediaPlayoutPosition-b.mediaPlayoutPosition);return a.mediaId===b.mediaId&&a.mediaPlayoutRate===b.mediaPlayoutRate&&d<=c&&a.playbackState===b.playbackState};var Nf=function(a,b){const c=nd(a.signal,d=>{b(d)});a.j.push(c)},Sf=class{constructor(a,b){this.channel=a;this.signal=b;this.j=[]}send(a){this.channel.send(ec(a))}async O(a,b){a=await this.channel.O(ec(a));return b(a.data)}shutdown(){this.j.forEach(a=>{this.signal.detach(a)})}};function Tf(a,b){var c=Uf;const d=a.signal(),e=a.signal();nd(b,f=>{const g=c(f)?d:e;ze(a,g,f)},a);return{ib:d,fb:e}}function Vf(a,b,c,d=e=>e){nd(c,e=>{ze(a,b,d(e))},a)};async function Wf(a,b){if(b)return a=await Kf({activityTitle:b.activityTitle,ua:"co-watching",kb:()=>b.onCoWatchingStateQuery(),Da:c=>{b.onCoWatchingStateChanged(c)}},a,{Na:Cf,Ma:Ef,Ka:Hf,Ca:Af,za:Rf}),new Qf(a)}async function Xf(a,b){if(b)return a=await Kf({activityTitle:b.activityTitle,ua:"co-doing",Da:c=>{b.onCoDoingStateChanged(c)}},a,{Na:xf,Ma:zf,Ka:If,Ca:wf,za:Pf}),new Of(a)}
|
|
70
|
+
async function Yf(a){const b=new Be,c=b.signal();a=await a;Vf(b,c,a.signal,f=>f.content);const {ib:d,fb:e}=Tf(b,c);return{Qa:new Sf(a.channel,d),Ra:new Sf(a.channel,e)}}function Uf(a){a:switch(a.S()){case 1:a=J(a,Ne,1,Pe);break a;default:throw Error("CA Message arrived with no known content message set");}return a.U()};async function Zf(a,b){({Qa:a}=await Yf(We(a.i)));b=await Xf(a,b);if(!b)throw Error("Failed to create co-doing session");return b}async function $f(a,b){({Ra:a}=await Yf(We(a.i)));b=await Wf(a,b);if(!b)throw Error("Failed to create co-watching session");return b};var ag=class extends ud{async notifySidePanel(a){await Ze(this.context.i,1,a)}async unloadSidePanel(){await Xe(this.context.i)}async loadSidePanel(){await Ye(this.context.i)}};var bg=class extends ud{async setAddonStartingState(a){if(a===null)throw new L(Ac("addonStartingState"));if(typeof a!=="object")throw new L(M("addonStartingState",typeof a,"object | undefined"));if(a.sidePanelUrl!==void 0&&typeof a.sidePanelUrl!=="string")throw new L(M("sidePanelUrl",typeof a.sidePanelUrl,"string | undefined"));if(a.additionalData!==void 0&&typeof a.additionalData!=="string")throw new L(M("additionalData",typeof a.additionalData,"string | undefined"));if(Object.keys(a).length!==+!!a.sidePanelUrl+
|
|
71
|
+
+!!a.additionalData)throw new L(zc);if(Object.keys(a).length===0)throw new L(yc);const b=[];b.push(Uc(Tc(Sc(1),a.sidePanelUrl),a.additionalData));await $e(this.context.i,(new Hd).setAddonStartingState((new Gd).X(b)))}};var cg=class extends ud{async notifyMainStage(a){await Ze(this.context.i,2,a)}};var dg=class{constructor(a){a=a.cloudProjectNumber;const b=wd();if(b.cloudProjectNumber!==a)throw new L(sc);const c=b.Ia,d=b.Sa;let e;af=(e=af)!=null?e:Se(d,c,a);this.K=new bf(b)}async createMainStageClient(){var a=this.K;if(a.P.frameType!==2)throw new L(oc);return await Promise.resolve(new ag(a))}async createSidePanelClient(){var a=this.K;if(a.P.frameType!==1)throw new L(pc);return await Promise.resolve(new cg(a))}async createCoWatchingClient(a){return await $f(this.K,a)}async createCoDoingClient(a){return await Zf(this.K,
|
|
72
|
+
a)}async createRoomsStandaloneClient(){var a=this.K;if(a.P.frameType!==2)throw new L(oc);return await Promise.resolve(new bg(a))}};let eg=null;var fg={addon:{getFrameType:function(){a:{var a=wd().frameType;switch(a){case 2:a="MAIN_STAGE";break a;case 1:a="SIDE_PANEL";break a;default:throw Error(`Unknown frame type: ${a}`);}}return a},createAddonSession:async function(a){if(a===null)throw new L(Ac("config"));if(typeof a!=="object")throw new L(M("config",typeof a,"object"));if(typeof a.cloudProjectNumber!=="string")throw new L(M("cloudProjectNumber",typeof a.cloudProjectNumber,"string"));if(eg&&wd().Ia!=="integration.test.google.com")throw new L(Ic);
|
|
73
|
+
return eg=new dg(a)}}},gg=["meet"],Y=k;gg[0]in Y||typeof Y.execScript=="undefined"||Y.execScript("var "+gg[0]);for(var Z;gg.length&&(Z=gg.shift());)gg.length||fg===void 0?Y=Y[Z]&&Y[Z]!==Object.prototype[Z]?Y[Z]:Y[Z]={}:Y[Z]=fg;}).call(this);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@googleworkspace/meet-addons",
|
|
3
3
|
"description": "The Google Meet Add-ons SDK lets you embed your app into Google Meet as an add-on where users can discover, share, and collaborate in the app without leaving Meet",
|
|
4
|
-
"version": "0.9.1-
|
|
4
|
+
"version": "0.9.1-668624766",
|
|
5
5
|
"repository": "googleworkspace/meet",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"homepage": "https://developers.google.com/meet/add-ons/guides/overview",
|