@googleworkspace/meet-addons 0.9.1 → 0.10.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.
- package/meet.addons.d.ts +46 -82
- package/meet.addons.js +67 -77
- package/meet.addons.screenshare.js +20 -19
- package/package.json +23 -1
package/meet.addons.d.ts
CHANGED
|
@@ -282,7 +282,6 @@ declare global {
|
|
|
282
282
|
// Original file: client.types.d.ts
|
|
283
283
|
|
|
284
284
|
|
|
285
|
-
|
|
286
285
|
/**
|
|
287
286
|
* Information about the meeting in which the add-on is running.
|
|
288
287
|
*/
|
|
@@ -310,25 +309,17 @@ export type FrameType = 'SIDE_PANEL' | 'MAIN_STAGE';
|
|
|
310
309
|
* - `OPEN_ADDON`: The frame was opened because the add-on was selected in the
|
|
311
310
|
* activities panel.
|
|
312
311
|
*
|
|
313
|
-
* - `
|
|
314
|
-
*
|
|
312
|
+
* - `START_ACTIVITY`: The frame was opened because the local user started an
|
|
313
|
+
* activity.
|
|
315
314
|
*
|
|
316
|
-
* - `
|
|
317
|
-
*
|
|
315
|
+
* - `JOIN_ACTIVITY`: The frame was opened because the user joined an activity
|
|
316
|
+
* started by another user.
|
|
318
317
|
*/
|
|
319
318
|
export type FrameOpenReason =
|
|
320
319
|
| 'UNKNOWN'
|
|
321
320
|
| 'OPEN_ADDON'
|
|
322
|
-
| '
|
|
323
|
-
| '
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* The different reasons why the collaboration was ended:
|
|
327
|
-
*
|
|
328
|
-
* - `END_REASON_UNSPECIFIED`: The reason for ending the collaboration is
|
|
329
|
-
* unspecified.
|
|
330
|
-
*/
|
|
331
|
-
export type EndCollaborationReason = 'END_REASON_UNSPECIFIED';
|
|
321
|
+
| 'START_ACTIVITY'
|
|
322
|
+
| 'JOIN_ACTIVITY';
|
|
332
323
|
|
|
333
324
|
/**
|
|
334
325
|
* A client-initiated message sent from one add-on frame to another.
|
|
@@ -351,22 +342,32 @@ export interface FrameToFrameMessage {
|
|
|
351
342
|
* throws an error.
|
|
352
343
|
*/
|
|
353
344
|
export type ErrorType =
|
|
354
|
-
|
|
345
|
+
|
|
346
|
+
| 'ActivityIsOngoing'
|
|
347
|
+
| 'ActivityStartingStateEmpty'
|
|
348
|
+
| 'ActivityStartingStateMissingAttributes'
|
|
349
|
+
| 'ActivityStartingStateUnrecognizedAttributes'
|
|
350
|
+
| 'AddonSessionAlreadyCreated'
|
|
351
|
+
| 'AddonStartingStateMissingAttributes'
|
|
352
|
+
| 'AddonStartingStateUnrecognizedAttributes'
|
|
353
|
+
| 'ArgumentNullError'
|
|
354
|
+
| 'ArgumentTypeError'
|
|
355
355
|
| 'DestinationNotReady'
|
|
356
|
+
| 'InternalError'
|
|
357
|
+
| 'InvalidActivityStartingState'
|
|
358
|
+
| 'InvalidAddonStartingState'
|
|
356
359
|
| 'InvalidCloudProjectNumber'
|
|
357
|
-
| 'InvalidCollaborationStartingState'
|
|
358
360
|
| 'MissingUrlParameter'
|
|
359
361
|
| 'NeedsMainStageContext'
|
|
360
362
|
| 'NeedsSidePanelContext'
|
|
363
|
+
| 'NotSupportedInMeetCall'
|
|
361
364
|
| 'NotSupportedInStandalone'
|
|
362
365
|
| 'RequiresEapEnrollment'
|
|
363
|
-
| '
|
|
366
|
+
| 'SizeLimitExceededActivityStartingState'
|
|
367
|
+
| 'SizeLimitExceededAddonStartingState'
|
|
364
368
|
| 'SizeLimitExceededFrameToFrameMessage'
|
|
365
|
-
| '
|
|
366
|
-
| '
|
|
367
|
-
| 'CollaborationStartingStateMissingAttributes'
|
|
368
|
-
| 'CollaborationStartingStateEmpty'
|
|
369
|
-
| 'CollaborationStartingStateUnrecognizedAttributes';
|
|
369
|
+
| 'UserCancelled'
|
|
370
|
+
| 'UserNotInitiator';
|
|
370
371
|
|
|
371
372
|
/**
|
|
372
373
|
* All of the callbacks that add-ons can attach to.
|
|
@@ -377,33 +378,29 @@ export interface AddonCallbacks {
|
|
|
377
378
|
* another frame.
|
|
378
379
|
*/
|
|
379
380
|
readonly frameToFrameMessage?: (message: FrameToFrameMessage) => void;
|
|
380
|
-
/**
|
|
381
|
-
* Callback that's triggered when the user initiates a collaboration in Meet.
|
|
382
|
-
*/
|
|
383
|
-
readonly userInitiatedCollaboration?: () => void;
|
|
384
381
|
}
|
|
385
382
|
|
|
386
383
|
/**
|
|
387
384
|
* Starting state of the add-on when the participant accepts the invitation to
|
|
388
|
-
*
|
|
385
|
+
* start an activity.
|
|
389
386
|
*/
|
|
390
|
-
export interface
|
|
387
|
+
export interface ActivityStartingState {
|
|
391
388
|
/**
|
|
392
|
-
* The URL that the main stage opens for users joining the
|
|
389
|
+
* The URL that the main stage opens for users joining the activity.
|
|
393
390
|
* The length of this URL must be less than 512 characters.
|
|
394
391
|
*/
|
|
395
392
|
mainStageUrl?: string;
|
|
396
393
|
|
|
397
394
|
/**
|
|
398
|
-
* The URL that the side panel opens for users joining the
|
|
395
|
+
* The URL that the side panel opens for users joining the activity.
|
|
399
396
|
* The length of this URL must be less than 512 characters.
|
|
400
397
|
*/
|
|
401
398
|
sidePanelUrl?: string;
|
|
402
399
|
|
|
403
400
|
/**
|
|
404
401
|
* Data internal to the add-on that it can use to initialize itself. Useful
|
|
405
|
-
* for communicating application-specific state to users joining the
|
|
406
|
-
*
|
|
402
|
+
* for communicating application-specific state to users joining the activity
|
|
403
|
+
* that cannot be stored in the URLs.
|
|
407
404
|
* The length of this string must be less than 4,096 characters.
|
|
408
405
|
*/
|
|
409
406
|
additionalData?: string;
|
|
@@ -419,21 +416,16 @@ export interface MeetAddonClient {
|
|
|
419
416
|
getMeetingInfo(): Promise<MeetingInfo>;
|
|
420
417
|
/**
|
|
421
418
|
* Retrieves information about the initial state of the add-on when the
|
|
422
|
-
* participant accepts the invitation to
|
|
419
|
+
* participant accepts the invitation to activity.
|
|
423
420
|
*/
|
|
424
|
-
|
|
421
|
+
getActivityStartingState(): Promise<ActivityStartingState>;
|
|
425
422
|
/**
|
|
426
423
|
* Sets or updates information about the initial state of the add-on that's
|
|
427
|
-
* used when the participant accepts the invitation to
|
|
424
|
+
* used when the participant accepts the invitation to join the activity.
|
|
428
425
|
*/
|
|
429
|
-
|
|
430
|
-
|
|
426
|
+
setActivityStartingState(
|
|
427
|
+
activityStartingState: ActivityStartingState,
|
|
431
428
|
): Promise<void>;
|
|
432
|
-
/**
|
|
433
|
-
* Clears the information about the initial state of the add-on used in the
|
|
434
|
-
* collaboration.
|
|
435
|
-
*/
|
|
436
|
-
clearCollaborationStartingState(): Promise<void>;
|
|
437
429
|
/**
|
|
438
430
|
* Provides access to the {@link
|
|
439
431
|
* https://developers.google.com/meet/add-ons/reference/websdk/addon_sdk.addoncallbacks
|
|
@@ -444,42 +436,29 @@ export interface MeetAddonClient {
|
|
|
444
436
|
eventHandler: AddonCallbacks[T],
|
|
445
437
|
): void;
|
|
446
438
|
|
|
447
|
-
/**
|
|
448
|
-
* Retrieves information about the Meet platform in which the add-on is
|
|
449
|
-
* running.
|
|
450
|
-
*/
|
|
451
|
-
getMeetPlatformInfo(): Promise<MeetPlatformInfo>;
|
|
452
439
|
/**
|
|
453
440
|
* Retrieves the action causing the add-on frame to be opened.
|
|
454
441
|
*/
|
|
455
442
|
getFrameOpenReason(): Promise<FrameOpenReason>;
|
|
456
443
|
|
|
457
444
|
/**
|
|
458
|
-
*
|
|
459
|
-
* @ignore Exclusively intended for use by the Spotify add-on.
|
|
460
|
-
*/
|
|
461
|
-
getCurrentMeetingRecordingStatus(): Promise<RecordingStatus>;
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* Starts a collaboration with the provided starting state of frames that the
|
|
445
|
+
* Starts an activity with the provided starting state of frames that the
|
|
465
446
|
* initiator and participants can use during the activity.
|
|
466
447
|
*/
|
|
467
|
-
|
|
468
|
-
collaborationStartingState?: CollaborationStartingState,
|
|
469
|
-
): Promise<void>;
|
|
448
|
+
startActivity(activityStartingState?: ActivityStartingState): Promise<void>;
|
|
470
449
|
|
|
471
450
|
/**
|
|
472
|
-
* Ends an ongoing
|
|
451
|
+
* Ends an ongoing activity.
|
|
473
452
|
* Will fail if:
|
|
474
|
-
* - There is not an ongoing
|
|
475
|
-
* - The user is not the initiator of the
|
|
453
|
+
* - There is not an ongoing activity.
|
|
454
|
+
* - The user is not the initiator of the activity.
|
|
476
455
|
*/
|
|
477
|
-
|
|
456
|
+
endActivity(): Promise<void>;
|
|
478
457
|
|
|
479
458
|
/**
|
|
480
459
|
* Close the add-on that's running in the Meet iframe by unloading all
|
|
481
460
|
* iframes and closing the side panel if it's open. Calling this while there's
|
|
482
|
-
* an ongoing
|
|
461
|
+
* an ongoing activity has no effect.
|
|
483
462
|
*/
|
|
484
463
|
closeAddon(): Promise<void>;
|
|
485
464
|
}
|
|
@@ -495,7 +474,8 @@ export interface MeetSidePanelClient extends MeetAddonClient {
|
|
|
495
474
|
* https://developers.google.com/meet/add-ons/reference/websdk/addon_sdk.addoncallbacks.frametoframemessage
|
|
496
475
|
* | frameToFrameMessage} add-on callback (see {@link
|
|
497
476
|
* https://developers.google.com/meet/add-ons/reference/websdk/addon_sdk.addoncallbacks
|
|
498
|
-
* | AddonCallbacks}).
|
|
477
|
+
* | AddonCallbacks}). The length of this string must be less than 1,000,000
|
|
478
|
+
* characters.
|
|
499
479
|
*/
|
|
500
480
|
notifyMainStage(payload: string): Promise<void>;
|
|
501
481
|
}
|
|
@@ -509,7 +489,8 @@ export interface MeetMainStageClient extends MeetAddonClient {
|
|
|
509
489
|
* iframe. The add-on running in the side panel iframe can react to this
|
|
510
490
|
* message using the {@link
|
|
511
491
|
* https://developers.google.com/meet/add-ons/reference/websdk/addon_sdk.addoncallbacks.frametoframemessage
|
|
512
|
-
* | frameToFrameMessage} add-on callback.
|
|
492
|
+
* | frameToFrameMessage} add-on callback. The length of this string must
|
|
493
|
+
* be less than 1,000,000 characters.
|
|
513
494
|
*/
|
|
514
495
|
notifySidePanel(payload: string): Promise<void>;
|
|
515
496
|
/**
|
|
@@ -547,23 +528,6 @@ export interface AddonSession {
|
|
|
547
528
|
createCoWatchingClient(
|
|
548
529
|
coWatchingDelegate: CoWatchingDelegate,
|
|
549
530
|
): Promise<CoWatchingClient>;
|
|
550
|
-
/**
|
|
551
|
-
* Creates a GuaranteedDeliveryClient
|
|
552
|
-
* @ignore Exclusively intended for use by the Spotify add-on.
|
|
553
|
-
*/
|
|
554
|
-
createGuaranteedDeliveryClient(
|
|
555
|
-
guaranteedDeliveryDelegate: GuaranteedDeliveryClientDelegate,
|
|
556
|
-
): Promise<MeetGuaranteedDeliveryClient>;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
* Information about the Meet platform in which the add-on is running.
|
|
561
|
-
*/
|
|
562
|
-
export interface MeetPlatformInfo {
|
|
563
|
-
/**
|
|
564
|
-
* Whether the meeting is running on Meet Rooms hardware.
|
|
565
|
-
*/
|
|
566
|
-
isMeetHardware: boolean;
|
|
567
531
|
}
|
|
568
532
|
|
|
569
533
|
|
package/meet.addons.js
CHANGED
|
@@ -1,82 +1,72 @@
|
|
|
1
|
-
(function(){var
|
|
1
|
+
(function(){var aa=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a},ba=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");},ca=ba(this),da=function(a,b){if(b)a:{var c=ca;a=a.split(".");for(var d=0;d<
|
|
2
2
|
a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&b!=null&&aa(c,a,{configurable:!0,writable:!0,value:b})}};da("Symbol.dispose",function(a){return a?a:Symbol("Symbol.dispose")});/*
|
|
3
3
|
|
|
4
4
|
Copyright The Closure Library Authors.
|
|
5
5
|
SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
*/
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
function
|
|
11
|
-
function
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
function Ub(a,b,c,d){let e=a.get(d);if(e!=null)return e;e=0;for(let
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
message:"This method is not supported in standalone mode.",g:"Do not call this method in standalone mode."},
|
|
27
|
-
g:"This parameter is automatically appended by Meet to the iframe URL. Ensure that your infrastructure does not modify URL parameters (e.g. as part of a redirect) and ensure that the correct Cloud Project Number was passed into the SDK as a string."},
|
|
28
|
-
message:"Origin of the
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
g:"Meet add-on early access enrollment is currently closed."},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
g:"
|
|
35
|
-
|
|
36
|
-
(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
(
|
|
49
|
-
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
b=a.send;var c=new nf;var d=new kf;c=D(c,3,mf,d);b.call(a,cc(c));this.ja.stop();clearTimeout(this.Ca);this.ea.signal.detach(this.tb)}},Tf=class extends Error{constructor(){super("Timed out waiting for guaranteed delivery delegate method to return")}};async function Vf(a,b){a=await cf(a.i);return new Uf(a,b)};var Xf=class extends K{Ka(a){return $b(this,a)}xa(){return G(this,T,2,Wf)}ma(a){D(this,2,Wf,a)}ha(){return z(this,T,2,Wf)}ya(){return G(this,U,3,Wf)}na(a){D(this,3,Wf,a)}Ba(){return z(this,U,3,Wf)}},Wf=[2,3];var Yf=class extends K{constructor(){super()}};var Zf=class extends K{constructor(){super()}};var $f=class extends K{constructor(){super()}Ja(a){return Pb(this,4,qb(a))}};var bg=class extends K{constructor(){super()}Ka(a){return $b(this,a)}xa(){return G(this,T,2,ag)}ma(a){D(this,2,ag,a)}ha(){return z(this,T,2,ag)}ya(){return G(this,U,3,ag)}na(a){D(this,3,ag,a)}Ba(){return z(this,U,3,ag)}},ag=[2,3],cg=[5,6];var dg=class extends K{constructor(){super()}Ja(a){return I(this,1,a)}};var fg=class extends K{constructor(){super()}F(){return y(this,eg)}za(){return G(this,Xf,1,eg)}oa(a){return D(this,1,eg,a)}},eg=[1,2,3];function gg(a){var b=new hg;let c=0,d;return(...e)=>{if(ig(b)){jg(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()},kg(b))))}};var kg=function(a){const b=a.Qa;let c;a=Date.now()-((c=a.Ea[a.index])!=null?c:0);return a>=b?0:b-a},ig=function(a){const b=a.Qa;let c;return Date.now()-((c=a.Ea[a.index])!=null?c:0)>=b},jg=function(a){a.Ea[a.index]=Date.now();a.index=(a.index+1)%a.zb},hg=class{constructor(){this.zb=1;this.Qa=500;this.Ea=[];this.index=0}};var lg=class extends Error{constructor(){super("Failed to create CoActivity: Connection refused - Meet refused to begin Live Sharing")}};var mg=class{constructor(a){this.config=a}start(){this.Ya!=null||(this.Ya=setInterval(()=>{this.config.Cb()},this.config.vb));return this}shutdown(){clearInterval(this.Ya)}};function ng(){const a=new Map,b={set(c,d){a.set(c,d);return b},ra:()=>a};return b};function og(a){if(a.ha()){var b=a.xa().getState();a=Uint8Array;Ea(Ca);var c=b.pa;if(c!=null&&!Ba(c))if(typeof c==="string"){ya.test(c)&&(c=c.replace(ya,Aa));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.pa=c;return{bytes:new a(b||0)}}}function pg(a,b){a.ma(qg(b));return a}function rg(a,b){a.ma(qg(b));return a}function qg(a){var b=new T;return Sb(b,1,Ya(a.bytes,!1,!1),Ga())}
|
|
74
|
-
function sg(a){if(a.Ba()){a=a.ya();var b,c,d=E(a,1),e=(c=(b=A(a,fc,2))==null?void 0:Zb(b))!=null?c:0;c=a.h;let f=c[t];const g=Mb(c,f,4);b=g==null||typeof g==="number"?g:g==="NaN"||g==="Infinity"||g==="-Infinity"?Number(g):void 0;b!=null&&b!==g&&x(c,f,4,b);return{mediaId:d,mediaPlayoutPosition:e,mediaPlayoutRate:Yb(b,0),playbackState:tg.get(F(a,3))}}}function ug(a,b){a.na(vg(b));return a}function wg(a,b){a.na(vg(b));return a}
|
|
75
|
-
const tg=ng().set(0,"INVALID").set(1,"BUFFERING").set(2,"PLAY").set(3,"PAUSE").set(4,"ENDED").ra(),xg=ng().set("INVALID",0).set("BUFFERING",1).set("PLAY",2).set("PAUSE",3).set("ENDED",4).ra();function vg(a){var b=new U;b=I(b,1,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=Sb(b,4,c,0);c=(new fc).setSeconds(a.mediaPlayoutPosition);b=B(b,2,c);a=xg.get(a.playbackState);return J(b,3,a)}
|
|
76
|
-
function yg({activityTitle:a}){return(new $f).Ja(a)}function zg(a,b){var c=new Zf;b=J(c,1,b.M);D(a,6,cg,b);return a}function Ag(a){var b=new Yf;D(a,5,cg,b);return a};const Bg=ng().set("co-doing",1).set("co-watching",2).ra();async function Cg(a,b,c){var d=b.Y,e=new fg;var f=(new dg).Ja(a.activityTitle);var g=Bg.get(a.Ma);f=J(f,2,g);e=D(e,3,eg,f);d=await d.call(b,e,Ue);let h;if((h=Yb(kb(Nb(d,1)),!1))!=null&&h)return new Dg(a,b,c,A(d,Te,2));throw new lg;}var Eg=function(a,b){const c=a.config.Ua(b);c&&!a.config.Ra(a.A,c)&&(a.A=c,a.Fa=Zb(b),a.qb(a.A))},Fg=function(a,b){const {state:c,Ab:d,context:e}=b(a.A);a.A=c;a.notify(a.A,e,d)};
|
|
77
|
-
class Dg{constructor(a,b,c,d){this.K=a;this.da=b;this.config=c;this.qb=gg(e=>void this.K.Wa(e));Gg(this.da,e=>{const f=e.F();switch(f){case 1:Eg(this,G(e,Te,1,Ve));break;case 2:case 0:console.warn(`IllegalMessage: ${f} - ${"Unhandled message"} - ${"Please raise a bug with the MeetJS team"}`)}});this.ub=(new mg({vb:1E3,Cb:()=>{var e;let f;const g=(f=(e=this.K).Gb)==null?void 0:f.call(e);this.A!==null&&(this.A={...this.A,...g},e=(new fg).oa(this.config.hb((new Xf).Ka(this.Fa),this.A)),this.da.send(e))}})).start();
|
|
78
|
-
this.A=null;this.Fa=0;d&&Eg(this,d)}disconnect(){this.da.shutdown();this.ub.shutdown()}notify(a,b,c){var d=c?yg(c):void 0;c=this.config;var e=c.ib,f=(new bg).Ka(this.Fa);d=B(f,4,d);a=e.call(c,d,a);a=this.config.eb(a,b);b=this.da;c=b.send;e=new fg;a=D(e,2,eg,a);c.call(b,a)}};var Hg=class{constructor(a){this.s=a}broadcastStateUpdate(a){Fg(this.s,()=>({state:a,context:{}}))}disconnect(){this.s.disconnect()}};function Ig(a,b){return a==null||b==null?!1:a.bytes.length===b.bytes.length&&a.bytes.every((c,d)=>c===b.bytes[d])};var Jg=class{constructor(a){this.s=a}notifySwitchedToMedia(a,b,c){Fg(this.s,()=>({state:{mediaId:b,mediaPlayoutRate:1,mediaPlayoutPosition:c,playbackState:"PLAY"},Ab:{activityTitle:a},context:{M:1}}))}notifyPauseState(a,b){Fg(this.s,c=>{if(c==null)throw Error("Invalid before coWatchingState");return{state:{...c,playbackState:a?"PAUSE":"PLAY",mediaPlayoutPosition:b},context:{M:3}}})}notifySeekToTimestamp(a){Fg(this.s,b=>{if(b==null)throw Error("Invalid before coWatchingState");return{state:{...b,mediaPlayoutPosition:a},
|
|
79
|
-
context:{M:2}}})}notifyPlayoutRate(a){Fg(this.s,b=>{if(b==null)throw Error("Invalid before coWatchingState");return{state:{...b,mediaPlayoutRate:a},context:{M:4}}})}notifyBuffering(a){Fg(this.s,b=>{if(b==null)throw Error("Invalid before coWatchingState");return{state:{...b,mediaPlayoutPosition:a,playbackState:"BUFFERING"},context:{M:3}}})}notifyReady(a){Fg(this.s,b=>{if(b==null)throw Error("Invalid before coWatchingState");return{state:{...b,mediaPlayoutPosition:a},context:{M:3}}})}disconnect(){this.s.disconnect()}};
|
|
80
|
-
function Kg(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 Gg=function(a,b){const c=id(a.signal,d=>{b(d)});a.l.push(c)},Lg=class{constructor(a,b){this.channel=a;this.signal=b;this.l=[]}send(a){this.channel.send(cc(a))}async Y(a,b){a=await this.channel.Y(cc(a));return b(a.data)}shutdown(){this.l.forEach(a=>{this.signal.detach(a)})}};function Mg(a,b){var c=Ng;const d=a.signal(),e=a.signal();id(b,f=>{const g=c(f)?d:e;ze(a,g,f)},a);return{Eb:d,Bb:e}}function Og(a,b,c,d=e=>e){id(c,e=>{ze(a,b,d(e))},a)};async function Pg(a,b){if(b)return a=await Cg({activityTitle:b.activityTitle,Ma:"co-watching",Gb:()=>b.onCoWatchingStateQuery(),Wa:c=>{b.onCoWatchingStateChanged(c)}},a,{ib:ug,hb:wg,eb:zg,Ua:sg,Ra:Kg}),new Jg(a)}async function Qg(a,b){if(b)return a=await Cg({activityTitle:b.activityTitle,Ma:"co-doing",Wa:c=>{b.onCoDoingStateChanged(c)}},a,{ib:pg,hb:rg,eb:Ag,Ua:og,Ra:Ig}),new Hg(a)}
|
|
81
|
-
async function Rg(a){const b=new Be,c=b.signal();a=await a;Og(b,c,a.signal,f=>f.content);const {Eb:d,Bb:e}=Mg(b,c);return{mb:new Lg(a.channel,d),nb:new Lg(a.channel,e)}}function Ng(a){a:switch(a.F()){case 1:a=G(a,Te,1,Ve);break a;default:throw Error("CA Message arrived with no known content message set");}return a.ha()};async function Sg(a,b){({mb:a}=await Rg(bf(a.i)));b=await Qg(a,b);if(!b)throw Error("Failed to create co-doing session");return b}async function Tg(a,b){({nb:a}=await Rg(bf(a.i)));b=await Pg(a,b);if(!b)throw Error("Failed to create co-watching session");return b};var Ug=class extends qd{async notifySidePanel(a){await ff(this.context.i,1,a)}async unloadSidePanel(){await df(this.context.i)}async loadSidePanel(){await ef(this.context.i)}};var Vg=class extends qd{async notifyMainStage(a){await ff(this.context.i,2,a)}};var Wg=class{constructor(a){this.R=hf(a)}async createMainStageClient(){var a=this.R;if(a.sa.frameType!==2)throw new L(nc);return await Promise.resolve(new Ug(a))}async createSidePanelClient(){var a=this.R;if(a.sa.frameType!==1)throw new L(oc);return await Promise.resolve(new Vg(a))}async createCoWatchingClient(a){return await Tg(this.R,a)}async createCoDoingClient(a){return await Sg(this.R,a)}async createGuaranteedDeliveryClient(a){return await Vf(this.R,a)}};let Xg=null;var Yg=class{};var Zg={addon:{Ob:hf,getFrameType:function(){a:{var a=sd().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},Nb:function(a){a=bf(a.i);Rg(a);return new Yg},createAddonSession:async function(a){if(Xg&&sd().ab!=="integration.test.google.com")throw Error("AddonSession already created");return Xg=new Wg(a)}}},$g=["meet"],Z=m;$g[0]in Z||typeof Z.execScript=="undefined"||Z.execScript("var "+$g[0]);
|
|
82
|
-
for(var ah;$g.length&&(ah=$g.shift());)$g.length||Zg===void 0?Z=Z[ah]&&Z[ah]!==Object.prototype[ah]?Z[ah]:Z[ah]={}:Z[ah]=Zg;}).call(this);
|
|
7
|
+
var l=this||self,ea=function(a,b){a:{var c=["CLOSURE_FLAGS"];for(var d=l,e=0;e<c.length;e++)if(d=d[c[e]],d==null){c=null;break a}c=d}a=c&&c[a];return a!=null?a:b},fa=function(a,b,c){return a.call.apply(a.bind,arguments)},ha=function(a,b,c){ha=fa;return ha.apply(null,arguments)},ia=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}},ja=function(a,b){function c(){}c.prototype=b.prototype;a.sb=b.prototype;a.prototype=
|
|
8
|
+
new c;a.prototype.constructor=a;a.ob=function(d,e,g){for(var f=Array(arguments.length-2),h=2;h<arguments.length;h++)f[h-2]=arguments[h];return b.prototype[e].apply(d,f)}};function ka(a,b){if(Error.captureStackTrace)Error.captureStackTrace(this,ka);else{const c=Error().stack;c&&(this.stack=c)}a&&(this.message=String(a));b!==void 0&&(this.cause=b)}ja(ka,Error);ka.prototype.name="CustomError";function m(a){l.setTimeout(()=>{throw a;},0)};var la=ea(610401301,!1),ma=ea(645172343,!0);var na;const oa=l.navigator;na=oa?oa.userAgentData||null:null;function pa(a){return la?na?na.brands.some(({brand:b})=>b&&b.indexOf(a)!=-1):!1:!1}function p(a){var b;a:{if(b=l.navigator)if(b=b.userAgent)break a;b=""}return b.indexOf(a)!=-1};function q(){return la?!!na&&na.brands.length>0:!1}function qa(){return q()?pa("Chromium"):(p("Chrome")||p("CriOS"))&&!(q()?0:p("Edge"))||p("Silk")};function ra(a,b){b=Array.prototype.indexOf.call(a,b,void 0);b>=0&&Array.prototype.splice.call(a,b,1)};!p("Android")||qa();qa();p("Safari")&&(qa()||(q()?0:p("Coast"))||(q()?0:p("Opera"))||(q()?0:p("Edge"))||(q()?pa("Microsoft Edge"):p("Edg/"))||q()&&pa("Opera"));function sa(a){let b="",c=0;const d=a.length-10240;for(;c<d;)b+=String.fromCharCode.apply(null,a.subarray(c,c+=10240));b+=String.fromCharCode.apply(null,c?a.subarray(c):a);return btoa(b)}const ta=/[-_.]/g,ua={"-":"+",_:"/",".":"="};function va(a){return ua[a]||""}function wa(a){return a!=null&&a instanceof Uint8Array}var xa={};let ya;function za(a){if(a!==xa)throw Error("illegal external caller");}var Ba=function(){return ya||(ya=new Aa(null,xa))},Aa=class{constructor(a,b){za(b);this.Z=a;if(a!=null&&a.length===0)throw Error("ByteString should be constructed with non-empty values");}};var Ca=function(a,b){a.__closure__error__context__984382||(a.__closure__error__context__984382={});a.__closure__error__context__984382.severity=b};let Da;function Ea(){const a=Error();Ca(a,"incident");m(a)}function Fa(a){a=Error(a);Ca(a,"warning");return a};function Ga(){return typeof BigInt==="function"};function Ha(a){return Array.prototype.slice.call(a)};var r=Symbol(),Ja=Symbol(),Ka=Symbol();function La(a,b){b[r]=(a|0)&-14591}function Ma(a,b){b[r]=(a|34)&-14557};var Na={},Oa={};function Pa(a){return!(!a||typeof a!=="object"||a.rb!==Oa)}function Qa(a){return a!==null&&typeof a==="object"&&!Array.isArray(a)&&a.constructor===Object}function Ra(a,b,c){if(a!=null)if(typeof a==="string")a=a?new Aa(a,xa):Ba();else if(a.constructor!==Aa)if(wa(a))a=a.length?new Aa(c?a:new Uint8Array(a),xa):Ba();else{if(!b)throw Error();a=void 0}return a}function Sa(a){return!Array.isArray(a)||a.length?!1:(a[r]|0)&1?!0:!1}var Ta;const Ua=[];Ua[r]=55;Ta=Object.freeze(Ua);
|
|
9
|
+
function Va(a){if(a&2)throw Error();}var Wa=Object.freeze({});Object.freeze({});var Xa=Object.freeze({});function Ya(a){a.qb=!0;return a};var Za=Ya(a=>typeof a==="number"),$a=Ya(a=>typeof a==="string"),ab=Ya(a=>typeof a==="boolean");var bb=typeof l.BigInt==="function"&&typeof l.BigInt(0)==="bigint";var hb=Ya(a=>bb?a>=cb&&a<=db:a[0]==="-"?eb(a,fb):eb(a,gb));const fb=Number.MIN_SAFE_INTEGER.toString(),cb=bb?BigInt(Number.MIN_SAFE_INTEGER):void 0,gb=Number.MAX_SAFE_INTEGER.toString(),db=bb?BigInt(Number.MAX_SAFE_INTEGER):void 0;function eb(a,b){if(a.length>b.length)return!1;if(a.length<b.length||a===b)return!0;for(let c=0;c<a.length;c++){const d=a[c],e=b[c];if(d>e)return!1;if(d<e)return!0}};let t=0,v=0;function ib(a){const b=a>>>0;t=b;v=(a-b)/4294967296>>>0}function jb(a){if(a<0){ib(0-a);const [b,c]=kb(t,v);t=b>>>0;v=c>>>0}else ib(a)}function lb(a,b){b>>>=0;a>>>=0;if(b<=2097151)var c=""+(4294967296*b+a);else Ga()?c=""+(BigInt(b)<<BigInt(32)|BigInt(a)):(c=(a>>>24|b<<8)&16777215,b=b>>16&65535,a=(a&16777215)+c*6777216+b*6710656,c+=b*8147497,b*=2,a>=1E7&&(c+=a/1E7>>>0,a%=1E7),c>=1E7&&(b+=c/1E7>>>0,c%=1E7),c=b+mb(c)+mb(a));return c}
|
|
10
|
+
function mb(a){a=String(a);return"0000000".slice(a.length)+a}function kb(a,b){b=~b;a?a=~a+1:b+=1;return[a,b]};const nb=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function rb(a){const b=typeof a;switch(b){case "bigint":return!0;case "number":return Number.isFinite(a)}return b!=="string"?!1:nb.test(a)}function w(a){if(a!=null){if(!Number.isFinite(a))throw Fa("enum");a|=0}return a}
|
|
11
|
+
function sb(a){if(!rb(a))throw Fa("int64");switch(typeof a){case "string":return tb(a);case "bigint":var b=a=BigInt.asIntN(64,a);if($a(b)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(b))throw Error(String(b));}else if(Za(b)&&!Number.isSafeInteger(b))throw Error(String(b));a=bb?BigInt(a):ab(a)?a?"1":"0":$a(a)?a.trim()||"0":String(a);return a;default:return ub(a)}}
|
|
12
|
+
function ub(a){a=Math.trunc(a);if(!Number.isSafeInteger(a)){jb(a);var b=t,c=v;if(a=c&2147483648)b=~b+1>>>0,c=~c>>>0,b==0&&(c=c+1>>>0);b=c*4294967296+(b>>>0);a=a?-b:b}return a}
|
|
13
|
+
function tb(a){var b=Math.trunc(Number(a));if(Number.isSafeInteger(b))return String(b);b=a.indexOf(".");b!==-1&&(a=a.substring(0,b));if(!(a[0]==="-"?a.length<20||a.length===20&&Number(a.substring(0,7))>-922337:a.length<19||a.length===19&&Number(a.substring(0,6))<922337)){if(a.length<16)jb(Number(a));else if(Ga())a=BigInt(a),t=Number(a&BigInt(4294967295))>>>0,v=Number(a>>BigInt(32)&BigInt(4294967295));else{b=+(a[0]==="-");v=t=0;const c=a.length;for(let d=0+b,e=(c-b)%6+b;e<=c;d=e,e+=6){const g=Number(a.slice(d,
|
|
14
|
+
e));v*=1E6;t=t*1E6+g;t>=4294967296&&(v+=Math.trunc(t/4294967296),v>>>=0,t>>>=0)}if(b){const [d,e]=kb(t,v);t=d;v=e}}a=t;b=v;if(b&2147483648)if(Ga())a=""+(BigInt(b|0)<<BigInt(32)|BigInt(a>>>0));else{const [c,d]=kb(a,b);a="-"+lb(c,d)}else a=lb(a,b)}return a}function vb(a){if(a!=null&&typeof a!=="string")throw Error();return a}function wb(a,b,c){if(a!=null&&typeof a==="object"&&a.na===Na)return a;if(Array.isArray(a)){var d=a[r]|0,e=d;e===0&&(e|=c&32);e|=c&2;e!==d&&(a[r]=e);return new b(a)}};var Bb=function(a){var b=xb(a);if(b)return b;if(Math.random()>.01)return a;if(yb===void 0)if(typeof Proxy!=="function")yb=null;else try{yb=Proxy.toString().indexOf("[native code]")!==-1?Proxy:null}catch{yb=null}b=yb;if(!b)return a;b=new b(a,{set(c,d,e){zb();c[d]=e;return!0}});Ab(a,b);return b};function zb(){Ea()}let Cb=void 0,Db=void 0;var xb=function(a){let b;return(b=Cb)==null?void 0:b.get(a)};function Ab(a,b){(Cb||(Cb=new WeakMap)).set(a,b);(Db||(Db=new WeakMap)).set(b,a)}let yb=void 0;let Eb;function Fb(a,b){Eb=b;a=new a(b);Eb=void 0;return a};function Gb(a,b){return Hb(b)}function Hb(a){switch(typeof a){case "number":return isFinite(a)?a:String(a);case "bigint":return hb(a)?Number(a):String(a);case "boolean":return a?1:0;case "object":if(a)if(Array.isArray(a)){if(Sa(a))return}else{if(wa(a))return sa(a);if(a instanceof Aa){const b=a.Z;return b==null?"":typeof b==="string"?b:a.Z=sa(b)}}}return a};function Ib(a,b,c){a=Ha(a);var d=a.length;const e=b&256?a[d-1]:void 0;d+=e?-1:0;for(b=b&512?1:0;b<d;b++)a[b]=c(a[b]);if(e){b=a[b]={};for(const g in e)b[g]=c(e[g])}return a}function Jb(a,b,c,d,e){if(a!=null){if(Array.isArray(a))a=Sa(a)?void 0:e&&(a[r]|0)&2?a:Kb(a,b,c,d!==void 0,e);else if(Qa(a)){const g={};for(let f in a)g[f]=Jb(a[f],b,c,d,e);a=g}else a=b(a,d);return a}}
|
|
15
|
+
function Kb(a,b,c,d,e){const g=d||c?a[r]|0:0;d=d?!!(g&32):void 0;a=Ha(a);for(let f=0;f<a.length;f++)a[f]=Jb(a[f],b,c,d,e);c&&c(g,a);return a}function Lb(a){return a.na===Na?a.toJSON():Hb(a)};function Mb(a,b,c=Ma){if(a!=null){if(a instanceof Uint8Array)return b?a:new Uint8Array(a);if(Array.isArray(a)){var d=a[r]|0;if(d&2)return a;b&&(b=d===0||!!(d&32)&&!(d&64||!(d&16)));return b?(a[r]=(d|34)&-12293,a):Kb(a,Mb,d&4?Ma:c,!0,!0)}a.na===Na&&(c=a.h,d=c[r],a=d&2?a:Fb(a.constructor,Nb(c,d,!0)));return a}}function Nb(a,b,c){const d=c||b&2?Ma:La,e=!!(b&32);a=Ib(a,b,g=>Mb(g,e,d));a[r]=a[r]|32|(c?2:0);return a}function Ob(a){const b=a.h,c=b[r];return c&2?Fb(a.constructor,Nb(b,c,!1)):a};var Pb=function(a,b){a=a.h;return x(a,a[r],b)};function Qb(a,b,c,d){b=d+(+!!(b&512)-1);if(!(b<0||b>=a.length||b>=c))return a[b]}var x=function(a,b,c,d){if(c===-1)return null;const e=b>>14&1023||536870912;if(c>=e){if(b&256)return a[a.length-1][c]}else{var g=a.length;if(d&&b&256&&(d=a[g-1][c],d!=null)){if(Qb(a,b,e,c)&&Ja!=null){var f;a=(f=Da)!=null?f:Da={};f=a[Ja]||0;f>=4||(a[Ja]=f+1,Ea())}return d}return Qb(a,b,e,c)}},Rb=function(a,b,c){const d=a.h;let e=d[r];Va(e);y(d,e,b,c);return a};
|
|
16
|
+
function y(a,b,c,d,e){const g=b>>14&1023||536870912;if(c>=g||e&&!ma){let f=b;if(b&256)e=a[a.length-1];else{if(d==null)return f;e=a[g+(+!!(b&512)-1)]={};f|=256}e[c]=d;c<g&&(a[c+(+!!(b&512)-1)]=void 0);f!==b&&(a[r]=f);return f}a[c+(+!!(b&512)-1)]=d;b&256&&(a=a[a.length-1],c in a&&delete a[c]);return b}var A=function(a,b,c,d){c=z(a,d)===c?c:-1;return Sb(a,b,c)!==void 0};function Tb(a){return!!(2&a)&&!!(4&a)||!!(2048&a)}
|
|
17
|
+
function B(a,b,c,d){const e=a.h;let g=e[r];Va(g);y(e,g,b,(d==="0"?Number(c)===0:c===d)?void 0:c);return a}var z=function(a,b){a=a.h;return Ub(Vb(a),a,a[r],b)};function Vb(a){let b;return(b=a[Ka])!=null?b:a[Ka]=new Map}function Ub(a,b,c,d){let e=a.get(d);if(e!=null)return e;e=0;for(let g=0;g<d.length;g++){const f=d[g];x(b,c,f)!=null&&(e!==0&&(c=y(b,c,e)),e=f)}a.set(d,e);return e}function Sb(a,b,c,d){a=a.h;let e=a[r];const g=x(a,e,c,d);b=wb(g,b,e);b!==g&&b!=null&&y(a,e,c,b,d);return b}
|
|
18
|
+
var Wb=function(a,b,c){b=Sb(a,b,c,!1);if(b==null)return b;a=a.h;let d=a[r];if(!(d&2)){const e=Ob(b);e!==b&&(b=e,y(a,d,c,b,!1))}return b},Xb=function(a,b,c){c==null&&(c=void 0);return Rb(a,b,c)},C=function(a,b,c,d){d==null&&(d=void 0);a:{const f=a.h;var e=f[r];Va(e);if(d==null){var g=Vb(f);if(Ub(g,f,e,c)===b)g.set(c,0);else break a}else{g=f;const h=Vb(g),k=Ub(h,g,e,c);k!==b&&(k&&(e=y(g,e,k)),h.set(c,b))}y(f,e,b,d)}return a};function Yb(a,b){a=(2&b?a|2:a&-3)|32;return a&=-2049}
|
|
19
|
+
function Zb(a,b,c){32&b&&c||(a&=-33);return a}
|
|
20
|
+
var $b=function(a){a=Pb(a,1);a!=null&&(typeof a==="bigint"?hb(a)?a=Number(a):(a=BigInt.asIntN(64,a),a=hb(a)?Number(a):String(a)):a=rb(a)?typeof a==="number"?ub(a):tb(a):void 0);return a!=null?a:0},D=function(a,b){a=Pb(a,b);a=a==null||typeof a==="string"?a:void 0;return a!=null?a:""},E=function(a,b){a=Pb(a,b);a=a==null?a:Number.isFinite(a)?a|0:void 0;return a!=null?a:0},F=function(a,b,c,d){c=z(a,d)===c?c:-1;return Wb(a,b,c)},H=function(a,b,c){return B(a,b,vb(c),"")};let I;
|
|
21
|
+
var bc=function(a){try{return I=!0,JSON.stringify(ac(a),Gb)}finally{I=!1}},J=class{constructor(a){a:{a==null&&(a=Eb);Eb=void 0;if(a==null){var b=96;a=[]}else{if(!Array.isArray(a))throw Error("narr");b=a[r]|0;if(b&2048)throw Error("farr");if(b&64)break a;var c=a;b|=64;var d=c.length;if(d&&(--d,Qa(c[d]))){b|=256;c=d-(+!!(b&512)-1);if(c>=1024)throw Error("pvtlmt");b=b&-16760833|(c&1023)<<14}}a[r]=b}this.h=a}toJSON(){return ac(this)}getExtension(a){const b=a.D?a.Xa?a.L(this,a.D,a.F,void 0===Wa?2:4,!0):
|
|
22
|
+
a.L(this,a.D,a.F,!0):a.Xa?a.L(this,a.F,void 0===Wa?2:4,!0):a.L(this,a.F,a.defaultValue,!0);return a.pb&&b==null?a.defaultValue:b}hasExtension(a){a.D?a=Sb(this,a.D,a.F,!0)!==void 0:(a=a.D?a.L(this,a.D,a.F,!0):a.L(this,a.F,null,!0),a=(a===null?void 0:a)!==void 0);return a}clone(){const a=this.h;return Fb(this.constructor,Nb(a,a[r],!1))}};J.prototype.na=Na;J.prototype.toString=function(){try{return I=!0,ac(this).toString()}finally{I=!1}};
|
|
23
|
+
function ac(a){a=I?a.h:Kb(a.h,Lb,void 0,void 0,!1);{var b=!I;let n=a.length;if(n){var c=a[n-1],d=Qa(c);d?n--:c=void 0;var e=a;if(d){b:{var g=c;var f={};d=!1;if(g)for(var h in g){if(isNaN(+h)){f[h]=g[h];continue}let u=g[h];Array.isArray(u)&&(Sa(u)||Pa(u)&&u.size===0)&&(u=null);u==null&&(d=!0);u!=null&&(f[h]=u)}if(d){for(let u in f)break b;f=null}else f=g}g=f==null?c!=null:f!==c}for(;n>0;n--){h=e[n-1];if(!(h==null||Sa(h)||Pa(h)&&h.size===0))break;var k=!0}if(e!==a||g||k){if(!b)e=Array.prototype.slice.call(e,
|
|
24
|
+
0,n);else if(k||g||f)e.length=n;f&&e.push(f)}k=e}else k=a}return k};function cc(a){return b=>{if(b==null||b=="")b=new a;else{b=JSON.parse(b);if(!Array.isArray(b))throw Error("dnarr");b[r]|=32;b=Fb(a,b)}return b}};var dc=function(a){return b=>{b=JSON.parse(b);if(!Array.isArray(b)){var c=typeof b;throw Error("Expected jspb data to be an array, got "+(c!="object"?c:b?Array.isArray(b)?"array":c:"null")+": "+b);}b[r]|=34;return new a(b)}}(class extends J{});var ec=class extends J{setSeconds(a){return B(this,1,a==null?a:sb(a),"0")}};var gc=class extends J{ya(){return z(this,fc)}},fc=[2,3];var hc=class extends J{};var K=class extends Error{constructor({errorType:a,message:b,g:c}){super(`Meet Add-on SDK error: ${`${b}${c?` - ${c}`:""}`}`);this.errorType=a}},ic={errorType:"InternalError",message:"An unexpected error has occurred.",g:"No further information is available."},L={errorType:"InternalError",message:"An unexpected error has occurred.",g:"No further information is available."},jc={errorType:"MissingUrlParameter",message:"Missing required Meet SDK URL parameter",g:"This parameter is automatically appended by Meet to the iframe URL. Ensure that your infrastructure does not strip URL parameters (e.g. as part of a redirect)."},
|
|
25
|
+
kc={errorType:"NeedsMainStageContext",message:"This method can only be invoked if the addon is running in the main stage.",g:"Use getFrameType to check whether the addon is running in the main stage before invoking this method."},lc={errorType:"NeedsSidePanelContext",message:"This method can only be invoked if the addon is running in the side panel.",g:"Use getFrameType to check whether the addon is running in the side panel before invoking this method."},mc={errorType:"NotSupportedInStandalone",
|
|
26
|
+
message:"This method is not supported in standalone mode.",g:"Do not call this method in standalone mode."},nc={errorType:"InternalError",message:"The frame type URL parameter is set to an unexpected value.",g:"This parameter is automatically appended by Meet to the iframe URL. Ensure that your infrastructure does not modify URL parameters (e.g. as part of a redirect)."},oc={errorType:"InvalidCloudProjectNumber",message:"Cloud Project Number provided by meet does not match the one passed in by the SDK. Ensure that the correct Cloud Project Number is passed to the SDK as a string.",
|
|
27
|
+
g:"This parameter is automatically appended by Meet to the iframe URL. Ensure that your infrastructure does not modify URL parameters (e.g. as part of a redirect) and ensure that the correct Cloud Project Number was passed into the SDK as a string."},pc={errorType:"DestinationNotReady",message:"The recipient frame is not connected via the addon SDK and cannot receive the notification.",g:"Make sure the destination frame has connected before sending messages to it."},qc={errorType:"InvalidActivityStartingState",
|
|
28
|
+
message:"Origin of the ActivityStartingState iframeURLs does not match the origin of the URLs provided in the Add-on manifest.",g:"Ensure that the ActivityStartingState iframeURL origins match the origins of the URLs provided in the Add-on manifest."},rc={errorType:"ActivityStartingStateMissingAttributes",message:"The supplied ActivityStartingState object does not contain any recognized attributes.",g:"Ensure that the ActivityStartingState object contains at least one of the following attributes: mainStageUrl, sidePanelUrl, additionalData."},
|
|
29
|
+
sc={errorType:"ActivityStartingStateUnrecognizedAttributes",message:"The supplied ActivityStartingState object contains attributes that are not recognized.",g:"Ensure that the ActivityStartingState object has only the following attributes: mainStageUrl, sidePanelUrl, additionalData."},uc=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",
|
|
30
|
+
message:`The type '${b}' of argument supplied for '${a}' did not match the expected type '${c}'.`,g:"Ensure the type of the argument provided matches the expected type."}),vc=a=>({errorType:"InternalError",message:`Could not connect to ${a} channel. Unknown error`,g:"No further information is available."}),wc={errorType:"ActivityIsOngoing",message:"Operation cannot be performed while an activity is ongoing.",g:"Ensure that no activity is ongoing."},xc={errorType:"InternalError",message:"Frame message missing required Meet SDK command.",
|
|
31
|
+
g:"Send one of the available commands in the frame message."},yc={errorType:"RequiresEapEnrollment",message:"This feature is only available to early access partners.",g:"Meet add-on early access enrollment is currently closed."},zc={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."},Ac={errorType:"SizeLimitExceededActivityStartingState",
|
|
32
|
+
message:"The size of the activityStartingState URLs and/or its data exceed the limits allowed.",g:"Ensure that the activityStartingState URL size is less than 512 characters and the additional data size is less than 4096 characters."},Bc={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."},Cc={errorType:"AddonSessionAlreadyCreated",message:"The addon session has already been created.",
|
|
33
|
+
g:"Only instantiate the AddonSession once."},Dc={errorType:"UserCancelled",message:"The user cancelled starting an activity.",g:"The user needs to click continue to start the activity."},Ec={errorType:"NotSupportedInMeetCall",message:"This method is not supported during a Meet call.",g:"Do not call this method during a Meet call."},Fc={errorType:"InvalidAddonStartingState",message:"Origin of the AddonStartingState iframeURLs does not match the origin of the URLs provided in the Add-on manifest.",
|
|
34
|
+
g:"Ensure that the AddonStartingState iframeURL origins match the origins of the URLs provided in the Add-on manifest."},Gc={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."};
|
|
35
|
+
function Hc(a){switch(a){case 0:return ic;case 1:return pc;case 2:return qc;case 3:return wc;case 4:return xc;case 5:return yc;case 6:return mc;case 7:return zc;case 8:return Ac;case 9:return Bc;case 10:return Dc;case 11:return Ec;case 12:return Fc;case 13:return Gc;default:return L}}
|
|
36
|
+
function Ic(a){let b;var c=(b=E(a,1))!=null?b:0;a=Jc(a.ya());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}.`,
|
|
37
|
+
g:"This method might require EAP enrollment."};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 vc(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",
|
|
38
|
+
message:`Could not connect to ${a} channel.`,g:"No further information is available."}}return c;default:return vc(a)}}function Jc(a){switch(a){case 2:return"coActivity";case 3:return"guaranteed delivery";case 0:return"unknown";default:return"unknown"}}function Kc({errorType:a,message:b,g:c},d=""){throw new K({errorType:a,message:d?`${b} ${d}`:b,g:c});}function Lc(a,b){Kc({...jc,message:`${jc.message}: ${a}. In URL ${b}`})};var Nc=function(a){var b=new Mc;return B(b,1,w(a),0)},Mc=class extends J{getFrameType(){return E(this,1)}};var Oc=function(a){var b=a.h,c=b[r];a=c;var d=!(2&c),e=Mc,g=void 0===Wa?2:5;g=(c=!!(2&a))?1:g;d&&(d=!c);c=x(b,a,1);c=Array.isArray(c)?c:Ta;var f=c[r]|0,h=!!(4&f);if(!h){var k=f;k===0&&(k=Yb(k,a));f=c;k|=1;var n=a;const G=!!(2&k);G&&(n|=2);let P=!G,ob=!0,Ia=0,pb=0;for(;Ia<f.length;Ia++){const qb=wb(f[Ia],e,n);if(qb instanceof e){if(!G){const tc=!!((qb.h[r]|0)&2);P&&(P=!tc);ob&&(ob=tc)}f[pb++]=qb}}pb<Ia&&(f.length=pb);k|=4;k=ob?k|16:k&-17;k=P?k|8:k&-9;f[r]=k;G&&Object.freeze(f);f=k}if(d&&!(8&f||!c.length&&
|
|
39
|
+
(g===1||g===4&&32&f))){Tb(f)&&(c=Ha(c),f=Yb(f,a),a=y(b,a,1,c));d=c;e=f;for(f=0;f<d.length;f++)k=d[f],n=Ob(k),k!==n&&(d[f]=n);e|=8;e=d.length?e&-17:e|16;f=d[r]=e}let u;g===1||g===4&&32&f?Tb(f)||(a=f,b=!!(32&f),f|=!c.length||16&f&&(!h||b)?2:2048,f!==a&&(c[r]=f),Object.freeze(c)):(h=g!==5?!1:!!(32&f)||Tb(f)||!!xb(c),(g===2||h)&&Tb(f)&&(c=Ha(c),f=Yb(f,a),f=Zb(f,a,!1),c[r]=f,a=y(b,a,1,c)),Tb(f)||(b=f,f=Zb(f,a,!1),f!==b&&(c[r]=f)),h&&(u=Bb(c)));return u||c},Qc=function(a){{var b=new Pc;const u=b.h;let G=
|
|
40
|
+
u[r];Va(G);if(a==null)y(u,G,1);else{var c=a,d;a=((d=Db)==null?void 0:d.get(c))||c;c=d=a[r]|0;var e=!!(2&d)||!!(2048&d),g=e||Object.isFrozen(a),f;if(f=!g)f=void 0===Xa||!1;var h=!0,k=!0;for(let P=0;P<a.length;P++){var n=a[P];e||(n=!!((n.h[r]|0)&2),h&&(h=!n),k&&(k=n))}e||(d|=5,d=h?d|8:d&-9,d=k?d|16:d&-17);if(f||g&&d!==c)a=Ha(a),c=0,d=Yb(d,G),d=Zb(d,G,!0);d!==c&&(a[r]=d);y(u,G,1,a)}}return b},Pc=class extends J{};var Rc=class extends J{constructor(){super()}};var Tc=function(a){var b=new Sc;return B(b,1,w(a),0)},Sc=class extends J{constructor(){super()}};var Uc=class extends J{Ja(a){return H(this,2,a)}};var Vc=class extends J{};var Xc=class extends J{R(){return z(this,Wc)}ja(){return F(this,Pc,2,Wc)}Y(a){return C(this,2,Wc,a)}getMeetingInfo(){return F(this,Vc,3,Wc)}},Wc=[2,3,4,5];var Zc=class extends J{za(){return z(this,Yc)}},Yc=[1,4,5,6,7,8,9,10,11,12,13,14,15,16,17];var $c=class extends J{constructor(){super()}ja(){return Wb(this,Pc,1)}Y(a){return Xb(this,1,a)}};var ad=class extends J{constructor(){super()}ja(){return Wb(this,Pc,1)}Y(a){return Xb(this,1,a)}};var bd=new Map([[2,"MAIN_STAGE"],[1,"SIDE_PANEL"]]),cd=new Map([[0,"UNKNOWN"],[1,"OPEN_ADDON"],[2,"START_ACTIVITY"],[3,"JOIN_ACTIVITY"]]);function dd(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.ea())};N.prototype[Symbol.dispose]=function(){this.dispose()};var ed=function(a,b){a.o?b():(a.A||(a.A=[]),a.A.push(b))};N.prototype.ea=function(){if(this.A)for(;this.A.length;)this.A.shift()()};var fd=function({ra:a,Fa:b}){if(a===null)throw new K(uc("activityStartingState"));if(b||a!==void 0){if(typeof a!=="object")throw new K(M("activityStartingState",typeof a,`object${b?"":" | undefined"}`));if(a.mainStageUrl!==void 0&&typeof a.mainStageUrl!=="string")throw new K(M("mainStageUrl",typeof a.mainStageUrl,"string | undefined"));if(a.sidePanelUrl!==void 0&&typeof a.sidePanelUrl!=="string")throw new K(M("sidePanelUrl",typeof a.sidePanelUrl,"string | undefined"));if(a.additionalData!==void 0&&
|
|
41
|
+
typeof a.additionalData!=="string")throw new K(M("additionalData",typeof a.additionalData,"string | undefined"));if(Object.keys(a).length!==+!!a.mainStageUrl+ +!!a.sidePanelUrl+ +!!a.additionalData)throw new K(sc);if(Object.keys(a).length===0)throw new K(rc);}},gd=function(a){const b=[];var c=b.push;var d=Nc(2);d=H(d,2,a.mainStageUrl);d=H(d,3,a.additionalData);c.call(b,d);c=b.push;d=Nc(1);d=H(d,2,a.sidePanelUrl);a=H(d,3,a.additionalData);c.call(b,a);return b},od=class extends N{constructor(a){super();
|
|
42
|
+
this.context=a;this.Da={};hd(this.context.i.fb,b=>{switch(b.content.za()){case 7:const d=this.Da.frameToFrameMessage;b=F(b.content,Uc,7,Yc);if(d&&b){var c=E(b,1);c=bd.get(c);if(c===void 0)throw Error("Unknown frame type.");d({originator:c,payload:D(b,2)})}break;case 16:id(this.context.i)}})}async getMeetingInfo(){const a=await jd(this.context.i,Tc(2));return{meetingId:D(a.getMeetingInfo(),1)}}async getFrameOpenReason(){let a;const b=(a=this.context.ca.Ua)!=null?a:0;let c;return(c=cd.get(b))!=null?
|
|
43
|
+
c:"UNKNOWN"}async getActivityStartingState(){var a=(await jd(this.context.i,Tc(1))).ja();const b=a==null?void 0:Oc(a).find(c=>c.getFrameType()===2);a=a==null?void 0:Oc(a).find(c=>c.getFrameType()===1);return{mainStageUrl:(b==null?void 0:D(b,2))||void 0,sidePanelUrl:(a==null?void 0:D(a,2))||void 0,additionalData:(a==null?void 0:D(a,3))||void 0}}async setActivityStartingState(a){fd({ra:a,Fa:!0});a=gd(a);await kd(this.context.i,(new $c).Y(Qc(a)))}on(a,b){this.Da[a]=b}async closeAddon(){await ld(this.context.i)}async startActivity(a){fd({ra:a,
|
|
44
|
+
Fa:!1});const b=new ad;a&&(a=gd(a),b.Y(Qc(a)));await md(this.context.i,b)}async endActivity(a){var b=nd,c=this.context.i,d=new Rc;a=B(d,1,w(a==="aab61ee0-51b4-475d-aa4d-849f2498640d"?999:0),0);await b(c,a)}};var pd=cc(class extends J{getFrameOpenReason(){return E(this,5)}});function qd(){var a=window.location.href;var b=window.location.href;var c=(new URL(b)).searchParams.get("meet_sdk");c?b=pd(atob(c)):(Lc("meet_sdk",b),b=void 0);(c=D(b,1))||Lc("meet_addon_frame_type",a);c=Number(c);if(c!==2&&c!==1)throw new K(nc);const d=D(b,2);d||Lc("meet_control_channel_name",a);const e=D(b,4);e||Lc("addon_cloud_project_number",a);var g;a=(g=b.getFrameOpenReason())!=null?g:0;g=D(b,3)||"https://meet.google.com";return{Ua:a,frameType:c,Qa:d,cloudProjectNumber:e,Ga:g}};var rd=class extends J{constructor(){super()}};var sd=class extends J{constructor(){super()}};var vd=function(){var a=new td,b=new sd;return C(a,1,ud,b)},td=class extends J{constructor(){super()}ya(){return z(this,ud)}},ud=[1,2];var wd=class extends J{constructor(){super()}};var xd=class extends J{constructor(){super()}};var yd=class extends J{constructor(){super()}Ja(a){return H(this,2,a)}};var zd=class extends J{constructor(){super()}};var Ad=class extends J{constructor(){super()}};var Q=class extends J{constructor(){super()}za(){return z(this,O)}},O=[1,2,5,6,7,8,9,10,11,13,14,15,16];var Bd=class extends J{},Cd=cc(Bd),Dd=[1,2];class Ed{constructor(a,b){this.data=a;this.channel=b}};var Fd=Promise;var Hd=function(a){const b=new MessageChannel;Gd(b.port1,a);return b},Jd=function(a,b){Gd(a,b);return new Id(a)};class Id{constructor(a){this.hb=a}send(a,b,c=[]){b=Hd(b);this.hb.postMessage(a,[b.port2].concat(c))}N(a,b){return new Fd(c=>{this.send(a,c,b)})}}const Gd=function(a,b){b&&(a.onmessage=c=>{var d=c.data;c=Jd(c.ports[0]);b(new Ed(d,c))})};class Kd{constructor(a,b){this.Za=100;this.Ra=a;this.kb=b;this.V=0;this.U=null}get(){let a;this.V>0?(this.V--,a=this.U,this.U=a.next,a.next=null):a=this.Ra();return a}put(a){this.kb(a);this.V<this.Za&&(this.V++,a.next=this.U,this.U=a)}};var Ld=function(){var a=document;var b="IFRAME";a.contentType==="application/xhtml+xml"&&(b=b.toLowerCase());return a.createElement(b)};var Md=function(){};var Nd,Od=function(){var a=l.MessageChannel;typeof a==="undefined"&&typeof window!=="undefined"&&window.postMessage&&window.addEventListener&&!p("Presto")&&(a=function(){var e=Ld();e.style.display="none";document.documentElement.appendChild(e);var g=e.contentWindow;e=g.document;e.open();e.close();var f="callImmediate"+Math.random(),h=g.location.protocol=="file:"?"*":g.location.protocol+"//"+g.location.host;e=ha(function(k){if((h=="*"||k.origin==h)&&k.data==f)this.port1.onmessage()},this);g.addEventListener("message",
|
|
45
|
+
e,!1);this.port1={};this.port2={postMessage:function(){g.postMessage(f,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.ua;c.ua=null;e()}};return function(e){d.next={ua:e};d=d.next;b.port2.postMessage(0)}}return function(e){l.setTimeout(e,0)}};class Pd{constructor(){this.aa=this.J=null}add(a,b){const c=Qd.get();c.set(a,b);this.aa?this.aa.next=c:this.J=c;this.aa=c}remove(){let a=null;this.J&&(a=this.J,this.J=this.J.next,this.J||(this.aa=null),a.next=null);return a}}var Qd=new Kd(()=>new Rd,a=>a.reset());class Rd{constructor(){this.next=this.scope=this.ga=null}set(a,b){this.ga=a;this.scope=b;this.next=null}reset(){this.next=this.scope=this.ga=null}};let Sd,Td=!1,Ud=new Pd,Wd=(a,b)=>{Sd||Vd();Td||(Sd(),Td=!0);Ud.add(a,b)},Vd=()=>{if(l.Promise&&l.Promise.resolve){const a=l.Promise.resolve(void 0);Sd=()=>{a.then(Xd)}}else Sd=()=>{var a=Xd;typeof l.setImmediate!=="function"||l.Window&&l.Window.prototype&&l.Window.prototype.setImmediate==l.setImmediate?(Nd||(Nd=Od()),Nd(a)):l.setImmediate(a)}};var Xd=()=>{let a;for(;a=Ud.remove();){try{a.ga.call(a.scope)}catch(b){m(b)}Qd.put(a)}Td=!1};var R=function(a){this.l=0;this.Ha=void 0;this.C=this.u=this.B=null;this.S=this.fa=!1;if(a!=Md)try{var b=this;a.call(void 0,function(c){Yd(b,2,c)},function(c){Yd(b,3,c)})}catch(c){Yd(this,3,c)}},Zd=function(){this.next=this.context=this.H=this.M=this.v=null;this.K=!1};Zd.prototype.reset=function(){this.context=this.H=this.M=this.v=null;this.K=!1};
|
|
46
|
+
var $d=new Kd(function(){return new Zd},function(a){a.reset()}),ae=function(a,b,c){var d=$d.get();d.M=a;d.H=b;d.context=c;return d},ce=function(){var a,b,c=new R(function(d,e){a=d;b=e});return new be(c,a,b)};R.prototype.then=function(a,b,c){return de(this,typeof a==="function"?a:null,typeof b==="function"?b:null,c)};R.prototype.$goog_Thenable=!0;var fe=function(a,b){b=ae(b,b);b.K=!0;ee(a,b)};R.prototype.lb=function(a,b){return de(this,null,a,b)};R.prototype.catch=R.prototype.lb;
|
|
47
|
+
R.prototype.cancel=function(a){if(this.l==0){var b=new S(a);Wd(function(){ge(this,b)},this)}};
|
|
48
|
+
var ge=function(a,b){if(a.l==0)if(a.B){var c=a.B;if(c.u){for(var d=0,e=null,g=null,f=c.u;f&&(f.K||(d++,f.v==a&&(e=f),!(e&&d>1)));f=f.next)e||(g=f);e&&(c.l==0&&d==1?ge(c,b):(g?(d=g,d.next==c.C&&(c.C=d),d.next=d.next.next):he(c),ie(c,e,3,b)))}a.B=null}else Yd(a,3,b)},ee=function(a,b){a.u||a.l!=2&&a.l!=3||je(a);a.C?a.C.next=b:a.u=b;a.C=b},de=function(a,b,c,d){var e=ae(null,null,null);e.v=new R(function(g,f){e.M=b?function(h){try{var k=b.call(d,h);g(k)}catch(n){f(n)}}:g;e.H=c?function(h){try{var k=c.call(d,
|
|
49
|
+
h);k===void 0&&h instanceof S?f(h):g(k)}catch(n){f(n)}}:f});e.v.B=a;ee(a,e);return e.v};R.prototype.mb=function(a){this.l=0;Yd(this,2,a)};R.prototype.nb=function(a){this.l=0;Yd(this,3,a)};
|
|
50
|
+
var Yd=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.mb,g=a.nb;if(d instanceof R){ee(d,ae(e||Md,g||null,a));var f=!0}else{if(d)try{var h=!!d.$goog_Thenable}catch(n){h=!1}else h=!1;if(h)d.then(e,g,a),f=!0;else{h=typeof d;if(h=="object"&&d!=null||h=="function")try{var k=d.then;if(typeof k==="function"){ke(d,k,e,g,a);f=!0;break a}}catch(n){g.call(a,n);f=!0;break a}f=!1}}}f||(a.Ha=c,a.l=b,a.B=null,je(a),b!=3||c instanceof S||le(a,c))}},
|
|
51
|
+
ke=function(a,b,c,d,e){var g=!1,f=function(k){g||(g=!0,c.call(e,k))},h=function(k){g||(g=!0,d.call(e,k))};try{b.call(a,f,h)}catch(k){h(k)}},je=function(a){a.fa||(a.fa=!0,Wd(a.Ta,a))},he=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.Ta=function(){for(var a;a=he(this);)ie(this,a,this.l,this.Ha);this.fa=!1};
|
|
52
|
+
var ie=function(a,b,c,d){if(c==3&&b.H&&!b.K)for(;a&&a.S;a=a.B)a.S=!1;if(b.v)b.v.B=null,me(b,c,d);else try{b.K?b.M.call(b.context):me(b,c,d)}catch(e){ne.call(null,e)}$d.put(b)},me=function(a,b,c){b==2?a.M.call(a.context,c):a.H&&a.H.call(a.context,c)},le=function(a,b){a.S=!0;Wd(function(){a.S&&ne.call(null,b)})},ne=m,S=function(a){ka.call(this,a)};ja(S,ka);S.prototype.name="cancel";var be=function(a,b,c){this.promise=a;this.resolve=b;this.reject=c};let oe=1,pe=new WeakMap;
|
|
53
|
+
var re=function(a,b,c){var d=qe;a.Ma.has(b);d(b,c)},te=class extends N{constructor(){super();this.Ma=new Set}signal(){const a=new se;this.Ma.add(a);ed(this,ia(dd,a));return a}},qe=function(a,b){return new Promise(c=>{ue(()=>{a.ta&&(a.Ya=b,a.Ca=!0);for(const {qa:d,slot:e}of a.j.values())try{e(b,{signal:a,qa:d})}catch(g){m(g)}for(const d of a.I)d.resolve(b);a.I.clear();c()})})},hd=function(a,b,c){const d=oe++;ue(()=>{ve(a,d,b,c)});return d},ve=function(a,b,c,d){if(!a.o)if(d){if(!d.o){const e=()=>{ue(()=>
|
|
54
|
+
{a.j.delete(b);const g=pe.get(d);g&&ra(g,e)})};a.j.set(b,{qa:b,slot:c,da:e});we(d,e)}}else a.j.set(b,{qa:b,slot:c,da:()=>a.j.delete(b)})},se=class extends N{constructor(){super();this.ta=!1;this.j=new Map;this.I=new Set;this.Ca=!1}detach(a){ue(()=>{const b=this.j.get(a);b&&b.da()})}value(a){return this.promise(!0,a)}next(a){return this.promise(!1,a)}promise(a,b){const c=ce();ue(()=>{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&&
|
|
55
|
+
this.ta&&this.Ca)c.resolve(this.Ya);else if(this.I.add(c),fe(c.promise,()=>{this.I.delete(c)}),b){const d=()=>{c.reject(new S("Owner asynchronously disposed"))};fe(c.promise,()=>{const e=pe.get(b);e&&ra(e,d)});we(b,d)}});return c.promise}ea(){super.ea();ue(()=>{for(const {da: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 xe=[];let ye=!1;function ue(a){xe.push(a);ze()}
|
|
56
|
+
async function ze(){if(!ye)try{ye=!0;let a=Ae(0);for(;a<xe.length;)await Promise.resolve(),a=Ae(a)}catch(a){m(a)}finally{xe.length=0,ye=!1}}function Ae(a){const b=a+100;for(;a<b&&a<xe.length;)try{xe[a++]()}catch(c){m(c)}return a}function we(a,b){if(a.o)b();else{var c=pe.get(a);if(c)c.push(b);else{const d=[b];pe.set(a,d);ed(a,()=>{for(const e of[...d])e();pe.delete(a)})}}};function T(a){var b=new Bd;a=C(b,1,Dd,a);return{content:bc(a)}}const Be=new te;function Ce(a,b){const c=Be.signal();return{channel:Jd(a,d=>{const e=b(d.data);re(Be,c,{content:e,jb:d})}),signal:c}};let De;var U=class extends J{getState(){const a=this.h;let b=a[r];const c=x(a,b,1),d=Ra(c,!0,!!(b&34));d!=null&&d!==c&&y(a,b,1,d);return d==null?Ba():d}};var V=class extends J{};var Fe=class extends J{ha(){return F(this,U,2,Ee)}W(a){C(this,2,Ee,a)}T(){return A(this,U,2,Ee)}ia(){return F(this,V,3,Ee)}X(a){C(this,3,Ee,a)}ka(){return A(this,V,3,Ee)}},Ee=[2,3];var Ge=cc(class extends J{});var Ie=cc(class extends J{R(){return z(this,He)}}),He=[1,2];var Je=({destination:a,origin:b,tb:c,Na:d="ZNWN1d",onMessage:e})=>{if(b==="*")throw Error("Sending to wildcard origin not allowed.");const g=Hd(e);a.postMessage(c?{n:d,t:c}:d,b,[g.port2]);return Jd(g.port1,e)};function Ke(a,b,c){const d=new te,e=d.signal();a=Je({destination:window.parent,origin:b,Na:a,onMessage:g=>{const f=Cd(g.data.content);z(f,Dd)===2&&re(d,e,{content:F(f,Zc,2,Dd),jb:g,messagePort:g.data.messagePort})}});return new Le(e,a,c)}
|
|
57
|
+
var id=async function(a){a=a.channel;var b=a.N;var c=new Q;var d=new zd;c=C(c,13,O,d);await b.call(a,T(c))},jd=async function(a,b){var c=W,d=new Q;b=C(d,9,O,b);a=await c(a,T(b));let e;return(e=F(Cd(a.data.content),Zc,2,Dd))==null?void 0:F(e,Xc,9,Yc)},kd=async function(a,b){var c=W,d=new Q;b=C(d,8,O,b);await c(a,T(b))},ld=async function(a){var b=W;var c=new Q;var d=new rd;c=C(c,11,O,d);await b(a,T(c))},md=async function(a,b){var c=W,d=new Q;b=C(d,14,O,b);await c(a,T(b))},nd=async function(a,b){var c=
|
|
58
|
+
W,d=new Q;b=C(d,15,O,b);await c(a,T(b))},Me=async function(a){setInterval(async()=>{await id(a)},1E3)},W=async function(a,b){(a=await a.channel.N(b))||Kc(L,"Falsy response received from the message channel."+` ${JSON.stringify(a)}`);(b=a.data)||Kc(L,"Data field in the response from the message channel is falsy."+` ${JSON.stringify(b)}`);(b=b.content)||Kc(L,"Content field in the response from the message channel is falsy."+` ${JSON.stringify(b)}`);let c=void 0;try{c=Cd(b)}catch(d){Kc(L,"The ControlMessage can't be deserialized."+
|
|
59
|
+
` ${JSON.stringify(b)}. ${JSON.stringify(d)}`)}(b=F(c,Zc,2,Dd))||Kc(L,"MeetToAddonMessage field on ControlMessage is falsy."+` ${JSON.stringify(b)}`);b=b==null?void 0:F(b,hc,10,Yc);if((b==null?void 0:E(b,1))!==void 0)throw new K(Hc(E(b,1)));return a},Ne=async function(a,b,c){var d=W,e=new Q;b=C(e,1,O,b);d=await d(a,T(b));a=d.data.messagePort;var g;(d=(g=F(Cd(d.data.content),Zc,2,Dd))==null?void 0:F(g,gc,1,Yc))!=null?g=d:(g=new gc,g=B(g,1,w(0),0));return{channel:a?Ce(a,c):void 0,response:g}},Oe=async function(a){const b=
|
|
60
|
+
vd(),{channel:c,response:d}=await Ne(a,b,e=>Ie(e));if(!c)throw new K(Ic(d));return c},Pe=async function(a){var b=W;var c=new Q;var d=new Ad;c=C(c,5,O,d);await b(a,T(c))},Qe=async function(a){var b=W;var c=new Q;var d=new xd;c=C(c,6,O,d);await b(a,T(c))},Re=async function(a,b,c){var d=W,e=new Q,g=new yd;b=B(g,1,w(b),0).Ja(c);e=C(e,7,O,b);await d(a,T(e))};
|
|
61
|
+
class Le extends N{constructor(a,b,c){super();this.fb=a;this.channel=b;a=De||(De=dc("[0,10,0]"));a=Ob(a);a=Rb(a,4,vb("671028142"));b=a.h;var d=b[r];b=d&2?a:Fb(a.constructor,Nb(b,d,!0));a=new Q;d=new wd;b=Xb(d,2,b);c=H(b,3,c);c=C(a,2,O,c);this.channel.send(T(c));Me(this)}};let Se;var Te=class{constructor(a){var b=Se;this.ca=a;this.i=b}delete(){throw Error("Not implemented.");}};var Ve=class extends J{constructor(){super()}pa(a){return B(this,1,a==null?a:sb(a),"0")}ha(){return F(this,U,2,Ue)}W(a){C(this,2,Ue,a)}T(){return A(this,U,2,Ue)}ia(){return F(this,V,3,Ue)}X(a){C(this,3,Ue,a)}ka(){return A(this,V,3,Ue)}},Ue=[2,3];var We=class extends J{constructor(){super()}};var Xe=class extends J{constructor(){super()}};var Ye=class extends J{constructor(){super()}oa(a){return Rb(this,4,vb(a))}};var $e=class extends J{constructor(){super()}pa(a){return B(this,1,a==null?a:sb(a),"0")}ha(){return F(this,U,2,Ze)}W(a){C(this,2,Ze,a)}T(){return A(this,U,2,Ze)}ia(){return F(this,V,3,Ze)}X(a){C(this,3,Ze,a)}ka(){return A(this,V,3,Ze)}},Ze=[2,3],af=[5,6];var bf=class extends J{constructor(){super()}oa(a){return H(this,1,a)}};var df=class extends J{constructor(){super()}R(){return z(this,cf)}},cf=[1,2,3];function ef(a){var b=new ff;let c=0,d;return(...e)=>{if(gf(b)){hf(b);var g=!0}else g=!1;g?a(...e):(d=()=>void a(...e),c||(c=setTimeout(()=>{c=0;let f;(f=d)==null||f()},jf(b))))}};var jf=function(a){const b=a.wa;let c;a=Date.now()-((c=a.la[a.index])!=null?c:0);return a>=b?0:b-a},gf=function(a){const b=a.wa;let c;return Date.now()-((c=a.la[a.index])!=null?c:0)>=b},hf=function(a){a.la[a.index]=Date.now();a.index=(a.index+1)%a.ab},ff=class{constructor(){this.ab=1;this.wa=500;this.la=[];this.index=0}};var kf=class extends Error{constructor(){super("Failed to create CoActivity: Connection refused - Meet refused to begin Live Sharing")}};var lf=class{constructor(a){this.config=a}start(){this.Ea!=null||(this.Ea=setInterval(()=>{this.config.eb()},this.config.Wa));return this}shutdown(){clearInterval(this.Ea)}};function mf(){const a=new Map,b={set(c,d){a.set(c,d);return b},ba:()=>a};return b};function nf(a){if(a.T()){var b=a.ha().getState();a=Uint8Array;za(xa);var c=b.Z;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.Z=c;return{bytes:new a(b||0)}}}function of(a,b){a.W(pf(b));return a}function qf(a,b){a.W(pf(b));return a}function pf(a){var b=new U;return B(b,1,Ra(a.bytes,!1,!1),Ba())}
|
|
62
|
+
function rf(a){if(a.ka()){a=a.ia();var b,c,d=D(a,1),e=(c=(b=Wb(a,ec,2))==null?void 0:$b(b))!=null?c:0;c=a.h;let g=c[r];const f=x(c,g,4);b=f==null||typeof f==="number"?f:f==="NaN"||f==="Infinity"||f==="-Infinity"?Number(f):void 0;b!=null&&b!==f&&y(c,g,4,b);return{mediaId:d,mediaPlayoutPosition:e,mediaPlayoutRate:b!=null?b:0,playbackState:sf.get(E(a,3))}}}function tf(a,b){a.X(uf(b));return a}function vf(a,b){a.X(uf(b));return a}
|
|
63
|
+
const sf=mf().set(0,"INVALID").set(1,"BUFFERING").set(2,"PLAY").set(3,"PAUSE").set(4,"ENDED").ba(),wf=mf().set("INVALID",0).set("BUFFERING",1).set("PLAY",2).set("PAUSE",3).set("ENDED",4).ba();function uf(a){var b=new V;b=H(b,1,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=B(b,4,c,0);c=(new ec).setSeconds(a.mediaPlayoutPosition);b=Xb(b,2,c);a=wf.get(a.playbackState);return B(b,3,w(a),0)}
|
|
64
|
+
function xf({activityTitle:a}){return(new Ye).oa(a)}function yf(a,b){var c=new Xe;b=B(c,1,w(b.G),0);C(a,6,af,b);return a}function zf(a){var b=new We;C(a,5,af,b);return a};const Af=mf().set("co-doing",1).set("co-watching",2).ba();async function Bf(a,b,c){var d=b.N,e=new df;var g=(new bf).oa(a.activityTitle);var f=Af.get(a.sa);g=B(g,2,w(f),0);e=C(e,3,cf,g);d=await d.call(b,e,Ge);let h;e=Pb(d,1);e=e==null||typeof e==="boolean"?e:typeof e==="number"?!!e:void 0;if((h=e!=null?e:!1)!=null&&h)return new Cf(a,b,c,Wb(d,Fe,2));throw new kf;}
|
|
65
|
+
var Df=function(a,b){const c=a.config.Aa(b);c&&!a.config.xa(a.s,c)&&(a.s=c,a.ma=$b(b),a.Sa(a.s))},X=function(a,b){const {state:c,bb:d,context:e}=b(a.s);a.s=c;a.notify(a.s,e,d)};
|
|
66
|
+
class Cf{constructor(a,b,c,d){this.va=a;this.P=b;this.config=c;this.Sa=ef(e=>void this.va.Ba(e));Ef(this.P,e=>{const g=e.R();switch(g){case 1:Df(this,F(e,Fe,1,He));break;case 2:case 0:console.warn(`IllegalMessage: ${g} - ${"Unhandled message"} - ${"Please raise a bug with the MeetJS team"}`)}});this.Va=(new lf({Wa:1E3,eb:()=>{var e,g;const f=(g=(e=this.va).ib)==null?void 0:g.call(e);this.s!==null&&(this.s={...this.s,...f},e=new df,g=this.config.Ka((new Ve).pa(this.ma),this.s),e=C(e,1,cf,g),this.P.send(e))}})).start();
|
|
67
|
+
this.s=null;this.ma=0;d&&Df(this,d)}disconnect(){this.P.shutdown();this.Va.shutdown()}notify(a,b,c){var d=c?xf(c):void 0;c=this.config;var e=c.La,g=(new $e).pa(this.ma);d=Xb(g,4,d);a=e.call(c,d,a);a=this.config.Ia(a,b);b=this.P;c=b.send;e=new df;a=C(e,2,cf,a);c.call(b,a)}};var Ff=class{constructor(a){this.m=a}broadcastStateUpdate(a){X(this.m,()=>({state:a,context:{}}))}disconnect(){this.m.disconnect()}};function Gf(a,b){return a==null||b==null?!1:a.bytes.length===b.bytes.length&&a.bytes.every((c,d)=>c===b.bytes[d])};var Hf=class{constructor(a){this.m=a}notifySwitchedToMedia(a,b,c){X(this.m,()=>({state:{mediaId:b,mediaPlayoutRate:1,mediaPlayoutPosition:c,playbackState:"PLAY"},bb:{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},
|
|
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()}};
|
|
69
|
+
function If(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 Ef=function(a,b){const c=hd(a.signal,d=>{b(d)});a.j.push(c)},Jf=class{constructor(a,b){this.channel=a;this.signal=b;this.j=[]}send(a){this.channel.send(bc(a))}async N(a,b){a=await this.channel.N(bc(a));return b(a.data)}shutdown(){this.j.forEach(a=>{this.signal.detach(a)})}};function Kf(a,b){var c=Lf;const d=a.signal(),e=a.signal();hd(b,g=>{const f=c(g)?d:e;re(a,f,g)},a);return{gb:d,cb:e}}function Mf(a,b,c,d=e=>e){hd(c,e=>{re(a,b,d(e))},a)};async function Nf(a,b){if(b)return a=await Bf({activityTitle:b.activityTitle,sa:"co-watching",ib:()=>b.onCoWatchingStateQuery(),Ba:c=>{b.onCoWatchingStateChanged(c)}},a,{La:tf,Ka:vf,Ia:yf,Aa:rf,xa:If}),new Hf(a)}async function Of(a,b){if(b)return a=await Bf({activityTitle:b.activityTitle,sa:"co-doing",Ba:c=>{b.onCoDoingStateChanged(c)}},a,{La:of,Ka:qf,Ia:zf,Aa:nf,xa:Gf}),new Ff(a)}
|
|
70
|
+
async function Pf(a){const b=new te,c=b.signal();a=await a;Mf(b,c,a.signal,g=>g.content);const {gb:d,cb:e}=Kf(b,c);return{Oa:new Jf(a.channel,d),Pa:new Jf(a.channel,e)}}function Lf(a){a:switch(a.R()){case 1:a=F(a,Fe,1,He);break a;default:throw Error("CA Message arrived with no known content message set");}return a.T()};async function Qf(a,b){({Oa:a}=await Pf(Oe(a.i)));b=await Of(a,b);if(!b)throw Error("Failed to create co-doing session");return b}async function Rf(a,b){({Pa:a}=await Pf(Oe(a.i)));b=await Nf(a,b);if(!b)throw Error("Failed to create co-watching session");return b};var Sf=class extends od{async notifySidePanel(a){await Re(this.context.i,1,a)}async unloadSidePanel(){await Pe(this.context.i)}async loadSidePanel(){await Qe(this.context.i)}};var Tf=class extends od{async notifyMainStage(a){await Re(this.context.i,2,a)}};var Uf=class{constructor(a){a=a.cloudProjectNumber;const b=qd();if(b.cloudProjectNumber!==a)throw new K(oc);const c=b.Ga,d=b.Qa;let e;Se=(e=Se)!=null?e:Ke(d,c,a);this.O=new Te(b)}async createMainStageClient(){var a=this.O;if(a.ca.frameType!==2)throw new K(kc);return await Promise.resolve(new Sf(a))}async createSidePanelClient(){var a=this.O;if(a.ca.frameType!==1)throw new K(lc);return await Promise.resolve(new Tf(a))}async createCoWatchingClient(a){return await Rf(this.O,a)}async createCoDoingClient(a){return await Qf(this.O,
|
|
71
|
+
a)}};let Vf=null;var Wf={addon:{getFrameType:function(){a:{var a=qd().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 K(uc("config"));if(typeof a!=="object")throw new K(M("config",typeof a,"object"));if(typeof a.cloudProjectNumber!=="string")throw new K(M("cloudProjectNumber",typeof a.cloudProjectNumber,"string"));if(Vf&&qd().Ga!=="integration.test.google.com")throw new K(Cc);
|
|
72
|
+
return Vf=new Uf(a)}}},Xf=["meet"],Y=l;Xf[0]in Y||typeof Y.execScript=="undefined"||Y.execScript("var "+Xf[0]);for(var Z;Xf.length&&(Z=Xf.shift());)Xf.length||Wf===void 0?Y=Y[Z]&&Y[Z]!==Object.prototype[Z]?Y[Z]:Y[Z]={}:Y[Z]=Wf;}).call(this);
|
|
@@ -3,22 +3,23 @@
|
|
|
3
3
|
Copyright The Closure Library Authors.
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
var
|
|
7
|
-
var aa={message:"cloudProjectNumber was not defined.",
|
|
8
|
-
v};let
|
|
9
|
-
function
|
|
10
|
-
1023)<<14}}}a[
|
|
11
|
-
function
|
|
12
|
-
function Q(a,b,c
|
|
13
|
-
var S=class{constructor(){this.
|
|
14
|
-
null
|
|
15
|
-
S.prototype.toString=function(){try{return R=!0,
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function W(a){var b=a[
|
|
19
|
-
1;typeof f==="number"&&f<0&&(
|
|
20
|
-
function
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
(
|
|
24
|
-
|
|
6
|
+
var m=this||self,t=function(a,b){a:{var d=["CLOSURE_FLAGS"];for(var c=m,e=0;e<d.length;e++)if(c=c[d[e]],c==null){d=null;break a}d=c}a=d&&d[a];return a!=null?a:b};var v=class extends Error{constructor(a,b){super(`Meet Addon Screenshare Info error: ${`${a}${b?` - ${b}`:""}`}`)}};function w(a){throw new a.v(a.message+"",a.D);}
|
|
7
|
+
var aa={message:"cloudProjectNumber was not defined.",D:"Ensure that cloudProjectNumber is provided in the call to exposeToMeetWhenScreensharing.",v},ba={message:"additionalData was defined, but startActivityOnOpen was not true.",D:"Ensure that startActivityOnOpen is set to true if additionalData is provided in the call to exposeToMeetWhenScreensharing.",v},ca={message:"Received an incorrect value for startActivityOnOpen.",D:"Ensure that startActivityOnOpen is set to true if a mainStageUrl is provided in the call to exposeToMeetWhenScreensharing.",
|
|
8
|
+
v};let da;function ea(a){m.setTimeout(()=>{throw a;},0)};var ha=t(610401301,!1),ia=t(645172343,!0),ja=t(660014094,!1);var y;const ka=m.navigator;y=ka?ka.userAgentData||null:null;function z(a){return ha?y?y.brands.some(({brand:b})=>b&&b.indexOf(a)!=-1):!1:!1}function A(a){var b;a:{if(b=m.navigator)if(b=b.userAgent)break a;b=""}return b.indexOf(a)!=-1};function B(){return ha?!!y&&y.brands.length>0:!1}function C(){return B()?z("Chromium"):(A("Chrome")||A("CriOS"))&&!(B()?0:A("Edge"))||A("Silk")};!A("Android")||C();C();A("Safari")&&(C()||(B()?0:A("Coast"))||(B()?0:A("Opera"))||(B()?0:A("Edge"))||(B()?z("Microsoft Edge"):A("Edg/"))||B()&&z("Opera"));var la={},D=null;var ma=function(a,b){a.__closure__error__context__984382||(a.__closure__error__context__984382={});a.__closure__error__context__984382.severity=b};let na;function E(){const a=Error();ma(a,"incident");ea(a)};var F=Symbol(),G=Symbol();function oa(a,b){b[F]=(a|0)&-14591}function H(a,b){b[F]=(a|34)&-14557};var I={},pa={};function qa(a){return!(!a||typeof a!=="object"||a.P!==pa)}function J(a){return a!==null&&typeof a==="object"&&!Array.isArray(a)&&a.constructor===Object}function K(a){return!Array.isArray(a)||a.length?!1:(a[F]|0)&1?!0:!1}const ra=[];ra[F]=55;Object.freeze(ra);function L(a){if(a&2)throw Error();}var sa=Object.freeze({});Object.freeze({});var ta=Object.freeze({});var ua=typeof m.BigInt==="function"&&typeof m.BigInt(0)==="bigint";const va=Number.MIN_SAFE_INTEGER.toString(),wa=ua?BigInt(Number.MIN_SAFE_INTEGER):void 0,xa=Number.MAX_SAFE_INTEGER.toString(),ya=ua?BigInt(Number.MAX_SAFE_INTEGER):void 0;function za(a,b){if(a.length>b.length)return!1;if(a.length<b.length||a===b)return!0;for(let d=0;d<a.length;d++){const c=a[d],e=b[d];if(c>e)return!1;if(c<e)return!0}};function Aa(a){if(a==null)return a;if(typeof a==="string"){if(!a)return;a=+a}if(typeof a==="number")return Number.isFinite(a)?a|0:void 0}function M(a){if(a!=null&&typeof a!=="string")throw Error();return a};let N,Ba,Ca;function Da(a){switch(typeof a){case "boolean":return Ba||(Ba=[0,void 0,!0]);case "number":return a>0?void 0:a===0?Ca||(Ca=[0,void 0]):[-a,void 0];case "string":return[0,a];case "object":return a}}
|
|
9
|
+
function Ea(a,b,d){a==null&&(a=N);N=void 0;if(a==null){var c=96;d?(a=[d],c|=512):a=[];b&&(c=c&-16760833|(b&1023)<<14)}else{if(!Array.isArray(a))throw Error("narr");c=a[F]|0;if(c&2048)throw Error("farr");if(c&64)return a;c|=64;if(d&&(c|=512,d!==a[0]))throw Error("mid");a:{d=a;const e=d.length;if(e){const f=e-1;if(J(d[f])){c|=256;b=f-(+!!(c&512)-1);if(b>=1024)throw Error("pvtlmt");c=c&-16760833|(b&1023)<<14;break a}}if(b){b=Math.max(b,e-(+!!(c&512)-1));if(b>1024)throw Error("spvt");c=c&-16760833|(b&
|
|
10
|
+
1023)<<14}}}a[F]=c;return a};function Fa(a){switch(typeof a){case "number":return isFinite(a)?a:String(a);case "bigint":return(ua?a>=wa&&a<=ya:a[0]==="-"?za(a,va):za(a,xa))?Number(a):String(a);case "boolean":return a?1:0;case "object":if(a)if(Array.isArray(a)){if(K(a))return}else if(a!=null&&a instanceof Uint8Array){let b="",d=0;const c=a.length-10240;for(;d<c;)b+=String.fromCharCode.apply(null,a.subarray(d,d+=10240));b+=String.fromCharCode.apply(null,d?a.subarray(d):a);return btoa(b)}}return a};function Ga(a,b,d){a=Array.prototype.slice.call(a);var c=a.length;const e=b&256?a[c-1]:void 0;c+=e?-1:0;for(b=b&512?1:0;b<c;b++)a[b]=d(a[b]);if(e){b=a[b]={};for(const f in e)b[f]=d(e[f])}return a}function Ha(a,b,d,c,e){if(a!=null){if(Array.isArray(a))a=K(a)?void 0:e&&(a[F]|0)&2?a:Ia(a,b,d,c!==void 0,e);else if(J(a)){const f={};for(let g in a)f[g]=Ha(a[g],b,d,c,e);a=f}else a=b(a,c);return a}}
|
|
11
|
+
function Ia(a,b,d,c,e){const f=c||d?a[F]|0:0;c=c?!!(f&32):void 0;a=Array.prototype.slice.call(a);for(let g=0;g<a.length;g++)a[g]=Ha(a[g],b,d,c,e);d&&d(f,a);return a}function Ja(a){return a.B===I?a.toJSON():Fa(a)};function Ka(a,b,d=H){if(a!=null){if(a instanceof Uint8Array)return b?a:new Uint8Array(a);if(Array.isArray(a)){var c=a[F]|0;if(c&2)return a;b&&(b=c===0||!!(c&32)&&!(c&64||!(c&16)));return b?(a[F]=(c|34)&-12293,a):Ia(a,Ka,c&4?H:d,!0,!0)}a.B===I&&(d=a.h,c=d[F],a=c&2?a:La(a,d,c,!0));return a}}function La(a,b,d,c){a=a.constructor;N=b=Ma(b,d,c);b=new a(b);N=void 0;return b}function Ma(a,b,d){const c=d||b&2?H:oa,e=!!(b&32);a=Ga(a,b,f=>Ka(f,e,c));a[F]=a[F]|32|(d?2:0);return a};function Na(a,b,d,c){b=c+(+!!(b&512)-1);if(!(b<0||b>=a.length||b>=d))return a[b]}var P=function(a,b,d){const c=a.h;let e=c[F];L(e);O(c,e,b,d);return a};function O(a,b,d,c,e){const f=b>>14&1023||536870912;if(d>=f||e&&!ia){let g=b;if(b&256)e=a[a.length-1];else{if(c==null)return;e=a[f+(+!!(b&512)-1)]={};g|=256}e[d]=c;d<f&&(a[d+(+!!(b&512)-1)]=void 0);g!==b&&(a[F]=g)}else a[d+(+!!(b&512)-1)]=c,b&256&&(a=a[a.length-1],d in a&&delete a[d])}
|
|
12
|
+
function Q(a,b,d,c){const e=a.h;let f=e[F];L(f);O(e,f,b,(c==="0"?Number(d)===0:d===c)?void 0:d);return a};let R;
|
|
13
|
+
var S=class{constructor(){this.h=Ea()}toJSON(){return Oa(this)}getExtension(a){const b=a.l?a.K?a.o(this,a.l,a.m,void 0===sa?2:4,!0):a.o(this,a.l,a.m,!0):a.K?a.o(this,a.m,void 0===sa?2:4,!0):a.o(this,a.m,a.defaultValue,!0);return a.O&&b==null?a.defaultValue:b}hasExtension(a){if(a.l){var b=a.l;a=a.m;const h=this.h;let k=h[F];a:{var d=h,c=k;if(a===-1)var e=null;else{var f=c>>14&1023||536870912;if(a>=f)e=c&256?d[d.length-1][a]:void 0;else{var g=d.length;if(c&256&&(g=d[g-1][a],g!=null)){Na(d,c,f,a)&&G!=
|
|
14
|
+
null&&(d=(e=na)!=null?e:na={},e=d[G]||0,e>=4||(d[G]=e+1,E()));e=g;break a}e=Na(d,c,f,a)}}}g=k;e!=null&&typeof e==="object"&&e.B===I?b=e:Array.isArray(e)?(c=d=e[F]|0,c===0&&(c|=g&32),c|=g&2,c!==d&&(e[F]=c),b=new b(e)):b=void 0;b!==e&&b!=null&&O(h,k,a,b,!0);a=b!==void 0}else a=a.l?a.o(this,a.l,a.m,!0):a.o(this,a.m,null,!0),a=(a===null?void 0:a)!==void 0;return a}clone(){const a=this.h;return La(this,a,a[F],!1)}};S.prototype.B=I;
|
|
15
|
+
S.prototype.toString=function(){try{return R=!0,Oa(this).toString()}finally{R=!1}};
|
|
16
|
+
function Oa(a){a=R?a.h:Ia(a.h,Ja,void 0,void 0,!1);{var b=!R;let n=a.length;if(n){var d=a[n-1],c=J(d);c?n--:d=void 0;var e=a;if(c){b:{var f=d;var g={};c=!1;if(f)for(var h in f){if(isNaN(+h)){g[h]=f[h];continue}let l=f[h];Array.isArray(l)&&(K(l)||qa(l)&&l.size===0)&&(l=null);l==null&&(c=!0);l!=null&&(g[h]=l)}if(c){for(let l in g)break b;g=null}else g=f}f=g==null?d!=null:g!==d}for(;n>0;n--){h=e[n-1];if(!(h==null||K(h)||qa(h)&&h.size===0))break;var k=!0}if(e!==a||f||k){if(!b)e=Array.prototype.slice.call(e,
|
|
17
|
+
0,n);else if(k||f||g)e.length=n;g&&e.push(g)}k=e}else k=a}return k};var T=function(a,b){for(;b>127;)a.i.push(b&127|128),b>>>=7;a.i.push(b)},Pa=function(a,b){if(b>=0)T(a,b);else{for(let d=0;d<9;d++)a.i.push(b&127|128),b>>=7;a.i.push(1)}},Qa=class{constructor(){this.i=[]}length(){return this.i.length}end(){const a=this.i;this.i=[];return a}F(a){this.i.push(a?1:0)}I(a){Pa(this,a)}};var U=function(a,b){b.length!==0&&(a.u.push(b),a.j+=b.length)},Ra=class{constructor(){this.u=[];this.j=0;this.g=new Qa}F(a,b){b!=null&&(T(this.g,a*8),this.g.F(b))}I(a,b){b!=null&&(b=parseInt(b,10),T(this.g,a*8),Pa(this.g,b))}};class V{constructor(a,b){this.s=a;this.J=b}};const Sa=Symbol(),Ta=Symbol();function Ua(a){let b=a[Ta];if(!b){const d=W(a);b=(c,e)=>Va(c,e,d);a[Ta]=b}return b}const Wa=Symbol();function Xa(a){return a.s}function Ya(a,b){let d,c;const e=a.s;return(f,g,h)=>e(f,g,h,c||(c=W(b).G),d||(d=Ua(b)))}
|
|
18
|
+
function W(a){var b=a[Wa];if(b)return b;b=a[Wa]={};var d=Xa,c=Ya;b.G=Da(a[0]);let e=0;var f=a[++e];f&&f.constructor===Object&&(b.A=f,f=a[++e],typeof f==="function"&&(b.N=f,b.L=a[++e],f=a[++e]));const g={};for(;Array.isArray(f)&&typeof f[0]==="number"&&f[0]>0;){for(var h=0;h<f.length;h++)g[f[h]]=f;f=a[++e]}for(h=1;f!==void 0;){typeof f==="number"&&(h+=f,f=a[++e]);let q;var k=void 0;f instanceof V?q=f:(q=Za,e--);if(q.J){f=a[++e];k=a;var n=e;typeof f=="function"&&(f=f(),k[n]=f);k=f}f=a[++e];let u=h+
|
|
19
|
+
1;typeof f==="number"&&f<0&&(u-=f,f=a[++e]);for(;h<u;h++){var l=g[h];n=b;var r=h;l=k?c(q,k,l):d(q,l);n[r]=l}}$a in a&&Sa in a&&Wa in a&&(a.length=0);return b}const $a=Symbol();function ab(a,b){var d=a[b];if(d)return d;if(d=a.A){var c=d[b];if(c){c=Array.isArray(c)?c[0]instanceof V?c:[bb,c]:[c,void 0];var e=c[0].s;c=c[1];var f;d=(f=d.H)==null?void 0:f[b];if(!ja||d){if(c){const g=Ua(c),h=W(c).G;d=(f=a.L)?f(h,g):(k,n,l)=>e(k,n,l,h,g)}else d=e;return a[b]=d}}}}
|
|
20
|
+
function Va(a,b,d){for(var c=a[F],e=+!!(c&512)-1,f=a.length,g=c&512?1:0,h=f+(c&256?-1:0);g<h;g++){const k=a[g];if(k==null)continue;const n=g-e,l=ab(d,n);if(!l)continue;const r=d.A;let q,u,x;(q=r)==null||!q[n]||((u=r)==null?0:(x=u.H)==null?0:x[n])||cb++<5&&E();l(b,k,n)}if(c&256){a=a[f-1];for(let k in a){c=+k;if(Number.isNaN(c))continue;e=a[k];if(e==null)continue;f=ab(d,c);if(!f)continue;h=d.A;let n,l,r;(n=h)==null||!n[c]||((l=h)==null?0:(r=l.H)==null?0:r[c])||cb++<5&&E();f(b,e,c)}}}let cb=0;
|
|
21
|
+
function db(a,b,d){b=b==null||typeof b==="string"?b:void 0;b!=null&&(b=(da||(da=new TextEncoder)).encode(b),T(a.g,d*8+2),T(a.g,b.length),U(a,a.g.end()),U(a,b))}function eb(a,b,d,c,e){b=b instanceof S?b.h:Array.isArray(b)?Ea(b,c[0],c[1]):void 0;if(b!=null){T(a.g,d*8+2);d=a.g.end();U(a,d);d.push(a.j);e(b,a);e=d.pop();for(e=a.j+a.g.length()-e;e>127;)d.push(e&127|128),e>>>=7,a.j++;d.push(e);a.j++}}var fb;fb=new V(function(a,b,d){a.F(d,b==null||typeof b==="boolean"?b:typeof b==="number"?!!b:void 0)},!1);
|
|
22
|
+
var gb=new V(db,!1),bb=new V(eb,!0),Za=new V(eb,!0),hb;hb=new V(function(a,b,d,c,e){if(Array.isArray(b))for(let f=0;f<b.length;f++)eb(a,b[f],d,c,e)},!0);function ib(a){return function(){const b=new Ra;Va(this.h,b,W(a));U(b,b.g.end());const d=new Uint8Array(b.j),c=b.u,e=c.length;let f=0;for(let g=0;g<e;g++){const h=c[g];d.set(h,f);f+=h.length}b.u=[d];return d}};var kb=function(a){var b=new jb;if(a!=null){if(!Number.isFinite(a))throw b=Error("enum"),ma(b,"warning"),b;a|=0}return Q(b,1,a,0)},jb=class extends S{};var lb=[0,new V(function(a,b,d){a.I(d,Aa(b))},!1),new V(db,!1),-1];jb.prototype.C=ib(lb);var mb=class extends S{};var nb=[0,hb,lb];mb.prototype.C=ib(nb);var ob=class extends S{};ob.prototype.C=ib([0,gb,-1,nb,fb]);function pb(){let a,b;const d=(b=(a=(new URL(qb||window.location.href)).searchParams.get("meet_capture_handle_origins"))==null?void 0:a.split(",").filter(c=>{try{return(new URL(c)).origin.endsWith(".google.com")}catch(e){return!1}}))!=null?b:[];return d.length===0?rb:d}let qb="";const rb=["https://meet.google.com"];var sb={exposeToMeetWhenScreensharing:function(a){var b=a.M,d=a.cloudProjectNumber,c=a.additionalData,e=a.mainStageUrl,f=a.sidePanelUrl;a=a.startActivityOnOpen;d||w(aa);var g=new ob;d=P(g,2,M(d));b&&P(d,1,M(b));b=[];c&&!a&&w(ba);e&&!a&&w(ca);if(f){g=b.push;var h=kb(1);f=Q(h,2,M(f),"");f=Q(f,3,M(c),"");g.call(b,f)}e&&(f=b.push,g=kb(2),e=Q(g,2,M(e),""),c=Q(e,3,M(c),""),f.call(b,c));c=new mb;e=b;f=c.h;g=f[F];L(g);if(e==null)O(f,g,1);else{b=h=e[F]|0;var k=!!(2&h)||!!(2048&h),n=k||Object.isFrozen(e),l;
|
|
23
|
+
if(l=!n)l=void 0===ta||!1;var r=!0,q=!0;for(let fa=0;fa<e.length;fa++){var u=e[fa];k||(u=!!((u.h[F]|0)&2),r&&(r=!u),q&&(q=u))}k||(h|=5,h=r?h|8:h&-9,h=q?h|16:h&-17);if(l||n&&h!==b)e=Array.prototype.slice.call(e),b=0,h=2&g?h|2:h&-3,h=(h|32)&-2049,32&g||(h&=-33);h!==b&&(e[F]=h);O(f,g,1,e)}c==null&&(c=void 0);c=P(d,3,c);if(a!=null&&typeof a!=="boolean"){var x=typeof a;throw Error(`Expected boolean but got ${x!="object"?x:a?Array.isArray(a)?"array":x:"null"}: ${a}`);}P(c,4,a);a=d.C();var p;p===void 0&&
|
|
24
|
+
(p=0);if(!D)for(D={},d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),c=["+/=","+/","-_=","-_.","-_"],e=0;e<5;e++)for(b=d.concat(c[e].split("")),la[e]=b,f=0;f<b.length;f++)g=b[f],D[g]===void 0&&(D[g]=f);p=la[p];d=Array(Math.floor(a.length/3));c=p[64]||"";for(e=b=0;b<a.length-2;b+=3)h=a[b],k=a[b+1],g=a[b+2],f=p[h>>2],h=p[(h&3)<<4|k>>4],k=p[(k&15)<<2|g>>6],g=p[g&63],d[e++]=""+f+h+k+g;f=0;g=c;switch(a.length-b){case 2:f=a[b+1],g=p[(f&15)<<2]||c;case 1:a=a[b],d[e]=""+p[a>>
|
|
25
|
+
2]+p[(a&3)<<4|f>>4]+g+c}a=d.join("");p=window;p.top===p.self&&(a={handle:a,permittedOrigins:pb(),exposeOrigin:!0},(x=p.navigator.mediaDevices)==null||x.setCaptureHandleConfig(a))}},X=["meet","addon","screensharing"],Y=m;X[0]in Y||typeof Y.execScript=="undefined"||Y.execScript("var "+X[0]);for(var Z;X.length&&(Z=X.shift());)X.length||sb===void 0?Y=Y[Z]&&Y[Z]!==Object.prototype[Z]?Y[Z]:Y[Z]={}:Y[Z]=sb;}).call(this);
|
package/package.json
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
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.
|
|
4
|
+
"version": "0.10.0",
|
|
5
5
|
"repository": "googleworkspace/meet",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"homepage": "https://developers.google.com/meet/add-ons/guides/overview",
|
|
8
8
|
"author": "Addons Team <meet-addons-support@google.com>",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./meet.addons.js",
|
|
12
|
+
"types": "./meet.addons.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./addons": {
|
|
15
|
+
"import": "./meet.addons.js",
|
|
16
|
+
"types": "./meet.addons.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./screenshare": {
|
|
19
|
+
"import": "./meet.addons.screenshare.js",
|
|
20
|
+
"types": "./meet.addons.screenshare.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./meet.addons": {
|
|
23
|
+
"import": "./meet.addons.js",
|
|
24
|
+
"types": "./meet.addons.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./meet.addons.screenshare": {
|
|
27
|
+
"import": "./meet.addons.screenshare.js",
|
|
28
|
+
"types": "./meet.addons.screenshare.d.ts"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
9
31
|
"keywords": [
|
|
10
32
|
"google",
|
|
11
33
|
"meet",
|