@arcware-cloud/pixelstreaming-websdk
Version:
WebSDK for easy implementation of pixel streaming with Arcware Cloud Services. Heavily based on the '@epicgames-ps' library.
1 lines • 451 kB
JavaScript
var e={204(e,t,n){n.d(t,{b:()=>s});class i{constructor(e){this._args=[],this._callback=e}handleEvent(e){this._callback(...this._args),this._args=[]}setArgs(...e){this._args=e}}class s extends EventTarget{constructor(){super(),this._eventListeners=new Map}removeListenerInternal(e,t){if(this._eventListeners.has(e)){const n=this._eventListeners.get(e);if(void 0===n)return this;for(let i=0;i<n.length;++i){const s=n[i];if(s.callback===t){super.removeEventListener(e,s.eventListenerWrapper),n.splice(i,1);break}}}return this}addListener(e,t){return this.on(e,t)}on(e,t){var n;const s=new i(t);return super.addEventListener(e,s),this._eventListeners.has(e)||this._eventListeners.set(e,new Array),null===(n=this._eventListeners.get(e))||void 0===n||n.push({callback:t,eventListenerWrapper:s}),this}once(e,t){var n;const s=new i((...n)=>{t(...n),this.removeListenerInternal(e,t)});return super.addEventListener(e,s,{once:!0}),this._eventListeners.has(e)||this._eventListeners.set(e,new Array),null===(n=this._eventListeners.get(e))||void 0===n||n.push({callback:t,eventListenerWrapper:s}),this}removeListener(e,t){return this.removeListenerInternal(e,t),this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){if(this._eventListeners.has(e)){const t=this._eventListeners.get(e);if(void 0===t)return this;for(const n of t)this.removeEventListener(e,n.eventListenerWrapper);this._eventListeners.delete(e)}return this}emit(e,...t){if(this._eventListeners.has(e)){const n=this._eventListeners.get(e);if(void 0===n)return!1;for(const e of n)e.eventListenerWrapper.setArgs(...t);return super.dispatchEvent(new Event(e)),!0}return!1}}},2114(e,t,n){var i;n.d(t,{Vy:()=>r}),function(e){e[e.Disabled=0]="Disabled",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info",e[e.Debug=4]="Debug"}(i||(i={}));class s{constructor(){this.logLevel=i.Debug,this.includeStack=!0}}let r=new class{InitLogging(e,t){this.ValidateContext(),this.context.logLevel=e,this.context.includeStack=t}Debug(e){this.ValidateContext(),this.context.logLevel>=i.Debug&&this.CommonLog("Debug",e)}Info(e){this.ValidateContext(),this.context.logLevel>=i.Info&&this.CommonLog("Info",e)}Warning(e){this.ValidateContext(),this.context.logLevel>=i.Warning&&this.CommonLog("Warning",e)}Error(e){this.ValidateContext(),this.context.logLevel>=i.Error&&this.CommonLog("Error",e)}CommonLog(e,t){let n=`[${e}] - ${t}`;this.context.includeStack&&(n+=`\nStack: ${this.GetStackTrace()}`),"Error"===e?console.error(n):"Warning"===e?console.warn(n):console.log(n)}GetStackTrace(){const e=new Error;let t="No Stack Available for this browser";return e.stack&&(t=e.stack.toString().replace(/Error/g,"")),t}ValidateContext(){this.context||("undefined"!=typeof window&&window?window.loggerContext?this.context=window.loggerContext:(this.context=new s,window.loggerContext=this.context):this.context=new s)}}},1837(e,t,n){function i(e,t){const n=e.create();return n.type=e.typeName,t&&e.mergePartial(n,t),n}n.d(t,{o:()=>i})},7733(e,t,n){n.d(t,{$W:()=>c,B1:()=>S,BI:()=>F,C_:()=>G,H2:()=>B,Rd:()=>Z,Rq:()=>Q,ZF:()=>R,hU:()=>D,l8:()=>g,q5:()=>b,tg:()=>j,vq:()=>W,x:()=>L,yB:()=>T,zW:()=>v});var i=n(8899),s=n(3923),r=n(2285);class o extends r.G{constructor(){super("base_message",[{no:1,name:"type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();if(1===t)r.type=e.string();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new o;class a extends r.G{constructor(){super("peerConnectionOptions",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const l=new a;class d extends r.G{constructor(){super("config",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"peerConnectionOptions",kind:"message",T:()=>l},{no:3,name:"protocolVersion",kind:"scalar",opt:!0,T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.peerConnectionOptions=l.internalBinaryRead(e,e.uint32(),n,r.peerConnectionOptions);break;case 3:r.protocolVersion=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),e.peerConnectionOptions&&l.internalBinaryWrite(e.peerConnectionOptions,t.tag(2,i.O0.LengthDelimited).fork(),n).join(),void 0!==e.protocolVersion&&t.tag(3,i.O0.LengthDelimited).string(e.protocolVersion);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const c=new d;class h extends r.G{constructor(){super("identify",[{no:1,name:"type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();if(1===t)r.type=e.string();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new h;class u extends r.G{constructor(){super("endpointId",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:9},{no:3,name:"protocolVersion",kind:"scalar",opt:!0,T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.id="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.id=e.string();break;case 3:r.protocolVersion=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),""!==e.id&&t.tag(2,i.O0.LengthDelimited).string(e.id),void 0!==e.protocolVersion&&t.tag(3,i.O0.LengthDelimited).string(e.protocolVersion);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new u;class m extends r.G{constructor(){super("endpointIdConfirm",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"committedId",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.committedId="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.committedId=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),""!==e.committedId&&t.tag(2,i.O0.LengthDelimited).string(e.committedId);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new m;class p extends r.G{constructor(){super("streamerIdChanged",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"newID",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.newID="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.newID=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),""!==e.newID&&t.tag(2,i.O0.LengthDelimited).string(e.newID);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const g=new p;class f extends r.G{constructor(){super("listStreamers",[{no:1,name:"type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();if(1===t)r.type=e.string();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const v=new f;class y extends r.G{constructor(){super("streamerList",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"ids",kind:"scalar",repeat:2,T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.ids=[],void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.ids.push(e.string());break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type);for(let n=0;n<e.ids.length;n++)t.tag(2,i.O0.LengthDelimited).string(e.ids[n]);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const b=new y;class w extends r.G{constructor(){super("subscribe",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"streamerId",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.streamerId="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.streamerId=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),""!==e.streamerId&&t.tag(2,i.O0.LengthDelimited).string(e.streamerId);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const S=new w;class C extends r.G{constructor(){super("unsubscribe",[{no:1,name:"type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();if(1===t)r.type=e.string();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new C;class E extends r.G{constructor(){super("subscribeFailed",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"message",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.message="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.message=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),""!==e.message&&t.tag(2,i.O0.LengthDelimited).string(e.message);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const T=new E;class x extends r.G{constructor(){super("playerConnected",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"dataChannel",kind:"scalar",T:8},{no:3,name:"sfu",kind:"scalar",T:8},{no:5,name:"playerId",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.dataChannel=!1,t.sfu=!1,t.playerId="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.dataChannel=e.bool();break;case 3:r.sfu=e.bool();break;case 5:r.playerId=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),!1!==e.dataChannel&&t.tag(2,i.O0.Varint).bool(e.dataChannel),!1!==e.sfu&&t.tag(3,i.O0.Varint).bool(e.sfu),""!==e.playerId&&t.tag(5,i.O0.LengthDelimited).string(e.playerId);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new x;class I extends r.G{constructor(){super("playerDisconnected",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"playerId",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.playerId="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.playerId=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),""!==e.playerId&&t.tag(2,i.O0.LengthDelimited).string(e.playerId);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new I;class M extends r.G{constructor(){super("offer",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9},{no:3,name:"playerId",kind:"scalar",opt:!0,T:9},{no:4,name:"sfu",kind:"scalar",opt:!0,T:8},{no:5,name:"multiplex",kind:"scalar",opt:!0,T:8},{no:6,name:"scalabilityMode",kind:"scalar",opt:!0,T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.sdp="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.sdp=e.string();break;case 3:r.playerId=e.string();break;case 4:r.sfu=e.bool();break;case 5:r.multiplex=e.bool();break;case 6:r.scalabilityMode=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),""!==e.sdp&&t.tag(2,i.O0.LengthDelimited).string(e.sdp),void 0!==e.playerId&&t.tag(3,i.O0.LengthDelimited).string(e.playerId),void 0!==e.sfu&&t.tag(4,i.O0.Varint).bool(e.sfu),void 0!==e.multiplex&&t.tag(5,i.O0.Varint).bool(e.multiplex),void 0!==e.scalabilityMode&&t.tag(6,i.O0.LengthDelimited).string(e.scalabilityMode);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const L=new M;class k extends r.G{constructor(){super("answer",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9},{no:3,name:"playerId",kind:"scalar",opt:!0,T:9},{no:4,name:"minBitrateBps",kind:"scalar",opt:!0,T:5},{no:5,name:"maxBitrateBps",kind:"scalar",opt:!0,T:5}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.sdp="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.sdp=e.string();break;case 3:r.playerId=e.string();break;case 4:r.minBitrateBps=e.int32();break;case 5:r.maxBitrateBps=e.int32();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),""!==e.sdp&&t.tag(2,i.O0.LengthDelimited).string(e.sdp),void 0!==e.playerId&&t.tag(3,i.O0.LengthDelimited).string(e.playerId),void 0!==e.minBitrateBps&&t.tag(4,i.O0.Varint).int32(e.minBitrateBps),void 0!==e.maxBitrateBps&&t.tag(5,i.O0.Varint).int32(e.maxBitrateBps);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const R=new k;class P extends r.G{constructor(){super("iceCandidateData",[{no:1,name:"candidate",kind:"scalar",T:9},{no:2,name:"sdpMid",kind:"scalar",T:9},{no:3,name:"sdpMLineIndex",kind:"scalar",T:5},{no:4,name:"usernameFragment",kind:"scalar",opt:!0,T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.candidate="",t.sdpMid="",t.sdpMLineIndex=0,void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.candidate=e.string();break;case 2:r.sdpMid=e.string();break;case 3:r.sdpMLineIndex=e.int32();break;case 4:r.usernameFragment=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.candidate&&t.tag(1,i.O0.LengthDelimited).string(e.candidate),""!==e.sdpMid&&t.tag(2,i.O0.LengthDelimited).string(e.sdpMid),0!==e.sdpMLineIndex&&t.tag(3,i.O0.Varint).int32(e.sdpMLineIndex),void 0!==e.usernameFragment&&t.tag(4,i.O0.LengthDelimited).string(e.usernameFragment);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const O=new P;class A extends r.G{constructor(){super("iceCandidate",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"candidate",kind:"message",T:()=>O},{no:3,name:"playerId",kind:"scalar",opt:!0,T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.candidate=O.internalBinaryRead(e,e.uint32(),n,r.candidate);break;case 3:r.playerId=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),e.candidate&&O.internalBinaryWrite(e.candidate,t.tag(2,i.O0.LengthDelimited).fork(),n).join(),void 0!==e.playerId&&t.tag(3,i.O0.LengthDelimited).string(e.playerId);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const F=new A;class N extends r.G{constructor(){super("disconnectPlayer",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"playerId",kind:"scalar",T:9},{no:3,name:"reason",kind:"scalar",opt:!0,T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.playerId="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.playerId=e.string();break;case 3:r.reason=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),""!==e.playerId&&t.tag(2,i.O0.LengthDelimited).string(e.playerId),void 0!==e.reason&&t.tag(3,i.O0.LengthDelimited).string(e.reason);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new N;class _ extends r.G{constructor(){super("ping",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"time",kind:"scalar",T:5}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.time=0,void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.time=e.int32();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),0!==e.time&&t.tag(2,i.O0.Varint).int32(e.time);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const D=new _;class V extends r.G{constructor(){super("pong",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"time",kind:"scalar",T:5}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.time=0,void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.time=e.int32();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),0!==e.time&&t.tag(2,i.O0.Varint).int32(e.time);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const B=new V;class U extends r.G{constructor(){super("streamerDisconnected",[{no:1,name:"type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();if(1===t)r.type=e.string();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new U;class H extends r.G{constructor(){super("layerPreference",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"spatialLayer",kind:"scalar",T:5},{no:3,name:"temporalLayer",kind:"scalar",T:5},{no:4,name:"playerId",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.spatialLayer=0,t.temporalLayer=0,t.playerId="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.spatialLayer=e.int32();break;case 3:r.temporalLayer=e.int32();break;case 4:r.playerId=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),0!==e.spatialLayer&&t.tag(2,i.O0.Varint).int32(e.spatialLayer),0!==e.temporalLayer&&t.tag(3,i.O0.Varint).int32(e.temporalLayer),""!==e.playerId&&t.tag(4,i.O0.LengthDelimited).string(e.playerId);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const W=new H;class z extends r.G{constructor(){super("dataChannelRequest",[{no:1,name:"type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();if(1===t)r.type=e.string();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const j=new z;class $ extends r.G{constructor(){super("peerDataChannels",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"playerId",kind:"scalar",T:9},{no:3,name:"sendStreamId",kind:"scalar",T:5},{no:4,name:"recvStreamId",kind:"scalar",T:5}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.playerId="",t.sendStreamId=0,t.recvStreamId=0,void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.playerId=e.string();break;case 3:r.sendStreamId=e.int32();break;case 4:r.recvStreamId=e.int32();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),""!==e.playerId&&t.tag(2,i.O0.LengthDelimited).string(e.playerId),0!==e.sendStreamId&&t.tag(3,i.O0.Varint).int32(e.sendStreamId),0!==e.recvStreamId&&t.tag(4,i.O0.Varint).int32(e.recvStreamId);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const Q=new $;class q extends r.G{constructor(){super("peerDataChannelsReady",[{no:1,name:"type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();if(1===t)r.type=e.string();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const G=new q;class K extends r.G{constructor(){super("streamerDataChannels",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sfuId",kind:"scalar",T:9},{no:3,name:"sendStreamId",kind:"scalar",T:5},{no:4,name:"recvStreamId",kind:"scalar",T:5}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.sfuId="",t.sendStreamId=0,t.recvStreamId=0,void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.sfuId=e.string();break;case 3:r.sendStreamId=e.int32();break;case 4:r.recvStreamId=e.int32();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),""!==e.sfuId&&t.tag(2,i.O0.LengthDelimited).string(e.sfuId),0!==e.sendStreamId&&t.tag(3,i.O0.Varint).int32(e.sendStreamId),0!==e.recvStreamId&&t.tag(4,i.O0.Varint).int32(e.recvStreamId);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new K;class J extends r.G{constructor(){super("startStreaming",[{no:1,name:"type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();if(1===t)r.type=e.string();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new J;class X extends r.G{constructor(){super("stopStreaming",[{no:1,name:"type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();if(1===t)r.type=e.string();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new X;class Y extends r.G{constructor(){super("playerCount",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"count",kind:"scalar",T:5}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.count=0,void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.count=e.int32();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),0!==e.count&&t.tag(2,i.O0.Varint).int32(e.count);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}const Z=new Y;class ee extends r.G{constructor(){super("stats",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"data",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.data="",void 0!==e&&(0,s.x)(this,t,e),t}internalBinaryRead(e,t,n,s){let r=null!=s?s:this.create(),o=e.pos+t;for(;e.pos<o;){let[t,s]=e.tag();switch(t){case 1:r.type=e.string();break;case 2:r.data=e.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${t} (wire type ${s}) for ${this.typeName}`);let a=e.skip(s);!1!==o&&(!0===o?i.f$.onRead:o)(this.typeName,r,t,s,a)}}return r}internalBinaryWrite(e,t,n){""!==e.type&&t.tag(1,i.O0.LengthDelimited).string(e.type),""!==e.data&&t.tag(2,i.O0.LengthDelimited).string(e.data);let s=n.writeUnknownFields;return!1!==s&&(1==s?i.f$.onWrite:s)(this.typeName,e,t),t}}new ee},4042(e,t,n){n.d(t,{P:()=>r});var i=n(7733),s=n(1837);class r{get RTT(){return this.rtt}constructor(e,t){this.alive=!1,this.rtt=0,this.protocol=e,this.timeout=t,this.onResponse=this.onHeartbeatResponse.bind(this),this.protocol.transport.on("close",this.stop.bind(this)),this.start()}start(){this.alive=!0,this.protocol.on("pong",this.onResponse),this.keepalive=setInterval(this.sendHeartbeat.bind(this),this.timeout)}stop(){clearInterval(this.keepalive),this.protocol.off("pong",this.onResponse)}sendHeartbeat(){var e;!1!==this.alive?(this.alive=!1,this.protocol.sendMessage(s.o(i.hU,{time:(new Date).getTime()}))):null===(e=this.onTimeout)||void 0===e||e.call(this)}onHeartbeatResponse(e){this.rtt=(new Date).getTime()-e.time,this.alive=!0}}},3862(e,t,n){n.d(t,{t:()=>r});var i=n(204),s=n(2114);class r extends i.b{static get SIGNALLING_VERSION(){return"1.3.0"}constructor(e){super(),this.transport=e,e.onMessage=t=>{let n;try{const e=JSON.parse(t);s.Vy.Debug("Protocol received => \n"+JSON.stringify(e,void 0,4)),n=e}catch(e){return void(e instanceof Error?s.Vy.Error(`Error parsing message string ${t}.\n${e.message}`):s.Vy.Error("Unknown error while parsing message data in handleOnMessage"))}e.emit("message",n),this.emit(n.type,n)||this.emit("unhandled",n)}}connect(e){return this.transport.connect(e)}disconnect(e,t){this.transport.disconnect(e,t)}isConnected(){return this.transport.isConnected()}sendMessage(e){this.transport.sendMessage(JSON.stringify(e)),this.transport.emit("out",e),s.Vy.Debug("Protocol sent => \n"+JSON.stringify(e,void 0,4))}}},6145(e,t,n){n.d(t,{T:()=>r});var i=n(2114),s=n(204);class r extends s.b{constructor(e){super(),this.WS_OPEN_STATE=1,this.protocols=e}sendMessage(e){this.webSocket&&this.webSocket.send(e)}connect(e){i.Vy.Info(e);try{return this.webSocket=new WebSocket(e,this.protocols),this.webSocket.onopen=e=>this.handleOnOpen(),this.webSocket.onerror=e=>this.handleOnError(),this.webSocket.onclose=e=>this.handleOnClose(e),this.webSocket.onmessage=e=>this.handleOnMessage(e),this.webSocket.onmessagebinary=e=>this.handleOnMessageBinary(e),!0}catch(e){return i.Vy.Error(e instanceof Error?e.message:String(e)),!1}}disconnect(e,t){this.webSocket&&this.webSocket.close(e,t)}isConnected(){return!!this.webSocket&&this.webSocket.readyState!=WebSocket.CLOSED}handleOnMessageBinary(e){e&&e.data&&e.data.text().then(e=>{const t=new MessageEvent("messageFromBinary",{data:e});this.handleOnMessage(t)}).catch(e=>{i.Vy.Error(`Failed to parse binary blob from websocket, reason: ${e.message}`)})}handleOnMessage(e){e.data&&e.data instanceof Blob?this.handleOnMessageBinary(e):this.onMessage&&this.onMessage(e.data)}handleOnOpen(){i.Vy.Info("Connected to the signalling server via WebSocket"),this.emit("open")}handleOnError(){this.emit("error")}handleOnClose(e){i.Vy.Info("Disconnected to the signalling server via WebSocket: "+JSON.stringify(e.code)+" - "+e.reason),this.emit("close",e)}}},3404(e,t,n){n.d(t,{p:()=>i});class i{static addVideoHeaderExtensionToSdp(e,t){const n=e.split("\n").filter(e=>e.startsWith("a=extmap:")).map(e=>parseInt(e.split(" ")[0].substring(9),10)).sort((e,t)=>e-t).filter((e,t,n)=>n.indexOf(e)===t),i="a=extmap:"+(n[n.length-1]+1)+" "+t+"\r\n",s=e.split("\nm=").map((e,t)=>(t>0?"m="+e:e).trim()+"\r\n");return s.shift()+s.map(e=>e.startsWith("m=video")?e+i:e).join("")}}},4331(e,t,n){n.d(t,{R:()=>o});var i=n(4225),s=n(2114),r=n(6155);class o{constructor(e,t,n){this.active=!1,this.countdownActive=!1,this.warnTimer=void 0,this.countDown=0,this.countDownTimer=void 0,this.config=e,this.pixelStreaming=t,this.onDismissAfk=n,this.onAFKTimedOutCallback=()=>{console.log("AFK timed out, did you want to override this callback?")}}onAfkClick(){clearInterval(this.countDownTimer),(this.active||this.countdownActive)&&(this.startAfkWarningTimer(),this.pixelStreaming.dispatchEvent(new r.jr))}startAfkWarningTimer(){this.config.getNumericSettingValue(i.k$.AFKTimeoutSecs)>0&&this.config.isFlagEnabled(i.iI.AFKDetection)?this.active=!0:this.active=!1,this.resetAfkWarningTimer()}stopAfkWarningTimer(){this.active=!1,this.countdownActive=!1,clearTimeout(this.warnTimer),clearInterval(this.countDownTimer)}pauseAfkWarningTimer(){this.active=!1}resetAfkWarningTimer(){this.active&&this.config.isFlagEnabled(i.iI.AFKDetection)&&(clearTimeout(this.warnTimer),this.warnTimer=setTimeout(()=>this.activateAfkEvent(),1e3*this.config.getNumericSettingValue(i.k$.AFKTimeoutSecs)))}activateAfkEvent(){this.pauseAfkWarningTimer(),this.pixelStreaming.dispatchEvent(new r.mC({countDown:this.countDown,dismissAfk:this.onDismissAfk})),this.countDown=this.config.getNumericSettingValue(i.k$.AFKCountdownSecs),this.countdownActive=!0,this.pixelStreaming.dispatchEvent(new r.S_({countDown:this.countDown})),this.config.isFlagEnabled(i.iI.HoveringMouseMode)||document.exitPointerLock&&document.exitPointerLock(),this.countDownTimer=setInterval(()=>{this.countDown--,0==this.countDown?(this.pixelStreaming.dispatchEvent(new r.Kr),this.onAFKTimedOutCallback(),s.Vy.Info("You have been disconnected due to inactivity"),this.stopAfkWarningTimer()):this.pixelStreaming.dispatchEvent(new r.S_({countDown:this.countDown}))},1e3)}}},4225(e,t,n){n.d(t,{B9:()=>g,Bs:()=>b,CR:()=>h,Ri:()=>v,TS:()=>y,gw:()=>p,iI:()=>c,k$:()=>u,mY:()=>f,tQ:()=>m});var i=n(2114),s=n(5969),r=n(5110),o=n(4608),a=n(6926),l=n(6155),d=n(2227);class c{}c.AutoConnect="AutoConnect",c.AutoPlayVideo="AutoPlayVideo",c.AFKDetection="TimeoutIfIdle",c.HoveringMouseMode="HoveringMouse",c.ForceMonoAudio="ForceMonoAudio",c.ForceTURN="ForceTURN",c.FakeMouseWithTouches="FakeMouseWithTouches",c.IsQualityController="ControlsQuality",c.MatchViewportResolution="MatchViewportRes",c.StartVideoMuted="StartVideoMuted",c.SuppressBrowserKeys="SuppressBrowserKeys",c.UseMic="UseMic",c.UseModalForTextInput="UseModalForTextInput",c.UseCamera="UseCamera",c.KeyboardInput="KeyboardInput",c.MouseInput="MouseInput",c.TouchInput="TouchInput",c.GamepadInput="GamepadInput",c.XRControllerInput="XRControllerInput",c.WaitForStreamer="WaitForStreamer",c.HideUI="HideUI",c.EnableCaptureTimeExt="EnableCaptureTimeExt",c.BrowserSendOffer="BrowserSendOffer",c.LatencyCSV="LatencyCSV";const h=e=>Object.getOwnPropertyNames(c).some(t=>c[t]===e);class u{}u.AFKTimeoutSecs="AFKTimeout",u.AFKCountdownSecs="AFKCountdown",u.MinQP="MinQP",u.MaxQP="MaxQP",u.MinQuality="MinQuality",u.MaxQuality="MaxQuality",u.CompatQualityMin="CompatQualityMin",u.CompatQualityMax="CompatQualityMax",u.WebRTCFPS="WebRTCFPS",u.WebRTCMinBitrate="WebRTCMinBitrate",u.WebRTCMaxBitrate="WebRTCMaxBitrate",u.MaxReconnectAttempts="MaxReconnectAttempts",u.StreamerAutoJoinInterval="StreamerAutoJoinInterval",u.KeepaliveDelay="KeepaliveDelay";const m=e=>Object.getOwnPropertyNames(u).some(t=>u[t]===e);class p{}p.SignallingServerUrl="ss";const g=e=>Object.getOwnPropertyNames(p).some(t=>p[t]===e);class f{}f.PreferredCodec="PreferredCodec",f.StreamerId="StreamerId",f.PreferredQuality="PreferredQuality";const v=e=>Object.getOwnPropertyNames(f).some(t=>f[t]===e);class y{constructor(e={}){this.flags=new Map,this.numericParameters=new Map,this.textParameters=new Map,this.optionParameters=new Map;const{initialSettings:t,useUrlParams:n,webSocketProtocols:i}=e;this._useUrlParams=!!n,this._webSocketProtocols=i,this.populateDefaultSettings(this._useUrlParams,t)}get useUrlParams(){return this._useUrlParams}get webSocketProtocols(){return this._webSocketProtocols}populateDefaultSettings(e,t){this.textParameters.set(p.SignallingServerUrl,new o.c(p.SignallingServerUrl,"Signalling url","Url of the signalling server",t&&Object.prototype.hasOwnProperty.call(t,p.SignallingServerUrl)?t[p.SignallingServerUrl]:("https:"===location.protocol?"wss://":"ws://")+window.location.hostname+("80"===window.location.port||""===window.location.port?"":`:${window.location.port}`),e)),this.optionParameters.set(f.StreamerId,new a.G(f.StreamerId,"Streamer ID","The ID of the streamer to stream.",t&&Object.prototype.hasOwnProperty.call(t,f.StreamerId)?t[f.StreamerId]:"",t&&Object.prototype.hasOwnProperty.call(t,f.StreamerId)?[t[f.StreamerId]]:void 0,e));const n=function(e){const t=d.C.getSupportedVideoCodecs();if(t.includes(e))return e;for(const n of t)if(n.startsWith(e))return n;return e};this.optionParameters.set(f.PreferredCodec,new a.G(f.PreferredCodec,"Preferred Codec","The preferred codec to be used during codec negotiation",t&&Object.prototype.hasOwnProperty.call(t,f.PreferredCodec)?n(t[f.PreferredCodec]):function(){const e=d.C.getSupportedVideoCodecs();if(1==e.length)return e[0];if(e.length>0){const t=e[0];for(const t of e)if(t.startsWith("H264"))return t;return t}return i.Vy.Error("Could not find any reasonable video codec to assign as a default."),""}(),d.C.getSupportedVideoCodecs(),e,n)),this.optionParameters.set(f.PreferredQuality,new a.G(f.PreferredQuality,"Preferred Quality","The preferred quality of the stream (only applicable when using the SFU)",t&&Object.prototype.hasOwnProperty.call(t,f.PreferredQuality)?t[f.PreferredQuality]:"Default",["Default"],e)),this.flags.set(c.AutoConnect,new s.T(c.AutoConnect,"Auto connect to stream","Whether we should attempt to auto connect to the signalling server or show a click to start prompt.",!(!t||!Object.prototype.hasOwnProperty.call(t,c.AutoConnect))&&t[c.AutoConnect],e)),this.flags.set(c.AutoPlayVideo,new s.T(c.AutoPlayVideo,"Auto play video","When video is ready automatically start playing it as opposed to showing a play button.",!t||!Object.prototype.hasOwnProperty.call(t,c.AutoPlayVideo)||t[c.AutoPlayVideo],e)),this.flags.set(c.UseMic,new s.T(c.UseMic,"Use microphone","Make browser request microphone access and open an input audio track.",!(!t||!Object.prototype.hasOwnProperty.call(t,c.UseMic))&&t[c.UseMic],e)),this.flags.set(c.UseModalForTextInput,new s.T(c.UseModalForTextInput,"Use modal for text input","When entering input into a streamed UE text widget, use an input modal.",!t||!Object.prototype.hasOwnProperty.call(t,c.UseModalForTextInput)||t[c.UseModalForTextInput],e)),this.flags.set(c.UseCamera,new s.T(c.UseCamera,"Use webcam","Make browser request webcam access and open a input video track.",!(!t||!Object.prototype.hasOwnProperty.call(t,c.UseCamera))&&t[c.UseCamera],e)),this.flags.set(c.StartVideoMuted,new s.T(c.StartVideoMuted,"Start video muted","Video will start muted if true.",!(!t||!Object.prototype.hasOwnProperty.call(t,c.StartVideoMuted))&&t[c.StartVideoMuted],e)),this.flags.set(c.SuppressBrowserKeys,new s.T(c.SuppressBrowserKeys,"Suppress browser keys","Suppress certain browser keys that we use in UE, for example F5 to show shader complexity instead of refresh the page.",!t||!Object.prototype.hasOwnProperty.call(t,c.SuppressBrowserKeys)||t[c.SuppressBrowserKeys],e)),this.flags.set(c.IsQualityController,new s.T(c.IsQualityController,"Is quality controller?","True if this peer controls stream quality",!t||!Object.prototype.hasOwnProperty.call(t,c.IsQualityController)||t[c.IsQualityController],e)),this.flags.set(c.ForceMonoAudio,new s.T(c.ForceMonoAudio,"Force mono audio","Force browser to request mono audio in the SDP",!(!t||!Object.prototype.hasOwnProperty.call(t,c.ForceMonoAudio))&&t[c.ForceMonoAudio],e)),this.flags.set(c.ForceTURN,new s.T(c.ForceTURN,"Force TURN","Only generate TURN/Relayed ICE candidates.",!(!t||!Object.prototype.hasOwnProperty.call(t,c.ForceTURN))&&t[c.ForceTURN],e)),this.flags.set(c.AFKDetection,new s.T(c.AFKDetection,"AFK if idle","Timeout the experience if user is AFK for a period.",!(!t||!Object.prototype.hasOwnProperty.call(t,c.AFKDetection))&&t[c.AFKDetection],e)),this.flags.set(c.MatchViewportResolution,new s.T(c.MatchViewportResolution,"Match viewport resolution","Pixel Streaming will be instructed to dynamically resize the video stream to match the size of the video element.",!(!t||!Object.prototype.hasOwnProperty.call(t,c.MatchViewportResolution))&&t[c.MatchViewportResolution],e)),this.flags.set(c.HoveringMouseMode,new s.T(c.HoveringMouseMode,"Control Scheme: Locked Mouse","Either locked mouse, where the pointer is consumed by the video and locked to it, or hovering mouse, where the mouse is not consumed.",!(!t||!Object.prototype.hasOwnProperty.call(t,c.HoveringMouseMode))&&t[c.HoveringMouseMode],e,(e,t)=>{t.label=`Control Scheme: ${e?"Hovering":"Locked"} Mouse`})),this.flags.set(c.FakeMouseWithTouches,new s.T(c.FakeMouseWithTouches,"Fake mouse with touches","A single finger touch is converted into a mouse event. This allows a non-touch application to be controlled partially via a touch device.",!(!t||!Object.prototype.hasOwnProperty.call(t,c.FakeMouseWithTouches))&&t[c.FakeMouseWithTouches],e)),this.flags.set(c.KeyboardInput,new s.T(c.KeyboardInput,"Keyboard input","If enabled, send keyboard events to streamer",!t||!Object.prototype.hasOwnProperty.call(t,c.KeyboardInput)||t[c.KeyboardInput],e)),this.flags.set(c.MouseInput,new s.T(c.MouseInput,"Mouse input","If enabled, send mouse events to streamer",!t||!Object.prototype.hasOwnProperty.call(t,c.MouseInput)||t[c.MouseInput],e)),this.flags.set(c.TouchInput,new s.T(c.TouchInput,"Touch input","If enabled, send touch events to streamer",!t||!Object.prototype.hasOwnProperty.call(t,c.TouchInput)||t[c.TouchInput],e)),this.flags.set(c.GamepadInput,new s.T(c.GamepadInput,"Gamepad input","If enabled, send gamepad events to streamer",!t||!Object.prototype.hasOwnProperty.call(t,c.GamepadInput)||t[c.GamepadInput],e)),this.flags.set(c.XRControllerInput,new s.T(c.XRControllerInput,"XR controller input","If enabled, send XR controller events to streamer",!t||!Object.prototype.hasOwnProperty.call(t,c.XRControllerInput)||t[c.XRControllerInput],e)),this.flags.set(c.WaitForStreamer,new s.T(c.WaitForStreamer,"Wait for streamer","Will continue trying to connect to the first streamer available.",!t||!Object.prototype.hasOwnProperty.call(t,c.WaitForStreamer)||t[c.WaitForStreamer],e)),this.flags.set(c.HideUI,new s.T(c.HideUI,"Hide the UI overlay","Will hide all UI overlay details",!(!t||!Object.prototype.hasOwnProperty.call(t,c.HideUI))&&t[c.HideUI],e)),this.flags.set(c.EnableCaptureTimeExt,new s.T(c.EnableCaptureTimeExt,"Enable abs-capture-time","Enables the abs-capture-time RTP header extension",!(!t||!Object.prototype.hasOwnProperty.call(t,c.EnableCaptureTimeExt))&&t[c.EnableCaptureTimeExt],e)),this.flags.set(c.BrowserSendOffer,new s.T(c.BrowserSendOffer,"Browser send offer (4.27 ONLY)","Browser will initiate the WebRTC handshake by sending the offer to the streamer (4.27 ONLY)",!(!t||!Object.prototype.hasOwnProperty.call(t,c.BrowserSendOffer))&&t[c.BrowserSendOffer],e)),this.flags.set(c.LatencyCSV,new s.T(c.LatencyCSV,"Export Latency CSV","Shows a button in the stats panel that allows to run a latency test and export the results to a CSV file.",!(!t||!Object.prototype.hasOwnProperty.call(t,c.LatencyCSV))&&t[c.LatencyCSV],e)),this.numericParameters.set(u.AFKTimeoutSecs,new r.U(u.AFKTimeoutSecs,"AFK timeout","The time (in seconds) it takes for the application to time out if AFK timeout is enabled.",0,null,t&&Object.prototype.hasOwnProperty.call(t,u.AFKTimeoutSecs)?t[u.AFKTimeoutSecs]:120,e)),this.numericParameters.set(u.AFKCountdownSecs,new r.U(u.AFKCountdownSecs,"AFK countdown","The time (in seconds) for a user to respond before the stream is ended after an AFK timeout.",10,null,10,e)),this.numericParameters.set(u.MaxReconnectAttempts,new r.U(u.MaxReconnectAttempts,"Max Reconnects","Maximum number of reconnects the application will attempt when a streamer disconnects.",0,999,t&&Object.prototype.hasOwnProperty.call(t,u.MaxReconnectAttempts)?t[u.MaxReconnectAttempts]:3,e)),this.numericParameters.set(u.MinQP,new r.U(u.MinQP,"Min QP","The lower bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.",0,51,t&&Object.prototype.hasOwnProperty.call(t,u.MinQP)?t[u.MinQP]:0,e)),this.numericParameters.set(u.MaxQP,new r.U(u.MaxQP,"Max QP","The upper bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.",0,51,t&&Object.prototype.hasOwnProperty.call(t,u.MaxQP)?t[u.MaxQP]:51,e)),this.numericParameters.set(u.MinQuality,new r.U(u.MinQuality,"Min Quality","The lower bound for the quality factor of the encoder. 0 = Worst quality, 100 = Best quality.",0,100,t&&Object.prototype.hasOwnProperty.call(t,u.MinQuality)?t[u.MinQuality]:0,e)),this.numericParameters.set(u.MaxQuality,new r.U(u.MaxQuality,"Max Quality","The upper bound for the quality factor of the encoder. 0 = Worst quality, 100 = Best quality.",0,100,t&&Object.prototype.hasOwnProperty.call(t,u.MaxQuality)?t[u.MaxQuality]:100,e)),this.numericParameters.set(u.CompatQualityMin,new r.U(u.CompatQualityMin,"Min Quality","The lower bound for encoding quality. 0 = Worst, 100 = Best.",0,100,t&&Object.prototype.hasOwnProperty.call(t,u.CompatQualityMin)?t[u.CompatQualityMin]:0,e)),this.numericParameters.set(u.CompatQualityMax,new r.U(u.CompatQualityMax,"Max Quality","The upper bound for encoding quality. 0 = Worst, 100 = Best.",0,100,t&&Object.prototype.hasOwnProperty.call(t,u.CompatQualityMax)?t[u.CompatQualityMax]:100,e)),this.numericParameters.set(u.WebRTCFPS,new r.U(u.WebRTCFPS,"Max FPS","The maximum FPS that WebRTC will try to transmit frames at.",1,999,t&&Object.prototype.hasOwnProperty.call(t,u.WebRTCFPS)?t[u.WebRTCFPS]:60,e)),this.numericParameters.set(u.WebRTCMinBitrate,new