@streamlayer/react 1.8.5 → 1.8.6

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.
@@ -1,7 +1,7 @@
1
1
  "use strict";var qc=Object.defineProperty;var xc=(e,t,n)=>t in e?qc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var p=(e,t,n)=>xc(e,typeof t!="symbol"?t+"":t,n);const xs=require("react");function Hc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wr={exports:{}},Z=wr.exports={},ve,Ae;function Pa(){throw new Error("setTimeout has not been defined")}function Ca(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ve=setTimeout:ve=Pa}catch{ve=Pa}try{typeof clearTimeout=="function"?Ae=clearTimeout:Ae=Ca}catch{Ae=Ca}})();function Rr(e){if(ve===setTimeout)return setTimeout(e,0);if((ve===Pa||!ve)&&setTimeout)return ve=setTimeout,setTimeout(e,0);try{return ve(e,0)}catch{try{return ve.call(null,e,0)}catch{return ve.call(this,e,0)}}}function Qc(e){if(Ae===clearTimeout)return clearTimeout(e);if((Ae===Ca||!Ae)&&clearTimeout)return Ae=clearTimeout,clearTimeout(e);try{return Ae(e)}catch{try{return Ae.call(null,e)}catch{return Ae.call(this,e)}}}var He=[],At=!1,lt,Tn=-1;function Yc(){!At||!lt||(At=!1,lt.length?He=lt.concat(He):Tn=-1,He.length&&Lr())}function Lr(){if(!At){var e=Rr(Yc);At=!0;for(var t=He.length;t;){for(lt=He,He=[];++Tn<t;)lt&&lt[Tn].run();Tn=-1,t=He.length}lt=null,At=!1,Qc(e)}}Z.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];He.push(new Mr(e,t)),He.length===1&&!At&&Rr(Lr)};function Mr(e,t){this.fun=e,this.array=t}Mr.prototype.run=function(){this.fun.apply(null,this.array)};Z.title="browser";Z.browser=!0;Z.env={};Z.argv=[];Z.version="";Z.versions={};function $e(){}Z.on=$e;Z.addListener=$e;Z.once=$e;Z.off=$e;Z.removeListener=$e;Z.removeAllListeners=$e;Z.emit=$e;Z.prependListener=$e;Z.prependOnceListener=$e;Z.listeners=function(e){return[]};Z.binding=function(e){throw new Error("process.binding is not supported")};Z.cwd=function(){return"/"};Z.chdir=function(e){throw new Error("process.chdir is not supported")};Z.umask=function(){return 0};var jc=wr.exports;const Hs=Hc(jc);var is={exports:{}};function $c(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var Kc=Wc;function Wc(e,t,n){var a=n&&n.stringify||$c,s=1;if(typeof e=="object"&&e!==null){var o=t.length+s;if(o===1)return e;var r=new Array(o);r[0]=a(e);for(var c=1;c<o;c++)r[c]=a(t[c]);return r.join(" ")}if(typeof e!="string")return e;var l=t.length;if(l===0)return e;for(var m="",u=1-s,d=-1,y=e&&e.length||0,T=0;T<y;){if(e.charCodeAt(T)===37&&T+1<y){switch(d=d>-1?d:0,e.charCodeAt(T+1)){case 100:case 102:if(u>=l||t[u]==null)break;d<T&&(m+=e.slice(d,T)),m+=Number(t[u]),d=T+2,T++;break;case 105:if(u>=l||t[u]==null)break;d<T&&(m+=e.slice(d,T)),m+=Math.floor(Number(t[u])),d=T+2,T++;break;case 79:case 111:case 106:if(u>=l||t[u]===void 0)break;d<T&&(m+=e.slice(d,T));var f=typeof t[u];if(f==="string"){m+="'"+t[u]+"'",d=T+2,T++;break}if(f==="function"){m+=t[u].name||"<anonymous>",d=T+2,T++;break}m+=a(t[u]),d=T+2,T++;break;case 115:if(u>=l)break;d<T&&(m+=e.slice(d,T)),m+=String(t[u]),d=T+2,T++;break;case 37:d<T&&(m+=e.slice(d,T)),m+="%",d=T+2,T++,u--;break}++u}++T}return d===-1?e:(d<y&&(m+=e.slice(d)),m)}const Qs=Kc;is.exports=je;const zt=ml().console||{},zc={mapHttpRequest:on,mapHttpResponse:on,wrapRequestSerializer:sa,wrapResponseSerializer:sa,wrapErrorSerializer:sa,req:on,res:on,err:js,errWithCause:js};function vn(e,t){return e==="silent"?1/0:t.levels.values[e]}const cs=Symbol("pino.logFuncs"),Da=Symbol("pino.hierarchy"),Jc={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Ys(e,t){const n={logger:t,parent:e[Da]};t[Da]=n}function Xc(e,t,n){const a={};t.forEach(s=>{a[s]=n[s]?n[s]:zt[s]||zt[Jc[s]||"log"]||wt}),e[cs]=a}function Zc(e,t){return Array.isArray(e)?e.filter(function(a){return a!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function je(e){e=e||{},e.browser=e.browser||{};const t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");const n=e.browser.write||zt;e.browser.write&&(e.browser.asObject=!0);const a=e.serializers||{},s=Zc(e.browser.serialize,a);let o=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);const r=Object.keys(e.customLevels||{}),c=["error","fatal","warn","info","debug","trace"].concat(r);typeof n=="function"&&c.forEach(function(_){n[_]=n}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");const l=e.level||"info",m=Object.create(n);m.log||(m.log=wt),Xc(m,c,n),Ys({},m),Object.defineProperty(m,"levelVal",{get:d}),Object.defineProperty(m,"level",{get:y,set:T});const u={transmit:t,serialize:s,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:c,timestamp:il(e),messageKey:e.messageKey||"msg",onChild:e.onChild||wt};m.levels=el(e),m.level=l,m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=wt,m.serializers=a,m._serialize=s,m._stdErrSerialize=o,m.child=function(..._){return f.call(this,u,..._)},t&&(m._logEvent=Ua());function d(){return vn(this.level,this)}function y(){return this._level}function T(_){if(_!=="silent"&&!this.levels.values[_])throw Error("unknown level "+_);this._level=_,it(this,u,m,"error"),it(this,u,m,"fatal"),it(this,u,m,"warn"),it(this,u,m,"info"),it(this,u,m,"debug"),it(this,u,m,"trace"),r.forEach(N=>{it(this,u,m,N)})}function f(_,N,E){if(!N)throw new Error("missing bindings for child Pino");E=E||{},s&&N.serializers&&(E.serializers=N.serializers);const b=E.serializers;if(s&&b){var w=Object.assign({},a,b),O=e.browser.serialize===!0?Object.keys(w):s;delete N.serializers,ls([N],O,w,this._stdErrSerialize)}function A(v){this._childLevel=(v._childLevel|0)+1,this.bindings=N,w&&(this.serializers=w,this._serialize=O),t&&(this._logEvent=Ua([].concat(v._logEvent.bindings,N)))}A.prototype=this;const L=new A(this);return Ys(this,L),L.child=function(...v){return f.call(this,_,...v)},L.level=E.level||this.level,_.onChild(L),L}return m}function el(e){const t=e.customLevels||{},n=Object.assign({},je.levels.values,t),a=Object.assign({},je.levels.labels,tl(t));return{values:n,labels:a}}function tl(e){const t={};return Object.keys(e).forEach(function(n){t[e[n]]=n}),t}je.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};je.stdSerializers=zc;je.stdTimeFunctions=Object.assign({},{nullTime:Pr,epochTime:Cr,unixTime:cl,isoTime:ll});function nl(e){const t=[];e.bindings&&t.push(e.bindings);let n=e[Da];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}function it(e,t,n,a){if(Object.defineProperty(e,a,{value:vn(e.level,n)>vn(a,n)?wt:n[cs][a],writable:!0,enumerable:!0,configurable:!0}),e[a]===wt){if(!t.transmit)return;const o=t.transmit.level||e.level,r=n.levels.values[o];if(n.levels.values[a]<r)return}e[a]=sl(e,t,n,a);const s=nl(e);s.length!==0&&(e[a]=al(s,e[a]))}function al(e,t){return function(){return t.apply(this,[...e,...arguments])}}function sl(e,t,n,a){return function(s){return function(){const r=t.timestamp(),c=new Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===zt?zt:this;for(var m=0;m<c.length;m++)c[m]=arguments[m];var u=!1;if(t.serialize&&(ls(c,this._serialize,this.serializers,this._stdErrSerialize),u=!0),t.asObject||t.formatters?s.call(l,ol(this,a,c,r,t)):s.apply(l,c),t.transmit){const d=t.transmit.level||e._level,y=n.levels.values[d],T=n.levels.values[a];if(T<y)return;rl(this,{ts:r,methodLevel:a,methodValue:T,transmitLevel:d,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:vn(e._level,n)},c,u)}}}(e[cs][a])}function ol(e,t,n,a,s){const{level:o,log:r=y=>y}=s.formatters||{},c=n.slice();let l=c[0];const m={};if(a&&(m.time=a),o){const y=o(t,e.levels.values[t]);Object.assign(m,y)}else m.level=e.levels.values[t];let u=(e._childLevel|0)+1;if(u<1&&(u=1),l!==null&&typeof l=="object"){for(;u--&&typeof c[0]=="object";)Object.assign(m,c.shift());l=c.length?Qs(c.shift(),c):void 0}else typeof l=="string"&&(l=Qs(c.shift(),c));return l!==void 0&&(m[s.messageKey]=l),r(m)}function ls(e,t,n,a){for(const s in e)if(a&&e[s]instanceof Error)e[s]=je.stdSerializers.err(e[s]);else if(typeof e[s]=="object"&&!Array.isArray(e[s])&&t)for(const o in e[s])t.indexOf(o)>-1&&o in n&&(e[s][o]=n[o](e[s][o]))}function rl(e,t,n,a=!1){const s=t.send,o=t.ts,r=t.methodLevel,c=t.methodValue,l=t.val,m=e._logEvent.bindings;a||ls(n,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=o,e._logEvent.messages=n.filter(function(u){return m.indexOf(u)===-1}),e._logEvent.level.label=r,e._logEvent.level.value=c,s(r,e._logEvent,l),e._logEvent=Ua(m)}function Ua(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function js(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)t[n]===void 0&&(t[n]=e[n]);return t}function il(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Pr:Cr}function on(){return{}}function sa(e){return e}function wt(){}function Pr(){return!1}function Cr(){return Date.now()}function cl(){return Math.round(Date.now()/1e3)}function ll(){return new Date(Date.now()).toISOString()}function ml(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}is.exports.default=je;var Dr=is.exports.pino=je;function z(e,t){if(!e)throw new Error(t)}const ul=34028234663852886e22,dl=-34028234663852886e22,pl=4294967295,Tl=2147483647,yl=-2147483648;function yn(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>Tl||e<yl)throw new Error("invalid int 32: "+e)}function Fa(e){if(typeof e!="number")throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>pl||e<0)throw new Error("invalid uint 32: "+e)}function Ur(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>ul||e<dl))throw new Error("invalid float 32: "+e)}const Fr=Symbol("@bufbuild/protobuf/enum-type");function fl(e){const t=e[Fr];return z(t,"missing enum type on enum object"),t}function Gr(e,t,n,a){e[Fr]=Br(t,n.map(s=>({no:s.no,name:s.name,localName:e[s.no]})))}function Br(e,t,n){const a=Object.create(null),s=Object.create(null),o=[];for(const r of t){const c=Vr(r);o.push(c),a[r.name]=c,s[r.no]=c}return{typeName:e,values:o,findName(r){return a[r]},findNumber(r){return s[r]}}}function gl(e,t,n){const a={};for(const s of t){const o=Vr(s);a[o.localName]=o.no,a[o.no]=o.localName}return Gr(a,e,t),a}function Vr(e){return"localName"in e?e:Object.assign(Object.assign({},e),{localName:e.name})}class Zt{equals(t){return this.getType().runtime.util.equals(this.getType(),this,t)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(t,n){const a=this.getType(),s=a.runtime.bin,o=s.makeReadOptions(n);return s.readMessage(this,o.readerFactory(t),t.byteLength,o),this}fromJson(t,n){const a=this.getType(),s=a.runtime.json,o=s.makeReadOptions(n);return s.readMessage(a,t,o,this),this}fromJsonString(t,n){let a;try{a=JSON.parse(t)}catch(s){throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${s instanceof Error?s.message:String(s)}`)}return this.fromJson(a,n)}toBinary(t){const n=this.getType(),a=n.runtime.bin,s=a.makeWriteOptions(t),o=s.writerFactory();return a.writeMessage(this,o,s),o.finish()}toJson(t){const n=this.getType(),a=n.runtime.json,s=a.makeWriteOptions(t);return a.writeMessage(this,s)}toJsonString(t){var n;const a=this.toJson(t);return JSON.stringify(a,null,(n=t==null?void 0:t.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function kl(e,t,n,a){var s;const o=(s=a==null?void 0:a.localName)!==null&&s!==void 0?s:t.substring(t.lastIndexOf(".")+1),r={[o]:function(c){e.util.initFields(this),e.util.initPartial(c,this)}}[o];return Object.setPrototypeOf(r.prototype,new Zt),Object.assign(r,{runtime:e,typeName:t,fields:e.util.newFieldList(n),fromBinary(c,l){return new r().fromBinary(c,l)},fromJson(c,l){return new r().fromJson(c,l)},fromJsonString(c,l){return new r().fromJsonString(c,l)},equals(c,l){return e.util.equals(r,c,l)}}),r}function hl(){let e=0,t=0;for(let a=0;a<28;a+=7){let s=this.buf[this.pos++];if(e|=(s&127)<<a,!(s&128))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,!(n&128))return this.assertBounds(),[e,t];for(let a=3;a<=31;a+=7){let s=this.buf[this.pos++];if(t|=(s&127)<<a,!(s&128))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function oa(e,t,n){for(let o=0;o<28;o=o+7){const r=e>>>o,c=!(!(r>>>7)&&t==0),l=(c?r|128:r)&255;if(n.push(l),!c)return}const a=e>>>28&15|(t&7)<<4,s=!!(t>>3);if(n.push((s?a|128:a)&255),!!s){for(let o=3;o<31;o=o+7){const r=t>>>o,c=!!(r>>>7),l=(c?r|128:r)&255;if(n.push(l),!c)return}n.push(t>>>31&1)}}const fn=4294967296;function $s(e){const t=e[0]==="-";t&&(e=e.slice(1));const n=1e6;let a=0,s=0;function o(r,c){const l=Number(e.slice(r,c));s*=n,a=a*n+l,a>=fn&&(s=s+(a/fn|0),a=a%fn)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?xr(a,s):ms(a,s)}function Sl(e,t){let n=ms(e,t);const a=n.hi&2147483648;a&&(n=xr(n.lo,n.hi));const s=qr(n.lo,n.hi);return a?"-"+s:s}function qr(e,t){if({lo:e,hi:t}=_l(e,t),t<=2097151)return String(fn*t+e);const n=e&16777215,a=(e>>>24|t<<8)&16777215,s=t>>16&65535;let o=n+a*6777216+s*6710656,r=a+s*8147497,c=s*2;const l=1e7;return o>=l&&(r+=Math.floor(o/l),o%=l),r>=l&&(c+=Math.floor(r/l),r%=l),c.toString()+Ks(r)+Ks(o)}function _l(e,t){return{lo:e>>>0,hi:t>>>0}}function ms(e,t){return{lo:e|0,hi:t|0}}function xr(e,t){return t=~t,e?e=~e+1:t+=1,ms(e,t)}const Ks=e=>{const t=String(e);return"0000000".slice(t.length)+t};function Ws(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function El(){let e=this.buf[this.pos++],t=e&127;if(!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;e&128&&n<10;n++)e=this.buf[this.pos++];if(e&128)throw new Error("invalid varint");return this.assertBounds(),t>>>0}function bl(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(typeof Hs!="object"||typeof Hs.env!="object"||!1)){const s=BigInt("-9223372036854775808"),o=BigInt("9223372036854775807"),r=BigInt("0"),c=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(l){const m=typeof l=="bigint"?l:BigInt(l);if(m>o||m<s)throw new Error(`int64 invalid: ${l}`);return m},uParse(l){const m=typeof l=="bigint"?l:BigInt(l);if(m>c||m<r)throw new Error(`uint64 invalid: ${l}`);return m},enc(l){return e.setBigInt64(0,this.parse(l),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(l){return e.setBigInt64(0,this.uParse(l),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(l,m){return e.setInt32(0,l,!0),e.setInt32(4,m,!0),e.getBigInt64(0,!0)},uDec(l,m){return e.setInt32(0,l,!0),e.setInt32(4,m,!0),e.getBigUint64(0,!0)}}}const n=s=>z(/^-?[0-9]+$/.test(s),`int64 invalid: ${s}`),a=s=>z(/^[0-9]+$/.test(s),`uint64 invalid: ${s}`);return{zero:"0",supported:!1,parse(s){return typeof s!="string"&&(s=s.toString()),n(s),s},uParse(s){return typeof s!="string"&&(s=s.toString()),a(s),s},enc(s){return typeof s!="string"&&(s=s.toString()),n(s),$s(s)},uEnc(s){return typeof s!="string"&&(s=s.toString()),a(s),$s(s)},dec(s,o){return Sl(s,o)},uDec(s,o){return qr(s,o)}}}const pe=bl();var h;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(h||(h={}));var et;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING"})(et||(et={}));function Je(e,t,n){if(t===n)return!0;if(e==h.BYTES){if(!(t instanceof Uint8Array)||!(n instanceof Uint8Array)||t.length!==n.length)return!1;for(let a=0;a<t.length;a++)if(t[a]!==n[a])return!1;return!0}switch(e){case h.UINT64:case h.FIXED64:case h.INT64:case h.SFIXED64:case h.SINT64:return t==n}return!1}function Pt(e,t){switch(e){case h.BOOL:return!1;case h.UINT64:case h.FIXED64:case h.INT64:case h.SFIXED64:case h.SINT64:return t==0?pe.zero:"0";case h.DOUBLE:case h.FLOAT:return 0;case h.BYTES:return new Uint8Array(0);case h.STRING:return"";default:return 0}}function Hr(e,t){switch(e){case h.BOOL:return t===!1;case h.STRING:return t==="";case h.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}var X;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(X||(X={}));class Nl{constructor(t){this.stack=[],this.textEncoder=t??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let s=0;s<this.chunks.length;s++)t+=this.chunks[s].length;let n=new Uint8Array(t),a=0;for(let s=0;s<this.chunks.length;s++)n.set(this.chunks[s],a),a+=this.chunks[s].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,n){return this.uint32((t<<3|n)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Fa(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return yn(t),Ws(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.textEncoder.encode(t);return this.uint32(n.byteLength),this.raw(n)}float(t){Ur(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){Fa(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){yn(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return yn(t),t=(t<<1^t>>31)>>>0,Ws(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),a=new DataView(n.buffer),s=pe.enc(t);return a.setInt32(0,s.lo,!0),a.setInt32(4,s.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),a=new DataView(n.buffer),s=pe.uEnc(t);return a.setInt32(0,s.lo,!0),a.setInt32(4,s.hi,!0),this.raw(n)}int64(t){let n=pe.enc(t);return oa(n.lo,n.hi,this.buf),this}sint64(t){let n=pe.enc(t),a=n.hi>>31,s=n.lo<<1^a,o=(n.hi<<1|n.lo>>>31)^a;return oa(s,o,this.buf),this}uint64(t){let n=pe.uEnc(t);return oa(n.lo,n.hi,this.buf),this}}class Il{constructor(t,n){this.varint64=hl,this.uint32=El,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=n??new TextDecoder}tag(){let t=this.uint32(),n=t>>>3,a=t&7;if(n<=0||a<0||a>5)throw new Error("illegal tag: field no "+n+" wire type "+a);return[n,a]}skip(t,n){let a=this.pos;switch(t){case X.Varint:for(;this.buf[this.pos++]&128;);break;case X.Bit64:this.pos+=4;case X.Bit32:this.pos+=4;break;case X.LengthDelimited:let s=this.uint32();this.pos+=s;break;case X.StartGroup:for(;;){const[o,r]=this.tag();if(r===X.EndGroup){if(n!==void 0&&o!==n)throw new Error("invalid end group tag");break}this.skip(r,o)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(a,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return pe.dec(...this.varint64())}uint64(){return pe.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64(),a=-(t&1);return t=(t>>>1|(n&1)<<31)^a,n=n>>>1^a,pe.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return pe.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return pe.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.textDecoder.decode(this.bytes())}}function Ol(e,t,n,a){let s;return{typeName:t,extendee:n,get field(){if(!s){const o=typeof a=="function"?a():a;o.name=t.split(".").pop(),o.jsonName=`[${t}]`,s=e.util.newFieldList([o]).list()[0]}return s},runtime:e}}function Qr(e){const t=e.field.localName,n=Object.create(null);return n[t]=vl(e),[n,()=>n[t]]}function vl(e){const t=e.field;if(t.repeated)return[];if(t.default!==void 0)return t.default;switch(t.kind){case"enum":return t.T.values[0].no;case"scalar":return Pt(t.T,t.L);case"message":const n=t.T,a=new n;return n.fieldWrapper?n.fieldWrapper.unwrapField(a):a;case"map":throw"map fields are not allowed to be extensions"}}function Al(e,t){if(!t.repeated&&(t.kind=="enum"||t.kind=="scalar")){for(let n=e.length-1;n>=0;--n)if(e[n].no==t.no)return[e[n]];return[]}return e.filter(n=>n.no===t.no)}let Be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),xn=[];for(let e=0;e<Be.length;e++)xn[Be[e].charCodeAt(0)]=e;xn[45]=Be.indexOf("+");xn[95]=Be.indexOf("/");const us={dec(e){let t=e.length*3/4;e[e.length-2]=="="?t-=2:e[e.length-1]=="="&&(t-=1);let n=new Uint8Array(t),a=0,s=0,o,r=0;for(let c=0;c<e.length;c++){if(o=xn[e.charCodeAt(c)],o===void 0)switch(e[c]){case"=":s=0;case`
2
2
  `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(s){case 0:r=o,s=1;break;case 1:n[a++]=r<<2|(o&48)>>4,r=o,s=2;break;case 2:n[a++]=(r&15)<<4|(o&60)>>2,r=o,s=3;break;case 3:n[a++]=(r&3)<<6|o,s=0;break}}if(s==1)throw Error("invalid base64 string.");return n.subarray(0,a)},enc(e){let t="",n=0,a,s=0;for(let o=0;o<e.length;o++)switch(a=e[o],n){case 0:t+=Be[a>>2],s=(a&3)<<4,n=1;break;case 1:t+=Be[s|a>>4],s=(a&15)<<2,n=2;break;case 2:t+=Be[s|a>>6],t+=Be[a&63],n=0;break}return n&&(t+=Be[s],t+="=",n==1&&(t+="=")),t}};function wl(e,t,n){jr(t,e);const a=t.runtime.bin.makeReadOptions(n),s=Al(e.getType().runtime.bin.listUnknownFields(e),t.field),[o,r]=Qr(t);for(const c of s)t.runtime.bin.readField(o,a.readerFactory(c.data),t.field,c.wireType,a);return r()}function Rl(e,t,n,a){jr(t,e);const s=t.runtime.bin.makeReadOptions(a),o=t.runtime.bin.makeWriteOptions(a);if(Yr(e,t)){const m=e.getType().runtime.bin.listUnknownFields(e).filter(u=>u.no!=t.field.no);e.getType().runtime.bin.discardUnknownFields(e);for(const u of m)e.getType().runtime.bin.onUnknownField(e,u.no,u.wireType,u.data)}const r=o.writerFactory();let c=t.field;!c.opt&&!c.repeated&&(c.kind=="enum"||c.kind=="scalar")&&(c=Object.assign(Object.assign({},t.field),{opt:!0})),t.runtime.bin.writeField(c,n,r,o);const l=s.readerFactory(r.finish());for(;l.pos<l.len;){const[m,u]=l.tag(),d=l.skip(u,m);e.getType().runtime.bin.onUnknownField(e,m,u,d)}}function Yr(e,t){const n=e.getType();return t.extendee.typeName===n.typeName&&!!n.runtime.bin.listUnknownFields(e).find(a=>a.no==t.field.no)}function jr(e,t){z(e.extendee.typeName==t.getType().typeName,`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}function $r(e,t){const n=e.localName;if(e.repeated)return t[n].length>0;if(e.oneof)return t[e.oneof.localName].case===n;switch(e.kind){case"enum":case"scalar":return e.opt||e.req?t[n]!==void 0:e.kind=="enum"?t[n]!==e.T.values[0].no:!Hr(e.T,t[n]);case"message":return t[n]!==void 0;case"map":return Object.keys(t[n]).length>0}}function zs(e,t){const n=e.localName,a=!e.opt&&!e.req;if(e.repeated)t[n]=[];else if(e.oneof)t[e.oneof.localName]={case:void 0};else switch(e.kind){case"map":t[n]={};break;case"enum":t[n]=a?e.T.values[0].no:void 0;break;case"scalar":t[n]=a?Pt(e.T,e.L):void 0;break;case"message":t[n]=void 0;break}}function dt(e,t){if(e===null||typeof e!="object"||!Object.getOwnPropertyNames(Zt.prototype).every(a=>a in e&&typeof e[a]=="function"))return!1;const n=e.getType();return n===null||typeof n!="function"||!("typeName"in n)||typeof n.typeName!="string"?!1:t===void 0?!0:n.typeName==t.typeName}function Kr(e,t){return dt(t)||!e.fieldWrapper?t:e.fieldWrapper.wrapField(t)}h.DOUBLE,h.FLOAT,h.INT64,h.UINT64,h.INT32,h.UINT32,h.BOOL,h.STRING,h.BYTES;const Js={ignoreUnknownFields:!1},Xs={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function Ll(e){return e?Object.assign(Object.assign({},Js),e):Js}function Ml(e){return e?Object.assign(Object.assign({},Xs),e):Xs}const An=Symbol(),gn=Symbol();function Pl(){return{makeReadOptions:Ll,makeWriteOptions:Ml,readMessage(e,t,n,a){if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.typeName} from JSON: ${we(t)}`);a=a??new e;const s=new Map,o=n.typeRegistry;for(const[r,c]of Object.entries(t)){const l=e.fields.findJsonName(r);if(l){if(l.oneof){if(c===null&&l.kind=="scalar")continue;const m=s.get(l.oneof);if(m!==void 0)throw new Error(`cannot decode message ${e.typeName} from JSON: multiple keys for oneof "${l.oneof.name}" present: "${m}", "${r}"`);s.set(l.oneof,r)}Zs(a,c,l,n,e)}else{let m=!1;if(o!=null&&o.findExtension&&r.startsWith("[")&&r.endsWith("]")){const u=o.findExtension(r.substring(1,r.length-1));if(u&&u.extendee.typeName==e.typeName){m=!0;const[d,y]=Qr(u);Zs(d,c,u.field,n,u),Rl(a,u,y(),n)}}if(!m&&!n.ignoreUnknownFields)throw new Error(`cannot decode message ${e.typeName} from JSON: key "${r}" is unknown`)}}return a},writeMessage(e,t){const n=e.getType(),a={};let s;try{for(s of n.fields.byNumber()){if(!$r(s,e)){if(s.req)throw"required field not set";if(!t.emitDefaultValues||!Dl(s))continue}const r=s.oneof?e[s.oneof.localName].value:e[s.localName],c=eo(s,r,t);c!==void 0&&(a[t.useProtoFieldName?s.name:s.jsonName]=c)}const o=t.typeRegistry;if(o!=null&&o.findExtensionFor)for(const r of n.runtime.bin.listUnknownFields(e)){const c=o.findExtensionFor(n.typeName,r.no);if(c&&Yr(e,c)){const l=wl(e,c,t),m=eo(c.field,l,t);m!==void 0&&(a[c.field.jsonName]=m)}}}catch(o){const r=s?`cannot encode field ${n.typeName}.${s.name} to JSON`:`cannot encode message ${n.typeName} to JSON`,c=o instanceof Error?o.message:String(o);throw new Error(r+(c.length>0?`: ${c}`:""))}return a},readScalar(e,t,n){return Yt(e,t,n??et.BIGINT,!0)},writeScalar(e,t,n){if(t!==void 0&&(n||Hr(e,t)))return kn(e,t)},debug:we}}function we(e){if(e===null)return"null";switch(typeof e){case"object":return Array.isArray(e)?"array":"object";case"string":return e.length>100?"string":`"${e.split('"').join('\\"')}"`;default:return String(e)}}function Zs(e,t,n,a,s){let o=n.localName;if(n.repeated){if(z(n.kind!="map"),t===null)return;if(!Array.isArray(t))throw new Error(`cannot decode field ${s.typeName}.${n.name} from JSON: ${we(t)}`);const r=e[o];for(const c of t){if(c===null)throw new Error(`cannot decode field ${s.typeName}.${n.name} from JSON: ${we(c)}`);switch(n.kind){case"message":r.push(n.T.fromJson(c,a));break;case"enum":const l=ra(n.T,c,a.ignoreUnknownFields,!0);l!==gn&&r.push(l);break;case"scalar":try{r.push(Yt(n.T,c,n.L,!0))}catch(m){let u=`cannot decode field ${s.typeName}.${n.name} from JSON: ${we(c)}`;throw m instanceof Error&&m.message.length>0&&(u+=`: ${m.message}`),new Error(u)}break}}}else if(n.kind=="map"){if(t===null)return;if(typeof t!="object"||Array.isArray(t))throw new Error(`cannot decode field ${s.typeName}.${n.name} from JSON: ${we(t)}`);const r=e[o];for(const[c,l]of Object.entries(t)){if(l===null)throw new Error(`cannot decode field ${s.typeName}.${n.name} from JSON: map value null`);let m;try{m=Cl(n.K,c)}catch(u){let d=`cannot decode map key for field ${s.typeName}.${n.name} from JSON: ${we(t)}`;throw u instanceof Error&&u.message.length>0&&(d+=`: ${u.message}`),new Error(d)}switch(n.V.kind){case"message":r[m]=n.V.T.fromJson(l,a);break;case"enum":const u=ra(n.V.T,l,a.ignoreUnknownFields,!0);u!==gn&&(r[m]=u);break;case"scalar":try{r[m]=Yt(n.V.T,l,et.BIGINT,!0)}catch(d){let y=`cannot decode map value for field ${s.typeName}.${n.name} from JSON: ${we(t)}`;throw d instanceof Error&&d.message.length>0&&(y+=`: ${d.message}`),new Error(y)}break}}}else switch(n.oneof&&(e=e[n.oneof.localName]={case:o},o="value"),n.kind){case"message":const r=n.T;if(t===null&&r.typeName!="google.protobuf.Value")return;let c=e[o];dt(c)?c.fromJson(t,a):(e[o]=c=r.fromJson(t,a),r.fieldWrapper&&!n.oneof&&(e[o]=r.fieldWrapper.unwrapField(c)));break;case"enum":const l=ra(n.T,t,a.ignoreUnknownFields,!1);switch(l){case An:zs(n,e);break;case gn:break;default:e[o]=l;break}break;case"scalar":try{const m=Yt(n.T,t,n.L,!1);switch(m){case An:zs(n,e);break;default:e[o]=m;break}}catch(m){let u=`cannot decode field ${s.typeName}.${n.name} from JSON: ${we(t)}`;throw m instanceof Error&&m.message.length>0&&(u+=`: ${m.message}`),new Error(u)}break}}function Cl(e,t){if(e===h.BOOL)switch(t){case"true":t=!0;break;case"false":t=!1;break}return Yt(e,t,et.BIGINT,!0).toString()}function Yt(e,t,n,a){if(t===null)return a?Pt(e,n):An;switch(e){case h.DOUBLE:case h.FLOAT:if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""||typeof t=="string"&&t.trim().length!==t.length||typeof t!="string"&&typeof t!="number")break;const s=Number(t);if(Number.isNaN(s)||!Number.isFinite(s))break;return e==h.FLOAT&&Ur(s),s;case h.INT32:case h.FIXED32:case h.SFIXED32:case h.SINT32:case h.UINT32:let o;if(typeof t=="number"?o=t:typeof t=="string"&&t.length>0&&t.trim().length===t.length&&(o=Number(t)),o===void 0)break;return e==h.UINT32||e==h.FIXED32?Fa(o):yn(o),o;case h.INT64:case h.SFIXED64:case h.SINT64:if(typeof t!="number"&&typeof t!="string")break;const r=pe.parse(t);return n?r.toString():r;case h.FIXED64:case h.UINT64:if(typeof t!="number"&&typeof t!="string")break;const c=pe.uParse(t);return n?c.toString():c;case h.BOOL:if(typeof t!="boolean")break;return t;case h.STRING:if(typeof t!="string")break;try{encodeURIComponent(t)}catch{throw new Error("invalid UTF8")}return t;case h.BYTES:if(t==="")return new Uint8Array(0);if(typeof t!="string")break;return us.dec(t)}throw new Error}function ra(e,t,n,a){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:a?e.values[0].no:An;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const s=e.findName(t);if(s!==void 0)return s.no;if(n)return gn;break}throw new Error(`cannot decode enum ${e.typeName} from JSON: ${we(t)}`)}function Dl(e){return e.repeated||e.kind=="map"?!0:!(e.oneof||e.kind=="message"||e.opt||e.req)}function eo(e,t,n){if(e.kind=="map"){z(typeof t=="object"&&t!=null);const a={},s=Object.entries(t);switch(e.V.kind){case"scalar":for(const[r,c]of s)a[r.toString()]=kn(e.V.T,c);break;case"message":for(const[r,c]of s)a[r.toString()]=c.toJson(n);break;case"enum":const o=e.V.T;for(const[r,c]of s)a[r.toString()]=ia(o,c,n.enumAsInteger);break}return n.emitDefaultValues||s.length>0?a:void 0}if(e.repeated){z(Array.isArray(t));const a=[];switch(e.kind){case"scalar":for(let s=0;s<t.length;s++)a.push(kn(e.T,t[s]));break;case"enum":for(let s=0;s<t.length;s++)a.push(ia(e.T,t[s],n.enumAsInteger));break;case"message":for(let s=0;s<t.length;s++)a.push(t[s].toJson(n));break}return n.emitDefaultValues||a.length>0?a:void 0}switch(e.kind){case"scalar":return kn(e.T,t);case"enum":return ia(e.T,t,n.enumAsInteger);case"message":return Kr(e.T,t).toJson(n)}}function ia(e,t,n){var a;if(z(typeof t=="number"),e.typeName=="google.protobuf.NullValue")return null;if(n)return t;const s=e.findNumber(t);return(a=s==null?void 0:s.name)!==null&&a!==void 0?a:t}function kn(e,t){switch(e){case h.INT32:case h.SFIXED32:case h.SINT32:case h.FIXED32:case h.UINT32:return z(typeof t=="number"),t;case h.FLOAT:case h.DOUBLE:return z(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case h.STRING:return z(typeof t=="string"),t;case h.BOOL:return z(typeof t=="boolean"),t;case h.UINT64:case h.FIXED64:case h.INT64:case h.SFIXED64:case h.SINT64:return z(typeof t=="bigint"||typeof t=="string"||typeof t=="number"),t.toString();case h.BYTES:return z(t instanceof Uint8Array),us.enc(t)}}const St=Symbol("@bufbuild/protobuf/unknown-fields"),to={readUnknownFields:!0,readerFactory:e=>new Il(e)},no={writeUnknownFields:!0,writerFactory:()=>new Nl};function Ul(e){return e?Object.assign(Object.assign({},to),e):to}function Fl(e){return e?Object.assign(Object.assign({},no),e):no}function Gl(){return{makeReadOptions:Ul,makeWriteOptions:Fl,listUnknownFields(e){var t;return(t=e[St])!==null&&t!==void 0?t:[]},discardUnknownFields(e){delete e[St]},writeUnknownFields(e,t){const a=e[St];if(a)for(const s of a)t.tag(s.no,s.wireType).raw(s.data)},onUnknownField(e,t,n,a){const s=e;Array.isArray(s[St])||(s[St]=[]),s[St].push({no:t,wireType:n,data:a})},readMessage(e,t,n,a,s){const o=e.getType(),r=s?t.len:t.pos+n;let c,l;for(;t.pos<r&&([c,l]=t.tag(),!(s===!0&&l==X.EndGroup));){const m=o.fields.find(c);if(!m){const u=t.skip(l,c);a.readUnknownFields&&this.onUnknownField(e,c,l,u);continue}ao(e,t,m,l,a)}if(s&&(l!=X.EndGroup||c!==n))throw new Error("invalid end group tag")},readField:ao,writeMessage(e,t,n){const a=e.getType();for(const s of a.fields.byNumber()){if(!$r(s,e)){if(s.req)throw new Error(`cannot encode field ${a.typeName}.${s.name} to binary: required field not set`);continue}const o=s.oneof?e[s.oneof.localName].value:e[s.localName];so(s,o,t,n)}return n.writeUnknownFields&&this.writeUnknownFields(e,t),t},writeField(e,t,n,a){t!==void 0&&so(e,t,n,a)}}}function ao(e,t,n,a,s){let{repeated:o,localName:r}=n;switch(n.oneof&&(e=e[n.oneof.localName],e.case!=r&&delete e.value,e.case=r,r="value"),n.kind){case"scalar":case"enum":const c=n.kind=="enum"?h.INT32:n.T;let l=wn;if(n.kind=="scalar"&&n.L>0&&(l=Vl),o){let y=e[r];if(a==X.LengthDelimited&&c!=h.STRING&&c!=h.BYTES){let f=t.uint32()+t.pos;for(;t.pos<f;)y.push(l(t,c))}else y.push(l(t,c))}else e[r]=l(t,c);break;case"message":const m=n.T;o?e[r].push(hn(t,new m,s,n)):dt(e[r])?hn(t,e[r],s,n):(e[r]=hn(t,new m,s,n),m.fieldWrapper&&!n.oneof&&!n.repeated&&(e[r]=m.fieldWrapper.unwrapField(e[r])));break;case"map":let[u,d]=Bl(n,t,s);e[r][u]=d;break}}function hn(e,t,n,a){const s=t.getType().runtime.bin,o=a==null?void 0:a.delimited;return s.readMessage(t,e,o?a.no:e.uint32(),n,o),t}function Bl(e,t,n){const a=t.uint32(),s=t.pos+a;let o,r;for(;t.pos<s;){const[c]=t.tag();switch(c){case 1:o=wn(t,e.K);break;case 2:switch(e.V.kind){case"scalar":r=wn(t,e.V.T);break;case"enum":r=t.int32();break;case"message":r=hn(t,new e.V.T,n,void 0);break}break}}if(o===void 0&&(o=Pt(e.K,et.BIGINT)),typeof o!="string"&&typeof o!="number"&&(o=o.toString()),r===void 0)switch(e.V.kind){case"scalar":r=Pt(e.V.T,et.BIGINT);break;case"enum":r=e.V.T.values[0].no;break;case"message":r=new e.V.T;break}return[o,r]}function Vl(e,t){const n=wn(e,t);return typeof n=="bigint"?n.toString():n}function wn(e,t){switch(t){case h.STRING:return e.string();case h.BOOL:return e.bool();case h.DOUBLE:return e.double();case h.FLOAT:return e.float();case h.INT32:return e.int32();case h.INT64:return e.int64();case h.UINT64:return e.uint64();case h.FIXED64:return e.fixed64();case h.BYTES:return e.bytes();case h.FIXED32:return e.fixed32();case h.SFIXED32:return e.sfixed32();case h.SFIXED64:return e.sfixed64();case h.SINT64:return e.sint64();case h.UINT32:return e.uint32();case h.SINT32:return e.sint32()}}function so(e,t,n,a){z(t!==void 0);const s=e.repeated;switch(e.kind){case"scalar":case"enum":let o=e.kind=="enum"?h.INT32:e.T;if(s)if(z(Array.isArray(t)),e.packed)xl(n,o,e.no,t);else for(const r of t)jt(n,o,e.no,r);else jt(n,o,e.no,t);break;case"message":if(s){z(Array.isArray(t));for(const r of t)oo(n,a,e,r)}else oo(n,a,e,t);break;case"map":z(typeof t=="object"&&t!=null);for(const[r,c]of Object.entries(t))ql(n,a,e,r,c);break}}function ql(e,t,n,a,s){e.tag(n.no,X.LengthDelimited),e.fork();let o=a;switch(n.K){case h.INT32:case h.FIXED32:case h.UINT32:case h.SFIXED32:case h.SINT32:o=Number.parseInt(a);break;case h.BOOL:z(a=="true"||a=="false"),o=a=="true";break}switch(jt(e,n.K,1,o),n.V.kind){case"scalar":jt(e,n.V.T,2,s);break;case"enum":jt(e,h.INT32,2,s);break;case"message":z(s!==void 0),e.tag(2,X.LengthDelimited).bytes(s.toBinary(t));break}e.join()}function oo(e,t,n,a){const s=Kr(n.T,a);n.delimited?e.tag(n.no,X.StartGroup).raw(s.toBinary(t)).tag(n.no,X.EndGroup):e.tag(n.no,X.LengthDelimited).bytes(s.toBinary(t))}function jt(e,t,n,a){z(a!==void 0);let[s,o]=Wr(t);e.tag(n,s)[o](a)}function xl(e,t,n,a){if(!a.length)return;e.tag(n,X.LengthDelimited).fork();let[,s]=Wr(t);for(let o=0;o<a.length;o++)e[s](a[o]);e.join()}function Wr(e){let t=X.Varint;switch(e){case h.BYTES:case h.STRING:t=X.LengthDelimited;break;case h.DOUBLE:case h.FIXED64:case h.SFIXED64:t=X.Bit64;break;case h.FIXED32:case h.SFIXED32:case h.FLOAT:t=X.Bit32;break}const n=h[e].toLowerCase();return[t,n]}function Hl(){return{setEnumType:Gr,initPartial(e,t){if(e===void 0)return;const n=t.getType();for(const a of n.fields.byMember()){const s=a.localName,o=t,r=e;if(r[s]!=null)switch(a.kind){case"oneof":const c=r[s].case;if(c===void 0)continue;const l=a.findField(c);let m=r[s].value;l&&l.kind=="message"&&!dt(m,l.T)?m=new l.T(m):l&&l.kind==="scalar"&&l.T===h.BYTES&&(m=xt(m)),o[s]={case:c,value:m};break;case"scalar":case"enum":let u=r[s];a.T===h.BYTES&&(u=a.repeated?u.map(xt):xt(u)),o[s]=u;break;case"map":switch(a.V.kind){case"scalar":case"enum":if(a.V.T===h.BYTES)for(const[T,f]of Object.entries(r[s]))o[s][T]=xt(f);else Object.assign(o[s],r[s]);break;case"message":const y=a.V.T;for(const T of Object.keys(r[s])){let f=r[s][T];y.fieldWrapper||(f=new y(f)),o[s][T]=f}break}break;case"message":const d=a.T;if(a.repeated)o[s]=r[s].map(y=>dt(y,d)?y:new d(y));else{const y=r[s];d.fieldWrapper?d.typeName==="google.protobuf.BytesValue"?o[s]=xt(y):o[s]=y:o[s]=dt(y,d)?y:new d(y)}break}}},equals(e,t,n){return t===n?!0:!t||!n?!1:e.fields.byMember().every(a=>{const s=t[a.localName],o=n[a.localName];if(a.repeated){if(s.length!==o.length)return!1;switch(a.kind){case"message":return s.every((r,c)=>a.T.equals(r,o[c]));case"scalar":return s.every((r,c)=>Je(a.T,r,o[c]));case"enum":return s.every((r,c)=>Je(h.INT32,r,o[c]))}throw new Error(`repeated cannot contain ${a.kind}`)}switch(a.kind){case"message":return a.T.equals(s,o);case"enum":return Je(h.INT32,s,o);case"scalar":return Je(a.T,s,o);case"oneof":if(s.case!==o.case)return!1;const r=a.findField(s.case);if(r===void 0)return!0;switch(r.kind){case"message":return r.T.equals(s.value,o.value);case"enum":return Je(h.INT32,s.value,o.value);case"scalar":return Je(r.T,s.value,o.value)}throw new Error(`oneof cannot contain ${r.kind}`);case"map":const c=Object.keys(s).concat(Object.keys(o));switch(a.V.kind){case"message":const l=a.V.T;return c.every(u=>l.equals(s[u],o[u]));case"enum":return c.every(u=>Je(h.INT32,s[u],o[u]));case"scalar":const m=a.V.T;return c.every(u=>Je(m,s[u],o[u]))}break}})},clone(e){const t=e.getType(),n=new t,a=n;for(const s of t.fields.byMember()){const o=e[s.localName];let r;if(s.repeated)r=o.map(rn);else if(s.kind=="map"){r=a[s.localName];for(const[c,l]of Object.entries(o))r[c]=rn(l)}else s.kind=="oneof"?r=s.findField(o.case)?{case:o.case,value:rn(o.value)}:{case:void 0}:r=rn(o);a[s.localName]=r}for(const s of t.runtime.bin.listUnknownFields(e))t.runtime.bin.onUnknownField(a,s.no,s.wireType,s.data);return n}}}function rn(e){if(e===void 0)return e;if(dt(e))return e.clone();if(e instanceof Uint8Array){const t=new Uint8Array(e.byteLength);return t.set(e),t}return e}function xt(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function Ql(e,t,n){return{syntax:e,json:Pl(),bin:Gl(),util:Object.assign(Object.assign({},Hl()),{newFieldList:t,initFields:n}),makeMessageType(a,s,o){return kl(this,a,s,o)},makeEnum:gl,makeEnumType:Br,getEnumType:fl,makeExtension(a,s,o){return Ol(this,a,s,o)}}}class Yl{constructor(t,n){this._fields=t,this._normalizer=n}findJsonName(t){if(!this.jsonNames){const n={};for(const a of this.list())n[a.jsonName]=n[a.name]=a;this.jsonNames=n}return this.jsonNames[t]}find(t){if(!this.numbers){const n={};for(const a of this.list())n[a.no]=a;this.numbers=n}return this.numbers[t]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((t,n)=>t.no-n.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const t=this.members;let n;for(const a of this.list())a.oneof?a.oneof!==n&&(n=a.oneof,t.push(n)):t.push(a)}return this.members}}function zr(e,t){const n=Jr(e);return t?n:Jl(zl(n))}function jl(e){return zr(e,!1)}const $l=Jr;function Jr(e){let t=!1;const n=[];for(let a=0;a<e.length;a++){let s=e.charAt(a);switch(s){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(s),t=!1;break;default:t&&(t=!1,s=s.toUpperCase()),n.push(s);break}}return n.join("")}const Kl=new Set(["constructor","toString","toJSON","valueOf"]),Wl=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),Xr=e=>`${e}$`,zl=e=>Wl.has(e)?Xr(e):e,Jl=e=>Kl.has(e)?Xr(e):e;class Xl{constructor(t){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=t,this.localName=jl(t)}addField(t){z(t.oneof===this,`field ${t.name} not one of ${this.name}`),this.fields.push(t)}findField(t){if(!this._lookup){this._lookup=Object.create(null);for(let n=0;n<this.fields.length;n++)this._lookup[this.fields[n].localName]=this.fields[n]}return this._lookup[t]}}function Zl(e,t){var n,a,s,o,r,c;const l=[];let m;for(const u of typeof e=="function"?e():e){const d=u;if(d.localName=zr(u.name,u.oneof!==void 0),d.jsonName=(n=u.jsonName)!==null&&n!==void 0?n:$l(u.name),d.repeated=(a=u.repeated)!==null&&a!==void 0?a:!1,u.kind=="scalar"&&(d.L=(s=u.L)!==null&&s!==void 0?s:et.BIGINT),d.delimited=(o=u.delimited)!==null&&o!==void 0?o:!1,d.req=(r=u.req)!==null&&r!==void 0?r:!1,d.opt=(c=u.opt)!==null&&c!==void 0?c:!1,u.packed===void 0&&(d.packed=u.kind=="enum"||u.kind=="scalar"&&u.T!=h.BYTES&&u.T!=h.STRING),u.oneof!==void 0){const y=typeof u.oneof=="string"?u.oneof:u.oneof.name;(!m||m.name!=y)&&(m=new Xl(y)),d.oneof=m,m.addField(d)}l.push(d)}return l}const i=Ql("proto3",e=>new Yl(e,t=>Zl(t)),e=>{for(const t of e.getType().fields.byMember()){if(t.opt)continue;const n=t.localName,a=e;if(t.repeated){a[n]=[];continue}switch(t.kind){case"oneof":a[n]={case:void 0};break;case"enum":a[n]=0;break;case"map":a[n]={};break;case"scalar":a[n]=Pt(t.T,t.L);break}}});var R;(function(e){e[e.Unary=0]="Unary",e[e.ServerStreaming=1]="ServerStreaming",e[e.ClientStreaming=2]="ClientStreaming",e[e.BiDiStreaming=3]="BiDiStreaming"})(R||(R={}));var ro;(function(e){e[e.NoSideEffects=1]="NoSideEffects",e[e.Idempotent=2]="Idempotent"})(ro||(ro={}));class Te extends Zt{constructor(t){super(),this.seconds=pe.zero,this.nanos=0,i.util.initPartial(t,this)}fromJson(t,n){if(typeof t!="string")throw new Error(`cannot decode google.protobuf.Timestamp from JSON: ${i.json.debug(t)}`);const a=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!a)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const s=Date.parse(a[1]+"-"+a[2]+"-"+a[3]+"T"+a[4]+":"+a[5]+":"+a[6]+(a[8]?a[8]:"Z"));if(Number.isNaN(s))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=pe.parse(s/1e3),this.nanos=0,a[7]&&(this.nanos=parseInt("1"+a[7]+"0".repeat(9-a[7].length))-1e9),this}toJson(t){const n=Number(this.seconds)*1e3;if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let a="Z";if(this.nanos>0){const s=(this.nanos+1e9).toString().substring(1);s.substring(3)==="000000"?a="."+s.substring(0,3)+"Z":s.substring(6)==="000"?a="."+s.substring(0,6)+"Z":a="."+s+"Z"}return new Date(n).toISOString().replace(".000Z",a)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return Te.fromDate(new Date)}static fromDate(t){const n=t.getTime();return new Te({seconds:pe.parse(Math.floor(n/1e3)),nanos:n%1e3*1e6})}static fromBinary(t,n){return new Te().fromBinary(t,n)}static fromJson(t,n){return new Te().fromJson(t,n)}static fromJsonString(t,n){return new Te().fromJsonString(t,n)}static equals(t,n){return i.util.equals(Te,t,n)}}Te.runtime=i;Te.typeName="google.protobuf.Timestamp";Te.fields=i.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);class De extends Zt{constructor(t){super(),this.typeUrl="",this.value=new Uint8Array(0),i.util.initPartial(t,this)}toJson(t){var n;if(this.typeUrl==="")return{};const a=this.typeUrlToName(this.typeUrl),s=(n=t==null?void 0:t.typeRegistry)===null||n===void 0?void 0:n.findMessage(a);if(!s)throw new Error(`cannot encode message google.protobuf.Any to JSON: "${this.typeUrl}" is not in the type registry`);let r=s.fromBinary(this.value).toJson(t);return(a.startsWith("google.protobuf.")||r===null||Array.isArray(r)||typeof r!="object")&&(r={value:r}),r["@type"]=this.typeUrl,r}fromJson(t,n){var a;if(t===null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message google.protobuf.Any from JSON: expected object but got ${t===null?"null":Array.isArray(t)?"array":typeof t}`);if(Object.keys(t).length==0)return this;const s=t["@type"];if(typeof s!="string"||s=="")throw new Error('cannot decode message google.protobuf.Any from JSON: "@type" is empty');const o=this.typeUrlToName(s),r=(a=n==null?void 0:n.typeRegistry)===null||a===void 0?void 0:a.findMessage(o);if(!r)throw new Error(`cannot decode message google.protobuf.Any from JSON: ${s} is not in the type registry`);let c;if(o.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(t,"value"))c=r.fromJson(t.value,n);else{const l=Object.assign({},t);delete l["@type"],c=r.fromJson(l,n)}return this.packFrom(c),this}packFrom(t){this.value=t.toBinary(),this.typeUrl=this.typeNameToUrl(t.getType().typeName)}unpackTo(t){return this.is(t.getType())?(t.fromBinary(this.value),!0):!1}unpack(t){if(this.typeUrl==="")return;const n=t.findMessage(this.typeUrlToName(this.typeUrl));if(n)return n.fromBinary(this.value)}is(t){if(this.typeUrl==="")return!1;const n=this.typeUrlToName(this.typeUrl);let a="";return typeof t=="string"?a=t:a=t.typeName,n===a}typeNameToUrl(t){return`type.googleapis.com/${t}`}typeUrlToName(t){if(!t.length)throw new Error(`invalid type url: ${t}`);const n=t.lastIndexOf("/"),a=n>=0?t.substring(n+1):t;if(!a.length)throw new Error(`invalid type url: ${t}`);return a}static pack(t){const n=new De;return n.packFrom(t),n}static fromBinary(t,n){return new De().fromBinary(t,n)}static fromJson(t,n){return new De().fromJson(t,n)}static fromJsonString(t,n){return new De().fromJsonString(t,n)}static equals(t,n){return i.util.equals(De,t,n)}}De.runtime=i;De.typeName="google.protobuf.Any";De.fields=i.util.newFieldList(()=>[{no:1,name:"type_url",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:12}]);const em=i.makeEnum("streamlayer.analytics.v1.common.ResultStatus",[{no:0,name:"RESULT_STATUS_UNSET",localName:"UNSET"},{no:1,name:"RESULT_STATUS_OK",localName:"OK"},{no:2,name:"RESULT_STATUS_ERROR",localName:"ERROR"}]),re=i.makeEnum("streamlayer.analytics.v1.common.Kind",[{no:0,name:"KIND_UNSET",localName:"UNSET"},{no:1,name:"KIND_VIEWERS",localName:"VIEWERS"},{no:2,name:"KIND_EVENT_OPENED",localName:"EVENT_OPENED"},{no:3,name:"KIND_AUTHENTICATION_ATTEMPTED",localName:"AUTHENTICATION_ATTEMPTED"},{no:4,name:"KIND_AUTHENTICATION_COMPLETED",localName:"AUTHENTICATION_COMPLETED"},{no:5,name:"KIND_LAUNCH_BUTTON",localName:"LAUNCH_BUTTON"},{no:6,name:"KIND_PERMISSION_PROVIDED",localName:"PERMISSION_PROVIDED"},{no:7,name:"KIND_PERMISSION_NOT_PROVIDED",localName:"PERMISSION_NOT_PROVIDED"},{no:8,name:"KIND_INTERACTIONS",localName:"INTERACTIONS"},{no:9,name:"KIND_CONVERSATION_CREATED",localName:"CONVERSATION_CREATED"},{no:10,name:"KIND_CONVERSATION_JOINED",localName:"CONVERSATION_JOINED"},{no:11,name:"KIND_CONVERSATION_DELETED",localName:"CONVERSATION_DELETED"},{no:12,name:"KIND_NEW_CALL",localName:"NEW_CALL"},{no:13,name:"KIND_CALL_JOINED",localName:"CALL_JOINED"},{no:14,name:"KIND_CALL_FINISHED",localName:"CALL_FINISHED"},{no:15,name:"KIND_INVITATION_SENT",localName:"INVITATION_SENT"},{no:16,name:"KIND_INVITATION_ACCEPTED",localName:"INVITATION_ACCEPTED"},{no:17,name:"KIND_WAVES_SENT",localName:"WAVES_SENT"},{no:18,name:"KIND_WAVES_REPLIES",localName:"WAVES_REPLIES"},{no:19,name:"KIND_NOTIFICATION_RECEIVED",localName:"NOTIFICATION_RECEIVED"},{no:20,name:"KIND_NOTIFICATION_OPENED",localName:"NOTIFICATION_OPENED"},{no:21,name:"KIND_SESSION_HEARTBEAT",localName:"SESSION_HEARTBEAT"},{no:22,name:"KIND_CONVERSATION_OPENED",localName:"CONVERSATION_OPENED"},{no:23,name:"KIND_GROUP_CONVERSATION_OPENED",localName:"GROUP_CONVERSATION_OPENED"},{no:24,name:"KIND_GROUP_CALL_JOINED",localName:"GROUP_CALL_JOINED"},{no:25,name:"KIND_POLLS_VOTE",localName:"POLLS_VOTE"},{no:26,name:"KIND_POLLS_RECEIVED",localName:"POLLS_RECEIVED"},{no:27,name:"KIND_POLLS_OPENED",localName:"POLLS_OPENED"},{no:28,name:"KIND_GAMES_JOINED",localName:"GAMES_JOINED"},{no:29,name:"KIND_BUTTON_INITIALIZED",localName:"BUTTON_INITIALIZED"},{no:30,name:"KIND_POLLS_NAVIGATED",localName:"POLLS_NAVIGATED"},{no:31,name:"KIND_AD_VIDEO_PLAYED",localName:"AD_VIDEO_PLAYED"},{no:32,name:"KIND_AD_BUTTON_NAVIGATED",localName:"AD_BUTTON_NAVIGATED"},{no:33,name:"KIND_AD_BANNER_NAVIGATED",localName:"AD_BANNER_NAVIGATED"}]),me=i.makeEnum("streamlayer.analytics.v1.common.Category",[{no:0,name:"CATEGORY_UNSET",localName:"UNSET"},{no:1,name:"CATEGORY_STATS_HOME",localName:"STATS_HOME"},{no:2,name:"CATEGORY_STATS",localName:"STATS"},{no:3,name:"CATEGORY_TWITTER_HOME",localName:"TWITTER_HOME"},{no:4,name:"CATEGORY_TWITTER",localName:"TWITTER"},{no:5,name:"CATEGORY_MESSAGING_HOME",localName:"MESSAGING_HOME"},{no:6,name:"CATEGORY_MESSAGING",localName:"MESSAGING"},{no:7,name:"CATEGORY_CALLING_HOME",localName:"CALLING_HOME"},{no:8,name:"CATEGORY_CALLING",localName:"CALLING"},{no:9,name:"CATEGORY_PROFILE_HOME",localName:"PROFILE_HOME"},{no:10,name:"CATEGORY_PROFILE",localName:"PROFILE"},{no:11,name:"CATEGORY_WHOISWATCHING",localName:"WHOISWATCHING"},{no:12,name:"CATEGORY_WHOISWATCHING_HOME",localName:"WHOISWATCHING_HOME"},{no:13,name:"CATEGORY_INTERSTITIAL",localName:"INTERSTITIAL"},{no:14,name:"CATEGORY_BETTING",localName:"BETTING"},{no:15,name:"CATEGORY_BETTING_HOME",localName:"BETTING_HOME"},{no:16,name:"CATEGORY_INPLAY",localName:"INPLAY"},{no:17,name:"CATEGORY_INPLAY_HOME",localName:"INPLAY_HOME"},{no:18,name:"CATEGORY_MERCHANDISE",localName:"MERCHANDISE"},{no:19,name:"CATEGORY_MERCHANDISE_HOME",localName:"MERCHANDISE_HOME"},{no:20,name:"CATEGORY_CONTESTS",localName:"CONTESTS"},{no:21,name:"CATEGORY_CONTESTS_HOME",localName:"CONTESTS_HOME"},{no:22,name:"CATEGORY_TICKETS",localName:"TICKETS"},{no:23,name:"CATEGORY_TICKETS_HOME",localName:"TICKETS_HOME"},{no:24,name:"CATEGORY_INVITATION",localName:"INVITATION"},{no:25,name:"CATEGORY_INVITATION_HOME",localName:"INVITATION_HOME"},{no:26,name:"CATEGORY_POLLS",localName:"POLLS"},{no:27,name:"CATEGORY_POLLS_HOME",localName:"POLLS_HOME"},{no:28,name:"CATEGORY_FANTASY",localName:"FANTASY"},{no:29,name:"CATEGORY_WP",localName:"WP"},{no:30,name:"CATEGORY_HIGHLIGHTS_HOME",localName:"HIGHLIGHTS_HOME"},{no:31,name:"CATEGORY_HIGHLIGHTS",localName:"HIGHLIGHTS"},{no:32,name:"CATEGORY_PUBLIC_CHAT_HOME",localName:"PUBLIC_CHAT_HOME"},{no:33,name:"CATEGORY_PUBLIC_CHAT",localName:"PUBLIC_CHAT"}]),Ga=i.makeEnum("streamlayer.analytics.v1.common.ScreenOrientation",[{no:0,name:"SCREEN_ORIENTATION_UNSET",localName:"UNSET"},{no:1,name:"SCREEN_ORIENTATION_PORTRAIT",localName:"PORTRAIT"},{no:2,name:"SCREEN_ORIENTATION_LANDSCAPE",localName:"LANDSCAPE"}]),ae=i.makeEnum("streamlayer.analytics.v1.common.TopicType",[{no:0,name:"TOPIC_TYPE_UNSET",localName:"UNSET"},{no:1,name:"TOPIC_TYPE_CALL",localName:"CALL"},{no:2,name:"TOPIC_TYPE_CHAT",localName:"CHAT"},{no:3,name:"TOPIC_TYPE_FANTASY",localName:"FANTASY"},{no:4,name:"TOPIC_TYPE_POLLS",localName:"POLLS"},{no:5,name:"TOPIC_TYPE_POLLS_POLL",localName:"POLLS_POLL"},{no:6,name:"TOPIC_TYPE_POLLS_TRIVIA",localName:"POLLS_TRIVIA"},{no:7,name:"TOPIC_TYPE_POLLS_PREDICTION",localName:"POLLS_PREDICTION"},{no:8,name:"TOPIC_TYPE_POLLS_INSIGHT",localName:"POLLS_INSIGHT"},{no:9,name:"TOPIC_TYPE_POLLS_TWITTER",localName:"POLLS_TWITTER"},{no:10,name:"TOPIC_TYPE_LINK",localName:"LINK"},{no:11,name:"TOPIC_TYPE_MESSAGE",localName:"MESSAGE"},{no:12,name:"TOPIC_TYPE_POLLS_PROMOTION",localName:"POLLS_PROMOTION"},{no:13,name:"TOPIC_TYPE_PUBLIC_CHAT",localName:"PUBLIC_CHAT"}]),Re=i.makeEnum("streamlayer.analytics.v1.common.TopicSubType",[{no:0,name:"TOPIC_SUB_TYPE_UNSET",localName:"UNSET"},{no:1,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB21",localName:"PROMOTION_INGAME_IAB21"},{no:2,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB11",localName:"PROMOTION_INGAME_IAB11"},{no:3,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB61",localName:"PROMOTION_INGAME_IAB61"},{no:4,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB21_LBAR",localName:"PROMOTION_INGAME_IAB21_LBAR"},{no:5,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB11_LBAR",localName:"PROMOTION_INGAME_IAB11_LBAR"},{no:6,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB21_LBAR_ADDITIONAL",localName:"PROMOTION_INGAME_IAB21_LBAR_ADDITIONAL"},{no:7,name:"TOPIC_SUB_TYPE_PROMOTION_INGAME_IAB11_LBAR_ADDITIONAL",localName:"PROMOTION_INGAME_IAB11_LBAR_ADDITIONAL"},{no:8,name:"TOPIC_SUB_TYPE_PROMOTION_GAM",localName:"PROMOTION_GAM"}]),_e=i.makeEnum("streamlayer.analytics.v1.common.PollOpenedFrom",[{no:0,name:"POLL_OPENED_FROM_UNSET",localName:"UNSET"},{no:1,name:"POLL_OPENED_FROM_IN_APP",localName:"IN_APP"},{no:2,name:"POLL_OPENED_FROM_HISTORY",localName:"HISTORY"},{no:3,name:"POLL_OPENED_FROM_PICK_HISTORY",localName:"PICK_HISTORY"},{no:4,name:"POLL_OPENED_FROM_INSIGHT_HISTORY",localName:"INSIGHT_HISTORY"},{no:5,name:"POLL_OPENED_FROM_TWEETS_HISTORY",localName:"TWEETS_HISTORY"},{no:6,name:"POLL_OPENED_FROM_PROMOTION_HISTORY",localName:"PROMOTION_HISTORY"}]),tm=i.makeMessageType("streamlayer.social.TweetHashtags",()=>[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"indices",kind:"scalar",T:5,repeated:!0}]),nm=i.makeMessageType("streamlayer.social.TweetUrls",()=>[{no:1,name:"url",kind:"scalar",T:9},{no:2,name:"display_url",kind:"scalar",T:9},{no:3,name:"expanded_url",kind:"scalar",T:9},{no:4,name:"indices",kind:"scalar",T:5,repeated:!0}]),am=i.makeMessageType("streamlayer.social.TweetMedia",()=>[{no:1,name:"id",kind:"scalar",T:3},{no:2,name:"id_str",kind:"scalar",T:9},{no:3,name:"type",kind:"scalar",T:9},{no:4,name:"url",kind:"scalar",T:9},{no:5,name:"media_url",kind:"scalar",T:9},{no:6,name:"display_url",kind:"scalar",T:9},{no:7,name:"expanded_url",kind:"scalar",T:9},{no:8,name:"media_url_https",kind:"scalar",T:9},{no:9,name:"source_user_id",kind:"scalar",T:3},{no:10,name:"source_user_id_str",kind:"scalar",T:9},{no:11,name:"source_status_id",kind:"scalar",T:3},{no:12,name:"source_status_id_str",kind:"scalar",T:9},{no:13,name:"sizes",kind:"message",T:Zr},{no:14,name:"indices",kind:"scalar",T:5,repeated:!0}]),sm=i.makeMessageType("streamlayer.social.TweetExtendedMedia",()=>[{no:1,name:"id",kind:"scalar",T:3},{no:2,name:"id_str",kind:"scalar",T:9},{no:3,name:"type",kind:"scalar",T:9},{no:4,name:"url",kind:"scalar",T:9},{no:5,name:"media_url",kind:"scalar",T:9},{no:6,name:"display_url",kind:"scalar",T:9},{no:7,name:"expanded_url",kind:"scalar",T:9},{no:8,name:"media_url_https",kind:"scalar",T:9},{no:9,name:"sizes",kind:"message",T:Zr},{no:10,name:"indices",kind:"scalar",T:5,repeated:!0},{no:11,name:"video_info",kind:"message",T:rm},{no:12,name:"additional_media_info",kind:"message",T:om}]),om=i.makeMessageType("streamlayer.social.TweetExtendedMedia.TweetAdditionalMediaInfo",()=>[{no:1,name:"title",kind:"scalar",T:9},{no:2,name:"description",kind:"scalar",T:9},{no:3,name:"embeddable",kind:"scalar",T:8},{no:4,name:"monetizable",kind:"scalar",T:8}],{localName:"TweetExtendedMedia_TweetAdditionalMediaInfo"}),rm=i.makeMessageType("streamlayer.social.TweetMediaVideoInfo",()=>[{no:1,name:"aspect_ratio",kind:"scalar",T:5,repeated:!0},{no:2,name:"duration_millis",kind:"scalar",T:5},{no:3,name:"variants",kind:"message",T:im,repeated:!0}]),im=i.makeMessageType("streamlayer.social.TweetMediaVideoInfo.TweetVideoVariants",()=>[{no:1,name:"bitrate",kind:"scalar",T:5},{no:2,name:"content_type",kind:"scalar",T:9},{no:3,name:"url",kind:"scalar",T:9}],{localName:"TweetMediaVideoInfo_TweetVideoVariants"}),Zr=i.makeMessageType("streamlayer.social.TweetMediaSizes",()=>[{no:1,name:"thumb",kind:"message",T:cn},{no:2,name:"large",kind:"message",T:cn},{no:3,name:"medium",kind:"message",T:cn},{no:4,name:"small",kind:"message",T:cn}]),cn=i.makeMessageType("streamlayer.social.TweetMediaSize",()=>[{no:1,name:"w",kind:"scalar",T:5},{no:2,name:"h",kind:"scalar",T:5},{no:3,name:"resize",kind:"scalar",T:9}]),cm=i.makeMessageType("streamlayer.social.TweetUserMentions",()=>[{no:1,name:"id",kind:"scalar",T:3},{no:2,name:"id_str",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"screen_name",kind:"scalar",T:9},{no:5,name:"indices",kind:"scalar",T:5,repeated:!0}]),lm=i.makeMessageType("streamlayer.social.TweetSymbol",()=>[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"indices",kind:"scalar",T:5,repeated:!0}]),mm=i.makeMessageType("streamlayer.social.TweetPoll",()=>[{no:1,name:"duration_minutes",kind:"scalar",T:9},{no:2,name:"end_datetime",kind:"scalar",T:9},{no:3,name:"options",kind:"message",T:um,repeated:!0}]),um=i.makeMessageType("streamlayer.social.TweetPoll.TweetPollOption",()=>[{no:1,name:"position",kind:"scalar",T:5},{no:2,name:"text",kind:"scalar",T:9}],{localName:"TweetPoll_TweetPollOption"}),dm=i.makeMessageType("streamlayer.social.TweetMetadata",()=>[{no:1,name:"id_str",kind:"scalar",T:9},{no:2,name:"account",kind:"scalar",T:9},{no:3,name:"account_id",kind:"scalar",T:9},{no:4,name:"account_image",kind:"scalar",T:9},{no:8,name:"account_name",kind:"scalar",T:9},{no:9,name:"account_verified",kind:"scalar",T:8},{no:5,name:"retweeted_status",kind:"message",T:ds},{no:6,name:"entities",kind:"message",T:pm},{no:7,name:"extended_entities",kind:"message",T:Tm},{no:10,name:"retweet_count",kind:"scalar",T:4},{no:11,name:"favorite_count",kind:"scalar",T:4}]),pm=i.makeMessageType("streamlayer.social.TweetMetadata.TweetEntities",()=>[{no:1,name:"urls",kind:"message",T:nm,repeated:!0},{no:2,name:"hashtags",kind:"message",T:tm,repeated:!0},{no:3,name:"media",kind:"message",T:am,repeated:!0},{no:4,name:"user_mentions",kind:"message",T:cm,repeated:!0},{no:5,name:"symbols",kind:"message",T:lm,repeated:!0},{no:6,name:"polls",kind:"message",T:mm,repeated:!0}],{localName:"TweetMetadata_TweetEntities"}),Tm=i.makeMessageType("streamlayer.social.TweetMetadata.TweetExtendedEntities",()=>[{no:1,name:"media",kind:"message",T:sm,repeated:!0}],{localName:"TweetMetadata_TweetExtendedEntities"}),ds=i.makeMessageType("streamlayer.social.Tweet",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"date",kind:"scalar",T:9},{no:3,name:"text",kind:"scalar",T:9},{no:4,name:"meta",kind:"message",T:dm}]),P=i.makeEnum("streamlayer.interactive.QuestionType",[{no:0,name:"QUESTION_TYPE_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_TYPE_POLL",localName:"POLL"},{no:2,name:"QUESTION_TYPE_TRIVIA",localName:"TRIVIA"},{no:3,name:"QUESTION_TYPE_PREDICTION",localName:"PREDICTION"},{no:4,name:"QUESTION_TYPE_FACTOID",localName:"FACTOID"},{no:5,name:"QUESTION_TYPE_TWEET",localName:"TWEET"},{no:6,name:"QUESTION_TYPE_PROMOTION",localName:"PROMOTION"}]),ym=i.makeEnum("streamlayer.interactive.QuestionSource",[{no:0,name:"QUESTION_SOURCE_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_SOURCE_AI",localName:"AI"},{no:2,name:"QUESTION_SOURCE_CSV_IMPORT",localName:"CSV_IMPORT"}]),oe=i.makeEnum("streamlayer.interactive.QuestionStatus",[{no:0,name:"QUESTION_STATUS_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_STATUS_NOT_SCHEDULED",localName:"NOT_SCHEDULED"},{no:2,name:"QUESTION_STATUS_SCHEDULED",localName:"SCHEDULED"},{no:3,name:"QUESTION_STATUS_ACTIVE",localName:"ACTIVE"},{no:4,name:"QUESTION_STATUS_RESOLVED",localName:"RESOLVED"}]),fm=i.makeEnum("streamlayer.interactive.QuestionPosition",[{no:0,name:"QUESTION_POSITION_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_POSITION_DEFAULT",localName:"DEFAULT"},{no:2,name:"QUESTION_POSITION_FIXED_BOTTOM",localName:"FIXED_BOTTOM"}]),gm=i.makeEnum("streamlayer.interactive.QuestionLayout",[{no:0,name:"QUESTION_LAYOUT_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_LAYOUT_LIST_VIEW",localName:"LIST_VIEW"},{no:2,name:"QUESTION_LAYOUT_GRID_VIEW",localName:"GRID_VIEW"}]),ot=i.makeEnum("streamlayer.interactive.QuestionImages",[{no:0,name:"QUESTION_IMAGES_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_IMAGES_NONE",localName:"NONE"},{no:2,name:"QUESTION_IMAGES_ROUNDED",localName:"ROUNDED"},{no:3,name:"QUESTION_IMAGES_TRANSPARENT",localName:"TRANSPARENT"},{no:4,name:"QUESTION_IMAGES_CENTERED",localName:"CENTERED"}]),ei=i.makeEnum("streamlayer.interactive.NotificationPromotionMode",[{no:0,name:"NOTIFICATION_PROMOTION_MODE_UNSET",localName:"UNSET"},{no:1,name:"NOTIFICATION_PROMOTION_MODE_CLASSIC",localName:"CLASSIC"},{no:2,name:"NOTIFICATION_PROMOTION_MODE_LOWER_THIRD",localName:"LOWER_THIRD"},{no:3,name:"NOTIFICATION_PROMOTION_MODE_RICH_NOTIFICATION",localName:"RICH_NOTIFICATION"}]),ti=i.makeEnum("streamlayer.interactive.NotificationPromotionImagePosition",[{no:0,name:"NOTIFICATION_PROMOTION_IMAGE_POSITION_UNSET",localName:"UNSET"},{no:1,name:"NOTIFICATION_PROMOTION_IMAGE_POSITION_FIT",localName:"FIT"},{no:2,name:"NOTIFICATION_PROMOTION_IMAGE_POSITION_CENTERED",localName:"CENTERED"},{no:3,name:"NOTIFICATION_PROMOTION_IMAGE_POSITION_BOTTOM",localName:"BOTTOM"},{no:4,name:"NOTIFICATION_PROMOTION_IMAGE_POSITION_SOLID",localName:"SOLID"},{no:5,name:"NOTIFICATION_PROMOTION_IMAGE_POSITION_MIDDLE",localName:"MIDDLE"}]),ni=i.makeEnum("streamlayer.interactive.NotificationSponsorLogoMode",[{no:0,name:"NOTIFICATION_SPONSOR_LOGO_UNSET"},{no:1,name:"NOTIFICATION_SPONSOR_LOGO_NONE"},{no:2,name:"NOTIFICATION_SPONSOR_LOGO_TRANSPARENT"}]),ai=i.makeEnum("streamlayer.interactive.CtaIconMode",[{no:0,name:"CTA_ICON_UNSET"},{no:1,name:"CTA_ICON_NONE"},{no:2,name:"CTA_ICON_TRANSPARENT"}]),si=i.makeEnum("streamlayer.interactive.ImagePosition",[{no:0,name:"IMAGE_POSITION_UNSET",localName:"UNSET"},{no:1,name:"IMAGE_POSITION_LEFT",localName:"LEFT"},{no:2,name:"IMAGE_POSITION_RIGHT",localName:"RIGHT"}]),he=i.makeEnum("streamlayer.interactive.PromotionType",[{no:0,name:"PROMOTION_TYPE_UNSET",localName:"UNSET"},{no:1,name:"PROMOTION_TYPE_INGAME_IAB21",localName:"INGAME_IAB21"},{no:2,name:"PROMOTION_TYPE_INGAME_IAB11",localName:"INGAME_IAB11"},{no:3,name:"PROMOTION_TYPE_INGAME_IAB61",localName:"INGAME_IAB61"},{no:4,name:"PROMOTION_TYPE_INGAME_IAB11_LBAR",localName:"INGAME_IAB11_LBAR"},{no:5,name:"PROMOTION_TYPE_INGAME_IAB21_LBAR",localName:"INGAME_IAB21_LBAR"},{no:6,name:"PROMOTION_TYPE_EXTERNAL_AD",localName:"EXTERNAL_AD"}]),km=i.makeEnum("streamlayer.interactive.PromotionWallet",[{no:0,name:"PROMOTION_WALLET_UNSET",localName:"UNSET"},{no:1,name:"PROMOTION_WALLET_ENABLED",localName:"ENABLED"},{no:2,name:"PROMOTION_WALLET_DISABLED",localName:"DISABLED"}]),oi=i.makeEnum("streamlayer.interactive.PromotionButtonType",[{no:0,name:"PROMOTION_BUTTON_TYPE_UNSET",localName:"UNSET"},{no:1,name:"PROMOTION_BUTTON_TYPE_BASIC",localName:"BASIC"},{no:3,name:"PROMOTION_BUTTON_TYPE_ADD_TO_WALLET",localName:"ADD_TO_WALLET"},{no:4,name:"PROMOTION_BUTTON_TYPE_RETURN_TO_VIDEO",localName:"RETURN_TO_VIDEO"},{no:5,name:"PROMOTION_BUTTON_TYPE_NO_BUTTON",localName:"NO_BUTTON"}]),ri=i.makeEnum("streamlayer.interactive.PromotionLogoMode",[{no:0,name:"PROMOTION_LOGO_MODE_UNSET",localName:"UNSET"},{no:1,name:"PROMOTION_LOGO_MODE_LEFT",localName:"LEFT"},{no:2,name:"PROMOTION_LOGO_MODE_CENTER",localName:"CENTER"},{no:3,name:"PROMOTION_LOGO_MODE_MINMAL",localName:"MINMAL"}]),ii=i.makeEnum("streamlayer.interactive.UseAsNotification",[{no:0,name:"USE_AS_NOTIFICATION_UNSET",localName:"UNSET"},{no:1,name:"USE_AS_NOTIFICATION_ENABLED",localName:"ENABLED"},{no:2,name:"USE_AS_NOTIFICATION_DISABLED",localName:"DISABLED"}]),Rn=i.makeEnum("streamlayer.interactive.NotificationEnabled",[{no:0,name:"NOTIFICATION_ENABLED_UNSET"},{no:1,name:"NOTIFICATION_ENABLED"},{no:2,name:"NOTIFICATION_DISABLED"}]),ci=i.makeEnum("streamlayer.interactive.CloseTimerAuto",[{no:0,name:"CLOSE_TIMER_AUTO_UNSET",localName:"UNSET"},{no:1,name:"CLOSE_TIMER_AUTO_ENABLED",localName:"ENABLED"},{no:2,name:"CLOSE_TIMER_AUTO_DISABLED",localName:"DISABLED"}]),Hn=i.makeEnum("streamlayer.interactive.AutoPlayVideo",[{no:0,name:"AUTO_PLAY_VIDEO_UNSET",localName:"UNSET"},{no:1,name:"AUTO_PLAY_VIDEO_ENABLED",localName:"ENABLED"},{no:2,name:"AUTO_PLAY_VIDEO_DISABLED",localName:"DISABLED"}]),hm=i.makeEnum("streamlayer.interactive.QuestionAutoPostState",[{no:0,name:"QUESTION_AUTO_POST_STATE_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_AUTO_POST_STATE_ON",localName:"ON"},{no:2,name:"QUESTION_AUTO_POST_STATE_OFF",localName:"OFF"},{no:3,name:"QUESTION_AUTO_POST_STATE_PAUSED",localName:"PAUSED"},{no:4,name:"QUESTION_AUTO_POST_STATE_IDLE",localName:"IDLE"},{no:5,name:"QUESTION_AUTO_POST_STATE_RESET",localName:"RESET"}]),Sm=i.makeEnum("streamlayer.interactive.QuestionAutoPostStart",[{no:0,name:"QUESTION_AUTO_POST_START_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_AUTO_POST_START_SCHEDULE",localName:"SCHEDULE"},{no:2,name:"QUESTION_AUTO_POST_START_NOW",localName:"NOW"}]),_m=i.makeEnum("streamlayer.interactive.QuestionSkipReason",[{no:0,name:"QUESTION_SKIP_REASON_UNSET",localName:"UNSET"},{no:1,name:"QUESTION_SKIP_REASON_OVERDUE",localName:"OVERDUE"}]),li=i.makeEnum("streamlayer.interactive.SilenceSetting",[{no:0,name:"SILENCE_SETTING_UNSET",localName:"UNSET"},{no:1,name:"SILENCE_SETTING_ON",localName:"ON"},{no:2,name:"SILENCE_SETTING_OFF",localName:"OFF"}]),Em=i.makeEnum("streamlayer.interactive.ImportStatus",[{no:0,name:"IMPORT_STATUS_UNSET",localName:"UNSET"},{no:1,name:"IMPORT_STATUS_PLANNED",localName:"PLANNED"},{no:2,name:"IMPORT_STATUS_RUNNING",localName:"RUNNING"},{no:3,name:"IMPORT_STATUS_COMPLETED",localName:"COMPLETED"},{no:4,name:"IMPORT_STATUS_FAILED",localName:"FAILED"}]),ps=i.makeMessageType("streamlayer.interactive.CloseTimer",()=>[{no:1,name:"auto",kind:"enum",T:i.getEnumType(ci)},{no:2,name:"seconds",kind:"scalar",T:5}]),Ts=i.makeMessageType("streamlayer.interactive.QuestionAppearance",()=>[{no:1,name:"layout",kind:"enum",T:i.getEnumType(gm)},{no:2,name:"images",kind:"enum",T:i.getEnumType(ot)},{no:3,name:"primary_color",kind:"scalar",T:9},{no:4,name:"position",kind:"enum",T:i.getEnumType(fm)},{no:5,name:"auto_hide_interval",kind:"scalar",T:4}]),Gt=i.makeMessageType("streamlayer.interactive.Sponsorship",()=>[{no:1,name:"logo",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),bm=i.makeMessageType("streamlayer.interactive.PromotionNotification",()=>[{no:1,name:"sponsor_logo",kind:"scalar",T:9},{no:2,name:"sponsor_logo_mode",kind:"enum",T:i.getEnumType(ni)},{no:3,name:"cta_button",kind:"message",T:ui},{no:4,name:"image_position",kind:"enum",T:i.getEnumType(ti)},{no:5,name:"mode",kind:"enum",T:i.getEnumType(ei)}]),ys=i.makeMessageType("streamlayer.interactive.QuestionNotification",()=>[{no:1,name:"title",kind:"scalar",T:9},{no:2,name:"image",kind:"scalar",T:9},{no:3,name:"indicator_color",kind:"scalar",T:9},{no:4,name:"image_position",kind:"enum",T:i.getEnumType(si)},{no:5,name:"body",kind:"scalar",T:9},{no:6,name:"image_mode",kind:"enum",T:i.getEnumType(ot)},{no:7,name:"promotion",kind:"message",T:bm},{no:8,name:"enabled",kind:"enum",T:i.getEnumType(Rn)}]),Nm=i.makeMessageType("streamlayer.interactive.QuestionAnswer",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"icon",kind:"scalar",T:9},{no:4,name:"correct",kind:"scalar",T:8},{no:5,name:"points",kind:"scalar",T:13}]),Im=i.makeMessageType("streamlayer.interactive.ExtendedQuestionAnswer",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"icon",kind:"scalar",T:9},{no:4,name:"correct",kind:"scalar",T:8},{no:5,name:"points",kind:"scalar",T:13},{no:6,name:"percentage",kind:"scalar",T:13},{no:7,name:"you_voted",kind:"scalar",T:8},{no:8,name:"percentage_decimal",kind:"scalar",T:1},{no:9,name:"points_earned",kind:"scalar",T:13}]),tt=i.makeMessageType("streamlayer.interactive.AnswerFeedback",()=>[{no:1,name:"title",kind:"scalar",T:9},{no:2,name:"description",kind:"scalar",T:9}]),fs=i.makeMessageType("streamlayer.interactive.FileLink",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"thumbnail_url",kind:"scalar",T:9}]),mi=i.makeMessageType("streamlayer.interactive.WebLink",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9}]),ui=i.makeMessageType("streamlayer.interactive.CTAButton",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"color",kind:"scalar",T:9},{no:3,name:"text_color",kind:"scalar",T:9,opt:!0},{no:4,name:"cta_icon",kind:"scalar",T:9},{no:5,name:"cta_icon_mode",kind:"enum",T:i.getEnumType(ai)}]),io=i.makeMessageType("streamlayer.interactive.Banner",()=>[{no:1,name:"image_url",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"cta_button",kind:"message",T:ui},{no:4,name:"video",kind:"message",T:fs},{no:5,name:"body",kind:"scalar",T:9,opt:!0},{no:6,name:"analytics_topic_sub_type",kind:"enum",T:i.getEnumType(Re),opt:!0},{no:7,name:"title",kind:"scalar",T:9,opt:!0}]),Om=i.makeMessageType("streamlayer.interactive.AdLoop",()=>[{no:1,name:"interval",kind:"scalar",T:5,opt:!0}]),di=i.makeMessageType("streamlayer.interactive.QuestionOptions",()=>[{no:1,name:"poll",kind:"message",T:vm,oneof:"options"},{no:2,name:"trivia",kind:"message",T:Am,oneof:"options"},{no:3,name:"prediction",kind:"message",T:wm,oneof:"options"},{no:4,name:"factoid",kind:"message",T:Rm,oneof:"options"},{no:5,name:"tweet",kind:"message",T:Lm,oneof:"options"},{no:6,name:"promotion",kind:"message",T:Dm,oneof:"options"}]),vm=i.makeMessageType("streamlayer.interactive.QuestionOptions.PollOptions",[],{localName:"QuestionOptions_PollOptions"}),Am=i.makeMessageType("streamlayer.interactive.QuestionOptions.TriviaOptions",()=>[{no:1,name:"correct_feedback",kind:"message",T:tt},{no:2,name:"incorrect_feedback",kind:"message",T:tt},{no:3,name:"points",kind:"scalar",T:4}],{localName:"QuestionOptions_TriviaOptions"}),wm=i.makeMessageType("streamlayer.interactive.QuestionOptions.PredictionOptions",()=>[{no:1,name:"correct_feedback",kind:"message",T:tt},{no:2,name:"incorrect_feedback",kind:"message",T:tt}],{localName:"QuestionOptions_PredictionOptions"}),Rm=i.makeMessageType("streamlayer.interactive.QuestionOptions.FactoidOptions",()=>[{no:1,name:"image",kind:"scalar",T:9},{no:2,name:"body",kind:"scalar",T:9},{no:3,name:"video",kind:"message",T:fs},{no:4,name:"web_link",kind:"message",T:mi},{no:5,name:"image_mode",kind:"enum",T:i.getEnumType(ot)},{no:6,name:"use_as_notification",kind:"enum",T:i.getEnumType(ii)},{no:7,name:"close_timer",kind:"message",T:ps,opt:!0},{no:8,name:"auto_play_video",kind:"enum",T:i.getEnumType(Hn),opt:!0}],{localName:"QuestionOptions_FactoidOptions"}),Lm=i.makeMessageType("streamlayer.interactive.QuestionOptions.TweetOptions",()=>[{no:1,name:"tweet_url",kind:"scalar",T:9},{no:2,name:"tweet_id",kind:"scalar",T:9},{no:3,name:"tweet_meta",kind:"message",T:Mm}],{localName:"QuestionOptions_TweetOptions"}),Mm=i.makeMessageType("streamlayer.interactive.QuestionOptions.TweetOptions.TweetMetadata",()=>[{no:1,name:"account",kind:"scalar",T:9},{no:2,name:"account_verified",kind:"scalar",T:8},{no:3,name:"has_media",kind:"scalar",T:8},{no:4,name:"tweet",kind:"message",T:ds}],{localName:"QuestionOptions_TweetOptions_TweetMetadata"}),Pm=i.makeMessageType("streamlayer.interactive.QuestionOptions.GamOptions",()=>[{no:1,name:"env",kind:"scalar",T:9,opt:!0},{no:2,name:"gdfp_req",kind:"scalar",T:9,opt:!0},{no:3,name:"iu",kind:"scalar",T:9,opt:!0},{no:4,name:"output",kind:"scalar",T:9,opt:!0},{no:5,name:"sz",kind:"scalar",T:9,opt:!0},{no:6,name:"unviewed_position_start",kind:"scalar",T:9,opt:!0},{no:7,name:"ciu_szs",kind:"scalar",T:9,repeated:!0},{no:8,name:"url",kind:"scalar",T:9,opt:!0},{no:9,name:"description_url",kind:"scalar",T:9,opt:!0},{no:10,name:"correlator",kind:"scalar",T:9,opt:!0},{no:11,name:"cust_params",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:12,name:"plcmt",kind:"scalar",T:9,opt:!0},{no:13,name:"vpa",kind:"scalar",T:9,opt:!0},{no:14,name:"vpmute",kind:"scalar",T:9,opt:!0},{no:15,name:"wta",kind:"scalar",T:9,opt:!0},{no:16,name:"aconp",kind:"scalar",T:9,opt:!0},{no:17,name:"ad_rule",kind:"scalar",T:9,opt:!0},{no:18,name:"ad_type",kind:"scalar",T:9,opt:!0},{no:19,name:"hl",kind:"scalar",T:9,opt:!0},{no:20,name:"dth",kind:"scalar",T:9,opt:!0},{no:21,name:"gdpr",kind:"scalar",T:9,opt:!0},{no:22,name:"gdpr_consent",kind:"scalar",T:9,opt:!0},{no:23,name:"iabexcl",kind:"scalar",T:9,opt:!0},{no:24,name:"lip",kind:"scalar",T:8,opt:!0},{no:25,name:"ltd",kind:"scalar",T:9,opt:!0},{no:26,name:"nofb",kind:"scalar",T:9,opt:!0},{no:27,name:"npa",kind:"scalar",T:9,opt:!0},{no:28,name:"omid_p",kind:"scalar",T:9,opt:!0},{no:29,name:"ppt",kind:"scalar",T:9,opt:!0},{no:30,name:"ppos",kind:"scalar",T:9,opt:!0},{no:31,name:"ppid",kind:"scalar",T:9,opt:!0},{no:32,name:"scor",kind:"scalar",T:9,opt:!0},{no:33,name:"sdk_apis",kind:"scalar",T:9,opt:!0},{no:34,name:"ssss",kind:"scalar",T:9,opt:!0},{no:35,name:"sdmax",kind:"scalar",T:9,opt:!0},{no:36,name:"sid",kind:"scalar",T:9,opt:!0},{no:37,name:"rdp",kind:"scalar",T:9,opt:!0},{no:38,name:"addtl_consent",kind:"scalar",T:9,opt:!0},{no:39,name:"afvsz",kind:"scalar",T:9,opt:!0},{no:40,name:"allcues",kind:"scalar",T:9,opt:!0},{no:41,name:"cmsid",kind:"scalar",T:9,opt:!0},{no:42,name:"vid",kind:"scalar",T:9,opt:!0},{no:43,name:"excl_cat",kind:"scalar",T:9,opt:!0},{no:44,name:"ipd",kind:"scalar",T:9,opt:!0},{no:45,name:"ipe",kind:"scalar",T:9,opt:!0},{no:46,name:"max_ad_duration",kind:"scalar",T:9,opt:!0},{no:47,name:"min_ad_duration",kind:"scalar",T:9,opt:!0},{no:48,name:"mridx",kind:"scalar",T:9,opt:!0},{no:49,name:"msid",kind:"scalar",T:9,opt:!0},{no:50,name:"an",kind:"scalar",T:9,opt:!0},{no:51,name:"pmad",kind:"scalar",T:9,opt:!0},{no:52,name:"pmnd",kind:"scalar",T:9,opt:!0},{no:53,name:"pmxd",kind:"scalar",T:9,opt:!0},{no:54,name:"pod",kind:"scalar",T:9,opt:!0},{no:55,name:"pp",kind:"scalar",T:9,opt:!0},{no:56,name:"ppsj",kind:"scalar",T:9,opt:!0},{no:57,name:"ptpl",kind:"scalar",T:9,opt:!0},{no:58,name:"ptpln",kind:"scalar",T:9,opt:!0},{no:59,name:"pubf",kind:"scalar",T:9,opt:!0},{no:60,name:"pvtf",kind:"scalar",T:9,opt:!0},{no:61,name:"pvid",kind:"scalar",T:9,opt:!0},{no:62,name:"pvid_s",kind:"scalar",T:9,opt:!0},{no:63,name:"rdid",kind:"scalar",T:9,opt:!0},{no:64,name:"idtype",kind:"scalar",T:9,opt:!0},{no:65,name:"is_lat",kind:"scalar",T:9,opt:!0},{no:66,name:"tfcd",kind:"scalar",T:9,opt:!0},{no:67,name:"trt",kind:"scalar",T:9,opt:!0},{no:68,name:"vad_type",kind:"scalar",T:9,opt:!0},{no:69,name:"vid_d",kind:"scalar",T:9,opt:!0},{no:70,name:"vconp",kind:"scalar",T:9,opt:!0},{no:71,name:"vpi",kind:"scalar",T:9,opt:!0},{no:72,name:"vpos",kind:"scalar",T:9,opt:!0},{no:73,name:"impl",kind:"scalar",T:9,opt:!0},{no:74,name:"vad_format",kind:"scalar",T:9,opt:!0}],{localName:"QuestionOptions_GamOptions"}),Cm=i.makeMessageType("streamlayer.interactive.QuestionOptions.AdCampaigns",()=>[{no:1,name:"gam_options",kind:"message",T:Pm,opt:!0},{no:2,name:"gam_base_url",kind:"scalar",T:9,opt:!0},{no:3,name:"ad_loop",kind:"message",T:Om}],{localName:"QuestionOptions_AdCampaigns"}),Dm=i.makeMessageType("streamlayer.interactive.QuestionOptions.PromotionOptions",()=>[{no:1,name:"type",kind:"enum",T:i.getEnumType(he)},{no:2,name:"sponsor",kind:"message",T:Gt},{no:3,name:"banner",kind:"message",T:io},{no:4,name:"enable_wallet",kind:"enum",T:i.getEnumType(km)},{no:5,name:"additional_banner",kind:"message",T:io},{no:6,name:"coupon",kind:"scalar",T:9},{no:7,name:"logo_mode",kind:"enum",T:i.getEnumType(ri)},{no:8,name:"coupon_zip",kind:"scalar",T:9},{no:9,name:"coupon_barcode_url",kind:"scalar",T:9},{no:10,name:"button_type",kind:"enum",T:i.getEnumType(oi),opt:!0},{no:11,name:"ad_campaigns",kind:"message",T:Cm,opt:!0},{no:12,name:"close_timer",kind:"message",T:ps,opt:!0},{no:13,name:"auto_play_video",kind:"enum",T:i.getEnumType(Hn),opt:!0}],{localName:"QuestionOptions_PromotionOptions"}),Um=i.makeMessageType("streamlayer.interactive.Tag",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"label",kind:"scalar",T:9},{no:3,name:"last_used_time",kind:"scalar",T:4}]),Fm=i.makeMessageType("streamlayer.interactive.QuestionAi",()=>[{no:1,name:"verified",kind:"scalar",T:8}]),pi=i.makeMessageType("streamlayer.interactive.Question",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:i.getEnumType(P)},{no:3,name:"subject",kind:"scalar",T:9,opt:!0},{no:4,name:"options",kind:"message",T:di},{no:5,name:"appearance",kind:"message",T:Ts},{no:6,name:"sponsorship",kind:"message",T:Gt},{no:7,name:"notification",kind:"message",T:ys},{no:8,name:"answers",kind:"message",T:Nm,repeated:!0},{no:9,name:"status",kind:"enum",T:i.getEnumType(oe)},{no:10,name:"position",kind:"scalar",T:13,opt:!0},{no:11,name:"market_closed",kind:"scalar",T:8},{no:12,name:"activated_at",kind:"scalar",T:9},{no:13,name:"answer_set_at",kind:"scalar",T:9},{no:14,name:"overrides",kind:"map",K:9,V:{kind:"scalar",T:8}},{no:15,name:"event_id",kind:"scalar",T:9},{no:16,name:"stream_timestamp",kind:"message",T:Te},{no:17,name:"tags",kind:"message",T:Um,repeated:!0},{no:18,name:"bypass_notifications",kind:"message",T:ks},{no:19,name:"import_id",kind:"scalar",T:9},{no:20,name:"activation_trigger_count",kind:"scalar",T:13,opt:!0},{no:21,name:"source",kind:"enum",T:i.getEnumType(ym)},{no:22,name:"ai",kind:"message",T:Fm},{no:23,name:"has_triggers",kind:"scalar",T:8,opt:!0}]),gs=i.makeMessageType("streamlayer.interactive.ExtendedQuestion",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:i.getEnumType(P)},{no:3,name:"subject",kind:"scalar",T:9},{no:4,name:"options",kind:"message",T:di},{no:5,name:"appearance",kind:"message",T:Ts},{no:6,name:"sponsorship",kind:"message",T:Gt},{no:7,name:"notification",kind:"message",T:ys},{no:8,name:"answers",kind:"message",T:Im,repeated:!0},{no:9,name:"status",kind:"enum",T:i.getEnumType(oe)},{no:10,name:"position",kind:"scalar",T:13},{no:11,name:"market_closed",kind:"scalar",T:8},{no:12,name:"activated_at",kind:"scalar",T:9},{no:13,name:"answer_set_at",kind:"scalar",T:9},{no:14,name:"event_id",kind:"scalar",T:9},{no:15,name:"bypass_notifications",kind:"message",T:ks}]),Ti=i.makeMessageType("streamlayer.interactive.EventModeration",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:9},{no:3,name:"sponsorship",kind:"message",T:Gt},{no:4,name:"onboarding_enabled",kind:"scalar",T:8},{no:5,name:"question",kind:"message",T:Gm},{no:6,name:"sponsors",kind:"message",T:qm},{no:7,name:"notification",kind:"message",T:xm},{no:8,name:"activated_at",kind:"message",T:Te},{no:9,name:"deactivated_at",kind:"message",T:Te},{no:10,name:"question_auto_post",kind:"message",T:Hm},{no:11,name:"bypass_notifications",kind:"message",T:ks},{no:12,name:"importer_collaboration",kind:"message",T:Wm}]),Gm=i.makeMessageType("streamlayer.interactive.EventModeration.QuestionSettings",()=>[{no:1,name:"appearance",kind:"message",T:Ts},{no:2,name:"trivia",kind:"message",T:Bm},{no:3,name:"prediction",kind:"message",T:Vm},{no:4,name:"correct_feedbacks",kind:"message",T:tt,repeated:!0},{no:5,name:"incorrect_feedbacks",kind:"message",T:tt,repeated:!0}],{localName:"EventModeration_QuestionSettings"}),Bm=i.makeMessageType("streamlayer.interactive.EventModeration.QuestionSettings.TriviaCardSettings",()=>[{no:1,name:"points",kind:"scalar",T:13}],{localName:"EventModeration_QuestionSettings_TriviaCardSettings"}),Vm=i.makeMessageType("streamlayer.interactive.EventModeration.QuestionSettings.PredictionCardSettings",()=>[{no:1,name:"max_points",kind:"scalar",T:13}],{localName:"EventModeration_QuestionSettings_PredictionCardSettings"}),qm=i.makeMessageType("streamlayer.interactive.EventModeration.SponsorshipSettings",()=>[{no:1,name:"sponsors",kind:"message",T:Gt,repeated:!0}],{localName:"EventModeration_SponsorshipSettings"}),xm=i.makeMessageType("streamlayer.interactive.EventModeration.NotificationSettings",()=>[{no:1,name:"image",kind:"scalar",T:9},{no:2,name:"indicator_color",kind:"scalar",T:9},{no:3,name:"image_position",kind:"enum",T:i.getEnumType(si)},{no:4,name:"image_mode",kind:"enum",T:i.getEnumType(ot)}],{localName:"EventModeration_NotificationSettings"}),Hm=i.makeMessageType("streamlayer.interactive.QuestionAutoPost",()=>[{no:1,name:"state",kind:"enum",T:i.getEnumType(hm)},{no:2,name:"interval",kind:"scalar",T:13},{no:3,name:"next_post_time",kind:"message",T:Te},{no:4,name:"start_mode",kind:"enum",T:i.getEnumType(Sm)},{no:5,name:"start_options",kind:"message",T:Qm}]),Qm=i.makeMessageType("streamlayer.interactive.QuestionAutoPostStartOptions",()=>[{no:1,name:"schedule",kind:"message",T:Ym,oneof:"options"}]),Ym=i.makeMessageType("streamlayer.interactive.QuestionAutoPostStartOptions.ScheduleOptions",()=>[{no:1,name:"timestamp",kind:"scalar",T:4}],{localName:"QuestionAutoPostStartOptions_ScheduleOptions"}),Qn=i.makeMessageType("streamlayer.interactive.Pagination",()=>[{no:1,name:"page",kind:"scalar",T:5},{no:2,name:"page_size",kind:"scalar",T:5},{no:3,name:"cursor",kind:"scalar",T:9}]),jm=i.makeMessageType("streamlayer.interactive.Sort",()=>[{no:1,name:"field",kind:"scalar",T:9},{no:2,name:"order",kind:"scalar",T:9}]),ks=i.makeMessageType("streamlayer.interactive.BypassNotifications",()=>[{no:1,name:"in_app_silence",kind:"enum",T:i.getEnumType(li)}]),$m=i.makeMessageType("streamlayer.interactive.ImportError",()=>[{no:1,name:"row_id",kind:"scalar",T:9},{no:2,name:"message",kind:"scalar",T:9}]),Km=i.makeMessageType("streamlayer.interactive.ImportProgress",()=>[{no:1,name:"import_id",kind:"scalar",T:9},{no:2,name:"status",kind:"enum",T:i.getEnumType(Em)},{no:3,name:"errors",kind:"message",T:$m,repeated:!0},{no:4,name:"last_updated",kind:"message",T:Te}]),Wm=i.makeMessageType("streamlayer.interactive.ImporterCollaboration",()=>[{no:1,name:"imports",kind:"map",K:9,V:{kind:"message",T:Km}}]),Nt=i.makeEnum("streamlayer.interactive.feed.PickHistoryStatus",[{no:0,name:"PICK_HISTORY_STATUS_UNSET",localName:"UNSET"},{no:1,name:"PICK_HISTORY_STATUS_WON",localName:"WON"},{no:2,name:"PICK_HISTORY_STATUS_LOST",localName:"LOST"},{no:3,name:"PICK_HISTORY_STATUS_DNP",localName:"DNP"}]),zm=i.makeEnum("streamlayer.interactive.feed.FeedUpdateType",[{no:0,name:"UPDATE_TYPE_UNSET"},{no:1,name:"UPDATE_TYPE_QUESTION_ACTIVATE"},{no:2,name:"UPDATE_TYPE_QUESTION_SET_CORRECT_ANSWER"},{no:3,name:"UPDATE_TYPE_QUESTION_RESOLVE"}]),yi=i.makeMessageType("streamlayer.interactive.feed.FeedQuestion",()=>[{no:1,name:"question",kind:"message",T:pi},{no:2,name:"notification",kind:"message",T:ys},{no:3,name:"moderation",kind:"message",T:Ti},{no:4,name:"feed_item",kind:"message",T:Yn}]),Jm=i.makeMessageType("streamlayer.interactive.feed.SubscriptionRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9},{no:2,name:"feed_id",kind:"scalar",T:9}]),Xm=i.makeMessageType("streamlayer.interactive.feed.SubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:Zm}]),Zm=i.makeMessageType("streamlayer.interactive.feed.SubscriptionResponse.SubscriptionResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:yi}],{localName:"SubscriptionResponse_SubscriptionResponseData"}),eu=i.makeMessageType("streamlayer.interactive.feed.VotingSubscriptionRequest",()=>[{no:1,name:"feed_id",kind:"scalar",T:9},{no:2,name:"question_id",kind:"scalar",T:9}]),tu=i.makeMessageType("streamlayer.interactive.feed.VotingSubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:nu}]),nu=i.makeMessageType("streamlayer.interactive.feed.VotingSubscriptionResponse.VotingSubscriptionResponseData",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:hs,repeated:!0}],{localName:"VotingSubscriptionResponse_VotingSubscriptionResponseData"}),au=i.makeMessageType("streamlayer.interactive.feed.QuestionSubscription",()=>[{no:1,name:"question",kind:"message",T:gs}]),su=i.makeMessageType("streamlayer.interactive.feed.QuestionSubscriptionRequest",()=>[{no:1,name:"question_id",kind:"scalar",T:9}]),ou=i.makeMessageType("streamlayer.interactive.feed.QuestionSubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:ru}]),ru=i.makeMessageType("streamlayer.interactive.feed.QuestionSubscriptionResponse.QuestionSubscriptionResponseData",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:au}],{localName:"QuestionSubscriptionResponse_QuestionSubscriptionResponseData"}),iu=i.makeMessageType("streamlayer.interactive.feed.QuestionByUser",()=>[{no:1,name:"question",kind:"message",T:gs}]),cu=i.makeMessageType("streamlayer.interactive.feed.QuestionByUserRequest",()=>[{no:1,name:"question_id",kind:"scalar",T:9}]),lu=i.makeMessageType("streamlayer.interactive.feed.QuestionByUserResponse",()=>[{no:1,name:"data",kind:"message",T:mu}]),mu=i.makeMessageType("streamlayer.interactive.feed.QuestionByUserResponse.QuestionByUserResponseData",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:iu}],{localName:"QuestionByUserResponse_QuestionByUserResponseData"}),uu=i.makeMessageType("streamlayer.interactive.feed.SyncQuestionRequest",()=>[{no:1,name:"filter",kind:"message",T:du}]),du=i.makeMessageType("streamlayer.interactive.feed.SyncQuestionRequest.SyncQuestionRequestFilter",()=>[{no:1,name:"event_id",kind:"scalar",T:9},{no:2,name:"types",kind:"enum",T:i.getEnumType(P),repeated:!0}],{localName:"SyncQuestionRequest_SyncQuestionRequestFilter"}),pu=i.makeMessageType("streamlayer.interactive.feed.SyncQuestionResponse",()=>[{no:1,name:"data",kind:"message",T:Tu}]),Tu=i.makeMessageType("streamlayer.interactive.feed.SyncQuestionResponse.SyncQuestionResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:yi}],{localName:"SyncQuestionResponse_SyncQuestionResponseData"}),yu=i.makeMessageType("streamlayer.interactive.feed.GetQuestionRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),fu=i.makeMessageType("streamlayer.interactive.feed.GetQuestionResponse",()=>[{no:1,name:"data",kind:"message",T:gu}]),gu=i.makeMessageType("streamlayer.interactive.feed.GetQuestionResponse.GetQuestionResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:pi}],{localName:"GetQuestionResponse_GetQuestionResponseData"}),ku=i.makeMessageType("streamlayer.interactive.feed.QuestionDetailRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),hu=i.makeMessageType("streamlayer.interactive.feed.QuestionDetailResponse",()=>[{no:1,name:"data",kind:"message",T:Su}]),Su=i.makeMessageType("streamlayer.interactive.feed.QuestionDetailResponse.QuestionDetailResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:gs}],{localName:"QuestionDetailResponse_QuestionDetailResponseData"}),hs=i.makeMessageType("streamlayer.interactive.feed.AnswerVoteResult",()=>[{no:1,name:"answer_id",kind:"scalar",T:9},{no:2,name:"percentage",kind:"scalar",T:13},{no:3,name:"voted",kind:"scalar",T:8},{no:4,name:"correct",kind:"scalar",T:8}]),_u=i.makeMessageType("streamlayer.interactive.feed.SubmitAnswerRequest",()=>[{no:1,name:"data",kind:"message",T:Eu}]),Eu=i.makeMessageType("streamlayer.interactive.feed.SubmitAnswerRequest.SubmitRequestData",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"answer_id",kind:"scalar",T:9}],{localName:"SubmitAnswerRequest_SubmitRequestData"}),bu=i.makeMessageType("streamlayer.interactive.feed.SubmitAnswerResponse",()=>[{no:1,name:"data",kind:"message",T:Nu}]),Nu=i.makeMessageType("streamlayer.interactive.feed.SubmitAnswerResponse.SubmitAnswerResponseData",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:hs,repeated:!0}],{localName:"SubmitAnswerResponse_SubmitAnswerResponseData"}),Iu=i.makeMessageType("streamlayer.interactive.feed.SubmitInplayRequest",()=>[{no:1,name:"data",kind:"message",T:Ou}]),Ou=i.makeMessageType("streamlayer.interactive.feed.SubmitInplayRequest.SubmitRequestData",()=>[{no:1,name:"event_id",kind:"scalar",T:13}],{localName:"SubmitInplayRequest_SubmitRequestData"}),vu=i.makeMessageType("streamlayer.interactive.feed.SubmitInplayResponse",[]),Au=i.makeMessageType("streamlayer.interactive.feed.SkipQuestionRequest",()=>[{no:1,name:"data",kind:"message",T:wu}]),wu=i.makeMessageType("streamlayer.interactive.feed.SkipQuestionRequest.SkipQuestionRequestData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"reason",kind:"enum",T:i.getEnumType(_m)}],{localName:"SkipQuestionRequest_SkipQuestionRequestData"}),Ru=i.makeMessageType("streamlayer.interactive.feed.SkipQuestionResponse",()=>[{no:1,name:"data",kind:"message",T:Lu}]),Lu=i.makeMessageType("streamlayer.interactive.feed.SkipQuestionResponse.SkipQuestionResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:hs,repeated:!0}],{localName:"SkipQuestionResponse_SkipQuestionResponseData"}),Mu=i.makeMessageType("streamlayer.interactive.feed.PickHistoryRequest",()=>[{no:1,name:"question_type",kind:"enum",T:i.getEnumType(P),repeated:!0},{no:3,name:"event_id",kind:"scalar",T:9},{no:2,name:"pagination",kind:"message",T:Qn}]),fi=i.makeMessageType("streamlayer.interactive.feed.PickHistory",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"answer_id",kind:"scalar",T:9},{no:3,name:"status",kind:"enum",T:i.getEnumType(Nt)},{no:4,name:"question_type",kind:"enum",T:i.getEnumType(P)},{no:5,name:"subject",kind:"scalar",T:9},{no:6,name:"text",kind:"scalar",T:9},{no:7,name:"open_for_voting",kind:"scalar",T:8},{no:8,name:"question_status",kind:"enum",T:i.getEnumType(oe)}]),Pu=i.makeMessageType("streamlayer.interactive.feed.PickHistoryResponse",()=>[{no:1,name:"data",kind:"message",T:Cu,repeated:!0},{no:2,name:"meta",kind:"message",T:Du}]),Cu=i.makeMessageType("streamlayer.interactive.feed.PickHistoryResponse.PickHistoryResponseData",()=>[{no:1,name:"attributes",kind:"message",T:fi}],{localName:"PickHistoryResponse_PickHistoryResponseData"}),Du=i.makeMessageType("streamlayer.interactive.feed.PickHistoryResponse.PickHistoryResponseMetadata",()=>[{no:1,name:"total",kind:"scalar",T:5},{no:2,name:"page",kind:"scalar",T:5},{no:3,name:"page_size",kind:"scalar",T:5}],{localName:"PickHistoryResponse_PickHistoryResponseMetadata"}),Uu=i.makeMessageType("streamlayer.interactive.feed.InsightHistoryRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9}]),Fu=i.makeMessageType("streamlayer.interactive.feed.InstantView",()=>[{no:1,name:"heading",kind:"scalar",T:9,opt:!0},{no:2,name:"body",kind:"scalar",T:9,opt:!0},{no:3,name:"image",kind:"scalar",T:9,opt:!0},{no:4,name:"video",kind:"message",T:fs,opt:!0},{no:5,name:"web_link",kind:"message",T:mi,opt:!0},{no:6,name:"image_mode",kind:"enum",T:i.getEnumType(ot)},{no:7,name:"close_timer",kind:"message",T:ps,opt:!0},{no:8,name:"auto_play_video",kind:"enum",T:i.getEnumType(Hn),opt:!0}]),Gu=i.makeMessageType("streamlayer.interactive.feed.InsightNotification",()=>[{no:1,name:"title",kind:"scalar",T:9,opt:!0},{no:2,name:"body",kind:"scalar",T:9,opt:!0},{no:3,name:"image_position",kind:"scalar",T:5,opt:!0}]),gi=i.makeMessageType("streamlayer.interactive.feed.InsightHistory",()=>[{no:1,name:"question_id",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",T:9},{no:3,name:"image",kind:"scalar",T:9},{no:4,name:"image_mode",kind:"enum",T:i.getEnumType(ot)},{no:5,name:"instant_view",kind:"message",T:Fu,opt:!0},{no:6,name:"notification",kind:"message",T:Gu,opt:!0},{no:7,name:"use_as_notification",kind:"enum",T:i.getEnumType(ii)}]),Bu=i.makeMessageType("streamlayer.interactive.feed.InsightHistoryResponse",()=>[{no:1,name:"data",kind:"message",T:Vu,repeated:!0}]),Vu=i.makeMessageType("streamlayer.interactive.feed.InsightHistoryResponse.InsightHistoryResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:gi}],{localName:"InsightHistoryResponse_InsightHistoryResponseData"}),qu=i.makeMessageType("streamlayer.interactive.feed.TweetHistoryRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9}]),ki=i.makeMessageType("streamlayer.interactive.feed.TweetHistory",()=>[{no:1,name:"tweet_id",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",T:9},{no:3,name:"image",kind:"scalar",T:9},{no:4,name:"body",kind:"scalar",T:9},{no:5,name:"account",kind:"scalar",T:9},{no:6,name:"account_verified",kind:"scalar",T:8},{no:7,name:"tweet",kind:"message",T:ds}]),xu=i.makeMessageType("streamlayer.interactive.feed.TweetHistoryResponse",()=>[{no:1,name:"data",kind:"message",T:Hu,repeated:!0}]),Hu=i.makeMessageType("streamlayer.interactive.feed.TweetHistoryResponse.TweetHistoryResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:ki}],{localName:"TweetHistoryResponse_TweetHistoryResponseData"}),Qu=i.makeMessageType("streamlayer.interactive.feed.InteractiveFeed",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"options",kind:"message",T:Yu},{no:3,name:"moderation",kind:"message",T:Ti}]),Yu=i.makeMessageType("streamlayer.interactive.feed.FeedOptions",()=>[{no:1,name:"onboarding_enabled",kind:"scalar",T:8}]),ju=i.makeMessageType("streamlayer.interactive.feed.GetRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9}]),$u=i.makeMessageType("streamlayer.interactive.feed.GetResponse",()=>[{no:1,name:"data",kind:"message",T:Ku}]),Ku=i.makeMessageType("streamlayer.interactive.feed.GetResponse.GetResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:Qu}],{localName:"GetResponse_GetResponseData"}),Wu=i.makeMessageType("streamlayer.interactive.feed.PromotionHistoryRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9}]),hi=i.makeMessageType("streamlayer.interactive.feed.PromotionHistory",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",T:9},{no:3,name:"image",kind:"scalar",T:9}]),zu=i.makeMessageType("streamlayer.interactive.feed.PromotionHistoryResponse",()=>[{no:1,name:"data",kind:"message",T:Ju,repeated:!0}]),Ju=i.makeMessageType("streamlayer.interactive.feed.PromotionHistoryResponse.PromotionHistoryResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:hi}],{localName:"PromotionHistoryResponse_PromotionHistoryResponseData"}),Xu=i.makeMessageType("streamlayer.interactive.feed.FeedItemAttributes",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:i.getEnumType(P)},{no:3,name:"status",kind:"enum",T:i.getEnumType(oe)},{no:8,name:"created",kind:"scalar",T:9},{no:4,name:"question",kind:"message",T:fi,oneof:"attributes"},{no:5,name:"tweet",kind:"message",T:ki,oneof:"attributes"},{no:6,name:"insight",kind:"message",T:gi,oneof:"attributes"},{no:7,name:"promotion",kind:"message",T:hi,oneof:"attributes"}]),Yn=i.makeMessageType("streamlayer.interactive.feed.FeedItem",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:Xu}]),Zu=i.makeMessageType("streamlayer.interactive.feed.FeedListRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9},{no:2,name:"filter",kind:"message",T:ed},{no:3,name:"pagination",kind:"message",T:Qn}]),ed=i.makeMessageType("streamlayer.interactive.feed.FeedListRequest.FeedListFilter",()=>[{no:1,name:"types",kind:"enum",T:i.getEnumType(P),repeated:!0},{no:2,name:"statuses",kind:"enum",T:i.getEnumType(oe),repeated:!0}],{localName:"FeedListRequest_FeedListFilter"}),td=i.makeMessageType("streamlayer.interactive.feed.FeedListResponse",()=>[{no:1,name:"data",kind:"message",T:Yn,repeated:!0},{no:2,name:"meta",kind:"message",T:nd}]),nd=i.makeMessageType("streamlayer.interactive.feed.FeedListResponse.FeedListResponseMetadata",()=>[{no:1,name:"total",kind:"scalar",T:5},{no:2,name:"page",kind:"scalar",T:5},{no:3,name:"page_size",kind:"scalar",T:5}],{localName:"FeedListResponse_FeedListResponseMetadata"}),ad=i.makeMessageType("streamlayer.interactive.feed.FeedItemRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),sd=i.makeMessageType("streamlayer.interactive.feed.FeedItemResponse",()=>[{no:1,name:"data",kind:"message",T:Yn}]),od=i.makeMessageType("streamlayer.interactive.feed.FeedSubscriptionRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9}]),rd=i.makeMessageType("streamlayer.interactive.feed.FeedSubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:Yn},{no:2,name:"meta",kind:"message",T:id}]),id=i.makeMessageType("streamlayer.interactive.feed.FeedSubscriptionResponse.FeedSubscriptionMeta",()=>[{no:1,name:"type",kind:"enum",T:i.getEnumType(zm)}],{localName:"FeedSubscriptionResponse_FeedSubscriptionMeta"}),cd=i.makeMessageType("streamlayer.sdkSettings.game.common.GameAppearance",()=>[{no:1,name:"primary_color",kind:"scalar",T:9},{no:2,name:"secondary_color",kind:"scalar",T:9},{no:3,name:"accent_color",kind:"scalar",T:9}]),ld=i.makeMessageType("streamlayer.sdkSettings.game.common.GameMedia",()=>[{no:1,name:"game_icon",kind:"scalar",T:9},{no:2,name:"sponsor_logo",kind:"scalar",T:9}]),md=i.makeMessageType("streamlayer.sdkSettings.game.common.GamePrize",()=>[{no:1,name:"title",kind:"scalar",T:9},{no:2,name:"image",kind:"scalar",T:9}]),ud=i.makeMessageType("streamlayer.sdkSettings.game.common.GameOverview",()=>[{no:1,name:"title",kind:"scalar",T:9},{no:2,name:"description",kind:"scalar",T:9},{no:3,name:"auto_activate",kind:"scalar",T:8},{no:4,name:"scoring",kind:"scalar",T:8},{no:5,name:"media",kind:"message",T:ld},{no:6,name:"appearance",kind:"message",T:cd},{no:7,name:"prizes",kind:"message",T:md,repeated:!0},{no:8,name:"completed",kind:"scalar",T:8}]),dd=i.makeMessageType("streamlayer.sdkSettings.game.common.TitleCardMedia",()=>[{no:1,name:"icon",kind:"scalar",T:9},{no:2,name:"sponsor_logo",kind:"scalar",T:9}]),pd=i.makeMessageType("streamlayer.sdkSettings.game.common.TitleCardAppearance",()=>[{no:1,name:"graphic",kind:"scalar",T:9}]),Td=i.makeMessageType("streamlayer.sdkSettings.game.common.GameTitleCard",()=>[{no:1,name:"visible",kind:"scalar",T:8},{no:2,name:"opt_in",kind:"scalar",T:8},{no:3,name:"title",kind:"scalar",T:9},{no:4,name:"subtitle",kind:"scalar",T:9},{no:5,name:"header",kind:"scalar",T:9},{no:6,name:"media",kind:"message",T:dd},{no:7,name:"appearance",kind:"message",T:pd},{no:8,name:"completed",kind:"scalar",T:8}]),yd=i.makeMessageType("streamlayer.sdkSettings.game.common.OnboardingStep",()=>[{no:1,name:"headline",kind:"scalar",T:9},{no:2,name:"body",kind:"scalar",T:9},{no:3,name:"graphic",kind:"scalar",T:9}]),fd=i.makeMessageType("streamlayer.sdkSettings.game.common.GameOnboarding",()=>[{no:1,name:"steps",kind:"message",T:yd,repeated:!0},{no:2,name:"completed",kind:"scalar",T:8}]),gd=i.makeMessageType("streamlayer.sdkSettings.game.common.GameRules",()=>[{no:1,name:"heading",kind:"scalar",T:9},{no:2,name:"typeface",kind:"scalar",T:9},{no:3,name:"button_label",kind:"scalar",T:9},{no:4,name:"numbers_color",kind:"scalar",T:9},{no:5,name:"rules",kind:"scalar",T:9,repeated:!0},{no:6,name:"completed",kind:"scalar",T:8},{no:7,name:"terms",kind:"scalar",T:9},{no:8,name:"terms_url",kind:"scalar",T:9}]),kd=i.makeMessageType("streamlayer.sdkSettings.game.common.GameInviteCard",()=>[{no:1,name:"heading",kind:"scalar",T:9},{no:2,name:"typeface",kind:"scalar",T:9},{no:3,name:"subtext",kind:"scalar",T:9},{no:4,name:"button_label",kind:"scalar",T:9},{no:5,name:"icon_color",kind:"scalar",T:9},{no:6,name:"terms",kind:"scalar",T:9},{no:7,name:"completed",kind:"scalar",T:8}]),hd=i.makeMessageType("streamlayer.sdkSettings.game.common.GameSettings",()=>[{no:1,name:"overview",kind:"message",T:ud},{no:2,name:"title_card",kind:"message",T:Td},{no:3,name:"onboarding",kind:"message",T:fd},{no:4,name:"rules",kind:"message",T:gd},{no:5,name:"invite_card",kind:"message",T:kd},{no:6,name:"completed",kind:"scalar",T:8},{no:7,name:"enable",kind:"scalar",T:8}]),Sd=i.makeMessageType("streamlayer.sdkSettings.moderation.common.ModerationGeneral",()=>[{no:1,name:"default_color",kind:"scalar",T:9},{no:2,name:"points",kind:"scalar",T:13},{no:3,name:"auto_hide_interval",kind:"scalar",T:4},{no:4,name:"insights_history_enabled",kind:"scalar",T:8},{no:5,name:"pick_history_enabled",kind:"scalar",T:8},{no:6,name:"correct_feedbacks",kind:"message",T:tt,repeated:!0},{no:7,name:"incorrect_feedbacks",kind:"message",T:tt,repeated:!0}]),_d=i.makeMessageType("streamlayer.sdkSettings.moderation.common.ModerationNotifications",()=>[{no:1,name:"default_image",kind:"scalar",T:9},{no:2,name:"image_mode",kind:"enum",T:i.getEnumType(ot)}]),Ed=i.makeMessageType("streamlayer.sdkSettings.moderation.common.ModerationSponsorships",()=>[{no:1,name:"rotate",kind:"scalar",T:8},{no:2,name:"no_sponsor",kind:"scalar",T:8},{no:3,name:"sponsors",kind:"message",T:Gt,repeated:!0}]),bd=i.makeMessageType("streamlayer.sdkSettings.moderation.common.ModerationSettings",()=>[{no:1,name:"general",kind:"message",T:Sd},{no:2,name:"notifications",kind:"message",T:_d},{no:3,name:"sponsorships",kind:"message",T:Ed}]),H=i.makeEnum("streamlayer.sdkSettings.SdkOverlayType",[{no:0,name:"SDK_OVERLAY_TYPE_UNSET",localName:"UNSET"},{no:1,name:"SDK_OVERLAY_TYPE_INPLAY",localName:"INPLAY"},{no:2,name:"SDK_OVERLAY_TYPE_MESSAGING",localName:"MESSAGING"},{no:3,name:"SDK_OVERLAY_TYPE_STATISTICS",localName:"STATISTICS"},{no:4,name:"SDK_OVERLAY_TYPE_BETTING",localName:"BETTING"},{no:5,name:"SDK_OVERLAY_TYPE_TWITTER",localName:"TWITTER"},{no:6,name:"SDK_OVERLAY_TYPE_MERCHANDISE",localName:"MERCHANDISE"},{no:7,name:"SDK_OVERLAY_TYPE_CONTESTS",localName:"CONTESTS"},{no:8,name:"SDK_OVERLAY_TYPE_VOICE_CHAT",localName:"VOICE_CHAT"},{no:9,name:"SDK_OVERLAY_TYPE_TICKETS",localName:"TICKETS"},{no:10,name:"SDK_OVERLAY_TYPE_WHOIS_WATCHING",localName:"WHOIS_WATCHING"},{no:11,name:"SDK_OVERLAY_TYPE_PROFILE",localName:"PROFILE"},{no:12,name:"SDK_OVERLAY_TYPE_GAMES",localName:"GAMES"},{no:13,name:"SDK_OVERLAY_TYPE_GOLF_STATISTICS",localName:"GOLF_STATISTICS"},{no:14,name:"SDK_OVERLAY_TYPE_HIGHLIGHTS",localName:"HIGHLIGHTS"},{no:15,name:"SDK_OVERLAY_TYPE_PUBLIC_CHAT",localName:"PUBLIC_CHAT"}]),Nd=i.makeEnum("streamlayer.sdkSettings.BettingFavoriteType",[{no:0,name:"BETTING_FAVORITE_TYPE_UNSET",localName:"UNSET"},{no:1,name:"BETTING_FAVORITE_TYPE_LEAGUE",localName:"LEAGUE"},{no:2,name:"BETTING_FAVORITE_TYPE_TEAM",localName:"TEAM"}]),Id=i.makeEnum("streamlayer.sdkSettings.BettingSettingsTextColor",[{no:0,name:"BETTING_SETTINGS_TEXT_COLOR_UNSET",localName:"UNSET"},{no:1,name:"BETTING_SETTINGS_TEXT_COLOR_PRIMARY",localName:"PRIMARY"},{no:2,name:"BETTING_SETTINGS_TEXT_COLOR_GREY",localName:"GREY"},{no:3,name:"BETTING_SETTINGS_TEXT_COLOR_CUSTOM",localName:"CUSTOM"}]),Ss=i.makeEnum("streamlayer.sdkSettings.GetStreamChannelType",[{no:0,name:"GETSTREAM_CHANNEL_TYPE_UNSET"},{no:1,name:"GETSTREAM_CHANNEL_TYPE_LIVESTREAM"},{no:2,name:"GETSTREAM_CHANNEL_TYPE_MESSAGING"},{no:3,name:"GETSTREAM_CHANNEL_TYPE_TEAM"},{no:4,name:"GETSTREAM_CHANNEL_TYPE_COMMERCE"},{no:5,name:"GETSTREAM_CHANNEL_TYPE_GAMING"},{no:6,name:"GETSTREAM_CHANNEL_TYPE_CUSTOM"}]),Od=i.makeEnum("streamlayer.sdkSettings.GetStreamChannelDefault",[{no:0,name:"GETSTREAM_CHANNEL_DEFAULT_UNSET"},{no:1,name:"GETSTREAM_CHANNEL_DEFAULT_TRUE"},{no:2,name:"GETSTREAM_CHANNEL_DEFAULT_FALSE"}]),Si=i.makeEnum("streamlayer.sdkSettings.GetStreamEnabled",[{no:0,name:"GETSTREAM_ENABLED_UNSET"},{no:1,name:"GETSTREAM_ENABLED_TRUE"},{no:2,name:"GETSTREAM_ENABLED_FALSE"}]),vd=i.makeEnum("streamlayer.sdkSettings.PublicName",[{no:0,name:"PUBLIC_NAME_UNSET",localName:"UNSET"},{no:1,name:"PUBLIC_NAME_ENABLED",localName:"ENABLED"},{no:2,name:"PUBLIC_NAME_DISABLED",localName:"DISABLED"}]),Ad=i.makeEnum("streamlayer.sdkSettings.AnalyticsVersion",[{no:0,name:"ANALYTICS_VERSION_UNSET",localName:"UNSET"},{no:1,name:"ANALYTICS_VERSION_V1",localName:"V1"},{no:2,name:"ANALYTICS_VERSION_V2",localName:"V2"}]),wd=i.makeEnum("streamlayer.sdkSettings.LeaderboardKind",[{no:0,name:"LEADERBOARD_KIND_UNSET",localName:"UNSET"},{no:1,name:"LEADERBOARD_KIND_GLOBAL",localName:"GLOBAL"},{no:2,name:"LEADERBOARD_KIND_FRIENDS",localName:"FRIENDS"}]),Rd=i.makeEnum("streamlayer.sdkSettings.AdvertisingPlacement",[{no:0,name:"ADVERTISING_PLACEMENT_UNSET",localName:"UNSET"},{no:1,name:"ADVERTISING_PLACEMENT_DEFAULT",localName:"DEFAULT"},{no:2,name:"ADVERTISING_PLACEMENT_WATCHPARTY_FULLSIZE",localName:"WATCHPARTY_FULLSIZE"},{no:3,name:"ADVERTISING_PLACEMENT_WATCHPARTY_VIDEOPANEL",localName:"WATCHPARTY_VIDEOPANEL"},{no:4,name:"ADVERTISING_PLACEMENT_OVERLAY_NAVBAR",localName:"OVERLAY_NAVBAR"}]),Ld=i.makeMessageType("streamlayer.sdkSettings.TwitterOverlaySettings",()=>[{no:1,name:"accounts",kind:"scalar",T:9,repeated:!0}]),Md=i.makeMessageType("streamlayer.sdkSettings.BettingFavorite",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"icon",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"type",kind:"enum",T:i.getEnumType(Nd)}]),Pd=i.makeMessageType("streamlayer.sdkSettings.CtaImage",()=>[{no:1,name:"url",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),_i=i.makeMessageType("streamlayer.sdkSettings.BrandDefaults",()=>[{no:1,name:"appearance",kind:"message",T:Cd}]),Cd=i.makeMessageType("streamlayer.sdkSettings.BrandDefaults.Appearance",()=>[{no:1,name:"primary_color",kind:"scalar",T:9},{no:2,name:"secondary_color",kind:"scalar",T:9},{no:3,name:"accent_color",kind:"scalar",T:9}],{localName:"BrandDefaults_Appearance"}),co=i.makeMessageType("streamlayer.sdkSettings.BettingOverlaySettings",()=>[{no:1,name:"favorites",kind:"message",T:Md,repeated:!0},{no:2,name:"primary_color",kind:"scalar",T:9},{no:3,name:"button_icon",kind:"scalar",T:9},{no:4,name:"text_color",kind:"enum",T:i.getEnumType(Id)},{no:5,name:"app_installed_text",kind:"scalar",T:9},{no:6,name:"app_not_installed_text",kind:"scalar",T:9},{no:7,name:"text_color_custom",kind:"scalar",T:9},{no:8,name:"cta_image",kind:"message",T:Pd}]),Dd=i.makeMessageType("streamlayer.sdkSettings.GetStreamSettingsClient",()=>[{no:1,name:"enabled",kind:"enum",T:i.getEnumType(Si)},{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"app_id",kind:"scalar",T:9},{no:5,name:"default_channel_type",kind:"enum",T:i.getEnumType(Ss)}]),Ln=i.makeMessageType("streamlayer.sdkSettings.GetStreamChannel",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:9},{no:3,name:"channel_id",kind:"scalar",T:9},{no:4,name:"channel_type",kind:"enum",T:i.getEnumType(Ss)},{no:5,name:"is_default",kind:"enum",T:i.getEnumType(Od)}]),Ud=i.makeMessageType("streamlayer.sdkSettings.GetStreamChannels",()=>[{no:1,name:"enabled",kind:"enum",T:i.getEnumType(Si)},{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"app_id",kind:"scalar",T:9},{no:4,name:"default_channel_type",kind:"enum",T:i.getEnumType(Ss)},{no:5,name:"default_channel",kind:"message",T:Ln},{no:6,name:"channels",kind:"message",T:Ln,repeated:!0}]),Ei=i.makeMessageType("streamlayer.sdkSettings.StreamSettings",()=>[{no:1,name:"overlays",kind:"message",T:Ni,repeated:!0},{no:2,name:"custom",kind:"scalar",T:8},{no:3,name:"button_icon",kind:"scalar",T:9},{no:4,name:"primary_color",kind:"scalar",T:9},{no:5,name:"secondary_color",kind:"scalar",T:9},{no:6,name:"moderation_primary_color",kind:"scalar",T:9},{no:7,name:"link_share_icon",kind:"scalar",T:9},{no:8,name:"link_share_text",kind:"scalar",T:9},{no:9,name:"brand_defaults",kind:"message",T:_i},{no:10,name:"getstream",kind:"message",T:Ud}]),Fd=i.makeMessageType("streamlayer.sdkSettings.JWK",()=>[{no:1,name:"alg",kind:"scalar",T:9,opt:!0},{no:2,name:"crv",kind:"scalar",T:9,opt:!0},{no:3,name:"d",kind:"scalar",T:9,opt:!0},{no:4,name:"dp",kind:"scalar",T:9,opt:!0},{no:5,name:"dq",kind:"scalar",T:9,opt:!0},{no:6,name:"e",kind:"scalar",T:9,opt:!0},{no:7,name:"ext",kind:"scalar",T:8,opt:!0},{no:8,name:"k",kind:"scalar",T:9,opt:!0},{no:9,name:"key_ops",kind:"scalar",T:9,repeated:!0},{no:10,name:"kid",kind:"scalar",T:9,opt:!0},{no:11,name:"kty",kind:"scalar",T:9,opt:!0},{no:12,name:"n",kind:"scalar",T:9,opt:!0},{no:13,name:"oth",kind:"message",T:Gd,repeated:!0},{no:14,name:"p",kind:"scalar",T:9,opt:!0},{no:15,name:"q",kind:"scalar",T:9,opt:!0},{no:16,name:"qi",kind:"scalar",T:9,opt:!0},{no:17,name:"use",kind:"scalar",T:9,opt:!0},{no:18,name:"x",kind:"scalar",T:9,opt:!0},{no:19,name:"y",kind:"scalar",T:9,opt:!0},{no:20,name:"x5c",kind:"scalar",T:9,repeated:!0},{no:21,name:"x5t",kind:"scalar",T:9,opt:!0},{no:22,name:"x5u",kind:"scalar",T:9,opt:!0}]),Gd=i.makeMessageType("streamlayer.sdkSettings.JWK.OTH",()=>[{no:1,name:"d",kind:"scalar",T:9,opt:!0},{no:2,name:"r",kind:"scalar",T:9,opt:!0},{no:3,name:"t",kind:"scalar",T:9,opt:!0}],{localName:"JWK_OTH"}),bi=i.makeMessageType("streamlayer.sdkSettings.OrganizationSettings",()=>[{no:1,name:"overlays",kind:"message",T:Ni,repeated:!0},{no:2,name:"button_icon",kind:"scalar",T:9},{no:3,name:"tinode_host",kind:"scalar",T:9},{no:4,name:"audience",kind:"scalar",T:9},{no:5,name:"name",kind:"scalar",T:9},{no:6,name:"provider",kind:"scalar",T:9},{no:7,name:"primary_color",kind:"scalar",T:9},{no:8,name:"secondary_color",kind:"scalar",T:9},{no:9,name:"moderation_primary_color",kind:"scalar",T:9},{no:10,name:"link_share_icon",kind:"scalar",T:9},{no:11,name:"link_share_text",kind:"scalar",T:9},{no:12,name:"brand_defaults",kind:"message",T:_i},{no:13,name:"pub",kind:"message",T:Fd},{no:14,name:"getstream",kind:"message",T:Dd},{no:15,name:"public_name",kind:"enum",T:i.getEnumType(vd)},{no:16,name:"analytics_version",kind:"enum",T:i.getEnumType(Ad)}]),Bd=i.makeMessageType("streamlayer.sdkSettings.GamesOverlaySettings",()=>[{no:1,name:"inplay_game",kind:"message",T:hd},{no:2,name:"moderation",kind:"message",T:bd},{no:3,name:"pinned_leaderboard_id",kind:"scalar",T:9},{no:4,name:"leaderboard_kind",kind:"enum",T:i.getEnumType(wd)}]),lo=i.makeMessageType("streamlayer.sdkSettings.GetStreamOverlaySettings",()=>[{no:1,name:"default_channel",kind:"message",T:Ln},{no:2,name:"channels",kind:"message",T:Ln,repeated:!0}]),Qt=i.makeMessageType("streamlayer.sdkSettings.SdkOverlaySettings",()=>[{no:4,name:"twitter",kind:"message",T:Ld,oneof:"overlay_settings"},{no:5,name:"betting",kind:"message",T:co,oneof:"overlay_settings"},{no:6,name:"inplay",kind:"message",T:co,oneof:"overlay_settings"},{no:7,name:"games",kind:"message",T:Bd,oneof:"overlay_settings"},{no:8,name:"getstream",kind:"message",T:lo,oneof:"overlay_settings"},{no:9,name:"public_chat",kind:"message",T:lo,oneof:"overlay_settings"}]),Vd=i.makeMessageType("streamlayer.sdkSettings.SdkOverlayMeta",()=>[{no:1,name:"organization",kind:"message",T:Qt},{no:2,name:"global_preset",kind:"message",T:Qt},{no:3,name:"preset",kind:"message",T:Qt},{no:4,name:"stream",kind:"message",T:Qt}]),Ni=i.makeMessageType("streamlayer.sdkSettings.SdkOverlay",()=>[{no:1,name:"type",kind:"enum",T:i.getEnumType(H)},{no:3,name:"position",kind:"scalar",T:5},{no:4,name:"overwrite",kind:"scalar",T:8},{no:5,name:"settings",kind:"message",T:Qt},{no:6,name:"meta",kind:"message",T:Vd},{no:7,name:"enable",kind:"scalar",T:8},{no:8,name:"sdk_enable",kind:"scalar",T:8},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"icon",kind:"scalar",T:9},{no:11,name:"svg_icon",kind:"scalar",T:9},{no:12,name:"enable_overwrite",kind:"scalar",T:9,oneof:"overwrite_flag"},{no:13,name:"disable_overwrite",kind:"scalar",T:9,oneof:"overwrite_flag"},{no:14,name:"enable_sdk_button",kind:"scalar",T:8}]),qd=i.makeMessageType("streamlayer.sdkSettings.AdvertisingImage",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"preview_url",kind:"scalar",T:9},{no:3,name:"file_url",kind:"scalar",T:9},{no:4,name:"placement",kind:"enum",T:i.getEnumType(Rd)}]),xd=i.makeMessageType("streamlayer.sdkSettings.AdvertisingVideo",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"preview_url",kind:"scalar",T:9},{no:3,name:"file_url",kind:"scalar",T:9},{no:4,name:"background_color",kind:"scalar",T:9}]),Hd=i.makeMessageType("streamlayer.sdkSettings.AdvertisingSettings",()=>[{no:1,name:"frequency",kind:"scalar",T:5},{no:2,name:"images",kind:"message",T:qd,repeated:!0},{no:3,name:"videos",kind:"message",T:xd,repeated:!0}]),Qd=i.makeMessageType("streamlayer.sdkSettings.AdvertisingOverlaySettings",()=>[{no:1,name:"overlay_type",kind:"enum",T:i.getEnumType(H)},{no:2,name:"settings",kind:"map",K:9,V:{kind:"message",T:Hd}},{no:3,name:"enabled",kind:"scalar",T:8},{no:4,name:"overlay_name",kind:"scalar",T:9},{no:5,name:"use_custom",kind:"scalar",T:8,opt:!0}]),Yd=i.makeMessageType("streamlayer.sdkSettings.Advertising",()=>[{no:1,name:"template_id",kind:"scalar",T:9},{no:2,name:"overlay_settings",kind:"map",K:9,V:{kind:"message",T:Qd}}]),Ba=i.makeEnum("streamlayer.analytics.v1.invitations.InvitationCategory",[{no:0,name:"INVITATION_CATEGORY_UNSET",localName:"UNSET"},{no:1,name:"INVITATION_CATEGORY_WATCHING",localName:"WATCHING"},{no:2,name:"INVITATION_CATEGORY_MESSAGING",localName:"MESSAGING"},{no:3,name:"INVITATION_CATEGORY_VOICING",localName:"VOICING"},{no:4,name:"INVITATION_CATEGORY_GAMES",localName:"GAMES"}]),Mn=i.makeEnum("streamlayer.analytics.v1.invitations.InvitationFrom",[{no:0,name:"INVITATION_FROM_UNSET",localName:"UNSET"},{no:1,name:"INVITATION_FROM_TITLE_CARD",localName:"TITLE_CARD"},{no:2,name:"INVITATION_FROM_MENU",localName:"MENU"}]);let ca=0,mo=[];function jd(){return ca+=1,()=>{if(ca-=1,ca===0){let e=mo;mo=[];for(let t of e)t()}}}let le=[],nt=(e,t)=>{let n=[],a={get(){return a.lc||a.listen(()=>{})(),a.value},l:t||0,lc:0,listen(s,o){return a.lc=n.push(s,o||a.l)/2,()=>{let r=n.indexOf(s);~r&&(n.splice(r,2),--a.lc||a.off())}},notify(s,o){let r=!le.length;for(let c=0;c<n.length;c+=2)le.push(n[c],n[c+1],a.value,s,o);if(r){for(let c=0;c<le.length;c+=5){let l;for(let m=c+1;!l&&(m+=5)<le.length;)le[m]<le[c+1]&&(l=le.push(le[c],le[c+1],le[c+2],le[c+3],le[c+4]));l||le[c](le[c+2],le[c+3],le[c+4])}le.length=0}},off(){},set(s){let o=a.value;o!==s&&(a.value=s,a.notify(o))},subscribe(s,o){let r=a.listen(s,o);return s(a.value),r},value:e};return a};const $d=0,Kd=1,Wd=5,ln=6,mn=10;let _s=(e,t,n,a)=>(e.events=e.events||{},e.events[n+mn]||(e.events[n+mn]=a(s=>{e.events[n].reduceRight((o,r)=>(r(o),o),{shared:{},...s})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let s=e.events[n],o=s.indexOf(t);s.splice(o,1),s.length||(delete e.events[n],e.events[n+mn](),delete e.events[n+mn])}),zd=(e,t)=>_s(e,t,$d,n=>{let a=e.listen;return e.listen=s=>(!e.lc&&!e.starting&&(e.starting=!0,n(),delete e.starting),a(s)),()=>{e.listen=a}}),Jd=(e,t)=>_s(e,t,Kd,n=>{let a=e.off;return e.off=()=>{n(),a()},()=>{e.off=a}}),Xd=1e3,jn=(e,t)=>_s(e,a=>{let s=t(a);s&&e.events[ln].push(s)},Wd,a=>{let s=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,a()),s(...r));let o=e.off;return e.events[ln]=[],e.off=()=>{o(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let r of e.events[ln])r();e.events[ln]=[]}},Xd)},()=>{e.listen=s,e.off=o}}),Ii=(e,t,n)=>{Array.isArray(e)||(e=[e]);let a,s=0,o=()=>{let m=e.map(u=>u.get());if(a===void 0||m.some((u,d)=>u!==a[d])){let u=++s;a=m;let d=t(...m);d&&d.then&&d.t?d.then(y=>{u===s&&r.set(y)}):r.set(d)}},r=nt(void 0,Math.max(...e.map(m=>m.l))+1),c,l=n?()=>{clearTimeout(c),c=setTimeout(o)}:o;return jn(r,()=>{let m=e.map(u=>u.listen(l,-1/r.l));return o(),()=>{for(let u of m)u()}}),r},Zd=(e,t)=>Ii(e,t),uo=(e,t)=>Ii(e,t,!0),Va=(e={})=>{let t=nt(e);return t.setKey=function(n,a){let s=t.value;typeof a>"u"&&n in t.value?(t.value={...t.value},delete t.value[n],t.notify(s,n)):t.value[n]!==a&&(t.value={...t.value,[n]:a},t.notify(s,n))},t},qa=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");exports.Code=void 0;(function(e){e[e.Canceled=1]="Canceled",e[e.Unknown=2]="Unknown",e[e.InvalidArgument=3]="InvalidArgument",e[e.DeadlineExceeded=4]="DeadlineExceeded",e[e.NotFound=5]="NotFound",e[e.AlreadyExists=6]="AlreadyExists",e[e.PermissionDenied=7]="PermissionDenied",e[e.ResourceExhausted=8]="ResourceExhausted",e[e.FailedPrecondition=9]="FailedPrecondition",e[e.Aborted=10]="Aborted",e[e.OutOfRange=11]="OutOfRange",e[e.Unimplemented=12]="Unimplemented",e[e.Internal=13]="Internal",e[e.Unavailable=14]="Unavailable",e[e.DataLoss=15]="DataLoss",e[e.Unauthenticated=16]="Unauthenticated"})(exports.Code||(exports.Code={}));function po(e){const t=exports.Code[e];return typeof t!="string"?e.toString():t[0].toLowerCase()+t.substring(1).replace(/[A-Z]/g,n=>"_"+n.toLowerCase())}class x extends Error{constructor(t,n=exports.Code.Unknown,a,s,o){super(ep(t,n)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=t,this.code=n,this.metadata=new Headers(a??{}),this.details=s??[],this.cause=o}static from(t,n=exports.Code.Unknown){return t instanceof x?t:t instanceof Error?t.name=="AbortError"?new x(t.message,exports.Code.Canceled):new x(t.message,n,void 0,void 0,t):new x(String(t),n,void 0,void 0,t)}static[Symbol.hasInstance](t){return t instanceof Error?Object.getPrototypeOf(t)===x.prototype?!0:t.name==="ConnectError"&&"code"in t&&typeof t.code=="number"&&"metadata"in t&&"details"in t&&Array.isArray(t.details)&&"rawMessage"in t&&typeof t.rawMessage=="string"&&"cause"in t:!1}findDetails(t){const n="typeName"in t?{findMessage:s=>s===t.typeName?t:void 0}:t,a=[];for(const s of this.details){if("getType"in s){n.findMessage(s.getType().typeName)&&a.push(s);continue}const o=n.findMessage(s.type);if(o)try{a.push(o.fromBinary(s.value))}catch{}}return a}}function ep(e,t){return e.length?`[${po(t)}] ${e}`:`[${po(t)}]`}function tp(e,t,n){try{const a=us.dec(e);return t?t.fromBinary(a,n):a}catch(a){throw x.from(a,exports.Code.DataLoss)}}function np(e,t){const n={};for(const[a,s]of Object.entries(e.methods)){const o=t(Object.assign(Object.assign({},s),{localName:a,service:e}));o!=null&&(n[a]=o)}return n}const To=1;function yo(e){let t,n=new Uint8Array(0);function a(s){const o=new Uint8Array(n.length+s.length);o.set(n),o.set(s,n.length),n=o}return new ReadableStream({start(){t=e.getReader()},async pull(s){let o;for(;;){if(o===void 0&&n.byteLength>=5){let l=0;for(let m=1;m<5;m++)l=(l<<8)+n[m];o={flags:n[0],length:l}}if(o!==void 0&&n.byteLength>=o.length+5)break;const c=await t.read();if(c.done)break;a(c.value)}if(o===void 0){if(n.byteLength==0){s.close();return}s.error(new x("premature end of stream",exports.Code.DataLoss));return}const r=n.subarray(5,5+o.length);n=n.subarray(5+o.length),s.enqueue({flags:o.flags,data:r})}})}function fo(e,t){const n=new Uint8Array(t.length+5);n.set(t,5);const a=new DataView(n.buffer,n.byteOffset,n.byteLength);return a.setUint8(0,e),a.setUint32(1,t.length),n}var ap=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n);function a(o){n[o]=e[o]&&function(r){return new Promise(function(c,l){r=e[o](r),s(c,l,r.done,r.value)})}}function s(o,r,c,l){Promise.resolve(l).then(function(m){o({value:m,done:c})},r)}},Jt=function(e){return this instanceof Jt?(this.v=e,this):new Jt(e)},sp=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=n.apply(e,t||[]),s,o=[];return s={},c("next"),c("throw"),c("return",r),s[Symbol.asyncIterator]=function(){return this},s;function r(T){return function(f){return Promise.resolve(f).then(T,d)}}function c(T,f){a[T]&&(s[T]=function(_){return new Promise(function(N,E){o.push([T,_,N,E])>1||l(T,_)})},f&&(s[T]=f(s[T])))}function l(T,f){try{m(a[T](f))}catch(_){y(o[0][3],_)}}function m(T){T.value instanceof Jt?Promise.resolve(T.value.v).then(u,d):y(o[0][2],T)}function u(T){l("next",T)}function d(T){l("throw",T)}function y(T,f){T(f),o.shift(),o.length&&l(o[0][0],o[0][1])}},op=function(e){var t,n;return t={},a("next"),a("throw",function(s){throw s}),a("return"),t[Symbol.iterator]=function(){return this},t;function a(s,o){t[s]=e[s]?function(r){return(n=!n)?{value:Jt(e[s](r)),done:!1}:o?o(r):r}:o}};function rp(e){return sp(this,arguments,function*(){yield Jt(yield*op(ap(e)))})}var Oi=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n);function a(o){n[o]=e[o]&&function(r){return new Promise(function(c,l){r=e[o](r),s(c,l,r.done,r.value)})}}function s(o,r,c,l){Promise.resolve(l).then(function(m){o({value:m,done:c})},r)}},Ct=function(e){return this instanceof Ct?(this.v=e,this):new Ct(e)},ip=function(e){var t,n;return t={},a("next"),a("throw",function(s){throw s}),a("return"),t[Symbol.iterator]=function(){return this},t;function a(s,o){t[s]=e[s]?function(r){return(n=!n)?{value:Ct(e[s](r)),done:!1}:o?o(r):r}:o}},cp=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=n.apply(e,t||[]),s,o=[];return s={},c("next"),c("throw"),c("return",r),s[Symbol.asyncIterator]=function(){return this},s;function r(T){return function(f){return Promise.resolve(f).then(T,d)}}function c(T,f){a[T]&&(s[T]=function(_){return new Promise(function(N,E){o.push([T,_,N,E])>1||l(T,_)})},f&&(s[T]=f(s[T])))}function l(T,f){try{m(a[T](f))}catch(_){y(o[0][3],_)}}function m(T){T.value instanceof Ct?Promise.resolve(T.value.v).then(u,d):y(o[0][2],T)}function u(T){l("next",T)}function d(T){l("throw",T)}function y(T,f){T(f),o.shift(),o.length&&l(o[0][0],o[0][1])}};function go(e,t){return np(e,n=>{switch(n.kind){case R.Unary:return lp(t,e,n);case R.ServerStreaming:return mp(t,e,n);case R.ClientStreaming:return up(t,e,n);case R.BiDiStreaming:return dp(t,e,n);default:return null}})}function lp(e,t,n){return async function(a,s){var o,r;const c=await e.unary(t,n,s==null?void 0:s.signal,s==null?void 0:s.timeoutMs,s==null?void 0:s.headers,a,s==null?void 0:s.contextValues);return(o=s==null?void 0:s.onHeader)===null||o===void 0||o.call(s,c.header),(r=s==null?void 0:s.onTrailer)===null||r===void 0||r.call(s,c.trailer),c.message}}function mp(e,t,n){return function(a,s){return vi(e.stream(t,n,s==null?void 0:s.signal,s==null?void 0:s.timeoutMs,s==null?void 0:s.headers,rp([a]),s==null?void 0:s.contextValues),s)}}function up(e,t,n){return async function(a,s){var o,r,c,l,m,u;const d=await e.stream(t,n,s==null?void 0:s.signal,s==null?void 0:s.timeoutMs,s==null?void 0:s.headers,a,s==null?void 0:s.contextValues);(m=s==null?void 0:s.onHeader)===null||m===void 0||m.call(s,d.header);let y,T=0;try{for(var f=!0,_=Oi(d.message),N;N=await _.next(),o=N.done,!o;f=!0)l=N.value,f=!1,y=l,T++}catch(E){r={error:E}}finally{try{!f&&!o&&(c=_.return)&&await c.call(_)}finally{if(r)throw r.error}}if(!y)throw new x("protocol error: missing response message",exports.Code.Unimplemented);if(T>1)throw new x("protocol error: received extra messages for client streaming method",exports.Code.Unimplemented);return(u=s==null?void 0:s.onTrailer)===null||u===void 0||u.call(s,d.trailer),y}}function dp(e,t,n){return function(a,s){return vi(e.stream(t,n,s==null?void 0:s.signal,s==null?void 0:s.timeoutMs,s==null?void 0:s.headers,a,s==null?void 0:s.contextValues),s)}}function vi(e,t){const n=function(){return cp(this,arguments,function*(){var a,s;const o=yield Ct(e);(a=t==null?void 0:t.onHeader)===null||a===void 0||a.call(t,o.header),yield Ct(yield*ip(Oi(o.message))),(s=t==null?void 0:t.onTrailer)===null||s===void 0||s.call(t,o.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}function pp(...e){const t=new AbortController,n=e.filter(s=>s!==void 0).concat(t.signal);for(const s of n){if(s.aborted){a.apply(s);break}s.addEventListener("abort",a)}function a(){t.signal.aborted||t.abort(Ai(this));for(const s of n)s.removeEventListener("abort",a)}return t}function Tp(e){const t=new AbortController,n=()=>{t.abort(new x("the operation timed out",exports.Code.DeadlineExceeded))};let a;return e!==void 0&&(e<=0?n():a=setTimeout(n,e)),{signal:t.signal,cleanup:()=>clearTimeout(a)}}function Ai(e){if(!e.aborted)return;if(e.reason!==void 0)return e.reason;const t=new Error("This operation was aborted");return t.name="AbortError",t}function xa(){return{get(e){return e.id in this?this[e.id]:e.defaultValue},set(e,t){return this[e.id]=t,this},delete(e){return delete this[e.id],this}}}function Ha(e,t){return{id:Symbol(t==null?void 0:t.description),defaultValue:e}}const la=128;function ko(e){const t=new Headers,n=new TextDecoder().decode(e).split(`\r
3
3
  `);for(const a of n){if(a==="")continue;const s=a.indexOf(":");if(s>0){const o=a.substring(0,s).trim(),r=a.substring(s+1).trim();t.append(o,r)}}return t}const yp="Content-Type",fp="Grpc-Timeout",Dt="Grpc-Status",wi="Grpc-Message",gp="Grpc-Status-Details-Bin",kp="X-User-Agent",hp="X-Grpc-Web",Sp="application/grpc-web+proto",_p="application/grpc-web+json";class Qe extends Zt{constructor(t){super(),this.code=0,this.message="",this.details=[],i.util.initPartial(t,this)}static fromBinary(t,n){return new Qe().fromBinary(t,n)}static fromJson(t,n){return new Qe().fromJson(t,n)}static fromJsonString(t,n){return new Qe().fromJsonString(t,n)}static equals(t,n){return i.util.equals(Qe,t,n)}}Qe.runtime=i;Qe.typeName="google.rpc.Status";Qe.fields=i.util.newFieldList(()=>[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"details",kind:"message",T:De,repeated:!0}]);const Ep="0";function Ri(e){var t;const n=e.get(gp);if(n!=null){const s=tp(n,Qe);if(s.code==0)return;const o=new x(s.message,s.code,e);return o.details=s.details.map(r=>({type:r.typeUrl.substring(r.typeUrl.lastIndexOf("/")+1),value:r.value})),o}const a=e.get(Dt);if(a!=null){if(a===Ep)return;const s=parseInt(a,10);return s in exports.Code?new x(decodeURIComponent((t=e.get(wi))!==null&&t!==void 0?t:""),s,e):new x(`invalid grpc-status: ${a}`,exports.Code.Internal,e)}}function ho(e,t,n){const a=typeof t=="string"?t:t.typeName,s=typeof n=="string"?n:n.name;return e.toString().replace(/\/?$/,`/${a}/${s}`)}function Li(e,t){return t instanceof e?t:new e(t)}function bp(e,t){function n(a){return a.done===!0?a:{done:a.done,value:Li(e,a.value)}}return{[Symbol.asyncIterator](){const a=t[Symbol.asyncIterator](),s={next:()=>a.next().then(n)};return a.throw!==void 0&&(s.throw=o=>a.throw(o).then(n)),a.return!==void 0&&(s.return=o=>a.return(o).then(n)),s}}}function Mi(e,t){var n;return(n=t==null?void 0:t.concat().reverse().reduce((a,s)=>s(a),e))!==null&&n!==void 0?n:e}function Np(e){var t;const n=Object.assign({},e);return(t=n.ignoreUnknownFields)!==null&&t!==void 0||(n.ignoreUnknownFields=!0),n}function So(e,t,n,a){const s=t?_o(e.I,a):Eo(e.I,n);return{parse:(t?_o(e.O,a):Eo(e.O,n)).parse,serialize:s.serialize}}function _o(e,t){return{parse(n){try{return e.fromBinary(n,t)}catch(a){const s=a instanceof Error?a.message:String(a);throw new x(`parse binary: ${s}`,exports.Code.Internal)}},serialize(n){try{return n.toBinary(t)}catch(a){const s=a instanceof Error?a.message:String(a);throw new x(`serialize binary: ${s}`,exports.Code.Internal)}}}}function Eo(e,t){var n,a;const s=(n=t==null?void 0:t.textEncoder)!==null&&n!==void 0?n:new TextEncoder,o=(a=t==null?void 0:t.textDecoder)!==null&&a!==void 0?a:new TextDecoder,r=Np(t);return{parse(c){try{const l=o.decode(c);return e.fromJsonString(l,r)}catch(l){throw x.from(l,exports.Code.InvalidArgument)}},serialize(c){try{const l=c.toJsonString(r);return s.encode(l)}catch(l){throw x.from(l,exports.Code.Internal)}}}}function Ip(e){const t=Mi(e.next,e.interceptors),[n,a,s]=Pi(e),o=Object.assign(Object.assign({},e.req),{message:Li(e.req.method.I,e.req.message),signal:n});return t(o).then(r=>(s(),r),a)}function Op(e){const t=Mi(e.next,e.interceptors),[n,a,s]=Pi(e),o=Object.assign(Object.assign({},e.req),{message:bp(e.req.method.I,e.req.message),signal:n});let r=!1;return n.addEventListener("abort",function(){var c,l;const m=e.req.message[Symbol.asyncIterator]();r||(c=m.throw)===null||c===void 0||c.call(m,this.reason).catch(()=>{}),(l=m.return)===null||l===void 0||l.call(m).catch(()=>{})}),t(o).then(c=>Object.assign(Object.assign({},c),{message:{[Symbol.asyncIterator](){const l=c.message[Symbol.asyncIterator]();return{next(){return l.next().then(m=>(m.done==!0&&(r=!0,s()),m),a)}}}}}),a)}function Pi(e){const{signal:t,cleanup:n}=Tp(e.timeoutMs),a=pp(e.signal,t);return[a.signal,function(o){const r=x.from(t.aborted?Ai(t):o);return a.abort(r),n(),Promise.reject(r)},function(){n(),a.abort()}]}function vp(){try{new Headers}catch{throw new Error("connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.")}}function bo(e,t){const n=Ri(e);if(n)throw t.forEach((a,s)=>{n.metadata.append(s,a)}),n;if(!t.has(Dt)&&!e.has(Dt))throw new x("protocol error: missing status",exports.Code.Internal)}function No(e,t,n,a){const s=new Headers(n??{});return s.set(yp,e?Sp:_p),s.set(hp,"1"),s.set(kp,"connect-es/1.5.0"),t!==void 0&&s.set(fp,`${t}m`),s}function Ap(e){switch(e){case 400:return exports.Code.Internal;case 401:return exports.Code.Unauthenticated;case 403:return exports.Code.PermissionDenied;case 404:return exports.Code.Unimplemented;case 429:return exports.Code.Unavailable;case 502:return exports.Code.Unavailable;case 503:return exports.Code.Unavailable;case 504:return exports.Code.Unavailable;default:return exports.Code.Unknown}}function Io(e,t){var n;if(e>=200&&e<300)return{foundStatus:t.has(Dt),headerError:Ri(t)};throw new x(decodeURIComponent((n=t.get(wi))!==null&&n!==void 0?n:`HTTP ${e}`),Ap(e),t)}var mt=function(e){return this instanceof mt?(this.v=e,this):new mt(e)},wp=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=n.apply(e,t||[]),s,o=[];return s={},c("next"),c("throw"),c("return",r),s[Symbol.asyncIterator]=function(){return this},s;function r(T){return function(f){return Promise.resolve(f).then(T,d)}}function c(T,f){a[T]&&(s[T]=function(_){return new Promise(function(N,E){o.push([T,_,N,E])>1||l(T,_)})},f&&(s[T]=f(s[T])))}function l(T,f){try{m(a[T](f))}catch(_){y(o[0][3],_)}}function m(T){T.value instanceof mt?Promise.resolve(T.value.v).then(u,d):y(o[0][2],T)}function u(T){l("next",T)}function d(T){l("throw",T)}function y(T,f){T(f),o.shift(),o.length&&l(o[0][0],o[0][1])}};function Oo(e){var t;vp();const n=(t=e.useBinaryFormat)!==null&&t!==void 0?t:!0;return{async unary(a,s,o,r,c,l,m){var u;const{serialize:d,parse:y}=So(s,n,e.jsonOptions,e.binaryOptions);return r=r===void 0?e.defaultTimeoutMs:r<=0?void 0:r,await Ip({interceptors:e.interceptors,signal:o,timeoutMs:r,req:{stream:!1,service:a,method:s,url:ho(e.baseUrl,a,s),init:{method:"POST",credentials:(u=e.credentials)!==null&&u!==void 0?u:"same-origin",redirect:"error",mode:"cors"},header:No(n,r,c),contextValues:m??xa(),message:l},next:async T=>{var f;const N=await((f=e.fetch)!==null&&f!==void 0?f:globalThis.fetch)(T.url,Object.assign(Object.assign({},T.init),{headers:T.header,signal:T.signal,body:fo(0,d(T.message))})),{headerError:E}=Io(N.status,N.headers);if(!N.body)throw E!==void 0?E:"missing response body";const b=yo(N.body).getReader();let w,O;for(;;){const A=await b.read();if(A.done)break;const{flags:L,data:v}=A.value;if((L&To)===To)throw new x("protocol error: received unsupported compressed output",exports.Code.Internal);if(L===la){if(w!==void 0)throw"extra trailer";w=ko(v);continue}if(O!==void 0)throw new x("extra message",exports.Code.Unimplemented);O=y(v)}if(w===void 0)throw E!==void 0?E:new x("missing trailer",N.headers.has(Dt)?exports.Code.Unimplemented:exports.Code.Unknown);if(bo(w,N.headers),O===void 0)throw new x("missing message",w.has(Dt)?exports.Code.Unimplemented:exports.Code.Unknown);return{stream:!1,service:a,method:s,header:N.headers,message:O,trailer:w}}})},async stream(a,s,o,r,c,l,m){var u;const{serialize:d,parse:y}=So(s,n,e.jsonOptions,e.binaryOptions);function T(_,N,E,b,w,O){return wp(this,arguments,function*(){const L=yo(_).getReader();if(N){if(!(yield mt(L.read())).done)throw"extra data for trailers-only";return yield mt(void 0)}let v=!1;for(;;){const D=yield mt(L.read());if(D.done)break;const{flags:j,data:te}=D.value;if((j&la)===la){if(v)throw"extra trailer";v=!0;const $=ko(te);bo($,b),$.forEach((K,G)=>E.set(G,K));continue}if(v)throw"extra message";yield yield mt(y(te))}if("throwIfAborted"in O&&O.throwIfAborted(),!v)throw w||"missing trailer"})}async function f(_){if(s.kind!=R.ServerStreaming)throw"The fetch API does not support streaming request bodies";const N=await _[Symbol.asyncIterator]().next();if(N.done==!0)throw"missing request message";return fo(0,d(N.value))}return r=r===void 0?e.defaultTimeoutMs:r<=0?void 0:r,Op({interceptors:e.interceptors,signal:o,timeoutMs:r,req:{stream:!0,service:a,method:s,url:ho(e.baseUrl,a,s),init:{method:"POST",credentials:(u=e.credentials)!==null&&u!==void 0?u:"same-origin",redirect:"error",mode:"cors"},header:No(n,r,c),contextValues:m??xa(),message:l},next:async _=>{var N;const b=await((N=e.fetch)!==null&&N!==void 0?N:globalThis.fetch)(_.url,Object.assign(Object.assign({},_.init),{headers:_.header,signal:_.signal,body:await f(_.message)})),{foundStatus:w,headerError:O}=Io(b.status,b.headers);if(!b.body)throw O??"missing response body";const A=new Headers;return Object.assign(Object.assign({},_),{header:b.headers,trailer:A,message:T(b.body,w,A,b.headers,O,_.signal)})}})}}}let Rp=()=>({emit(e,...t){let n=this.events[e]||[];for(let a=0,s=n.length;a<s;a++)n[a](...t)},events:{},on(e,t){var n;return(n=this.events[e])!=null&&n.push(t)||(this.events[e]=[t]),()=>{var a;this.events[e]=(a=this.events[e])==null?void 0:a.filter(s=>t!==s)}}});const vo=({cache:e=new Map,fetcher:t,...n}={})=>{const a=Rp();let s=!0;Mo("visibilitychange",()=>{s=!document.hidden,s&&a.emit(wo)}),Mo("online",()=>a.emit(Ro));const o=new Map,r=new Map,c=new Map;let l={};const m=async([E,b],w,O,A)=>{var L;if(!s)return;const v=G=>{w.key===E&&(w.set(G),a.emit(ma,E,G,!0))},D=()=>{v({...w.value,...Co,promise:c.get(E)})},{dedupeTime:j=4e3,fetcher:te}={...O,...l},$=Po();if(c.has(E)){w.value.loading||D();return}if(!A){const G=e.get(E);G&&w.value.data!==G&&v({data:G,...Xe});const B=r.get(E);if(B&&B+j>$)return}const K=jd();try{const G=te(...b);r.set(E,$),c.set(E,G),D();const B=await G;e.set(E,B),v({data:B,...Xe}),r.set(E,Po())}catch(G){(L=O.onError)==null||L.call(O,G),v({data:w.value.data,error:G,...Xe})}finally{K(),c.delete(E)}},u=(E,{fetcher:b=t,...w}={})=>{const O=Va({...Xe}),A={...n,...w,fetcher:b};O._=Ci,O.invalidate=()=>{const{key:B}=O;B&&T(B)},O.mutate=B=>{const{key:J}=O;J&&f(J,B)};let L,v,D,j,te,$=[];zd(O,()=>{const B=!L;[te,L]=Lp(E),j=te.subscribe(ge=>{if(ge){const[ke,g]=ge;O.key=ke,m([ke,g],O,A),v=ke,D=g}else O.key=v=D=void 0,O.set({...Xe})});const J=te.get();J&&([v,D]=J,B&&K());const{refetchInterval:Fe=0,refetchOnFocus:qt,refetchOnReconnect:ze}=A,fe=()=>{v&&m([v,D],O,A)};Fe>0&&o.set(E,setInterval(fe,Fe)),qt&&$.push(a.on(wo,fe)),ze&&$.push(a.on(Ro,fe)),$.push(a.on(Lo,ge=>{v&&ua(v,ge)&&m([v,D],O,A,!0)}),a.on(ma,(ge,ke,g)=>{v&&ua(v,ge)&&O.value!==ke&&O.value.data!==ke&&O.set(g?ke:{data:ke,...Xe})}))});const K=()=>{v&&D&&m([v,D],O,A)},G=O.listen;return O.listen=B=>{const J=G(B);return B(O.value),K(),J},Jd(O,()=>{O.value={...Xe},L==null||L(),$.forEach(B=>B()),$=[],j==null||j(),clearInterval(o.get(E))}),O},d=E=>{e.delete(E),r.delete(E)},y=(E,b)=>{for(const w of e.keys())ua(w,E)&&b(w)},T=E=>{y(E,d),a.emit(Lo,E)},f=(E,b)=>{y(E,w=>{b===void 0?d(w):e.set(w,b)}),a.emit(ma,E,b)};function _(E){const b=async O=>{var A;const L=l.fetcher??E,v=[];try{w.set({error:void 0,data:void 0,mutate:b,...Co});const D=await L({data:O,invalidate:j=>{v.push(j)},getCacheUpdater:(j,te=!0)=>[$=>{f(j,$),te&&v.push(j)},e.get(j)]});return w.setKey("data",D),D}catch(D){(A=n==null?void 0:n.onError)==null||A.call(n,D),w.setKey("error",D)}finally{w.setKey("loading",!1),v.forEach(T)}},w=Va({mutate:b,...Xe});return w.mutate=b,w}return[u,_,{__unsafeOverruleSettings:E=>{console.warn("You should only use __unsafeOverruleSettings in test environment"),l=E},invalidateKeys:T,mutateCache:f}]};function Ao(e){return typeof e=="string"||typeof e=="number"||e===!0}const Lp=e=>{if(Ao(e))return[nt([""+e,[e]]),()=>{}];let t=nt(null),n=[];const a=()=>{n.some(o=>o==null||o===!1)?t.set(null):t.set([n.join(""),n])},s=[];for(let o=0;o<e.length;o++){const r=e[o];Ao(r)?n.push(r):s.push(r.subscribe(c=>{n[o]=Mp(r)?r.value&&"data"in r.value?r.key:null:c,a()}))}return a(),[t,()=>s.forEach(o=>o())]};function Mp(e){return e._===Ci}const wo=1,Ro=2,Lo=3,ma=4,Mo=(e,t)=>{typeof window>"u"||addEventListener(e,t)},ua=(e,t)=>Array.isArray(t)?t.includes(e):typeof t=="function"?t(e):e===t,Po=()=>new Date().getTime(),Ci=Symbol(),Co={loading:!0},Xe={loading:!1},Di=i.makeEnum("streamlayer.sports.EventStatus",[{no:0,name:"EVENT_STATUS_UNSET",localName:"UNSET"},{no:1,name:"EVENT_STATUS_PREGAME",localName:"PREGAME"},{no:2,name:"EVENT_STATUS_ACTIVE",localName:"ACTIVE"},{no:3,name:"EVENT_STATUS_BREAK",localName:"BREAK"},{no:4,name:"EVENT_STATUS_OVERTIME",localName:"OVERTIME"},{no:5,name:"EVENT_STATUS_SHOOTOUTS",localName:"SHOOTOUTS"},{no:6,name:"EVENT_STATUS_POSTGAME",localName:"POSTGAME"},{no:7,name:"EVENT_STATUS_CANCELLED",localName:"CANCELLED"}]),Ui=i.makeEnum("streamlayer.sports.EventEndless",[{no:0,name:"EVENT_ENDLESS_UNSET",localName:"UNSET"},{no:1,name:"EVENT_ENDLESS_ENABLED",localName:"ENABLED"},{no:2,name:"EVENT_ENDLESS_DISABLED",localName:"DISABLED"}]),$n=i.makeMessageType("streamlayer.sports.Pagination",()=>[{no:1,name:"page",kind:"scalar",T:5},{no:2,name:"page_size",kind:"scalar",T:5}]),Fi=i.makeMessageType("streamlayer.sports.Sort",()=>[{no:1,name:"field",kind:"scalar",T:9},{no:2,name:"order",kind:"scalar",T:9}]),Kn=i.makeMessageType("streamlayer.sports.Meta",()=>[{no:1,name:"count",kind:"scalar",T:5},{no:2,name:"page",kind:"scalar",T:5},{no:3,name:"page_size",kind:"scalar",T:5}]),Gi=i.makeMessageType("streamlayer.sports.Venue",()=>[{no:1,name:"city",kind:"scalar",T:9},{no:2,name:"country",kind:"scalar",T:9},{no:3,name:"stadium",kind:"scalar",T:9}]),Wn=i.makeMessageType("streamlayer.sports.EventTime",()=>[{no:1,name:"clock",kind:"scalar",T:9},{no:2,name:"period",kind:"scalar",T:5}]),Pp=i.makeMessageType("streamlayer.sports.EventPeriod",()=>[{no:1,name:"number",kind:"scalar",T:5},{no:2,name:"score_home",kind:"scalar",T:5},{no:3,name:"score_away",kind:"scalar",T:5}]),at=i.makeMessageType("streamlayer.sports.TeamRecord",()=>[{no:1,name:"wins",kind:"scalar",T:5},{no:2,name:"losses",kind:"scalar",T:5}]),st=i.makeMessageType("streamlayer.sports.EventTeam",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"alias",kind:"scalar",T:9},{no:4,name:"logo",kind:"scalar",T:9},{no:5,name:"colors",kind:"scalar",T:9,repeated:!0},{no:6,name:"is_winner",kind:"scalar",T:8}]),Cp=i.makeMessageType("streamlayer.sports.EventCustomFields",()=>[{no:1,name:"preview",kind:"scalar",T:9},{no:2,name:"stream",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"logo",kind:"scalar",T:9},{no:5,name:"event_ids",kind:"scalar",T:9,repeated:!0},{no:6,name:"subtitle",kind:"scalar",T:9},{no:7,name:"promotitle",kind:"scalar",T:9},{no:8,name:"slate",kind:"scalar",T:9},{no:9,name:"horizontal_preview",kind:"scalar",T:9},{no:10,name:"small_logo",kind:"scalar",T:9},{no:11,name:"description",kind:"scalar",T:9}]),Dp=i.makeMessageType("streamlayer.sports.EventProgram",()=>[{no:1,name:"id",kind:"scalar",T:9,opt:!0},{no:2,name:"title",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:9},{no:4,name:"end_time",kind:"scalar",T:9},{no:5,name:"thumbnail_url",kind:"scalar",T:9},{no:6,name:"square_thumbnail_url",kind:"scalar",T:9}]),Up=i.makeMessageType("streamlayer.sports.EventData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"sport",kind:"scalar",T:9},{no:3,name:"league",kind:"scalar",T:9},{no:4,name:"scheduled",kind:"scalar",T:9},{no:5,name:"home",kind:"message",T:st},{no:6,name:"away",kind:"message",T:st},{no:7,name:"status",kind:"enum",T:i.getEnumType(Di)},{no:8,name:"custom_fields",kind:"message",T:Cp},{no:9,name:"start_time",kind:"scalar",T:9},{no:10,name:"end_time",kind:"scalar",T:9},{no:11,name:"venue",kind:"message",T:Gi},{no:12,name:"schedule",kind:"message",T:Dp,repeated:!0},{no:13,name:"endless",kind:"enum",T:i.getEnumType(Ui)},{no:14,name:"provider_id",kind:"scalar",T:9}]),gt=i.makeMessageType("streamlayer.sports.EventSummary",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"scheduled",kind:"scalar",T:9},{no:3,name:"score_home",kind:"scalar",T:5},{no:4,name:"score_away",kind:"scalar",T:5},{no:5,name:"venue",kind:"message",T:Gi},{no:6,name:"event_time",kind:"message",T:Wn},{no:7,name:"home_team",kind:"message",T:st},{no:8,name:"away_team",kind:"message",T:st},{no:9,name:"status",kind:"enum",T:i.getEnumType(Di)},{no:10,name:"periods",kind:"message",T:Pp,repeated:!0},{no:11,name:"league",kind:"scalar",T:9},{no:12,name:"start_time",kind:"scalar",T:9},{no:13,name:"end_time",kind:"scalar",T:9},{no:14,name:"name",kind:"scalar",T:9},{no:15,name:"logo",kind:"scalar",T:9},{no:16,name:"stream",kind:"scalar",T:9}]),Fp=i.makeEnum("streamlayer.sports.baseball.PitcherStatus",[{no:0,name:"PITCHER_STATUS_UNSET",localName:"UNSET"},{no:1,name:"PITCHER_STATUS_WIN",localName:"WIN"},{no:2,name:"PITCHER_STATUS_LOSS",localName:"LOSS"}]),Gp=i.makeEnum("streamlayer.sports.baseball.BaseballBase",[{no:0,name:"BASEBALL_BASE_UNSET",localName:"UNSET"},{no:1,name:"BASEBALL_BASE_FIRST",localName:"FIRST"},{no:2,name:"BASEBALL_BASE_SECOND",localName:"SECOND"},{no:3,name:"BASEBALL_BASE_THIRD",localName:"THIRD"}]),Do=i.makeMessageType("streamlayer.sports.baseball.PitcherSummary",()=>[{no:1,name:"statistics",kind:"message",T:Bi},{no:2,name:"status",kind:"enum",T:i.getEnumType(Fp)},{no:3,name:"win_rate",kind:"scalar",T:5},{no:4,name:"loss_rate",kind:"scalar",T:5}]),Bp=i.makeMessageType("streamlayer.sports.baseball.Runner",()=>[{no:1,name:"player_name",kind:"scalar",T:9},{no:2,name:"jersey_number",kind:"scalar",T:9}]),Vp=i.makeMessageType("streamlayer.sports.baseball.RunnerOnBase",()=>[{no:1,name:"base_number",kind:"enum",T:i.getEnumType(Gp)},{no:2,name:"player",kind:"message",T:Bp}]),qp=i.makeMessageType("streamlayer.sports.baseball.Hitting",()=>[{no:1,name:"player_name",kind:"scalar",T:9},{no:2,name:"hits_per_bat",kind:"scalar",T:9},{no:3,name:"runs",kind:"scalar",T:9},{no:4,name:"run_batted_in",kind:"scalar",T:9},{no:5,name:"walks",kind:"scalar",T:9},{no:6,name:"batting_average",kind:"scalar",T:9}]),xp=i.makeMessageType("streamlayer.sports.baseball.Batting",()=>[{no:1,name:"player_name",kind:"scalar",T:9},{no:2,name:"at_bat",kind:"scalar",T:9},{no:3,name:"runs",kind:"scalar",T:9},{no:4,name:"hits",kind:"scalar",T:9},{no:5,name:"batting_average",kind:"scalar",T:9}]),Bi=i.makeMessageType("streamlayer.sports.baseball.Pitching",()=>[{no:1,name:"player_name",kind:"scalar",T:9},{no:2,name:"innings_pitched",kind:"scalar",T:9},{no:3,name:"hits_by_pitch",kind:"scalar",T:9},{no:4,name:"earned_runs",kind:"scalar",T:9},{no:5,name:"walks",kind:"scalar",T:9},{no:6,name:"strikeouts",kind:"scalar",T:9}]),Uo=i.makeMessageType("streamlayer.sports.baseball.BaseballTeamSummary",()=>[{no:1,name:"hitting",kind:"message",T:qp,repeated:!0},{no:2,name:"batting",kind:"message",T:xp,repeated:!0},{no:3,name:"pitching",kind:"message",T:Bi,repeated:!0}]),Hp=i.makeMessageType("streamlayer.sports.baseball.BaseballSummary",()=>[{no:1,name:"home_pitcher",kind:"message",T:Do},{no:2,name:"away_pitcher",kind:"message",T:Do},{no:3,name:"home_statistics",kind:"message",T:Uo},{no:4,name:"away_statistics",kind:"message",T:Uo}]),Qp=i.makeMessageType("streamlayer.sports.baseball.BaseballPlayByPlayStatistics",()=>[{no:1,name:"team",kind:"message",T:st},{no:2,name:"inning",kind:"scalar",T:9},{no:3,name:"play_text",kind:"scalar",T:9},{no:4,name:"detail",kind:"message",T:Yp,repeated:!0},{no:5,name:"runs",kind:"scalar",T:5},{no:6,name:"hits",kind:"scalar",T:5},{no:7,name:"errors",kind:"scalar",T:5}]),Yp=i.makeMessageType("streamlayer.sports.baseball.BaseballPlayByPlayStatistics.BaseballPlayByPlayDetailStatistics",()=>[{no:1,name:"score_home",kind:"scalar",T:5},{no:2,name:"score_away",kind:"scalar",T:5},{no:3,name:"play_text",kind:"scalar",T:9},{no:4,name:"scoring",kind:"scalar",T:8},{no:7,name:"play_id",kind:"scalar",T:5}],{localName:"BaseballPlayByPlayStatistics_BaseballPlayByPlayDetailStatistics"}),jp=i.makeMessageType("streamlayer.sports.baseball.EventScore",()=>[{no:1,name:"outs",kind:"scalar",T:5},{no:2,name:"inning",kind:"scalar",T:5},{no:3,name:"inning_division",kind:"scalar",T:9},{no:4,name:"is_delayed",kind:"scalar",T:8},{no:5,name:"reason_for_delay",kind:"scalar",T:9},{no:6,name:"runners_on_base",kind:"message",T:Vp,repeated:!0},{no:7,name:"taken_bases",kind:"scalar",T:5},{no:8,name:"home_team_record",kind:"message",T:at},{no:9,name:"away_team_record",kind:"message",T:at}]),$p=i.makeMessageType("streamlayer.sports.baseball.PlayByPlay",()=>[{no:1,name:"statistics",kind:"message",T:Qp,repeated:!0}]),Kp=i.makeMessageType("streamlayer.sports.baseball.EventSummary",()=>[{no:1,name:"statistics",kind:"message",T:Hp}]),Wp=i.makeMessageType("streamlayer.sports.baseball.TeamStanding",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"alias",kind:"scalar",T:9},{no:4,name:"logo",kind:"scalar",T:9},{no:5,name:"colors",kind:"scalar",T:9,repeated:!0},{no:6,name:"wins",kind:"scalar",T:5},{no:7,name:"losses",kind:"scalar",T:5},{no:8,name:"pct",kind:"scalar",T:1},{no:9,name:"games_behind",kind:"scalar",T:5},{no:10,name:"streak",kind:"message",T:zp},{no:11,name:"rank",kind:"message",T:Jp},{no:12,name:"division",kind:"scalar",T:9},{no:13,name:"conference",kind:"scalar",T:9}]),zp=i.makeMessageType("streamlayer.sports.baseball.TeamStanding.Streak",()=>[{no:1,name:"losses",kind:"scalar",T:5},{no:2,name:"wins",kind:"scalar",T:5}],{localName:"TeamStanding_Streak"}),Jp=i.makeMessageType("streamlayer.sports.baseball.TeamStanding.Rank",()=>[{no:1,name:"division",kind:"scalar",T:5},{no:2,name:"conference",kind:"scalar",T:5}],{localName:"TeamStanding_Rank"}),Xp=i.makeMessageType("streamlayer.sports.baseball.Standings",()=>[{no:1,name:"standings",kind:"message",T:Wp,repeated:!0}]),Zp=i.makeEnum("streamlayer.sports.basketball.BasketballPerformerCategory",[{no:0,name:"BASKETBALL_PERFORMER_CATEGORY_UNSET",localName:"UNSET"},{no:1,name:"BASKETBALL_PERFORMER_CATEGORY_POINTS",localName:"POINTS"},{no:2,name:"BASKETBALL_PERFORMER_CATEGORY_REBOUNDS",localName:"REBOUNDS"},{no:3,name:"BASKETBALL_PERFORMER_CATEGORY_ASSISTS",localName:"ASSISTS"}]),eT=i.makeMessageType("streamlayer.sports.basketball.EventScore",()=>[{no:8,name:"home_team_record",kind:"message",T:at},{no:9,name:"away_team_record",kind:"message",T:at}]),Fo=i.makeMessageType("streamlayer.sports.basketball.BasketballTeamSummary",()=>[{no:1,name:"field_goal_percentage",kind:"scalar",T:1},{no:2,name:"three_pts_percentage",kind:"scalar",T:1},{no:3,name:"free_throw_percentage",kind:"scalar",T:1},{no:4,name:"assists",kind:"scalar",T:5},{no:5,name:"rebounds",kind:"scalar",T:5}]),Go=i.makeMessageType("streamlayer.sports.basketball.BasketballPerformer",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"photo",kind:"scalar",T:9},{no:3,name:"score",kind:"scalar",T:9}]),tT=i.makeMessageType("streamlayer.sports.basketball.BasketballPerformers",()=>[{no:1,name:"category",kind:"enum",T:i.getEnumType(Zp)},{no:2,name:"home_player",kind:"message",T:Go},{no:3,name:"away_player",kind:"message",T:Go}]),nT=i.makeMessageType("streamlayer.sports.basketball.BasketballSummary",()=>[{no:1,name:"home_statistics",kind:"message",T:Fo},{no:2,name:"away_statistics",kind:"message",T:Fo}]),aT=i.makeMessageType("streamlayer.sports.basketball.EventSummary",()=>[{no:1,name:"statistics",kind:"message",T:nT},{no:2,name:"top_performers",kind:"message",T:tT,repeated:!0},{no:3,name:"last_games",kind:"message",T:Vi}]),sT=i.makeMessageType("streamlayer.sports.basketball.BasketballPlayByPlayStatistics",()=>[{no:1,name:"team",kind:"message",T:st},{no:2,name:"event_time",kind:"message",T:Wn},{no:3,name:"score_home",kind:"scalar",T:5},{no:4,name:"score_away",kind:"scalar",T:5},{no:5,name:"play_text",kind:"scalar",T:9},{no:6,name:"scoring",kind:"scalar",T:8},{no:7,name:"play_id",kind:"scalar",T:5}]),oT=i.makeMessageType("streamlayer.sports.basketball.PlayByPlay",()=>[{no:1,name:"statistics",kind:"message",T:sT,repeated:!0}]),Bo=i.makeMessageType("streamlayer.sports.basketball.PlayerScores",()=>[{no:1,name:"jersey",kind:"scalar",T:5},{no:2,name:"full_name",kind:"scalar",T:9},{no:3,name:"points",kind:"scalar",T:5},{no:4,name:"assists",kind:"scalar",T:5},{no:5,name:"rebounds",kind:"scalar",T:5},{no:6,name:"minutes",kind:"scalar",T:1},{no:7,name:"starter",kind:"scalar",T:8}]),rT=i.makeMessageType("streamlayer.sports.basketball.Boxscore",()=>[{no:1,name:"home_players",kind:"message",T:Bo,repeated:!0},{no:2,name:"away_players",kind:"message",T:Bo,repeated:!0}]),iT=i.makeMessageType("streamlayer.sports.basketball.TeamStanding",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"alias",kind:"scalar",T:9},{no:4,name:"logo",kind:"scalar",T:9},{no:5,name:"colors",kind:"scalar",T:9,repeated:!0},{no:6,name:"wins",kind:"scalar",T:5},{no:7,name:"losses",kind:"scalar",T:5},{no:8,name:"pct",kind:"scalar",T:1},{no:9,name:"games_behind",kind:"scalar",T:5},{no:10,name:"streak",kind:"message",T:cT},{no:11,name:"rank",kind:"message",T:lT},{no:12,name:"division",kind:"scalar",T:9},{no:13,name:"conference",kind:"scalar",T:9}]),cT=i.makeMessageType("streamlayer.sports.basketball.TeamStanding.Streak",()=>[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"length",kind:"scalar",T:5}],{localName:"TeamStanding_Streak"}),lT=i.makeMessageType("streamlayer.sports.basketball.TeamStanding.Rank",()=>[{no:1,name:"division",kind:"scalar",T:5},{no:2,name:"conference",kind:"scalar",T:5}],{localName:"TeamStanding_Rank"}),mT=i.makeMessageType("streamlayer.sports.basketball.Standings",()=>[{no:1,name:"standings",kind:"message",T:iT,repeated:!0}]),Vo=i.makeMessageType("streamlayer.sports.basketball.BasketballMatchPlayer",()=>[{no:1,name:"first_name",kind:"scalar",T:9},{no:2,name:"last_name",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"photo",kind:"scalar",T:9},{no:5,name:"position",kind:"scalar",T:9},{no:6,name:"jersey",kind:"scalar",T:5}]),qo=i.makeMessageType("streamlayer.sports.basketball.BasketballMatchLineup",()=>[{no:3,name:"start_players",kind:"message",T:Vo,repeated:!0},{no:4,name:"substitutes",kind:"message",T:Vo,repeated:!0}]),uT=i.makeMessageType("streamlayer.sports.basketball.BasketballMatchLineups",()=>[{no:1,name:"home_team",kind:"message",T:qo},{no:2,name:"away_team",kind:"message",T:qo}]),da=i.makeMessageType("streamlayer.sports.basketball.BasketballLastGame",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"attributes",kind:"message",T:dT}]),dT=i.makeMessageType("streamlayer.sports.basketball.BasketballLastGame.BasketballLastGameAttributes",()=>[{no:1,name:"league",kind:"scalar",T:9},{no:2,name:"home_team",kind:"scalar",T:9},{no:3,name:"away_team",kind:"scalar",T:9},{no:5,name:"home_score",kind:"scalar",T:5},{no:6,name:"away_score",kind:"scalar",T:5},{no:7,name:"date",kind:"scalar",T:9}],{localName:"BasketballLastGame_BasketballLastGameAttributes"}),Vi=i.makeMessageType("streamlayer.sports.basketball.BasketballLastGames",()=>[{no:1,name:"home",kind:"message",T:da,repeated:!0},{no:2,name:"away",kind:"message",T:da,repeated:!0},{no:3,name:"head_to_head",kind:"message",T:da,repeated:!0}]),pT=i.makeEnum("streamlayer.sports.hockey.HockeyPerformerCategory",[{no:0,name:"HOCKEY_PERFORMER_CATEGORY_UNSET",localName:"UNSET"},{no:1,name:"HOCKEY_PERFORMER_CATEGORY_GOALS",localName:"GOALS"},{no:2,name:"HOCKEY_PERFORMER_CATEGORY_SHOTS",localName:"SHOTS"},{no:3,name:"HOCKEY_PERFORMER_CATEGORY_HITS",localName:"HITS"},{no:4,name:"HOCKEY_PERFORMER_CATEGORY_SAVES",localName:"SAVES"}]),qi=i.makeEnum("streamlayer.sports.hockey.HockeyPlayerPosition",[{no:0,name:"HOCKEY_PLAYER_POSITION_UNSET",localName:"UNSET"},{no:1,name:"HOCKEY_PLAYER_POSITION_CENTER",localName:"CENTER"},{no:2,name:"HOCKEY_PLAYER_POSITION_LEFT_WIND",localName:"LEFT_WIND"},{no:3,name:"HOCKEY_PLAYER_POSITION_RIGHT_WING",localName:"RIGHT_WING"},{no:4,name:"HOCKEY_PLAYER_POSITION_DEFENSE",localName:"DEFENSE"},{no:5,name:"HOCKEY_PLAYER_POSITION_GOALTENDER",localName:"GOALTENDER"}]),TT=i.makeMessageType("streamlayer.sports.hockey.EventScore",()=>[{no:8,name:"home_team_record",kind:"message",T:at},{no:9,name:"away_team_record",kind:"message",T:at}]),xo=i.makeMessageType("streamlayer.sports.hockey.HockeyPerformer",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"photo",kind:"scalar",T:9},{no:3,name:"score",kind:"scalar",T:5}]),yT=i.makeMessageType("streamlayer.sports.hockey.HockeyPerformers",()=>[{no:1,name:"category",kind:"enum",T:i.getEnumType(pT)},{no:2,name:"home_player",kind:"message",T:xo,repeated:!0},{no:3,name:"away_player",kind:"message",T:xo,repeated:!0}]),Ho=i.makeMessageType("streamlayer.sports.hockey.HockeyTeamSummary",()=>[{no:1,name:"shots_on_goal",kind:"scalar",T:5},{no:2,name:"faceoff",kind:"scalar",T:1},{no:3,name:"powerplay",kind:"scalar",T:5},{no:4,name:"penalty_minutes",kind:"scalar",T:5},{no:5,name:"hits",kind:"scalar",T:5},{no:6,name:"blocks",kind:"scalar",T:5},{no:7,name:"giveaways",kind:"scalar",T:5},{no:8,name:"takeaways",kind:"scalar",T:5}]),fT=i.makeMessageType("streamlayer.sports.hockey.HockeySummary",()=>[{no:1,name:"home_statistics",kind:"message",T:Ho},{no:2,name:"away_statistics",kind:"message",T:Ho}]),gT=i.makeMessageType("streamlayer.sports.hockey.EventSummary",()=>[{no:1,name:"statistics",kind:"message",T:fT},{no:2,name:"top_performers",kind:"message",T:yT,repeated:!0}]),kT=i.makeMessageType("streamlayer.sports.hockey.HockeyPlayByPlayStatistics",()=>[{no:1,name:"team",kind:"message",T:st},{no:2,name:"event_time",kind:"message",T:Wn},{no:3,name:"score_home",kind:"scalar",T:5},{no:4,name:"score_away",kind:"scalar",T:5},{no:5,name:"play_text",kind:"scalar",T:9},{no:6,name:"scoring",kind:"scalar",T:8},{no:7,name:"play_id",kind:"scalar",T:5}]),hT=i.makeMessageType("streamlayer.sports.hockey.PlayByPlay",()=>[{no:1,name:"statistics",kind:"message",T:kT,repeated:!0}]),pa=i.makeMessageType("streamlayer.sports.hockey.PlayerScore",()=>[{no:1,name:"jersey",kind:"scalar",T:5},{no:2,name:"full_name",kind:"scalar",T:9},{no:3,name:"goals",kind:"scalar",T:5},{no:4,name:"assists",kind:"scalar",T:5},{no:5,name:"shots",kind:"scalar",T:5},{no:6,name:"penalty_minutes",kind:"scalar",T:1},{no:7,name:"minutes",kind:"scalar",T:9},{no:8,name:"position",kind:"enum",T:i.getEnumType(qi)}]),Qo=i.makeMessageType("streamlayer.sports.hockey.GoaltenderScore",()=>[{no:1,name:"jersey",kind:"scalar",T:5},{no:2,name:"full_name",kind:"scalar",T:9},{no:3,name:"shots_againts",kind:"scalar",T:5},{no:4,name:"goals_againts",kind:"scalar",T:5},{no:5,name:"saves",kind:"scalar",T:5},{no:6,name:"saves_pct",kind:"scalar",T:5},{no:7,name:"minutes",kind:"scalar",T:9},{no:8,name:"position",kind:"enum",T:i.getEnumType(qi)}]),Yo=i.makeMessageType("streamlayer.sports.hockey.PlayerScores",()=>[{no:1,name:"skaters",kind:"message",T:pa,repeated:!0},{no:2,name:"goaltender",kind:"message",T:Qo},{no:3,name:"forwards",kind:"message",T:pa,repeated:!0},{no:4,name:"defensemen",kind:"message",T:pa,repeated:!0},{no:5,name:"goaltenders",kind:"message",T:Qo,repeated:!0}]),ST=i.makeMessageType("streamlayer.sports.hockey.Boxscore",()=>[{no:1,name:"home_players",kind:"message",T:Yo},{no:2,name:"away_players",kind:"message",T:Yo}]),_T=i.makeMessageType("streamlayer.sports.hockey.TeamStanding",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"alias",kind:"scalar",T:9},{no:4,name:"logo",kind:"scalar",T:9},{no:5,name:"colors",kind:"scalar",T:9,repeated:!0},{no:6,name:"wins",kind:"scalar",T:5},{no:7,name:"losses",kind:"scalar",T:5},{no:8,name:"pct",kind:"scalar",T:1},{no:9,name:"games_behind",kind:"scalar",T:5},{no:10,name:"streak",kind:"message",T:ET},{no:11,name:"rank",kind:"message",T:bT},{no:12,name:"division",kind:"scalar",T:9},{no:13,name:"conference",kind:"scalar",T:9}]),ET=i.makeMessageType("streamlayer.sports.hockey.TeamStanding.Streak",()=>[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"length",kind:"scalar",T:5}],{localName:"TeamStanding_Streak"}),bT=i.makeMessageType("streamlayer.sports.hockey.TeamStanding.Rank",()=>[{no:1,name:"division",kind:"scalar",T:5},{no:2,name:"conference",kind:"scalar",T:5}],{localName:"TeamStanding_Rank"}),NT=i.makeMessageType("streamlayer.sports.hockey.Standings",()=>[{no:1,name:"standings",kind:"message",T:_T,repeated:!0}]),IT=i.makeEnum("streamlayer.sports.soccer.SoccerPerformerCategory",[{no:0,name:"SOCCER_PERFORMER_CATEGORY_UNSET",localName:"UNSET"},{no:1,name:"SOCCER_PERFORMER_CATEGORY_ATTACK",localName:"ATTACK"},{no:2,name:"SOCCER_PERFORMER_CATEGORY_MIDFIELD",localName:"MIDFIELD"},{no:3,name:"SOCCER_PERFORMER_CATEGORY_DEFENSE",localName:"DEFENSE"}]),OT=i.makeEnum("streamlayer.sports.soccer.SoccerMatchActivityType",[{no:0,name:"SOCCER_MATCH_ACTIVITY_UNSET"},{no:1,name:"SOCCER_MATCH_ACTIVITY_GOAL"},{no:2,name:"SOCCER_MATCH_ACTIVITY_YELLOW_CARD"},{no:3,name:"SOCCER_MATCH_ACTIVITY_RED_CARD"},{no:4,name:"SOCCER_MATCH_ACTIVITY_SUBSTITUTION"},{no:5,name:"SOCCER_MATCH_ACTIVITY_HALF_TIME"},{no:6,name:"SOCCER_MATCH_ACTIVITY_FULL_TIME"}]),vT=i.makeMessageType("streamlayer.sports.soccer.EventScore",()=>[{no:8,name:"home_team_record",kind:"message",T:at},{no:9,name:"away_team_record",kind:"message",T:at}]),Es=i.makeMessageType("streamlayer.sports.soccer.SoccerPerformer",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"photo",kind:"scalar",T:9},{no:3,name:"score",kind:"scalar",T:5}]),AT=i.makeMessageType("streamlayer.sports.soccer.SoccerAttackPerfomer",()=>[{no:1,name:"perfomer",kind:"message",T:Es},{no:2,name:"attack_stats",kind:"message",T:FT}]),wT=i.makeMessageType("streamlayer.sports.soccer.SoccerMidfieldPerformer",()=>[{no:1,name:"perfomer",kind:"message",T:Es},{no:2,name:"midfield_stats",kind:"message",T:GT}]),RT=i.makeMessageType("streamlayer.sports.soccer.SoccerDefensePerfomer",()=>[{no:1,name:"perfomer",kind:"message",T:Es},{no:2,name:"defense_stats",kind:"message",T:BT}]),LT=i.makeMessageType("streamlayer.sports.soccer.SoccerPerformers",()=>[{no:1,name:"category",kind:"enum",T:i.getEnumType(IT)},{no:2,name:"attack_performer",kind:"message",T:AT},{no:3,name:"midfield_performer",kind:"message",T:wT},{no:4,name:"defense_performer",kind:"message",T:RT}]),MT=i.makeMessageType("streamlayer.sports.soccer.SoccerTeamTopMatchStats",()=>[{no:1,name:"possession",kind:"scalar",T:1},{no:2,name:"shots",kind:"scalar",T:5},{no:3,name:"shots_on_target",kind:"scalar",T:5},{no:4,name:"passes",kind:"scalar",T:5},{no:5,name:"offsides",kind:"scalar",T:5},{no:6,name:"yellow_cards",kind:"scalar",T:5},{no:7,name:"corner_kicks",kind:"scalar",T:5},{no:8,name:"free_kicks",kind:"scalar",T:5},{no:9,name:"red_cards",kind:"scalar",T:5}]),PT=i.makeMessageType("streamlayer.sports.soccer.SoccerTeamAttackingStats",()=>[{no:1,name:"possession",kind:"scalar",T:1},{no:2,name:"passing_accuracy",kind:"scalar",T:1},{no:3,name:"chances_created",kind:"scalar",T:5},{no:4,name:"successful_crosses",kind:"scalar",T:1}]),CT=i.makeMessageType("streamlayer.sports.soccer.SoccerTeamDefenseStats",()=>[{no:1,name:"tackles_made",kind:"scalar",T:5},{no:2,name:"interceptions",kind:"scalar",T:5},{no:3,name:"blocked_shots",kind:"scalar",T:5},{no:4,name:"clearances",kind:"scalar",T:5},{no:5,name:"duels_won",kind:"scalar",T:5}]),jo=i.makeMessageType("streamlayer.sports.soccer.SoccerTeamSummary",()=>[{no:1,name:"top_match_stats",kind:"message",T:MT},{no:2,name:"attacking_stats",kind:"message",T:PT},{no:3,name:"defense_stats",kind:"message",T:CT}]),DT=i.makeMessageType("streamlayer.sports.soccer.SoccerSummary",()=>[{no:1,name:"home_statistics",kind:"message",T:jo},{no:2,name:"away_statistics",kind:"message",T:jo},{no:3,name:"perfomers",kind:"message",T:LT}]),UT=i.makeMessageType("streamlayer.sports.soccer.EventSummary",()=>[{no:1,name:"statistics",kind:"message",T:DT},{no:2,name:"last_games",kind:"message",T:xi}]),FT=i.makeMessageType("streamlayer.sports.soccer.SoccerPlayerAttackingStats",()=>[{no:1,name:"goals",kind:"scalar",T:5},{no:2,name:"assists",kind:"scalar",T:5},{no:3,name:"shots",kind:"scalar",T:5},{no:4,name:"shots_on_goal",kind:"scalar",T:5},{no:5,name:"penalty_kick_goals",kind:"scalar",T:5}]),GT=i.makeMessageType("streamlayer.sports.soccer.SoccerPlayerMidfieldStats",()=>[{no:1,name:"goals",kind:"scalar",T:5},{no:2,name:"assists",kind:"scalar",T:5},{no:3,name:"key_passes",kind:"scalar",T:5},{no:4,name:"crosses",kind:"scalar",T:5},{no:5,name:"corners",kind:"scalar",T:5}]),BT=i.makeMessageType("streamlayer.sports.soccer.SoccerPlayerDefenseStats",()=>[{no:1,name:"goals",kind:"scalar",T:5},{no:2,name:"assists",kind:"scalar",T:5},{no:3,name:"tackles_made",kind:"scalar",T:5},{no:4,name:"interceptions",kind:"scalar",T:5},{no:5,name:"blocked_shots",kind:"scalar",T:5}]),VT=i.makeMessageType("streamlayer.sports.soccer.SoccerMatchFormationMatrixPlayer",()=>[{no:1,name:"jersey_number",kind:"scalar",T:5},{no:2,name:"player_name",kind:"scalar",T:9},{no:3,name:"photo",kind:"scalar",T:9}]),qT=i.makeMessageType("streamlayer.sports.soccer.SoccerMatchFormationMatrix",()=>[{no:1,name:"row_players",kind:"message",T:VT,repeated:!0}]),$o=i.makeMessageType("streamlayer.sports.soccer.SoccerMatchPlayer",()=>[{no:1,name:"first_name",kind:"scalar",T:9},{no:2,name:"last_name",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"photo",kind:"scalar",T:9},{no:5,name:"position",kind:"scalar",T:9},{no:6,name:"jersey",kind:"scalar",T:5}]),Ko=i.makeMessageType("streamlayer.sports.soccer.SoccerMatchLineup",()=>[{no:1,name:"formation_string",kind:"scalar",T:9},{no:2,name:"formation_matrix",kind:"message",T:qT,repeated:!0},{no:3,name:"start_players",kind:"message",T:$o,repeated:!0},{no:4,name:"substitutes",kind:"message",T:$o,repeated:!0}]),xT=i.makeMessageType("streamlayer.sports.soccer.SoccerMatchLineups",()=>[{no:1,name:"home_team",kind:"message",T:Ko},{no:2,name:"away_team",kind:"message",T:Ko}]),HT=i.makeMessageType("streamlayer.sports.soccer.SoccerPlayByPlayStatistics",()=>[{no:1,name:"team",kind:"message",T:st},{no:2,name:"event_time",kind:"message",T:Wn},{no:3,name:"score_home",kind:"scalar",T:5},{no:4,name:"score_away",kind:"scalar",T:5},{no:5,name:"play_text",kind:"scalar",T:9},{no:6,name:"scoring",kind:"scalar",T:8},{no:7,name:"play_id",kind:"scalar",T:5},{no:8,name:"type",kind:"enum",T:i.getEnumType(OT)}]),QT=i.makeMessageType("streamlayer.sports.soccer.PlayByPlay",()=>[{no:1,name:"statistics",kind:"message",T:HT,repeated:!0}]),YT=i.makeMessageType("streamlayer.sports.soccer.TeamStanding",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"alias",kind:"scalar",T:9},{no:4,name:"logo",kind:"scalar",T:9},{no:5,name:"colors",kind:"scalar",T:9,repeated:!0},{no:6,name:"wins",kind:"scalar",T:5},{no:7,name:"losses",kind:"scalar",T:5},{no:8,name:"draws",kind:"scalar",T:5},{no:9,name:"games_behind",kind:"scalar",T:5},{no:12,name:"division",kind:"scalar",T:9},{no:13,name:"points",kind:"scalar",T:5},{no:14,name:"position",kind:"scalar",T:5},{no:15,name:"total_goals",kind:"scalar",T:5},{no:16,name:"total_goals_received",kind:"scalar",T:5}]),jT=i.makeMessageType("streamlayer.sports.soccer.Standings",()=>[{no:1,name:"standings",kind:"message",T:YT,repeated:!0}]),Ta=i.makeMessageType("streamlayer.sports.soccer.SoccerLastGame",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"attributes",kind:"message",T:$T}]),$T=i.makeMessageType("streamlayer.sports.soccer.SoccerLastGame.SoccerLastGameAttributes",()=>[{no:1,name:"league",kind:"scalar",T:9},{no:2,name:"home_team",kind:"scalar",T:9},{no:3,name:"away_team",kind:"scalar",T:9},{no:5,name:"home_score",kind:"scalar",T:5},{no:6,name:"away_score",kind:"scalar",T:5},{no:7,name:"date",kind:"scalar",T:9}],{localName:"SoccerLastGame_SoccerLastGameAttributes"}),xi=i.makeMessageType("streamlayer.sports.soccer.SoccerLastGames",()=>[{no:1,name:"home",kind:"message",T:Ta,repeated:!0},{no:2,name:"away",kind:"message",T:Ta,repeated:!0},{no:3,name:"head_to_head",kind:"message",T:Ta,repeated:!0}]),kt=i.makeEnum("streamlayer.sports.events.EventType",[{no:0,name:"EVENT_TYPE_UNSET",localName:"UNSET"},{no:1,name:"EVENT_TYPE_BASEBALL",localName:"BASEBALL"},{no:2,name:"EVENT_TYPE_BASKETBALL",localName:"BASKETBALL"},{no:3,name:"EVENT_TYPE_HOCKEY",localName:"HOCKEY"},{no:4,name:"EVENT_TYPE_SOCCER",localName:"SOCCER"},{no:5,name:"EVENT_TYPE_GOLF",localName:"GOLF"}]),KT=i.makeMessageType("streamlayer.sports.events.ScheduleAttributes",()=>[{no:1,name:"summary",kind:"message",T:gt},{no:2,name:"baseball",kind:"message",T:jp,oneof:"sport"},{no:3,name:"basketball",kind:"message",T:eT,oneof:"sport"},{no:4,name:"hockey",kind:"message",T:TT,oneof:"sport"},{no:5,name:"soccer",kind:"message",T:vT,oneof:"sport"}]),WT=i.makeMessageType("streamlayer.sports.events.ScheduleResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:i.getEnumType(kt)},{no:3,name:"attributes",kind:"message",T:KT}]),zT=i.makeMessageType("streamlayer.sports.events.ListResponseAttributes",()=>[{no:1,name:"common",kind:"message",T:Up}]),Hi=i.makeMessageType("streamlayer.sports.events.ListResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"attributes",kind:"message",T:zT}]),JT=i.makeMessageType("streamlayer.sports.events.ListRequest",()=>[{no:1,name:"filter",kind:"message",T:XT},{no:2,name:"pagination",kind:"message",T:$n},{no:3,name:"sort",kind:"message",T:Fi},{no:4,name:"ids",kind:"scalar",T:4,repeated:!0},{no:5,name:"organization_id",kind:"scalar",T:9}]),XT=i.makeMessageType("streamlayer.sports.events.ListRequest.Filter",()=>[{no:1,name:"date",kind:"scalar",T:9},{no:2,name:"league",kind:"scalar",T:9},{no:3,name:"start_date_time",kind:"scalar",T:9},{no:4,name:"end_date_time",kind:"scalar",T:9},{no:5,name:"sport",kind:"scalar",T:9},{no:6,name:"name",kind:"scalar",T:9},{no:7,name:"endless",kind:"enum",T:i.getEnumType(Ui)}],{localName:"ListRequest_Filter"}),ZT=i.makeMessageType("streamlayer.sports.events.DemoListRequest",()=>[{no:1,name:"filter",kind:"message",T:ey},{no:2,name:"pagination",kind:"message",T:$n},{no:3,name:"sort",kind:"message",T:Fi}]),ey=i.makeMessageType("streamlayer.sports.events.DemoListRequest.Filter",()=>[{no:1,name:"date",kind:"scalar",T:9},{no:2,name:"league",kind:"scalar",T:9}],{localName:"DemoListRequest_Filter"}),ty=i.makeMessageType("streamlayer.sports.events.DemoListResponse",()=>[{no:1,name:"meta",kind:"message",T:Kn},{no:2,name:"data",kind:"message",T:Hi,repeated:!0}]),ny=i.makeMessageType("streamlayer.sports.events.ListResponse",()=>[{no:1,name:"meta",kind:"message",T:Kn},{no:2,name:"data",kind:"message",T:Hi,repeated:!0}]),Wo=i.makeMessageType("streamlayer.sports.events.SummaryRequest",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"organization_id",kind:"scalar",T:9}]),zo=i.makeMessageType("streamlayer.sports.events.SummaryResponse",()=>[{no:1,name:"data",kind:"message",T:ay}]),ay=i.makeMessageType("streamlayer.sports.events.SummaryResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:i.getEnumType(kt)},{no:3,name:"attributes",kind:"message",T:sy}],{localName:"SummaryResponse_ResponseData"}),sy=i.makeMessageType("streamlayer.sports.events.SummaryResponse.ResponseData.SummaryResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:gt},{no:2,name:"baseball",kind:"message",T:Kp,oneof:"sports"},{no:3,name:"basketball",kind:"message",T:aT,oneof:"sports"},{no:4,name:"hockey",kind:"message",T:gT,oneof:"sports"},{no:5,name:"soccer",kind:"message",T:UT,oneof:"sports"}],{localName:"SummaryResponse_ResponseData_SummaryResponseAttributes"}),oy=i.makeMessageType("streamlayer.sports.events.AdminSummaryRequest",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"organization_id",kind:"scalar",T:9}]),ry=i.makeMessageType("streamlayer.sports.events.AdminSummaryResponse",()=>[{no:1,name:"data",kind:"message",T:iy}]),iy=i.makeMessageType("streamlayer.sports.events.AdminSummaryResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"attributes",kind:"message",T:cy}],{localName:"AdminSummaryResponse_ResponseData"}),cy=i.makeMessageType("streamlayer.sports.events.AdminSummaryResponse.ResponseData.SummaryResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:gt},{no:2,name:"provider_id",kind:"scalar",T:9}],{localName:"AdminSummaryResponse_ResponseData_SummaryResponseAttributes"}),ly=i.makeMessageType("streamlayer.sports.events.PlayByPlayRequest",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"pagination",kind:"message",T:$n},{no:3,name:"order",kind:"scalar",T:9}]),my=i.makeMessageType("streamlayer.sports.events.PlayByPlayResponse",()=>[{no:1,name:"data",kind:"message",T:uy},{no:2,name:"meta",kind:"message",T:Kn}]),uy=i.makeMessageType("streamlayer.sports.events.PlayByPlayResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:i.getEnumType(kt)},{no:3,name:"attributes",kind:"message",T:dy}],{localName:"PlayByPlayResponse_ResponseData"}),dy=i.makeMessageType("streamlayer.sports.events.PlayByPlayResponse.ResponseData.PlayByPlayResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:gt},{no:2,name:"baseball",kind:"message",T:$p,oneof:"sports"},{no:3,name:"basketball",kind:"message",T:oT,oneof:"sports"},{no:4,name:"hockey",kind:"message",T:hT,oneof:"sports"},{no:5,name:"soccer",kind:"message",T:QT,oneof:"sports"}],{localName:"PlayByPlayResponse_ResponseData_PlayByPlayResponseAttributes"}),py=i.makeMessageType("streamlayer.sports.events.ScheduleRequest",()=>[{no:1,name:"filter",kind:"message",T:Ty},{no:2,name:"pagination",kind:"message",T:$n}]),Ty=i.makeMessageType("streamlayer.sports.events.ScheduleRequest.Filter",()=>[{no:1,name:"date",kind:"scalar",T:9},{no:2,name:"league",kind:"scalar",T:9}],{localName:"ScheduleRequest_Filter"}),yy=i.makeMessageType("streamlayer.sports.events.ScheduleResponse",()=>[{no:1,name:"data",kind:"message",T:WT,repeated:!0},{no:2,name:"meta",kind:"message",T:Kn}]),fy=i.makeMessageType("streamlayer.sports.events.ScheduleDatesRequest",()=>[{no:1,name:"filter",kind:"message",T:gy}]),gy=i.makeMessageType("streamlayer.sports.events.ScheduleDatesRequest.Filter",()=>[{no:2,name:"league",kind:"scalar",T:9}],{localName:"ScheduleDatesRequest_Filter"}),ky=i.makeMessageType("streamlayer.sports.events.ScheduleDatesResponse",()=>[{no:1,name:"data",kind:"scalar",T:9,repeated:!0}]),hy=i.makeMessageType("streamlayer.sports.events.BoxscoreRequest",()=>[{no:1,name:"id",kind:"scalar",T:4}]),Sy=i.makeMessageType("streamlayer.sports.events.BoxscoreResponse",()=>[{no:1,name:"data",kind:"message",T:_y}]),_y=i.makeMessageType("streamlayer.sports.events.BoxscoreResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:i.getEnumType(kt)},{no:3,name:"attributes",kind:"message",T:Ey}],{localName:"BoxscoreResponse_ResponseData"}),Ey=i.makeMessageType("streamlayer.sports.events.BoxscoreResponse.ResponseData.BoxscoreResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:gt},{no:2,name:"basketball",kind:"message",T:rT,oneof:"sports"},{no:3,name:"hockey",kind:"message",T:ST,oneof:"sports"}],{localName:"BoxscoreResponse_ResponseData_BoxscoreResponseAttributes"}),by=i.makeMessageType("streamlayer.sports.events.StandingsRequest",()=>[{no:1,name:"league",kind:"scalar",T:9}]),Ny=i.makeMessageType("streamlayer.sports.events.StandingsResponse",()=>[{no:1,name:"data",kind:"message",T:Iy}]),Iy=i.makeMessageType("streamlayer.sports.events.StandingsResponse.ResponseData",()=>[{no:1,name:"type",kind:"enum",T:i.getEnumType(kt)},{no:2,name:"attributes",kind:"message",T:Oy}],{localName:"StandingsResponse_ResponseData"}),Oy=i.makeMessageType("streamlayer.sports.events.StandingsResponse.ResponseData.StandingsResponseAttributes",()=>[{no:2,name:"basketball",kind:"message",T:mT,oneof:"sports"},{no:3,name:"hockey",kind:"message",T:NT,oneof:"sports"},{no:4,name:"baseball",kind:"message",T:Xp,oneof:"sports"},{no:5,name:"soccer",kind:"message",T:jT,oneof:"sports"}],{localName:"StandingsResponse_ResponseData_StandingsResponseAttributes"}),vy=i.makeMessageType("streamlayer.sports.events.LineupRequest",()=>[{no:1,name:"id",kind:"scalar",T:4}]),Ay=i.makeMessageType("streamlayer.sports.events.LineupResponse",()=>[{no:1,name:"data",kind:"message",T:wy}]),wy=i.makeMessageType("streamlayer.sports.events.LineupResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:i.getEnumType(kt)},{no:3,name:"attributes",kind:"message",T:Ry}],{localName:"LineupResponse_ResponseData"}),Ry=i.makeMessageType("streamlayer.sports.events.LineupResponse.ResponseData.LineupResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:gt},{no:2,name:"soccer",kind:"message",T:xT,oneof:"sports"},{no:3,name:"basketball",kind:"message",T:uT,oneof:"sports"}],{localName:"LineupResponse_ResponseData_LineupResponseAttributes"}),Ly=i.makeMessageType("streamlayer.sports.events.LastGamesRequest",()=>[{no:1,name:"id",kind:"scalar",T:4}]),My=i.makeMessageType("streamlayer.sports.events.LastGamesResponse",()=>[{no:1,name:"data",kind:"message",T:Py}]),Py=i.makeMessageType("streamlayer.sports.events.LastGamesResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4},{no:2,name:"type",kind:"enum",T:i.getEnumType(kt)},{no:3,name:"attributes",kind:"message",T:Cy}],{localName:"LastGamesResponse_ResponseData"}),Cy=i.makeMessageType("streamlayer.sports.events.LastGamesResponse.ResponseData.LastGamesResponseAttributes",()=>[{no:1,name:"summary",kind:"message",T:gt},{no:2,name:"soccer",kind:"message",T:xi,oneof:"sports"},{no:3,name:"basketball",kind:"message",T:Vi,oneof:"sports"}],{localName:"LastGamesResponse_ResponseData_LastGamesResponseAttributes"}),Dy=i.makeMessageType("streamlayer.sports.events.RetrieveEventIdRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Uy=i.makeMessageType("streamlayer.sports.events.RetrieveEventIdResponse",()=>[{no:1,name:"data",kind:"message",T:Fy}]),Fy=i.makeMessageType("streamlayer.sports.events.RetrieveEventIdResponse.RetrieveEventIdResponseData",()=>[{no:1,name:"id",kind:"scalar",T:4}],{localName:"RetrieveEventIdResponse_RetrieveEventIdResponseData"}),Qi={typeName:"streamlayer.sports.events.Events",methods:{list:{name:"List",I:JT,O:ny,kind:R.Unary},demoList:{name:"DemoList",I:ZT,O:ty,kind:R.Unary},summary:{name:"Summary",I:Wo,O:zo,kind:R.Unary},adminSummary:{name:"AdminSummary",I:oy,O:ry,kind:R.Unary},boxscore:{name:"Boxscore",I:hy,O:Sy,kind:R.Unary},standings:{name:"Standings",I:by,O:Ny,kind:R.Unary},playByPlay:{name:"PlayByPlay",I:ly,O:my,kind:R.Unary},schedule:{name:"Schedule",I:py,O:yy,kind:R.Unary},scheduleDates:{name:"ScheduleDates",I:fy,O:ky,kind:R.Unary},lineup:{name:"Lineup",I:vy,O:Ay,kind:R.Unary},retrieveEventId:{name:"RetrieveEventId",I:Dy,O:Uy,kind:R.Unary},lastGames:{name:"LastGames",I:Ly,O:My,kind:R.Unary},summarySubscription:{name:"SummarySubscription",I:Wo,O:zo,kind:R.ServerStreaming}}},Gy=i.makeEnum("streamlayer.sdkSettings.client.VisibleStatus",[{no:0,name:"VISIBLE_STATUS_UNSET",localName:"UNSET"},{no:1,name:"VISIBLE_STATUS_INCOGNITO",localName:"INCOGNITO"},{no:2,name:"VISIBLE_STATUS_VISIBLE",localName:"VISIBLE"}]),By=i.makeEnum("streamlayer.sdkSettings.client.MessagesNotify",[{no:0,name:"MESSAGES_NOTIFY_UNSET",localName:"UNSET"},{no:1,name:"MESSAGES_NOTIFY_DISALLOW",localName:"DISALLOW"},{no:2,name:"MESSAGES_NOTIFY_ALLOW",localName:"ALLOW"}]),Vy=i.makeEnum("streamlayer.sdkSettings.client.FriendsNotify",[{no:0,name:"FRIENDS_NOTIFY_UNSET",localName:"UNSET"},{no:1,name:"FRIENDS_NOTIFY_DISALLOW",localName:"DISALLOW"},{no:2,name:"FRIENDS_NOTIFY_ALLOW",localName:"ALLOW"}]),qy=i.makeEnum("streamlayer.sdkSettings.client.TwitterNotify",[{no:0,name:"TWITTER_NOTIFY_UNSET",localName:"UNSET"},{no:1,name:"TWITTER_NOTIFY_DISALLOW",localName:"DISALLOW"},{no:2,name:"TWITTER_NOTIFY_ALLOW",localName:"ALLOW"}]),xy=i.makeEnum("streamlayer.sdkSettings.client.CallsSound",[{no:0,name:"CALLS_SOUND_UNSET",localName:"UNSET"},{no:1,name:"CALLS_SOUND_DISALLOW",localName:"DISALLOW"},{no:2,name:"CALLS_SOUND_ALLOW",localName:"ALLOW"}]),Hy=i.makeEnum("streamlayer.sdkSettings.client.MessagesSound",[{no:0,name:"MESSAGES_SOUND_UNSET",localName:"UNSET"},{no:1,name:"MESSAGES_SOUND_DISALLOW",localName:"DISALLOW"},{no:2,name:"MESSAGES_SOUND_ALLOW",localName:"ALLOW"}]),Qy=i.makeEnum("streamlayer.sdkSettings.client.FriendsSound",[{no:0,name:"FRIENDS_SOUND_UNSET",localName:"UNSET"},{no:1,name:"FRIENDS_SOUND_DISALLOW",localName:"DISALLOW"},{no:2,name:"FRIENDS_SOUND_ALLOW",localName:"ALLOW"}]),Yy=i.makeEnum("streamlayer.sdkSettings.client.TwitterSound",[{no:0,name:"TWITTER_SOUND_UNSET",localName:"UNSET"},{no:1,name:"TWITTER_SOUND_DISALLOW",localName:"DISALLOW"},{no:2,name:"TWITTER_SOUND_ALLOW",localName:"ALLOW"}]),Yi=i.makeEnum("streamlayer.sdkSettings.client.SettingsAllow",[{no:0,name:"SETTINGS_ALLOW_UNSET",localName:"UNSET"},{no:1,name:"SETTINGS_ALLOW_DISALLOW",localName:"DISALLOW"},{no:2,name:"SETTINGS_ALLOW_ALLOW",localName:"ALLOW"}]),jy=i.makeEnum("streamlayer.sdkSettings.client.ManagedGroupType",[{no:0,name:"MANAGED_GROUP_TYPE_UNSET",localName:"UNSET"},{no:1,name:"MANAGED_GROUP_TYPE_CHAT",localName:"CHAT"},{no:2,name:"MANAGED_GROUP_TYPE_WP",localName:"WP"}]),$y=i.makeEnum("streamlayer.sdkSettings.client.GroupType",[{no:0,name:"GROUP_TYPE_UNSET",localName:"UNSET"},{no:1,name:"GROUP_TYPE_CHAT",localName:"CHAT"},{no:2,name:"GROUP_TYPE_WP",localName:"WP"}]),Ky=i.makeMessageType("streamlayer.sdkSettings.client.NotifySettings",()=>[{no:1,name:"allow",kind:"enum",T:i.getEnumType(Yi)}]),Wy=i.makeMessageType("streamlayer.sdkSettings.client.SoundSettings",()=>[{no:1,name:"allow",kind:"enum",T:i.getEnumType(Yi)}]),ya=i.makeMessageType("streamlayer.sdkSettings.client.ClientSettingsNotifications",()=>[{no:1,name:"notify",kind:"message",T:Ky},{no:2,name:"sound",kind:"message",T:Wy}]),bs=i.makeMessageType("streamlayer.sdkSettings.client.ClientSettings",()=>[{no:1,name:"visible_status",kind:"enum",T:i.getEnumType(Gy)},{no:2,name:"messages_notify",kind:"enum",T:i.getEnumType(By)},{no:3,name:"friends_notify",kind:"enum",T:i.getEnumType(Vy)},{no:4,name:"calls_sound",kind:"enum",T:i.getEnumType(xy)},{no:5,name:"messages_sound",kind:"enum",T:i.getEnumType(Hy)},{no:6,name:"friends_sound",kind:"enum",T:i.getEnumType(Qy)},{no:7,name:"twitter_notify",kind:"enum",T:i.getEnumType(qy)},{no:8,name:"twitter_sound",kind:"enum",T:i.getEnumType(Yy)},{no:9,name:"gamification",kind:"message",T:ya},{no:10,name:"watch_party_invitation",kind:"message",T:ya},{no:11,name:"twitter_question",kind:"message",T:ya}]),zy=i.makeMessageType("streamlayer.sdkSettings.client.GetRequest",[]),Jy=i.makeMessageType("streamlayer.sdkSettings.client.GetResponse",()=>[{no:1,name:"data",kind:"message",T:Xy}]),Xy=i.makeMessageType("streamlayer.sdkSettings.client.GetResponse.GetResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:bs}],{localName:"GetResponse_GetResponseData"}),Zy=i.makeMessageType("streamlayer.sdkSettings.client.UpdateRequest",()=>[{no:2,name:"settings",kind:"message",T:bs}]),ef=i.makeMessageType("streamlayer.sdkSettings.client.UpdateResponse",()=>[{no:1,name:"data",kind:"message",T:tf}]),tf=i.makeMessageType("streamlayer.sdkSettings.client.UpdateResponse.UpdateResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:bs}],{localName:"UpdateResponse_UpdateResponseData"}),nf=i.makeMessageType("streamlayer.sdkSettings.client.GetStreamRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),af=i.makeMessageType("streamlayer.sdkSettings.client.GetStreamResponse",()=>[{no:1,name:"data",kind:"message",T:sf}]),sf=i.makeMessageType("streamlayer.sdkSettings.client.GetStreamResponse.GetResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:Ei}],{localName:"GetStreamResponse_GetResponseData"}),of=i.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationRequest",[]),rf=i.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationResponse",()=>[{no:1,name:"data",kind:"message",T:cf}]),cf=i.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationResponse.GetResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:bi}],{localName:"GetOrganizationResponse_GetResponseData"}),lf=i.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationAdvertisingRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:9,opt:!0}]),mf=i.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationAdvertisingResponse",()=>[{no:1,name:"data",kind:"message",T:uf}]),uf=i.makeMessageType("streamlayer.sdkSettings.client.GetOrganizationAdvertisingResponse.GetOrganizationAdvertisingResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:Yd}],{localName:"GetOrganizationAdvertisingResponse_GetOrganizationAdvertisingResponseData"}),df=i.makeMessageType("streamlayer.sdkSettings.client.ManagedGroup",()=>[{no:1,name:"group_id",kind:"scalar",T:9},{no:2,name:"fantasy_group_id",kind:"scalar",T:9},{no:3,name:"group_type",kind:"enum",T:i.getEnumType(jy)}]),pf=i.makeMessageType("streamlayer.sdkSettings.client.DeepLinkData",()=>[{no:1,name:"group_id",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:9},{no:3,name:"gamification",kind:"scalar",T:8},{no:4,name:"managed_group",kind:"message",T:df},{no:5,name:"external_event_id",kind:"scalar",T:9},{no:6,name:"external_group_id",kind:"scalar",T:9},{no:7,name:"group_type",kind:"enum",T:i.getEnumType($y)}]),Tf=i.makeMessageType("streamlayer.sdkSettings.client.GenerateDeepLinkRequest",()=>[{no:1,name:"data",kind:"message",T:pf}]),yf=i.makeMessageType("streamlayer.sdkSettings.client.DeepLink",()=>[{no:1,name:"url",kind:"scalar",T:9},{no:2,name:"link_id",kind:"scalar",T:9}]),ff=i.makeMessageType("streamlayer.sdkSettings.client.GenerateDeepLinkResponse",()=>[{no:1,name:"data",kind:"message",T:gf}]),gf=i.makeMessageType("streamlayer.sdkSettings.client.GenerateDeepLinkResponse.GenerateDeepLinkResponseData",()=>[{no:1,name:"attributes",kind:"message",T:yf}],{localName:"GenerateDeepLinkResponse_GenerateDeepLinkResponseData"}),kf=i.makeMessageType("streamlayer.sdkSettings.client.StreamSubscriptionRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),hf=i.makeMessageType("streamlayer.sdkSettings.client.OrganizationSubscriptionRequest",[]),Sf=i.makeMessageType("streamlayer.sdkSettings.client.StreamSubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:_f}]),_f=i.makeMessageType("streamlayer.sdkSettings.client.StreamSubscriptionResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:Ei}],{localName:"StreamSubscriptionResponse_ResponseData"}),Ef=i.makeMessageType("streamlayer.sdkSettings.client.OrganizationSubscriptionResponse",()=>[{no:1,name:"data",kind:"message",T:bf}]),bf=i.makeMessageType("streamlayer.sdkSettings.client.OrganizationSubscriptionResponse.ResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:bi}],{localName:"OrganizationSubscriptionResponse_ResponseData"}),en={typeName:"streamlayer.sdkSettings.client.Client",methods:{get:{name:"Get",I:zy,O:Jy,kind:R.Unary},update:{name:"Update",I:Zy,O:ef,kind:R.Unary},getStream:{name:"GetStream",I:nf,O:af,kind:R.Unary},getOrganization:{name:"GetOrganization",I:of,O:rf,kind:R.Unary},getOrganizationAdvertising:{name:"GetOrganizationAdvertising",I:lf,O:mf,kind:R.Unary},generateDeepLink:{name:"GenerateDeepLink",I:Tf,O:ff,kind:R.Unary},streamSubscription:{name:"StreamSubscription",I:kf,O:Sf,kind:R.ServerStreaming},organizationSubscription:{name:"OrganizationSubscription",I:hf,O:Ef,kind:R.ServerStreaming}}},Nf=i.makeMessageType("streamlayer.users.PublicChatUser",()=>[{no:1,name:"name",kind:"scalar",T:9}]),If=i.makeMessageType("streamlayer.users.UserAttributes",()=>[{no:1,name:"username",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"alias",kind:"scalar",T:9},{no:5,name:"avatar",kind:"scalar",T:9},{no:6,name:"public_chat",kind:"message",T:Nf},{no:7,name:"public_name",kind:"scalar",T:9}]),Ns=i.makeMessageType("streamlayer.users.User",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:If}]),Of=i.makeMessageType("streamlayer.users.LoginRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"password",kind:"scalar",T:9}]),vf=i.makeMessageType("streamlayer.users.AuthResponse",()=>[{no:1,name:"meta",kind:"message",T:Af},{no:2,name:"data",kind:"message",T:Ns}]),Af=i.makeMessageType("streamlayer.users.AuthResponse.AuthResponseMetadata",()=>[{no:1,name:"jwt",kind:"scalar",T:9},{no:3,name:"getstream",kind:"scalar",T:9}],{localName:"AuthResponse_AuthResponseMetadata"}),wf=i.makeMessageType("streamlayer.users.RegisterRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Rf=i.makeMessageType("streamlayer.users.Referral",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"watching_game",kind:"scalar",T:9}]),Lf=i.makeMessageType("streamlayer.users.RegisterResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"requires_activation",kind:"scalar",T:8},{no:3,name:"referral",kind:"message",T:Rf}]),Mf=i.makeMessageType("streamlayer.users.RequestPasswordRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Pf=i.makeMessageType("streamlayer.users.RequestPasswordResponse",()=>[{no:1,name:"requested",kind:"scalar",T:8},{no:2,name:"uid",kind:"scalar",T:9}]),Cf=i.makeMessageType("streamlayer.users.MeRequest",[]),Df=i.makeMessageType("streamlayer.users.MeResponse",()=>[{no:1,name:"data",kind:"message",T:Ns}]),Uf=i.makeMessageType("streamlayer.users.UpdateMetadataRequest",()=>[{no:1,name:"set_name",kind:"scalar",T:9,oneof:"name"},{no:2,name:"del_name",kind:"scalar",T:9,oneof:"name"}]),Ff=i.makeMessageType("streamlayer.users.UpdateAvatarRequest",()=>[{no:1,name:"username",kind:"scalar",T:9},{no:2,name:"set_avatar",kind:"scalar",T:9,oneof:"avatar"},{no:3,name:"del_avatar",kind:"scalar",T:9,oneof:"avatar"}]),Gf=i.makeMessageType("streamlayer.users.UpdateAvatarResponse",[]),Bf=i.makeMessageType("streamlayer.users.UpdatePublicChatNameRequest",()=>[{no:1,name:"username",kind:"scalar",T:9},{no:2,name:"set_name",kind:"scalar",T:9,oneof:"name"},{no:3,name:"del_name",kind:"scalar",T:9,oneof:"name"}]),Vf=i.makeMessageType("streamlayer.users.UpdatePublicChatNameResponse",[]),qf=i.makeMessageType("streamlayer.users.UpdatePublicNameRequest",()=>[{no:1,name:"username",kind:"scalar",T:9},{no:2,name:"set_name",kind:"scalar",T:9,oneof:"name"},{no:3,name:"del_name",kind:"scalar",T:9,oneof:"name"}]),xf=i.makeMessageType("streamlayer.users.UpdatePublicNameResponse",[]),Hf=i.makeMessageType("streamlayer.users.UpdateMetadataResponse",[]),Qf=i.makeMessageType("streamlayer.users.InviteRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"referral",kind:"message",T:Yf}]),Yf=i.makeMessageType("streamlayer.users.InviteRequest.InviteReferral",()=>[{no:1,name:"watching_game",kind:"scalar",T:9}],{localName:"InviteRequest_InviteReferral"}),jf=i.makeMessageType("streamlayer.users.InviteResponse",[]),$f=i.makeMessageType("streamlayer.users.BypassAuthRequest",()=>[{no:1,name:"user_key",kind:"scalar",T:9},{no:2,name:"schema",kind:"scalar",T:9},{no:3,name:"init",kind:"scalar",T:8},{no:4,name:"inviter_key",kind:"scalar",T:9,opt:!0}]),Kf=i.makeMessageType("streamlayer.users.BypassAuthResponse",()=>[{no:1,name:"meta",kind:"message",T:Wf},{no:2,name:"data",kind:"message",T:Ns,opt:!0}]),Wf=i.makeMessageType("streamlayer.users.BypassAuthResponse.AuthResponseMetadata",()=>[{no:1,name:"jwt",kind:"scalar",T:9,opt:!0},{no:3,name:"token",kind:"scalar",T:9,opt:!0},{no:4,name:"getstream",kind:"scalar",T:9},{no:5,name:"inviter_key",kind:"scalar",T:9,opt:!0}],{localName:"BypassAuthResponse_AuthResponseMetadata"}),zf=i.makeMessageType("streamlayer.users.GetFriendsRequest",()=>[{no:1,name:"last_created_at",kind:"scalar",T:9,opt:!0},{no:2,name:"limit",kind:"scalar",T:5,opt:!0}]),Jf=i.makeMessageType("streamlayer.users.GetFriendsResponse",()=>[{no:1,name:"data",kind:"message",T:Zf,repeated:!0},{no:2,name:"metadata",kind:"message",T:Xf}]),Xf=i.makeMessageType("streamlayer.users.GetFriendsResponse.ResponseMeta",()=>[{no:1,name:"last_created_at",kind:"scalar",T:9}],{localName:"GetFriendsResponse_ResponseMeta"}),Zf=i.makeMessageType("streamlayer.users.GetFriendsResponse.FriendData",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"tinode_id",kind:"scalar",T:9},{no:3,name:"sl_id",kind:"scalar",T:9}],{localName:"GetFriendsResponse_FriendData"}),Is={typeName:"streamlayer.users.Users",methods:{login:{name:"Login",I:Of,O:vf,kind:R.Unary},register:{name:"Register",I:wf,O:Lf,kind:R.Unary},requestPassword:{name:"RequestPassword",I:Mf,O:Pf,kind:R.Unary},me:{name:"Me",I:Cf,O:Df,kind:R.Unary},invite:{name:"Invite",I:Qf,O:jf,kind:R.Unary},bypassAuth:{name:"BypassAuth",I:$f,O:Kf,kind:R.Unary},updateMetadata:{name:"UpdateMetadata",I:Uf,O:Hf,kind:R.Unary},updateAvatar:{name:"UpdateAvatar",I:Ff,O:Gf,kind:R.Unary},updatePublicChatName:{name:"UpdatePublicChatName",I:Bf,O:Vf,kind:R.Unary},updatePublicName:{name:"UpdatePublicName",I:qf,O:xf,kind:R.Unary},getFriends:{name:"GetFriends",I:zf,O:Jf,kind:R.Unary}}},Ne={typeName:"streamlayer.interactive.feed.Feed",methods:{get:{name:"Get",I:ju,O:$u,kind:R.Unary},subscription:{name:"Subscription",I:Jm,O:Xm,kind:R.ServerStreaming},votingSubscription:{name:"VotingSubscription",I:eu,O:tu,kind:R.ServerStreaming},questionSubscription:{name:"QuestionSubscription",I:su,O:ou,kind:R.ServerStreaming},questionByUser:{name:"QuestionByUser",I:cu,O:lu,kind:R.Unary},syncQuestion:{name:"SyncQuestion",I:uu,O:pu,kind:R.Unary},getQuestion:{name:"GetQuestion",I:yu,O:fu,kind:R.Unary},questionDetail:{name:"QuestionDetail",I:ku,O:hu,kind:R.Unary},submitAnswer:{name:"SubmitAnswer",I:_u,O:bu,kind:R.Unary},submitInplay:{name:"SubmitInplay",I:Iu,O:vu,kind:R.Unary},skipQuestion:{name:"SkipQuestion",I:Au,O:Ru,kind:R.Unary},pickHistory:{name:"PickHistory",I:Mu,O:Pu,kind:R.Unary},insightHistory:{name:"InsightHistory",I:Uu,O:Bu,kind:R.Unary},tweetHistory:{name:"TweetHistory",I:qu,O:xu,kind:R.Unary},promotionHistory:{name:"PromotionHistory",I:Wu,O:zu,kind:R.Unary},list:{name:"List",I:Zu,O:td,kind:R.Unary},item:{name:"Item",I:ad,O:sd,kind:R.Unary},feedSubscription:{name:"FeedSubscription",I:od,O:rd,kind:R.ServerStreaming}}},eg=i.makeEnum("streamlayer.interactive.leaderboard.LeaderboardType",[{no:0,name:"LEADERBOARD_TYPE_UNSET",localName:"UNSET"},{no:1,name:"LEADERBOARD_TYPE_TOURNAMENT",localName:"TOURNAMENT"},{no:2,name:"LEADERBOARD_TYPE_EVENT",localName:"EVENT"}]),ji=i.makeMessageType("streamlayer.interactive.leaderboard.LeaderboardData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:i.getEnumType(eg)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"event_ids",kind:"scalar",T:3,repeated:!0},{no:5,name:"leaderboards",kind:"message",T:ji,repeated:!0},{no:6,name:"created_at",kind:"scalar",T:3}]),Os=i.makeMessageType("streamlayer.interactive.leaderboard.LeaderboardItem",()=>[{no:1,name:"streak",kind:"scalar",T:5},{no:2,name:"correct",kind:"scalar",T:5},{no:3,name:"incorrect",kind:"scalar",T:5},{no:4,name:"points",kind:"scalar",T:5},{no:5,name:"rank",kind:"scalar",T:5},{no:6,name:"name",kind:"scalar",T:9},{no:7,name:"avatar",kind:"scalar",T:9},{no:8,name:"user_id",kind:"scalar",T:9},{no:9,name:"recent_correct",kind:"scalar",T:5},{no:10,name:"streak_loss",kind:"scalar",T:5},{no:11,name:"friends_rank",kind:"scalar",T:5},{no:12,name:"in_top",kind:"scalar",T:5}]),tg=i.makeMessageType("streamlayer.interactive.leaderboard.LeaderboardSummaryItem",()=>[{no:1,name:"summary",kind:"message",T:Os},{no:2,name:"percentage",kind:"message",T:ng}]),ng=i.makeMessageType("streamlayer.interactive.leaderboard.LeaderboardSummaryItem.SummaryPercentage",()=>[{no:1,name:"correct",kind:"scalar",T:5},{no:2,name:"average",kind:"scalar",T:5}],{localName:"LeaderboardSummaryItem_SummaryPercentage"}),ag=i.makeMessageType("streamlayer.interactive.leaderboard.ListRequest",()=>[{no:1,name:"pagination",kind:"message",T:Qn},{no:2,name:"users_ids",kind:"scalar",T:9,repeated:!0},{no:3,name:"event_id",kind:"scalar",T:4},{no:4,name:"leaderboard_id",kind:"scalar",T:9}]),sg=i.makeMessageType("streamlayer.interactive.leaderboard.ListResponse",()=>[{no:1,name:"data",kind:"message",T:og,repeated:!0},{no:2,name:"meta",kind:"message",T:rg}]),og=i.makeMessageType("streamlayer.interactive.leaderboard.ListResponse.ListResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:Os}],{localName:"ListResponse_ListResponseData"}),rg=i.makeMessageType("streamlayer.interactive.leaderboard.ListResponse.ListResponseMeta",()=>[{no:1,name:"count",kind:"scalar",T:5},{no:2,name:"page",kind:"scalar",T:5},{no:3,name:"page_size",kind:"scalar",T:5}],{localName:"ListResponse_ListResponseMeta"}),ig=i.makeMessageType("streamlayer.interactive.leaderboard.SummaryRequest",()=>[{no:1,name:"event_id",kind:"scalar",T:4},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"leaderboard_id",kind:"scalar",T:9},{no:4,name:"users_ids",kind:"scalar",T:9,repeated:!0}]),cg=i.makeMessageType("streamlayer.interactive.leaderboard.SummaryResponse",()=>[{no:1,name:"data",kind:"message",T:lg}]),lg=i.makeMessageType("streamlayer.interactive.leaderboard.SummaryResponse.SummaryResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:tg}],{localName:"SummaryResponse_SummaryResponseData"}),mg=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:9}]),ug=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardsResponse",()=>[{no:2,name:"data",kind:"message",T:dg}]),dg=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardsResponse.EventLeaderboardsResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:ji}],{localName:"EventLeaderboardsResponse_EventLeaderboardsResponseData"}),pg=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9},{no:3,name:"pagination",kind:"message",T:Qn},{no:4,name:"sort",kind:"message",T:jm}]),Tg=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardResponse",()=>[{no:1,name:"data",kind:"message",T:yg,repeated:!0},{no:2,name:"meta",kind:"message",T:fg}]),yg=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardResponse.ListResponseData",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"attributes",kind:"message",T:Os}],{localName:"EventLeaderboardResponse_ListResponseData"}),fg=i.makeMessageType("streamlayer.interactive.leaderboard.EventLeaderboardResponse.ListResponseMeta",()=>[{no:1,name:"count",kind:"scalar",T:5},{no:2,name:"page",kind:"scalar",T:5},{no:3,name:"page_size",kind:"scalar",T:5}],{localName:"EventLeaderboardResponse_ListResponseMeta"}),$i={typeName:"streamlayer.interactive.leaderboard.Leaderboard",methods:{list:{name:"List",I:ag,O:sg,kind:R.Unary},summary:{name:"Summary",I:ig,O:cg,kind:R.Unary},eventLeaderboards:{name:"EventLeaderboards",I:mg,O:ug,kind:R.Unary},eventLeaderboard:{name:"EventLeaderboard",I:pg,O:Tg,kind:R.Unary}}},gg=i.makeMessageType("streamlayer.shortLinks.GenerateRequest",()=>[{no:1,name:"web",kind:"scalar",T:9},{no:2,name:"mobile",kind:"scalar",T:9}]),kg=i.makeMessageType("streamlayer.shortLinks.GenerateResponse",()=>[{no:1,name:"data",kind:"message",T:hg}]),hg=i.makeMessageType("streamlayer.shortLinks.GenerateResponse.GenerateResponseData",()=>[{no:1,name:"link",kind:"scalar",T:9}],{localName:"GenerateResponse_GenerateResponseData"}),Sg={typeName:"streamlayer.shortLinks.LinksClient",methods:{generate:{name:"Generate",I:gg,O:kg,kind:R.Unary}}},Qa=globalThis||void 0||self,Ya=i.makeEnum("streamlayer.analytics.v1.interactions.InteractionActionType",[{no:0,name:"INTERACTION_ACTION_TYPE_UNSET",localName:"UNSET"},{no:1,name:"INTERACTION_ACTION_TYPE_TAP",localName:"TAP"},{no:2,name:"INTERACTION_ACTION_TYPE_CALL",localName:"CALL"},{no:3,name:"INTERACTION_ACTION_TYPE_MESSAGE",localName:"MESSAGE"},{no:4,name:"INTERACTION_ACTION_TYPE_SCROLL",localName:"SCROLL"}]),Le=i.makeEnum("streamlayer.analytics.v1.notifications.NotificationKind",[{no:0,name:"NOTIFICATION_KIND_UNSET",localName:"UNSET"},{no:1,name:"NOTIFICATION_KIND_MESSAGE",localName:"MESSAGE"},{no:2,name:"NOTIFICATION_KIND_CALL",localName:"CALL"},{no:3,name:"NOTIFICATION_KIND_TWITTER",localName:"TWITTER"},{no:4,name:"NOTIFICATION_KIND_WAVE",localName:"WAVE"},{no:5,name:"NOTIFICATION_KIND_INPLAY",localName:"INPLAY"},{no:6,name:"NOTIFICATION_KIND_GROUP_CALL",localName:"GROUP_CALL"},{no:7,name:"NOTIFICATION_KIND_MISSED_CALL",localName:"MISSED_CALL"},{no:8,name:"NOTIFICATION_KIND_MISSED_GROUP_CALL",localName:"MISSED_GROUP_CALL"},{no:9,name:"NOTIFICATION_KIND_WATCH_PARTY",localName:"WATCH_PARTY"},{no:10,name:"NOTIFICATION_KIND_POLLS",localName:"POLLS"}]),ja=i.makeEnum("streamlayer.analytics.v1.notifications.NotificationType",[{no:0,name:"NOTIFICATION_TYPE_UNSET",localName:"UNSET"},{no:1,name:"NOTIFICATION_TYPE_IN_APP",localName:"IN_APP"},{no:2,name:"NOTIFICATION_TYPE_PUSH",localName:"PUSH"}]),_g=i.makeEnum("streamlayer.analytics.v1.permissions.PermissionType",[{no:0,name:"PERMISSION_TYPE_UNSET",localName:"UNSET"},{no:1,name:"PERMISSION_TYPE_ADDRESS_BOOK",localName:"ADDRESS_BOOK"},{no:2,name:"PERMISSION_TYPE_CALLING",localName:"CALLING"},{no:3,name:"PERMISSION_TYPE_CAMERA",localName:"CAMERA"}]),Eg=i.makeEnum("streamlayer.analytics.v1.waves.WaveCategory",[{no:0,name:"WAVE_CATEGORY_UNSET",localName:"UNSET"},{no:1,name:"WAVE_CATEGORY_WATCHING",localName:"WATCHING"},{no:2,name:"WAVE_CATEGORY_MESSAGING",localName:"MESSAGING"},{no:3,name:"WAVE_CATEGORY_VOICING",localName:"VOICING"}]),Jo=i.makeMessageType("streamlayer.analytics.v2.streaming.SendResponse",()=>[{no:1,name:"result",kind:"enum",T:i.getEnumType(em)}]),bg=i.makeMessageType("streamlayer.analytics.v2.streaming.SendExtra",[]),ye=i.makeMessageType("streamlayer.analytics.v2.streaming.CommonData",()=>[{no:1,name:"event_id",kind:"scalar",T:4,opt:!0},{no:2,name:"category",kind:"enum",T:i.getEnumType(me),opt:!0},{no:3,name:"kind",kind:"enum",T:i.getEnumType(re),opt:!0},{no:4,name:"screen_orientation",kind:"enum",T:i.getEnumType(Ga),opt:!0},{no:5,name:"session_id",kind:"scalar",T:9,opt:!0},{no:6,name:"overlay_session_id",kind:"scalar",T:9,opt:!0},{no:7,name:"topic_id",kind:"scalar",T:9,opt:!0},{no:8,name:"topic_type",kind:"enum",T:i.getEnumType(ae),opt:!0},{no:9,name:"parent_topic_id",kind:"scalar",T:9,opt:!0},{no:10,name:"parent_topic_type",kind:"enum",T:i.getEnumType(ae),opt:!0},{no:11,name:"participants_count",kind:"scalar",T:13,opt:!0},{no:12,name:"route_map",kind:"scalar",T:9,opt:!0},{no:13,name:"track_timestamp",kind:"scalar",T:4,opt:!0},{no:14,name:"topic_sub_type",kind:"enum",T:i.getEnumType(Re),opt:!0},{no:15,name:"country",kind:"scalar",T:9,opt:!0}]),Ng=i.makeMessageType("streamlayer.analytics.v2.streaming.SendAuthenticationsMessage",()=>[{no:1,name:"common",kind:"message",T:ye}]),Ig=i.makeMessageType("streamlayer.analytics.v2.streaming.SendCallsMessage",()=>[{no:1,name:"common",kind:"message",T:ye}]),Og=i.makeMessageType("streamlayer.analytics.v2.streaming.SendConversationsMessage",()=>[{no:1,name:"common",kind:"message",T:ye}]),vg=i.makeMessageType("streamlayer.analytics.v2.streaming.SendInteractionsMessage",()=>[{no:1,name:"common",kind:"message",T:ye},{no:2,name:"action_type",kind:"enum",T:i.getEnumType(Ya)}]),Ag=i.makeMessageType("streamlayer.analytics.v2.streaming.EventOpenedMessage",()=>[{no:1,name:"common",kind:"message",T:ye}]),wg=i.makeMessageType("streamlayer.analytics.v2.streaming.SendInvitationsMessage",()=>[{no:1,name:"common",kind:"message",T:ye},{no:2,name:"category",kind:"enum",T:i.getEnumType(Ba)},{no:3,name:"from",kind:"enum",T:i.getEnumType(Mn)}]),Rg=i.makeMessageType("streamlayer.analytics.v2.streaming.LaunchButtonMessage",()=>[{no:1,name:"common",kind:"message",T:ye}]),Lg=i.makeMessageType("streamlayer.analytics.v2.streaming.NotificationMessage",()=>[{no:1,name:"common",kind:"message",T:ye},{no:2,name:"notification_kind",kind:"enum",T:i.getEnumType(Le)},{no:3,name:"notification_type",kind:"enum",T:i.getEnumType(ja)}]),Mg=i.makeMessageType("streamlayer.analytics.v2.streaming.PermissionMessage",()=>[{no:1,name:"common",kind:"message",T:ye},{no:2,name:"permission",kind:"enum",T:i.getEnumType(_g)}]),Pg=i.makeMessageType("streamlayer.analytics.v2.streaming.ButtonInitializedMessage",()=>[{no:1,name:"common",kind:"message",T:ye}]),Cg=i.makeMessageType("streamlayer.analytics.v2.streaming.WavesMessage",()=>[{no:1,name:"common",kind:"message",T:ye},{no:2,name:"category",kind:"enum",T:i.getEnumType(Eg)}]),Dg=i.makeMessageType("streamlayer.analytics.v2.streaming.HeartbeatMessage",()=>[{no:1,name:"common",kind:"message",T:ye}]),Ug=i.makeMessageType("streamlayer.analytics.v2.streaming.GamesMessage",()=>[{no:1,name:"common",kind:"message",T:ye},{no:2,name:"poll_opened_from",kind:"enum",T:i.getEnumType(_e)}]),Fg=i.makeMessageType("streamlayer.analytics.v2.streaming.Login",()=>[{no:1,name:"common",kind:"message",T:ye},{no:2,name:"token",kind:"scalar",T:9}]),Gg=i.makeMessageType("streamlayer.analytics.v2.streaming.Logout",()=>[{no:1,name:"common",kind:"message",T:ye}]),Xo=i.makeMessageType("streamlayer.analytics.v2.streaming.SendRequest",()=>[{no:1,name:"auth",kind:"message",T:Ng,oneof:"message"},{no:2,name:"call",kind:"message",T:Ig,oneof:"message"},{no:3,name:"conversations",kind:"message",T:Og,oneof:"message"},{no:4,name:"interactions",kind:"message",T:vg,oneof:"message"},{no:5,name:"event_opened",kind:"message",T:Ag,oneof:"message"},{no:6,name:"invitation",kind:"message",T:wg,oneof:"message"},{no:7,name:"launch_button",kind:"message",T:Rg,oneof:"message"},{no:8,name:"notification",kind:"message",T:Lg,oneof:"message"},{no:9,name:"permission",kind:"message",T:Mg,oneof:"message"},{no:10,name:"button_init",kind:"message",T:Pg,oneof:"message"},{no:11,name:"waves",kind:"message",T:Cg,oneof:"message"},{no:12,name:"heartbeat",kind:"message",T:Dg,oneof:"message"},{no:13,name:"games",kind:"message",T:Ug,oneof:"message"},{no:14,name:"login",kind:"message",T:Fg,oneof:"message"},{no:15,name:"logout",kind:"message",T:Gg,oneof:"message"},{no:100,name:"extra",kind:"message",T:bg}]),Ki={typeName:"streamlayer.analytics.v2.streaming.AnalyticsService",methods:{send:{name:"Send",I:Xo,O:Jo,kind:R.ClientStreaming},unary:{name:"Unary",I:Xo,O:Jo,kind:R.Unary}}};function Bg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wi={exports:{}},ee=Wi.exports={},Me,Pe;function $a(){throw new Error("setTimeout has not been defined")}function Ka(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Me=setTimeout:Me=$a}catch{Me=$a}try{typeof clearTimeout=="function"?Pe=clearTimeout:Pe=Ka}catch{Pe=Ka}})();function zi(e){if(Me===setTimeout)return setTimeout(e,0);if((Me===$a||!Me)&&setTimeout)return Me=setTimeout,setTimeout(e,0);try{return Me(e,0)}catch{try{return Me.call(null,e,0)}catch{return Me.call(this,e,0)}}}function Vg(e){if(Pe===clearTimeout)return clearTimeout(e);if((Pe===Ka||!Pe)&&clearTimeout)return Pe=clearTimeout,clearTimeout(e);try{return Pe(e)}catch{try{return Pe.call(null,e)}catch{return Pe.call(this,e)}}}var Ye=[],Rt=!1,ut,Sn=-1;function qg(){!Rt||!ut||(Rt=!1,ut.length?Ye=ut.concat(Ye):Sn=-1,Ye.length&&Ji())}function Ji(){if(!Rt){var e=zi(qg);Rt=!0;for(var t=Ye.length;t;){for(ut=Ye,Ye=[];++Sn<t;)ut&&ut[Sn].run();Sn=-1,t=Ye.length}ut=null,Rt=!1,Vg(e)}}ee.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ye.push(new Xi(e,t)),Ye.length===1&&!Rt&&zi(Ji)};function Xi(e,t){this.fun=e,this.array=t}Xi.prototype.run=function(){this.fun.apply(null,this.array)};ee.title="browser";ee.browser=!0;ee.env={};ee.argv=[];ee.version="";ee.versions={};function Ke(){}ee.on=Ke;ee.addListener=Ke;ee.once=Ke;ee.off=Ke;ee.removeListener=Ke;ee.removeAllListeners=Ke;ee.emit=Ke;ee.prependListener=Ke;ee.prependOnceListener=Ke;ee.listeners=function(e){return[]};ee.binding=function(e){throw new Error("process.binding is not supported")};ee.cwd=function(){return"/"};ee.chdir=function(e){throw new Error("process.chdir is not supported")};ee.umask=function(){return 0};var xg=Wi.exports;const C=Bg(xg),Hg=Dr({level:"trace",enabled:typeof window<"u"&&!!window.localStorage.getItem("SL_DEBUG"),browser:{write:e=>{console.log(e)}}}),We=(e,t)=>Hg.child({name:e},t);class Qg extends Event{constructor(n,a){super(n);p(this,"slEventBus");this.slEventBus=a}}const Yg=We("event-bus");class jg{constructor(t="sl-event-bus"){p(this,"name");p(this,"listeners");p(this,"emit",(t,n)=>{const a=new Qg(this.name,{...n,type:t});Yg.debug(a,"Emitting event"),window.dispatchEvent(a)});p(this,"destroy",()=>{this.listeners.forEach(t=>{window.removeEventListener(this.name,t),this.listeners.delete(t)}),this.listeners.clear()});this.name=t,this.listeners=new Set}listen(t){return window.addEventListener(this.name,t),this.listeners.add(t),()=>{this.off(t)}}off(t){window.removeEventListener(this.name,t),this.listeners.delete(t)}}class $g{}window.slStore=Object.create(null);class zn{constructor(t,n){p(this,"store");p(this,"name");this.store=t,this.name=n}getStore(){return this.store}}const Kg=e=>{const t=Object.keys(e);return Zd(t.map(n=>e[n].getStore()),(...n)=>Object.fromEntries(t.map((a,s)=>[a,n[s]])))};class pt extends zn{constructor(){super(...arguments);p(this,"getValues",()=>this.getStore().get());p(this,"getValue",n=>this.getStore().get()[n]);p(this,"setValue",(n,a)=>this.getStore().setKey(n,a));p(this,"subscribe",(...n)=>this.getStore().subscribe(...n));p(this,"unsubscribe",()=>this.getStore().off())}}const Ee=e=>Va(e);var Ve;(function(e){e.ORGANIZATION="ORGANIZATION",e.STREAM="STREAM"})(Ve||(Ve={}));const Wg={[H.BETTING]:"betting",[H.GAMES]:"games",[H.PUBLIC_CHAT]:"publicChat",[H.TWITTER]:"twitter"};var $t;(function(e){e.Ready="ready",e.Suspended="suspended"})($t||($t={}));class Zi{constructor({settings:t,...n},a){p(this,"status");p(this,"source");p(this,"config");p(this,"settings");p(this,"listeners",new Set);p(this,"settingsKey");p(this,"enable",()=>{this.status.set($t.Ready)});p(this,"disable",()=>{this.status.set($t.Suspended)});p(this,"setFeatureConfig",({settings:t,...n})=>{var s;let a;for(a in n)this.config.setValue(a,n[a]);if(((s=t==null?void 0:t.overlaySettings)==null?void 0:s.case)!==void 0&&(t==null?void 0:t.overlaySettings.case)===this.settingsKey){const o=t.overlaySettings.value;if(o!==void 0){let r;for(r in o)o[r]!==0&&o[r]!==""&&this.settings.setValue(r,o[r])}}});p(this,"update",(t,n)=>{this.source===Ve.STREAM&&n===Ve.ORGANIZATION||(this.setFeatureConfig(t),this.source=n)});this.settingsKey=Wg[n.type],this.status=nt($t.Suspended),this.config=new pt(Ee(n),`feature:config:${this.settingsKey}`),this.settingsKey!==void 0&&(t==null?void 0:t.overlaySettings.case)===this.settingsKey?this.settings=new pt(Ee(t.overlaySettings.value),`feature:settings:${this.settingsKey}`):this.settings=new pt(Ee({}),`feature:settings:${this.settingsKey}`),this.source=a}get featureConfig(){return this.config.getStore()}get featureSettings(){return this.settings.getStore()}registerEventListener(t){this.listeners.add(t)}fireEvent(t){for(const n of this.listeners.values())try{n.onEvent(t)}catch(a){console.error(a)}}}class be extends zn{constructor(){super(...arguments);p(this,"getValue",()=>this.getStore().get());p(this,"setValue",n=>this.getStore().set(n));p(this,"subscribe",n=>this.getStore().subscribe(n));p(this,"unsubscribe",()=>this.getStore().off())}getValues(){throw new Error("not implemented")}listen(n){return this.getStore().listen(n)}get(){return this.getStore().get()}}const ie=e=>nt(e);class Ue extends zn{constructor(n,a,s){super(n,`api:${a}`);p(this,"atomStore");p(this,"getAtomStore",()=>this.atomStore);p(this,"getValue",async()=>{const n=this.getStore();if(n.value===void 0)throw new Error("no store");return await n.value.promise,n.get().data});p(this,"getValues",()=>this.getStore().get());p(this,"setValue",n=>this.getStore().set({loading:!1,data:n==null?void 0:n.data}));p(this,"subscribe",n=>this.getStore().subscribe(n));p(this,"unsubscribe",()=>{throw new Error("not implemented")});p(this,"invalidate",()=>{this.store.invalidate()});p(this,"listen",n=>this.getStore().listen(n));p(this,"key",()=>this.getStore().key);p(this,"off",()=>this.getStore().off());this.atomStore=nt(),s&&n.subscribe(o=>{const r=this.atomStore.get(),c=s(o,r);r!==c&&this.atomStore.set(c)})}get(){throw new Error("not implemented")}}const de=new jg;async function*zg(e,t){for await(const n of t){e.response.message=n,e.received_at=Date.now(),e.id=ec++;const a={type:"__GRPC_DEVTOOLS_EXTENSION__",data:e};window.postMessage(a),yield n}}let ec=0;const Jg=()=>e=>async t=>{const n={id:ec++,name:t.url,stream:t.stream,sent_at:Date.now(),request:{header:Object.fromEntries(t.header.entries()),message:t.message},response:{}};window.postMessage({type:"__GRPC_DEVTOOLS_EXTENSION__",data:n});try{const a=await e(t);if(n.received_at=Date.now(),n.response.header=Object.fromEntries(a.header.entries()),n.response.trailer=Object.fromEntries(a.trailer.entries()),t.stream){const s={type:"__GRPC_DEVTOOLS_EXTENSION__",data:{...n,stream:!1}};return window.postMessage(s),{...a,message:zg(n,a.message)}}else{n.response.message=a.message,n.latency=n.received_at-n.sent_at;const s={type:"__GRPC_DEVTOOLS_EXTENSION__",data:n};window.postMessage(s)}return a}catch(a){n.received_at=Date.now(),n.response.trailer={"grpc-status":a.code,"grpc-message":a.rawMessage},n.response.message=a.rawMessage,n.latency=n.received_at-n.sent_at;const s={type:"__GRPC_DEVTOOLS_EXTENSION__",data:n};throw window.postMessage(s),a}};window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));function tc(e){return e instanceof DOMException&&(e.code===22||e.code===1014||e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")}class Bt{constructor(t="main",n=window.localStorage){p(this,"delimiter",":");p(this,"prefix");p(this,"storage");p(this,"clear",()=>{for(const t in window.localStorage)t.startsWith(this.prefix)&&this.storage.removeItem(t)});p(this,"generateKey",t=>`${this.prefix}${this.delimiter}${t.join(this.delimiter)}`);p(this,"write",(...t)=>{const n=t.pop()||"",a=this.generateKey(t);try{this.storage.setItem(a,n)}catch(s){tc(s)&&this.storage===window.sessionStorage&&(window.sessionStorage.removeItem("slstreamlogs"),this.storage.setItem(a,n))}});p(this,"read",(...t)=>{const n=this.storage.getItem(this.generateKey(t));return n===null?void 0:n});p(this,"remove",(...t)=>{this.storage.removeItem(this.generateKey(t))});this.prefix=`sl-sdk${this.delimiter}${t}`,this.storage=n}}var Ie;(function(e){e.Init="init",e.Ready="ready",e.Connecting="connecting",e.Connected="connected",e.Disconnected="disconnected",e.Failed="failed",e.Reconnect="reconnect",e.Reconnecting="reconnecting"})(Ie||(Ie={}));class Xg{constructor(t,n,a,s){p(this,"params");p(this,"streamCancel");p(this,"method");p(this,"options");p(this,"headers");p(this,"listeners");p(this,"state");p(this,"store");p(this,"paramsListener");p(this,"reconnectTimeout");p(this,"attempt",0);p(this,"updateState",t=>{this.state.setValue("status",t),this.state.setValue("ts",new Date),this.addStateLog(`status => ${t}`)});p(this,"addStateLog",t=>{const n=this.state.getStore().get().log,a=`${this.options.name} ${new Date().toISOString()}: ${t}`;if(n.push(a),this.state.setValue("log",n),localStorage.getItem("SL_DEBUG"))try{window.sessionStorage.setItem("slstreamlogs",window.sessionStorage.getItem("slstreamlogs")+`
4
- `+a)}catch(s){tc(s)&&window.sessionStorage.removeItem("slstreamlogs"),window.sessionStorage.setItem("slstreamlogs",a)}});p(this,"addListener",(t,n)=>this.listeners.has(t)?(this.addStateLog(`listener '${t}' not added, already exists`),()=>{}):(this.listeners.set(t,n),this.addStateLog(`listener '${t}' added`),()=>this.removeListener(t)));p(this,"removeListener",t=>{this.listeners.delete(t),this.addStateLog(`listener '${t}' removed`)});p(this,"connect",()=>{this.updateState(Ie.Connecting),this.streamCancel&&(this.addStateLog("disconnect prev connection"),this.streamCancel.abort(),this.streamCancel=void 0);const t="get"in this.params&&typeof this.params.get=="function"?this.params.get():this.params;(async()=>{this.streamCancel=new AbortController;try{const n={headers:this.headers.getValues(),signal:this.streamCancel.signal},a=this.method(t,n);for await(const s of a)this.attempt=0,this.onData(s)}catch(n){n instanceof x&&n.code!=exports.Code.Canceled&&this.onStreamError(n)}})(),this.updateState(Ie.Connected)});p(this,"disconnect",()=>{var t;this.streamCancel&&this.streamCancel.abort(),this.listeners.clear(),(t=this.paramsListener)==null||t.call(this),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.updateState(Ie.Disconnected)});p(this,"reconnect",()=>{if(this.reconnectTimeout)this.addStateLog("already reconnecting");else if(this.attempt<this.options.reconnectMaxAttempts){this.updateState(Ie.Reconnect);const t=Math.min(this.options.reconnectMaxDelay,Math.pow(2,this.attempt)*this.options.reconnectDelay),n=Math.round(t*(1+Math.random())/2);this.reconnectTimeout=setTimeout(()=>{this.attempt++,this.updateState(Ie.Reconnecting),this.addStateLog(`reconnect attempt ${this.attempt} after ${n}ms`),this.connect(),this.reconnectTimeout=void 0},n)}else this.addStateLog("max reconnect attempts reached"),this.disconnect()});p(this,"getStore",()=>{var t;return(t=this.store)==null?void 0:t.getStore()});p(this,"onData",t=>{try{this.addStateLog(`received data => ${JSON.stringify(t)}`),this.store&&this.store.setValue(t);for(const[,n]of this.listeners)n(t);this.addStateLog(`data routed to ${this.listeners.size} listeners`)}catch(n){this.addStateLog(`error process data => ${n}`)}});p(this,"onStreamError",t=>{if(this.addStateLog(`error => ${t?JSON.stringify(t):"undefined"}}`),t!==void 0){if(t instanceof x&&t.code!==exports.Code.Canceled){this.updateState(Ie.Failed),this.state.setValue("error",t),this.reconnect();return}this.disconnect()}});const o={status:Ie.Init,ts:new Date,log:[]};this.state=new pt(Ee(o),`subscription:${s.name}:state`),this.options={...s,reconnectDelay:s.reconnectDelay??1e3,reconnectMaxDelay:s.reconnectMaxDelay??3e4,reconnectMaxAttempts:s.reconnectMaxAttempts??10,withStore:s.withStore??!1},this.headers=t,this.listeners=new Map,this.params=a,this.method=n,s.withStore&&(this.store=new be(ie(null),`subscription:${s.name}:store`)),"subscribe"in a&&typeof a.subscribe=="function"&&(this.paramsListener=a.subscribe(r=>{this.state.getValue("status")===Ie.Connected&&(this.addStateLog(`params updated, reconnect => ${JSON.stringify(r)}`),this.reconnect())})),this.updateState(Ie.Ready)}}const Zg=new Set([exports.Code.Unknown,exports.Code.Internal,exports.Code.DeadlineExceeded,exports.Code.ResourceExhausted,exports.Code.FailedPrecondition,exports.Code.Unavailable,exports.Code.DataLoss]),Zo=We("grpc:retry"),ek=e=>async t=>{const n=t.contextValues.get(Wa.retryAttempts),a=300,s=t.contextValues.get(Wa.retryDelay);if(t.stream||n===0)return e(t);Zo.trace({url:t.url,attempts:n,maxDelay:s},"retry options");for(let o=0;;o++)try{return await e(t)}catch(r){Zo.trace({attempt:o,error:r},"retry attempt");const c=x.from(r);if(o>=n||!(c instanceof x)||!Zg.has(c.code))throw r;const l=Math.min(s,Math.pow(2,o)*a),m=Math.round(l*(1+Math.random())/2);await new Promise(u=>setTimeout(u,m))}},Wa={retryAttempts:Ha(10,{description:"Number of attempts to retry"}),retryDelay:Ha(3e4,{description:"Max delay between retries in milliseconds"})},tk=()=>{const e=localStorage.getItem("sl-device-id");if(e)return e;const t=qa();return localStorage.setItem("sl-device-id",t),t},nk=()=>{var e;return((e=navigator.userAgentData)==null?void 0:e.platform)||navigator.platform};class er{constructor(t,n){p(this,"toJsonOptions",{emitDefaultValues:!1,enumAsInteger:!0,useProtoFieldName:!1});p(this,"transport");p(this,"streamTransport");p(this,"nanoquery");p(this,"host");p(this,"$headers");p(this,"interceptors",[]);p(this,"clients");p(this,"streamClients");p(this,"subscriptions");p(this,"opts");p(this,"addSubscription",(t,n,a)=>{const s=this.subscriptions.get(n);if(s)return s;const o=new Xg(this.$headers,t,n,a);return this.subscriptions.set(n,o),o});p(this,"removeSubscription",t=>{t.disconnect(),this.subscriptions.delete(t.params)});p(this,"disconnect",()=>{var s,o;for(const[r,c]of this.subscriptions)c.disconnect(),this.subscriptions.delete(r);this.clients.clear(),this.streamClients.clear(),this.subscriptions.clear();const[t,n,a]=vo({dedupeTime:(s=this.opts)==null?void 0:s.dedupeTime,refetchInterval:(o=this.opts)==null?void 0:o.refetchInterval});this.nanoquery={createFetcherStore:t,createMutatorStore:n,utils:a}});p(this,"registerInterceptor",t=>{this.interceptors.push(t)});p(this,"removeInterceptor",t=>{this.interceptors=this.interceptors.filter(n=>n!==t)});p(this,"getClient",t=>{const n=t.typeName;if(this.clients.has(n))return this.clients.get(n);const a=go(t,this.transport);return this.clients.set(n,a),a});p(this,"getStreamClient",t=>{const n=`stream-${t.typeName}`;if(this.clients.has(n))return this.clients.get(n);const a=go(t,this.streamTransport);return this.clients.set(n,a),a});p(this,"createPromiseClient",(t,{params:n=[],method:a})=>{const s=this.getClient(t),o=t.methods[a].name,r=[t.typeName,o.charAt(0).toLowerCase()+o.slice(1),...Array.isArray(n)?n:[n]],c=[t.typeName,o.charAt(0).toLowerCase()+o.slice(1)];return{client:s,createRequestOptions:l=>{const m=xa();for(const u in l){const d=Wa[u];m.set(d,l[u])}return m},queryKey:r,queryKeyStr:c.join("")}});p(this,"createStreamClient",t=>({client:this.getStreamClient(t)}));p(this,"setSdkKey",t=>{this.$headers.setValue("sdk",t)});p(this,"setAuth",(t,n)=>{this.$headers.setValue("authorization",t),this.$headers.setValue("sl-user-id",n)});p(this,"setHeader",(t,n)=>this.$headers.setValue(t,n));p(this,"getHeader",t=>this.$headers.getValue(t));p(this,"getHeaders",()=>this.$headers.getValues());p(this,"initInterceptors",()=>{var n;if(this.interceptors.length!==0)return;const t=a=>s=>{const o=this.$headers.getValues();for(const r in o)s.header.set(r,o[r]);return a(s)};this.interceptors.push(t),this.interceptors.push(Jg()),(n=this.opts)!=null&&n.retryable&&this.interceptors.push(ek)});this.host=t,this.opts=n,this.$headers=new pt(Ee({"sl-device-id":tk(),"sl-device-os":nk()}),"transport:headers"),this.initInterceptors(),this.clients=new Map,this.streamClients=new Map,this.subscriptions=new Map;const[a,s,o]=vo({dedupeTime:n==null?void 0:n.dedupeTime,refetchInterval:n==null?void 0:n.refetchInterval});this.nanoquery={createFetcherStore:a,createMutatorStore:s,utils:o},this.transport=Oo({baseUrl:t,defaultTimeoutMs:1e4,interceptors:this.interceptors}),this.streamTransport=Oo({baseUrl:t,interceptors:this.interceptors})}}const ak=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Qi,{method:"retrieveEventId",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var c;if(!r||typeof r!="string")return"";try{return((c=(await n.retrieveEventId({id:r})).data)==null?void 0:c.id)||""}catch{return""}}})},sk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(en,{method:"getStream",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var c;return r?(c=(await n.getStream({id:r})).data)==null?void 0:c.attributes:void 0}})},ok=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Qi,{method:"summary",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var c;return r?(c=(await n.summary({id:r})).data)==null?void 0:c.attributes:void 0}})},rk=(e,t)=>{const{queryKey:n,client:a}=t.createPromiseClient(Is,{method:"me",params:[e]});return t.nanoquery.createFetcherStore(n,{fetcher:async()=>{const{data:s}=await a.me({});return{data:s}}})},ik=e=>{const{client:t,createRequestOptions:n}=e.createPromiseClient(Is,{method:"bypassAuth"}),a=n({retryAttempts:0});return({userKey:s,schema:o,init:r,inviterKey:c})=>t.bypassAuth({userKey:s,schema:o,init:r,inviterKey:c},{contextValues:a})},ck=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(en,{method:"get",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async()=>{var s;return(s=(await n.get({})).data)==null?void 0:s.attributes}})},lk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(en,{method:"getOrganization",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async()=>{const s=await n.getOrganization({});return s.data?{...s.data.attributes,id:s.data.id}:void 0}})},mk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(en,{method:"getOrganizationAdvertising",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async()=>{var s;return(s=(await n.getOrganizationAdvertising({})).data)==null?void 0:s.attributes}})},uk=(e,t,n)=>{e.transport=new er(t.host,{dedupeTime:1e3*60*5,refetchInterval:1e3*60*5,retryable:!0}),e.analyticsTransport=new er(t.analyticsHost),e.sdk.host=e.transport.host,e.transport.setSdkKey(t.sdkKey),e.transport.setHeader("sl-sdk-version",t.version||"-"),e.transport.$headers.subscribe(a=>{e.analyticsTransport.$headers.getStore().set(a)}),e.sdk.onMount({name:"transport"},()=>()=>{e.transport.disconnect(),e.analyticsTransport.disconnect()}),n()};var Ge;(function(e){e.SCHEMA="schema",e.EXTERNAL_TOKEN="eToken",e.TOKEN="token"})(Ge||(Ge={}));class It extends Bt{constructor(){super("user");p(this,"setSchema",n=>{this.write(Ge.SCHEMA,n)});p(this,"getSchema",()=>this.read(Ge.SCHEMA));p(this,"setToken",n=>{this.write(Ge.TOKEN,n)});p(this,"getToken",()=>this.read(Ge.TOKEN));p(this,"setExternalToken",n=>{this.write(Ge.EXTERNAL_TOKEN,n)});p(this,"getExternalToken",()=>this.read(Ge.EXTERNAL_TOKEN));p(this,"removeToken",()=>{this.remove(Ge.TOKEN)})}}var qe;(function(e){e.DISABLED="disabled",e.INITIALIZATION="initialization",e.READY="ready",e.FAILED="failed",e.SUSPENDED="suspended"})(qe||(qe={}));const dk=e=>{const t=new It,n=new be(ie(t.getExternalToken()),"userKey"),a=new be(ie(t.getToken()),"userToken"),s=new Ue(rk(a.getStore(),e),"user",({data:r,error:c,loading:l},m)=>{var u;if(!c)return(u=r==null?void 0:r.data)!=null&&u.id?r.data.id:l===!1?void 0:m}),o=new Ue(ck(a.getStore(),e),"userSettings");return{userKey:n,userToken:a,user:s,userSettings:o}},pk=e=>{const t=new be(ie(void 0),"providerStreamId"),n=new Ue(ak(t.getStore(),e),"slStreamId",o=>o==null?void 0:o.data),a=new Ue(sk(n.getAtomStore(),e),"streamSettings"),s=new Ue(ok(n.getAtomStore(),e),"streamSettings");return n.getAtomStore().listen(o=>{(o===""||o===void 0)&&(a.getStore().mutate(void 0),s.getStore().mutate(void 0))}),{providerStreamId:t,slStreamId:n,streamSettings:a,streamSummary:s}},Tk=e=>{const t=new be(ie(void 0),"enabled"),n=new be(ie(qe.DISABLED),"status"),a=new Ue(lk(t.getStore(),e),"organizationSettings",c=>{var l;return(l=c==null?void 0:c.data)==null?void 0:l.id}),s=new Ue(mk(a.getAtomStore(),e),"organizationAdvertising"),o=dk(e),r=pk(e);return{enabled:t,status:n,providerStreamId:r.providerStreamId,slStreamId:r.slStreamId,streamSettings:r.streamSettings,streamSummary:r.streamSummary,user:o.user,userKey:o.userKey,userToken:o.userToken,userSettings:o.userSettings,organizationSettings:a,organizationAdvertising:s}};class yk extends zn{constructor(n){const a=Tk(n),s=Kg(a);super(s,"core");p(this,"stores");p(this,"subscribe",n=>{let a;for(a in this.stores){const s=n[a];a in n&&s!==void 0&&this.stores[a].subscribe(n[a])}});p(this,"unsubscribe",()=>this.getStore().off());this.stores=a}getValue(){throw new Error("Not implemented")}getValues(){return this.stores}setValue(){throw new Error("Not implemented")}}const fk=(e,t,n)=>{e.store=new yk(e.transport),e.stores=e.store.getValues(),e.sdk.enabled=e.stores.enabled.getStore(),e.sdk.status=e.stores.status.getStore(),e.sdk.sdkStore=Object.fromEntries(Object.entries(e.stores).map(([a,s])=>[a,s.getStore()])),e.sdk.organizationStore=()=>e.stores.organizationSettings.getStore(),e.sdk.streamStore=()=>e.stores.streamSettings.getStore(),e.sdk.streamSummary=()=>e.stores.streamSummary.getStore(),e.storeUnsubscribe=()=>{e.store.unsubscribe()},n()},gk=e=>{const{client:t}=e.createPromiseClient($i,{method:"list"});return n=>t.list(n)},nc=e=>{const{client:t}=e.createPromiseClient($i,{method:"summary"});return n=>t.summary(n)},kk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Is,{method:"getFriends",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{if(!r)return[];try{return(await n.getFriends({})).data}catch{return[]}}})},hk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ne,{method:"get",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var c;return(c=(await n.get({eventId:r})).data)==null?void 0:c.attributes},refetchInterval:0,dedupeTime:1e3*60*60})},Sk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ne,{method:"syncQuestion",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var l,m,u,d;if(!r)return;const c=await n.syncQuestion({filter:{eventId:r}});if(((u=(m=(l=c.data)==null?void 0:l.attributes)==null?void 0:m.question)==null?void 0:u.type)!==P.PROMOTION)return(d=c.data)==null?void 0:d.attributes},dedupeTime:1e3*60*10,refetchInterval:0})},_k=async(e,t)=>{const{client:n}=t.createPromiseClient(Ne,{method:"item",params:[e]});return(await n.item({id:e})).data},Ek=(e,t)=>{const{client:n}=t.createStreamClient(Ne),a=nt({eventId:e.get()||"",feedId:""});return e.subscribe((s="")=>{a.set({eventId:s,feedId:""})}),t.addSubscription(n.subscription,a,{name:"feedSubscription"})},bk=(e,t)=>{const{client:n}=t.createStreamClient(Ne);return t.addSubscription(n.questionSubscription,{questionId:e},{name:"questionSubscription"})},Nk=async(e,t)=>{var a,s;const{client:n}=t.createPromiseClient(Ne,{method:"questionByUser",params:[e]});return(s=(a=(await n.questionByUser({questionId:e})).data)==null?void 0:a.attributes)==null?void 0:s.question},za=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ne,{method:"questionByUser",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var c,l;return(l=(c=(await n.questionByUser({questionId:r})).data)==null?void 0:c.attributes)==null?void 0:l.question},dedupeTime:1e3*60*5})},ac=async(e,t)=>{var l;if(!e)return;const{client:n}=t.createPromiseClient(Ne,{method:"getQuestion",params:[e]}),a=await n.getQuestion({id:e});if(!((l=a.data)!=null&&l.attributes))return;const{options:s,notification:o,...r}=a.data.attributes,c=(s==null?void 0:s.options.case)==="promotion"?s==null?void 0:s.options.value:void 0;return{id:r.id,question:r,promotion:c,notification:o}},Ik=(e,t,n)=>{const{client:a,queryKey:s}=n.createPromiseClient(Ne,{method:"list",params:[e,t]});return n.nanoquery.createFetcherStore(s,{fetcher:async(o,r,c,l)=>c?(await a.list({eventId:c,filter:{types:l===Tt.ALLOWED?[]:[P.FACTOID,P.PROMOTION,P.TWEET],statuses:[oe.ACTIVE,oe.RESOLVED]}})).data:[],dedupeTime:0,refetchInterval:0})},Ok=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ne,{method:"list",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var l;if(!r)return;const c=(l=(await n.list({eventId:r,filter:{types:[P.PROMOTION],statuses:[oe.ACTIVE]},pagination:{page:0,pageSize:1}})).data)==null?void 0:l[0];if(c.type==="promotion")return ac(c.id,t)},dedupeTime:0,refetchInterval:0})},vk=(e,t,n)=>{const a=uo([t,n],()=>{var m,u;const r=t.get();if(!r)return;const c=(m=n.get().data)==null?void 0:m.find(d=>d.id===(r==null?void 0:r.questionId)),l=(u=r==null?void 0:r.question)==null?void 0:u.openedFrom;return c?(c.openedFrom=l,c):r.question}),s=uo(a,r=>r&&r.type==="question"?r.id:void 0),o=za(s,e);return{$store:a,$extendedStore:o,updateExtendedQuestion:r=>{const c=o.get().data,l=(m,u)=>{if(!m||!u)return m||u||[];const d=[];for(let y=0;y<m.length;y++)d.push({...m[y],...u[y],correct:m[y].correct,youVoted:m[y].youVoted,pointsEarned:m[y].pointsEarned});return d};o.mutate({...r,options:c==null?void 0:c.options,subject:c==null?void 0:c.subject,appearance:c==null?void 0:c.appearance,answers:l(c==null?void 0:c.answers,r==null?void 0:r.answers)})}}};var Pn;(function(e){e.SHOWED="showed"})(Pn||(Pn={}));class Ak extends Bt{constructor(){super("advertisement");p(this,"setShowed",n=>{this.write(Pn.SHOWED,n,"true")});p(this,"isViewed",n=>this.read(Pn.SHOWED,n))}}const wk=e=>{var r,c,l,m,u;const t=(c=(r=e.data)==null?void 0:r.attributes)==null?void 0:c.question;if((((u=(m=(l=e.data)==null?void 0:l.attributes)==null?void 0:m.feedItem)==null?void 0:u.type)==="promotion"?e.data.attributes.feedItem:void 0)===void 0||!t)return;const{options:n,notification:a,...s}=t,o=(n==null?void 0:n.options.case)==="promotion"?n.options.value:void 0;return{id:s.id,question:s,notification:a,promotion:o}},un=e=>e.startsWith("http://")||e.startsWith("https://")?new URL(e).toString():e,Rk=({gamOptions:e,gamBaseUrl:t})=>{const n=`${t}?`,a=[];for(const s in e){const o=s.replace(/([a-zA-Z])(?=[A-Z])/g,"$1_").toLowerCase(),r=e[s];if(r)if(typeof r=="string")a.push(`${o}=${un(r)}`);else if(Array.isArray(r))a.push(`${o}=${r.map(un).join(",")}`);else{const c=Object.entries(r).map(([l,m])=>Array.isArray(m)?`${l}=${m.map(un).join(",")}`:typeof m=="string"?`${l}=${un(m)}`:`${l}=${m}`).join("&").replaceAll("=","%3D").replaceAll("&","%26").replaceAll(",","%2C");a.push(`${o}=${c}`)}}return n+a.join("&")},Lk=(e,t,n)=>{let a=!1;const s=n.transport,o=We("advertisement"),r=new Ak,c=Ee({}),l=Ok(e,s),m=()=>{var N,E,b;c.setKey("hasNotification",!1);const T=c.get(),f=(N=T.data)==null?void 0:N.question.id,_=(b=(E=T.data)==null?void 0:E.promotion)==null?void 0:b.type;f&&de.emit("advertisement",{action:"notification-opened",payload:{id:f,type:_}})},u=()=>{var E,b,w,O;const T=c.get(),f=(E=T.data)==null?void 0:E.question.id,_=(w=(b=T.data)==null?void 0:b.promotion)==null?void 0:w.type,N=(O=c.get())==null?void 0:O.isOpened;f&&!N&&(o.debug({id:f},"markAsViewed: %o"),r.setShowed(f),c.setKey("isOpened",!0),de.emit("advertisement",{action:"opened",payload:{id:f,type:_}}))},d=(T,f)=>{var _;f?c.set({loading:!1,error:void 0,data:f,hasNotification:((_=f==null?void 0:f.notification)==null?void 0:_.enabled)===Rn.NOTIFICATION_ENABLED,close:()=>y(f.question.id),isViewed:!!r.isViewed(f.question.id)}):(c.setKey("loading",!0),ac(T,s).then(N=>{var E;return c.set({loading:!1,error:void 0,data:N,hasNotification:((E=N==null?void 0:N.notification)==null?void 0:E.enabled)===Rn.NOTIFICATION_ENABLED,close:()=>y(N==null?void 0:N.question.id),isViewed:N&&!!r.isViewed(N.question.id)})}).catch(N=>c.set({loading:!1,error:N,data:void 0})))};c.subscribe((T,f)=>{var _,N,E,b,w,O,A;if(((N=(_=T.data)==null?void 0:_.promotion)==null?void 0:N.type)===he.EXTERNAL_AD&&!(T!=null&&T.externalAd)&&((E=T.data.promotion.adCampaigns)!=null&&E.gamOptions)&&((b=T.data.promotion.adCampaigns)!=null&&b.gamBaseUrl)){const L=Rk(T.data.promotion.adCampaigns);c.setKey("externalAd",{type:"gam",url:L})}(w=T.data)!=null&&w.promotion&&!T.isOpened&&de.emit("advertisement",{action:"received",payload:{id:T.data.question.id,type:T.data.promotion.type,hasNotification:!!T.hasNotification,isViewed:!!r.isViewed(T.data.question.id)},skipAnalytics:T.data.question.id===((O=f==null?void 0:f.data)==null?void 0:O.question.id)}),!(T!=null&&T.data)&&(f!=null&&f.data)&&de.emit("advertisement",{action:"closed",payload:{id:f.data.question.id,type:(A=f.data.promotion)==null?void 0:A.type,hasNotification:!!f.hasNotification,isViewed:!!r.isViewed(f.data.question.id)}})});const y=T=>{var f,_;(!T||((_=(f=c.get())==null?void 0:f.data)==null?void 0:_.question.id)===T)&&c.set({})};return{connect:()=>{a||(a=!0,l.subscribe((T,f)=>{T.data&&(!(f!=null&&f.data)||T.data.id!==f.data.id)&&d(T.data.question.id,T.data)}),t.addListener("promotion",T=>{const f=wk(T);if(f){if(f.question.status===oe.RESOLVED){y(f.question.id),o.debug({promotion:f},"resolved: %o");return}if(f.question.status===oe.ACTIVE){o.debug({promotion:f},"active: %o"),d(f.question.id,f);return}o.debug({promotion:f},"skip: %o")}}))},hide:y,show:d,open:m,markAsViewed:u,$store:c}};var Tt;(function(e){e.ALLOWED="allowed",e.DISALLOWED="disallowed"})(Tt||(Tt={}));class Mk{constructor(t){p(this,"slStreamId");p(this,"organizationId");p(this,"userId");p(this,"interactiveAllowed");p(this,"openedQuestionId");p(this,"openedQuestion");p(this,"activeQuestionId");p(this,"feedList");p(this,"moderationId");p(this,"moderation");p(this,"feedSubscription");p(this,"questionSubscription");p(this,"advertisement");p(this,"notifications");p(this,"log");p(this,"transport");p(this,"cancels",new Set);p(this,"getCurrentSessionId",t=>{const n=t.eventId||this.slStreamId.get()||"",a=t.userId||this.userId.get()||"",s=t.organizationId||this.organizationId.get()||"",o=t.entity||"",r=t.prefix||"";return[s,n,a,r,o].join(":")});p(this,"disconnect",()=>{var t;(t=this.feedSubscription)==null||t.disconnect(),this.questionSubscription!==void 0&&(this.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0)});p(this,"openQuestion",(t,n)=>{this.openedQuestionId.set({questionId:t,question:n}),this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:t}))});p(this,"closeQuestion",t=>{this.openedQuestionId.set(void 0),t&&this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:t}))});this.transport=t.transport,this.log=We("gamification-background"),this.slStreamId=t.stores.slStreamId.getAtomStore(),this.organizationId=t.stores.organizationSettings.getAtomStore(),this.userId=t.stores.user.getAtomStore(),this.moderationId=new be(ie(void 0),"moderationId").getStore(),this.interactiveAllowed=new be(ie(Tt.DISALLOWED),"interactiveAllowed").getStore(),this.openedQuestionId=new be(ie(void 0),"openedQuestionId").getStore(),this.notifications=t.notifications,this.moderation=new Ue(hk(this.slStreamId,t.transport),"gamification:moderation"),this.feedList=new Ue(Ik(this.slStreamId,this.interactiveAllowed,t.transport),"gamification:feedList"),this.activeQuestionId=Sk(this.slStreamId,t.transport),this.openedQuestion=vk(t.transport,this.openedQuestionId,this.feedList.getStore()),this.cancels.add(this.openedQuestionId.listen(n=>{this.log.debug({item:n},"received question"),n!=null&&n.questionId?(this.questionSubscription=bk(n.questionId,t.transport),this.questionSubscription.addListener("feed-subscription-opened-question",a=>{var s,o;this.openedQuestion.updateExtendedQuestion((o=(s=a.data)==null?void 0:s.attributes)==null?void 0:o.question)}),this.questionSubscription.connect()):(this.log.info("cleanup on close question"),this.questionSubscription!==void 0&&(t.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0))})),this.feedSubscription=Ek(this.slStreamId,t.transport),this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question",n=>{var o,r,c,l;const a=(r=(o=this.activeQuestionId.get().data)==null?void 0:o.question)==null?void 0:r.id,s=(l=(c=n.data)==null?void 0:c.attributes)==null?void 0:l.question;if(!(!s||s.type===P.PROMOTION)){if(s.status===oe.RESOLVED){a===s.id&&this.activeQuestionId.mutate(void 0);return}window.requestAnimationFrame(()=>{var m;this.activeQuestionId.mutate((m=n.data)==null?void 0:m.attributes)})}})),this.cancels.add(this.feedSubscription.addListener("moderation update",n=>{window.requestAnimationFrame(()=>{var a,s,o,r;((s=(a=n.data)==null?void 0:a.attributes)==null?void 0:s.question)===void 0&&((r=(o=n.data)==null?void 0:o.attributes)!=null&&r.moderation)&&this.moderation.invalidate()})})),this.cancels.add(this.activeQuestionId.subscribe((n,a)=>{var s,o,r,c,l,m,u;(s=n.data)!=null&&s.feedItem&&((r=(o=n.data)==null?void 0:o.feedItem)==null?void 0:r.id)!==((l=(c=a==null?void 0:a.data)==null?void 0:c.feedItem)==null?void 0:l.id)&&t.onQuestionActivate({stage:"activate",id:n.data.feedItem.id,isViewed:!!this.notifications.isViewed(this.getCurrentSessionId({prefix:"notification",entity:n.data.feedItem.id})),hasNotification:!0,type:n.data.feedItem.type}),!((m=n.data)!=null&&m.feedItem)&&((u=a==null?void 0:a.data)!=null&&u.feedItem)&&t.onQuestionActivate({stage:"deactivate",id:a.data.feedItem.id,isViewed:!!this.notifications.isViewed(this.getCurrentSessionId({prefix:"notification",entity:a.data.feedItem.id})),hasNotification:!0,type:a.data.feedItem.type})})),this.feedSubscription.connect(),this.cancels.add(this.interactiveAllowed.listen(()=>{window.requestAnimationFrame(()=>{this.activeQuestionId.invalidate()})})),t.sdk.onMount({name:"gamification-background"},()=>()=>{this.activeQuestionId.off();for(const n of this.cancels)n(),this.cancels.delete(n)}),this.advertisement=Lk(this.slStreamId,this.feedSubscription,t)}}class Pk{constructor(t){p(this,"notificationsList");p(this,"store");p(this,"timeouts");p(this,"waitingQueue");p(this,"activeQueue");p(this,"options");p(this,"logger");p(this,"addToQueue",t=>{var s;if(this.store.has(t.id)){this.logger.debug({notification:t},"skip existed notification: %o");return}const n=t.close,a=t.action;if(this.store.set(t.id,{...t,close:(...o)=>{n&&n(...o),this.closeNotification(t.id)},action:(...o)=>{a&&a(...o),this.closeNotification(t.id,{animateHiding:!1})}}),this.waitingQueue.add(t.id),this.activeQueue.size===this.options.concurrency){const[o]=this.activeQueue;if(((s=this.store.get(o))==null?void 0:s.persistent)!==!0)this.closeNotification(o);else{const[r]=this.waitingQueue;this.waitingQueue.size>1&&this.closeNotification(r),this.tickWaitingQueue()}}else this.tickWaitingQueue()});p(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[t]=this.waitingQueue;if(!t)return;this.activeQueue.add(t),this.waitingQueue.delete(t),this.logger.debug({job:t},"waiting queue tick"),this.tickActiveQueue(t)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});p(this,"tickActiveQueue",t=>{if(!t)return;const n=this.store.get(t);if(!n){this.logger.debug({notificationId:t},"active queue tick skipped, notification not exist");return}de.emit("notification",{action:"received",payload:{questionId:n.data.questionId,questionType:n.data.questionType}});const a=setTimeout(()=>{const s=t,o=new Map(this.notificationsList.get());o.set(n.id,n),this.notificationsList.set(o);const r=setTimeout(()=>{this.logger.debug({notificationId:s,delay:n.autoHideDuration||5e3},"notification hiding by autoHideDuration"),this.closeNotification(s)},n.autoHideDuration||5e3);this.timeouts.set(s,r),this.logger.debug({notificationId:s,queue:[...o.values()]},"notification displayed")},n.delay||0);this.timeouts.set(t,a),this.logger.debug({notificationId:t},"active queue tick completed"),this.tickWaitingQueue()});p(this,"closeNotification",(t,{animateHiding:n=!0}={})=>{const a=new Map(this.notificationsList.get()),s=a.get(t);if(s){s.hiding=!(this.waitingQueue.size>=this.options.concurrency)&&n,this.notificationsList.set(a);const o=setTimeout(()=>{const r=new Map(this.notificationsList.get());r.delete(t),this.notificationsList.set(r);const c=this.timeouts.get(t);c!==void 0&&(clearTimeout(c),this.timeouts.delete(t)),this.logger.debug({notificationId:t},"notification hidden"),s.hiding&&de.emit("notification",{action:"closed",payload:{questionId:s.data.questionId,questionType:s.data.questionType}})},this.options.animationDelay||0);this.timeouts.set(t,o)}return this.store.delete(t),this.activeQueue.delete(t),this.waitingQueue.delete(t),this.tickWaitingQueue(),this.logger.debug({notificationId:t},"notification hiding"),s});p(this,"drain",()=>{this.store.clear(),this.timeouts.clear(),this.waitingQueue.clear(),this.activeQueue.clear(),this.notificationsList.off(),this.notificationsList.set(new Map)});this.options=t,this.logger=We("notifications"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.notificationsList=ie(new Map)}}var Cn;(function(e){e.OPENED="opened"})(Cn||(Cn={}));class Ck extends Bt{constructor(){super("notification");p(this,"setOpened",n=>{this.write(Cn.OPENED,n,"true")});p(this,"isOpened",n=>this.read(Cn.OPENED,n));p(this,"clearNotification",()=>{this.clear()})}}var Ze;(function(e){e[e.ONBOARDING=1]="ONBOARDING",e[e.QUESTION=2]="QUESTION",e[e.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(Ze||(Ze={}));class Dk{constructor(t={}){p(this,"queue");p(this,"storage");p(this,"isViewed",t=>this.storage.isOpened(t));p(this,"add",t=>{if(!this.isViewed(t.id)){if(t.data&&t.emitEvent){const n=t.action;t.action=(...a)=>{n&&n(...a),de.emit("notification",{action:"opened",payload:{questionId:t.data.questionId,questionType:t.data.questionType}})}}this.queue.addToQueue(t)}});p(this,"close",(t,{markAsViewed:n=!0,animateHiding:a}={})=>{this.queue.closeNotification(t,{animateHiding:a}),n&&this.markAsViewed(t)});p(this,"getActiveNotification",()=>{const t=this.queue.notificationsList.get();if(!(t!=null&&t.size))return null;for(const n of t.values())if(n.type===Ze.ONBOARDING)return n;return t.values().next().value});p(this,"getQueueStore",()=>this.queue.notificationsList);p(this,"markAsViewed",t=>{this.storage.setOpened(t)});this.storage=new Ck,this.queue=new Pk({concurrency:1,animationDelay:1600,...t})}}const Uk=(e,t,n)=>{e.notifications=new Dk(void 0),e.addNotification=e.notifications.add,e.sdk.getNotificationsStore=()=>e.notifications.getQueueStore(),e.sdk.getActiveNotification=()=>e.notifications.getActiveNotification(),e.sdk.onMount({name:"notifications"},()=>()=>{e.notifications.queue.drain()}),n()};var Xt;(function(e){e.UNKNOWN="unknown",e.ALREADY_VOTED="already_voted"})(Xt||(Xt={}));const Fk=async(e,t)=>{var o;const{client:n,createRequestOptions:a}=e.createPromiseClient(Ne,{method:"submitAnswer"}),s=a({retryAttempts:0});try{return await n.submitAnswer({data:t},{contextValues:s})}catch(r){throw((o=x.from(r))==null?void 0:o.code)===exports.Code.AlreadyExists?new Error(Xt.ALREADY_VOTED):new Error(Xt.UNKNOWN)}},Gk=(e,t)=>{const{client:n,createRequestOptions:a}=e.createPromiseClient(Ne,{method:"submitInplay"}),s=a({retryAttempts:0});return n.submitInplay({data:{eventId:+t}},{contextValues:s})};var Ot;(function(e){e.ONBOARDING="onboarding",e.ONBOARDING_IO="onboarding_io"})(Ot||(Ot={}));class Bk extends Bt{constructor(){super("gamification-session",window.sessionStorage);p(this,"writeValue",(n,a)=>{this.write(...n,a)});p(this,"readValue",n=>this.read(...n))}}class sc extends Bt{constructor(){super("gamification");p(this,"sessionStorage");p(this,"saveOnboardingStatus",({userId:n,eventId:a,organizationId:s},o)=>{this.write(Ot.ONBOARDING,s,n,a,o)});p(this,"getOnboardingStatus",({userId:n,eventId:a,organizationId:s})=>this.read(Ot.ONBOARDING,s,n,a));p(this,"setOnboardingInstantOpen",({userId:n,eventId:a,organizationId:s})=>{this.sessionStorage.writeValue([Ot.ONBOARDING_IO,s,n,a],"1")});p(this,"getOnboardingInstantOpen",({userId:n,eventId:a,organizationId:s})=>this.sessionStorage.readValue([Ot.ONBOARDING_IO,s,n,a]));this.sessionStorage=new Bk}}const Vk={pageSize:10},qk=(e,t,n,a,s)=>{let o=0;const r=ie({pageSize:Vk.pageSize,page:0}),c=Ee({data:[],key:Date.now(),hasMore:!0,loading:void 0,error:void 0}),l=gk(e),m=async()=>{var f;const y=t.get(),T=((f=a.getStore().get().data)==null?void 0:f.map(_=>_.slId))||[];if(y&&(T!=null&&T.length)){const _=n.get();_&&T.push(_),c.setKey("loading",!0),c.setKey("data",[]);const N=await l({eventId:y,usersIds:T});c.set({data:N.data.map((E,b)=>({...E.attributes,friendsRank:b+1})),hasMore:!1,key:Date.now(),loading:!1}),N.meta&&(o=Math.round(N.meta.count/N.meta.pageSize))}},u=()=>{m()},d=y=>{const T=r.get(),f=y||T.page+1;f<=o&&r.set({...T,page:f})};return jn(c,()=>{const y=t.listen(m),T=a.listen(m);return()=>{y(),T()}}),{$store:c,fetchMore:d,invalidate:u}};class xk extends Bt{constructor(){super("deep-link-context",window.sessionStorage);p(this,"get",this.read);p(this,"set",this.write);p(this,"del",this.remove)}}const tr="sldl",Jn="sldl_uid",oc="sldl_eid",rc="sldl_e_eid",Hk=new Set([Jn,oc,rc]),nr=e=>{const t={},n={};for(const[a,s]of e)Hk.has(a)?t[a]=s:n[a]=s;return{result:t,remain:n}},Qk=({hash:e,search:t})=>{if(e&&e.includes(tr)){const n=new URLSearchParams(e.substr(1));return{hash:nr(n)}}if(t&&t.includes(tr)){const n=new URLSearchParams(t);return{search:nr(n)}}return null},ar=We("deep_link"),Ce={debug:(...e)=>{ar.debug(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)},trace:(...e)=>{ar.trace(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)}},Yk=(e,t)=>{const{hash:n,search:a}=window.location;if(Ce.debug({hash:n,search:a},"get deep link data from"),n||a){const s=Qk({hash:n,search:a});if(Ce.debug(s,"parse deep link result"),s){const{hash:o,search:r}=s,{result:c,remain:l}=o||r;if(Object.keys(c).length!==0){e.setValue("data",c);const m=Object.keys(l).length!==0;if(o){let u="";m&&(u=`#${new URLSearchParams(l).toString()}`,Ce.debug({updatedHash:u},"update hash")),window.history.replaceState(null,"",window.location.pathname+window.location.search+u)}if(r){let u="";m&&(u=`?${new URLSearchParams(l).toString()}`,Ce.debug({updatedSearch:u},"update search")),window.history.replaceState(null,"",window.location.pathname+u+window.location.hash)}t(c)}}}e.setValue("parsed",!0)},jk=(e,t,n)=>{const a=new xk,s=a.get("sl-deep-link-store");let o={};if(s)try{o=JSON.parse(s)}catch(c){Ce.debug(c)}e.deepLink={$store:new pt(Ee(o),"deep-link-context"),getDeepLinkData:()=>{const{data:c,used:l}=e.deepLink.$store.getValues();return{data:c,used:l}},deepLinkUsed:c=>{Ce.debug(`logged in with inviterId: ${c}`),e.deepLink.$store.setValue("used",!0)},onDeepLinkHandlers:new Set},e.sdk.getInviter=()=>{const{data:c,used:l}=e.deepLink.getDeepLinkData();return l?c==null?void 0:c[Jn]:void 0},e.sdk.inviteDisplayed=()=>{e.deepLink.$store.getStore().set({}),e.deepLink.$store.getStore().off(),a.del("sl-deep-link-store")},e.deepLink.$store.subscribe(c=>a.set("sl-deep-link-store",JSON.stringify(c))),e.sdk.addDeepLinkHandler=c=>{localStorage.getItem("SL_DEBUG")&&Ce.trace("adding deep link handler"),e.deepLink.onDeepLinkHandlers.add(c)},t.onDeepLinkHandled&&e.sdk.addDeepLinkHandler(t.onDeepLinkHandled),e.sdk.removeDeepLinkHandler=c=>{Ce.trace("removing deep link handler"),e.deepLink.onDeepLinkHandlers.delete(c)};const r=c=>{e.deepLink.$store.setValue("handled",!0),Ce.trace({size:e.deepLink.onDeepLinkHandlers.size},"deep link handled, call callbacks");for(const l of e.deepLink.onDeepLinkHandlers)try{Ce.trace("called handler"),l(c)}catch(m){console.error(m)}};Yk(e.deepLink.$store,r),n()},$k=We("bypass");class Kk extends $g{constructor(n,a,s){super();p(this,"$coreStore");p(this,"deepLink");p(this,"transport");p(this,"bypassLogin");p(this,"me",async()=>{var n;return this.$coreStore.getValues().user.invalidate(),(n=await this.$coreStore.getValues().user.getValue())==null?void 0:n.data});p(this,"login",async(n,a)=>{var u,d,y;this.$coreStore.getValues().userKey.setValue(a);const{used:s,data:o}=this.deepLink.getDeepLinkData(),r=s?"":o==null?void 0:o[Jn];$k.debug({inviterKey:r},"login with inviterKey");const c=await this.bypassLogin({schema:n,userKey:a,inviterKey:r,init:!1}),l=(u=c.meta)==null?void 0:u.jwt,m=(d=c.data)==null?void 0:d.id;if(!l||!m)throw new Error("internal: token missing");return(y=c.meta)!=null&&y.inviterKey&&this.deepLink.deepLinkUsed(c.meta.inviterKey),this.$coreStore.getValues().user.getStore().mutate({data:c.data}),this.saveUser(l,m),l});p(this,"isAuthenticated",()=>this.me());p(this,"logout",()=>{this.$coreStore.getValues().user.setValue(),this.$coreStore.getValues().userKey.setValue(),this.$coreStore.getValues().userToken.setValue(),this.transport.setAuth("",""),new It().clear()});p(this,"softLogout",()=>{const n=new It;this.transport.setAuth("",""),n.setToken(""),this.reLogin()});p(this,"reLogin",()=>{const n=new It,a=n.getToken(),s=n.getExternalToken();if(this.$coreStore.getValues().userKey.setValue(s),a)return this.saveUser(a,""),this.me().then(o=>{if(o!=null&&o.id){const r=o.id;this.saveUser(a,r)}});if(s&&!a){const o=n.getSchema();o&&s&&this.login(o,s).catch(()=>{this.logout()})}});p(this,"saveUser",(n,a)=>{this.transport.setAuth(n,a),this.$coreStore.getValues().userToken.setValue(n),new It().setToken(n)});p(this,"connect",()=>{this.transport.registerInterceptor(n=>async a=>{try{return await n(a)}catch(s){throw s.code&&(s.code===7||s.code===16)&&this.transport.getHeader("authorization")&&this.softLogout(),s}})});this.$coreStore=n,this.deepLink=s,this.transport=a,this.bypassLogin=ik(this.transport),this.connect()}}const Ht=new It,Wk=(e,t,n)=>{e.auth=new Kk(e.store,e.transport,e.deepLink),e.stores.status.listen(a=>{a===qe.READY&&e.auth.reLogin()}),e.sdk.userId=e.stores.user.getAtomStore,e.sdk.authorizationBypass=async(a,s)=>{if(!(Ht.getSchema()===a&&Ht.getExternalToken()===s&&e.transport.getHeader("authorization")))try{await e.auth.login(a,s),Ht.setSchema(a),Ht.setExternalToken(s)}catch{e.sdk.logout()}},e.sdk.logout=()=>{e.auth.logout(),Ht.clear()},e.sdk.getUserStore=()=>e.stores.user.getStore(),e.sdk.isUserAuthorized=()=>e.auth.isAuthenticated(),n()},sr=We("video_player"),dn={debug:(...e)=>{sr.debug(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)},trace:(...e)=>{sr.trace(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)}},zk=(e,t,n)=>{e.videoPlayer={controllers:new Set},e.sdk.addVideoPlayerController=a=>{dn.trace("adding video player controller"),e.videoPlayer.controllers.add(a)},t.videoPlayerController&&e.sdk.addVideoPlayerController(t.videoPlayerController),e.sdk.removeVideoPlayerController=a=>{dn.trace("removing video player controller"),e.videoPlayer.controllers.delete(a)},e.sdk.controlVideoPlayer=a=>{dn.trace("controlling video player");for(const s of e.videoPlayer.controllers){dn.trace("calling video player controller");try{s(a)}catch(o){console.error(o)}}},n()},Jk={[P.FACTOID]:"insight",[P.POLL]:"poll",[P.TRIVIA]:"trivia",[P.PREDICTION]:"prediction",[P.TWEET]:"tweet"},Xk=(e,t,n)=>{e.sdk.uiState=Ee({}),e.ui={enableAppNotification:function(){e.sdk.uiState.setKey("appNotification",!0)},disableAppNotification:function(){e.sdk.uiState.get().app||e.sdk.uiState.setKey("appNotification",!1)},enableApp:function(){e.sdk.uiState.set({app:!0,appNotification:!0})},disableApp:function(){e.sdk.uiState.set({...e.sdk.uiState.get(),appNotification:!1,app:!1})}},t.onContentActivate&&(e.ui.onContentActivate=t.onContentActivate);const a=s=>{e.ui.onContentActivate&&e.ui.onContentActivate({...s,type:"advertisement"})};e.onQuestionActivate=({questionType:s,...o})=>{if(e.ui.onContentActivate){const r=o.type||s&&Jk[s]||"question";e.ui.onContentActivate({...o,type:r})}},e.sdk.onMount({name:"ui"},()=>{const s=c=>{var l,m;if(((l=c.slEventBus)==null?void 0:l.type)==="notification")switch(c.slEventBus.action){case"received":e.ui.enableAppNotification();break;case"closed":e.ui.disableAppNotification();break}if(((m=c.slEventBus)==null?void 0:m.type)==="advertisement"&&t.withAd){const u=c.slEventBus,{hasNotification:d,id:y,isViewed:T,type:f}=u.payload;switch(u.action){case"notification-opened":e.sdk.uiState.set({promotionExternalAd:f===he.EXTERNAL_AD,promotionBanner:!0,promotionNotification:!1,promotionOverlay:!0,promotionSidebar:!0});break;case"received":if(e.sdk.closeFeature(),a({stage:"activate",id:y,hasNotification:d,isViewed:T}),!t.withAdNotification){e.sdk.uiState.set({promotionBanner:!0,promotionOverlay:!0,promotionSidebar:!0,promotionExternalAd:f===he.EXTERNAL_AD});break}d?e.sdk.uiState.set({promotionNotification:!0}):e.sdk.uiState.set({promotionBanner:!0,promotionOverlay:!0,promotionSidebar:!0,promotionExternalAd:f===he.EXTERNAL_AD});break;case"closed":console.log("closed",u.payload),e.sdk.uiState.set({...e.sdk.uiState.get(),promotionNotification:!1,promotionBanner:!1,promotionOverlay:!1,promotionExternalAd:!1,promotionSidebar:!1}),a({stage:"deactivate",id:y,hasNotification:d,isViewed:T});break}}},o=de.listen(s),r=e.activeFeature.subscribe(c=>{c?e.ui.enableApp():e.ui.disableApp()});return()=>{o(),r()}}),n()},Zk=(e,t,n)=>{const a={onMountedFired:!1},s=new Map,o=new Map;e.sdk=Object.create(null),e.sdk.withAuth=!1,e.sdk.onMount=({name:r,clear:c},l)=>{var m,u;if(s.has(r)){const d=o.get(r);d&&d(),s.delete(r),o.delete(r)}s.set(r,{cb:l,clear:c}),((u=(m=e==null?void 0:e.stores)==null?void 0:m.enabled)==null?void 0:u.get())==="on"&&o.set(r,l())},e.ready=()=>{e.stores.enabled.subscribe(r=>{r==="on"&&a.onMountedFired===!1&&(s.forEach(({cb:c},l)=>o.set(l,c())),a.onMountedFired=!0),r!=="on"&&a.onMountedFired===!0&&(o.forEach(c=>c()),o.clear(),s.forEach(({clear:c},l)=>c&&s.delete(l)),a.onMountedFired=!1)})},e.sdk.initializeApp=async r=>{if(e.contextConfig=r,e.stores.enabled.get()==="on")return{enabled:!0};e.storeSubscribe(),e.stores.enabled.setValue("on"),e.stores.status.setValue(qe.INITIALIZATION);try{const c=await e.stores.organizationSettings.getValue();return c?(e.stores.status.setValue(qe.READY),{enabled:!!c}):(e.stores.status.setValue(qe.FAILED),{err:"failed"})}catch(c){return e.stores.enabled.setValue(),e.stores.status.setValue(qe.FAILED),{err:`${c}`}}},e.sdk.disableApp=()=>{e.stores.enabled.get()==="on"&&(e.stores.enabled.setValue(),e.stores.status.setValue(qe.DISABLED),e.stores.slStreamId.setValue(),e.stores.providerStreamId.setValue(),e.sdk.closeFeature(!0),e.storeUnsubscribe(),e.transport.disconnect())},e.sdk.createEventSession=r=>{e.stores.providerStreamId.setValue(r)},n()},eh=(e,t)=>{const{client:n,queryKey:a}=e.createPromiseClient(en,{method:"generateDeepLink",params:t});return e.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r,c)=>{var l;if(!r)return{};try{return(l=(await n.generateDeepLink({data:{gamification:!0,externalEventId:c,eventId:r}})).data)==null?void 0:l.attributes}catch{return}},dedupeTime:1e3*60*60*24,refetchInterval:0})},th=(e,{web:t,mobile:n})=>{const{client:a}=e.createPromiseClient(Sg,{method:"generate"});return a.generate({web:t,mobile:n})},or=(e,t)=>{const n=new URLSearchParams(e);for(const[a,s]of Object.entries(t))n.append(a,s);return n.toString()},nh=(e,t,n,a)=>{const s=Ee({});return jn(s,()=>eh(e,[t,n]).subscribe(async({data:o,error:r,loading:c})=>{var T;const l=r?"https://masters.com":o==null?void 0:o.url,m=a.get()||"",u=t.get()||"",d=n.get()||"",y={[Jn]:m,[oc]:u,[rc]:d};if(!c&&l){s.setKey("loading",!0);let f=window.location.search,_=window.location.hash;f&&_||_?f=`?${or(f,y)}`:_=`#${or("",y)}`;const N=window.location.origin+window.location.pathname+f+_;try{const E=await th(e,{web:N,mobile:l});s.set({data:(T=E.data)==null?void 0:T.link,loading:!1})}catch{s.set({loading:!1,error:"Failed to generate short link",data:void 0})}}else s.setKey("loading",!0)})),{$store:s,fetch}};var ne;(function(e){e.Unset="unset",e.Required="required",e.Optional="optional",e.Completed="completed",e.Disabled="disabled",e.Unavailable="unavailable"})(ne||(ne={}));const ah=(e,t,n,a)=>{const{inplayGame:s}=e.featureSettings.get(),o=t.getCurrentSessionId({prefix:"onboarding"});s&&n.add({type:Ze.ONBOARDING,id:o,action:e.openFeature,close:()=>{e.onboardingProcessed.set(!0)},persistent:!0,autoHideDuration:1e6,data:{questionId:"onboarding",questionType:P.UNSET,onboarding:{...s,instantOpen:!a.getOnboardingInstantOpen({userId:t.userId.get()||"",organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""})}}})},pn=(e,t,n,a,s,o)=>{var r,c,l;try{const m=t.userId.get();if(!m)return;if(s.getOnboardingStatus({userId:m,organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""})===ne.Completed){e.set(ne.Completed);for(const f of o)f();return}const u=(r=t.moderation.getStore().value)==null?void 0:r.data,d=n.featureSettings.get().inplayGame;if(u===void 0||d===void 0)return;const y=(c=u==null?void 0:u.options)==null?void 0:c.onboardingEnabled,T=(l=d==null?void 0:d.titleCard)==null?void 0:l.optIn;y?T?e.set(ne.Required):e.set(ne.Optional):(T?e.set(ne.Unavailable):e.set(ne.Disabled),a.close(t.getCurrentSessionId({prefix:"onboarding"}),{markAsViewed:!1}))}catch(m){console.error(m)}},sh=(e,t,n,a)=>{let s=!1;const o=new sc,r=ie(ne.Unset);r.subscribe(l=>{l!==ne.Unset&&(l===ne.Optional||l===ne.Required?s===!1&&(ah(e,t,a,o),s=!0):e.onboardingProcessed.set(!0),l===ne.Completed&&t.activeQuestionId.invalidate(),o.setOnboardingInstantOpen({userId:t.userId.get()||"",organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""}))});const c=[];return pn(r,t,e,a,o,c),r.get()!==ne.Completed&&(c.push(t.userId.listen(l=>{l&&pn(r,t,e,a,o,c)})),c.push(t.moderation.listen(l=>{l.data&&pn(r,t,e,a,o,c)})),c.push(e.featureSettings.listen(l=>{l&&pn(r,t,e,a,o,c)}))),{$store:r,submitInplay:async()=>{const l=t.slStreamId.get();if(l){await Gk(n,l),r.set(ne.Completed),o.saveOnboardingStatus({organizationId:t.organizationId.get()||"",userId:t.userId.get()||"",eventId:l},ne.Completed),de.emit("poll",{action:"onboardingPassed",payload:{}}),e.openFeature();const m=t.getCurrentSessionId({prefix:"onboarding"});a.close(m)}}}},oh=(e,t,n,a)=>{const s=Ee(void 0),o=nc(a),r=async()=>{var T,f;const l=e.get(),m=t.get(),u=(T=n.getStore().get().data)==null?void 0:T.map(_=>_.slId);if(!u)return;const d={eventId:l,userId:m,usersIds:[...u,m]},y=await o(d);s.set((f=y.data)==null?void 0:f.attributes)},c=()=>{r()};return jn(s,()=>{const l=e.listen(r),m=n.listen(r),u=t.listen(r);return()=>{l(),m(),u()}}),{$store:s,invalidate:c}},rh=async(e,t,n,a,s)=>{var u,d,y;const o=nc(s),r=e.get(),c=t.get(),l=((u=n.getStore().get().data)==null?void 0:u.map(T=>T.slId))||[],m={eventId:r,userId:a,usersIds:[...l,c]};return(y=(d=(await o(m)).data)==null?void 0:d.attributes)==null?void 0:y.summary},ih=new Set([P.POLL,P.PREDICTION,P.TRIVIA]);class ch extends Zi{constructor(n,a,s){super(n,a);p(this,"userSummary");p(this,"feedList");p(this,"friends");p(this,"leaderboardId");p(this,"leaderboardList");p(this,"deepLink");p(this,"onboardingStatus");p(this,"openedQuestion");p(this,"currentUserId");p(this,"openedUser");p(this,"closeFeature");p(this,"openFeature");p(this,"feedSubscription");p(this,"activeQuestionId");p(this,"openedQuestionId");p(this,"advertisement");p(this,"onboardingProcessed");p(this,"notifications");p(this,"transport");p(this,"background");p(this,"storage");p(this,"submitAnswerTimeout");p(this,"cancels",new Set);p(this,"onQuestionActivate");p(this,"checkInteractiveFlag",()=>{var c,l,m,u,d;const n=this.onboardingStatus.$store.get(),a=(m=(l=(c=this.background.moderation.getStore().value)==null?void 0:c.data)==null?void 0:l.options)==null?void 0:m.onboardingEnabled,s=(d=(u=this.settings.getValues().inplayGame)==null?void 0:u.titleCard)==null?void 0:d.optIn,o=n===ne.Completed,r=!a||o||s!==!0;this.background.interactiveAllowed.set(r?Tt.ALLOWED:Tt.DISALLOWED)});p(this,"connect",()=>{this.onboardingProcessed.subscribe(n=>{n&&this.advertisement.connect()}),this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-prediction-close",async n=>{var m,u,d,y,T,f,_,N,E,b,w;if(!this.isInteractiveAllowed)return;const a=(u=(m=n.data)==null?void 0:m.attributes)==null?void 0:u.question,s=(y=(d=n.data)==null?void 0:d.attributes)==null?void 0:y.feedItem;if(!a||!(s!=null&&s.attributes))return;const{status:o,type:r,id:c,answers:l}=a;if(o===oe.RESOLVED&&r===P.PREDICTION){const O=this.background.getCurrentSessionId({prefix:`notification-id:${c}`}),A=[...this.feedList.getValues().data||[]],L=A.findIndex(J=>J.id===c),v=A[L];let D=(_=(f=(T=v==null?void 0:v.attributes)==null?void 0:T.attributes)==null?void 0:f.value)==null?void 0:_.answerId;const j=za(c,this.transport),te=j.subscribe(()=>{});await j.get().promise;let $=j.get().data;$||($=await Nk(c,this.transport)),te(),window.requestAnimationFrame(()=>{j.invalidate()}),D||(D=(N=$==null?void 0:$.answers.find(({youVoted:J})=>J))==null?void 0:N.id);const K=l.find(({correct:J})=>J),G=D?l.find(({id:J})=>J===D):void 0,B=!!(G!=null&&G.correct);if(v&&((b=(E=A[L])==null?void 0:E.attributes)==null?void 0:b.attributes.case)==="question"){try{A[L].attributes.attributes.value.answerId=D,A[L].attributes.attributes.value.openForVoting=!1,D&&(A[L].attributes.attributes.value.status=B?Nt.WON:Nt.LOST)}catch{}this.feedList.getStore().mutate(A)}if(!G||!K)return;((w=this.openedQuestionId.get())==null?void 0:w.questionId)!==a.id&&this.notifications.add({type:Ze.QUESTION_RESOLVED,action:()=>this.openQuestion(a.id,s),close:()=>this.closeQuestion(c),autoHideDuration:B?15e3:12e3,id:O,emitEvent:!1,data:{questionId:c,questionType:P.PREDICTION,question:{title:B?`Congratulations! You answered correctly! You won ${K.points} pts!`:`Better luck next time! Correct: ${K==null?void 0:K.text}!`,votedAnswer:{title:G==null?void 0:G.text,points:G==null?void 0:G.points},correctAnswerTitle:K==null?void 0:K.text,correct:!!B,predictionResult:o===oe.RESOLVED,questionTitle:a==null?void 0:a.subject}}}),this.userSummary.invalidate()}})),this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list",n=>{var r,c,l,m,u;const a=[...((r=this.feedList.getStore().value)==null?void 0:r.data)||[]],s=(l=(c=n.data)==null?void 0:c.attributes)==null?void 0:l.feedItem,o=a.findIndex(d=>d.id===(s==null?void 0:s.id));if(s!=null&&s.attributes&&s.attributes.attributes.case!=="promotion"&&!(s.attributes.status!==oe.ACTIVE&&s.attributes.status!==oe.RESOLVED)){if(o!==-1)if(s.attributes.attributes.case==="question"&&((m=a[o].attributes)==null?void 0:m.attributes.case)==="question"){const d=a[o];d.attributes&&(a[o]={...a[o],attributes:{...d.attributes,attributes:{...d.attributes.attributes,value:{...d.attributes.attributes.value,...s.attributes.attributes.value,answerId:d.attributes.attributes.value.answerId,status:d.attributes.attributes.value.status,openForVoting:d.attributes.attributes.value.openForVoting}}}})}else{const d=a[o];d.attributes&&s.attributes&&(a[o]={...a[o],attributes:{...d.attributes,attributes:{...d.attributes.attributes,value:{...d.attributes.attributes.value,...s.attributes.attributes.value}}}})}o===-1&&(a.unshift(s),de.emit("poll",{action:"received",payload:{questionId:s.id,questionType:(u=s.attributes)==null?void 0:u.type}})),this.feedList.getStore().mutate(a)}}))});p(this,"disconnect",()=>{this.background.feedSubscription.removeListener("feed-subscription-prediction-close"),this.background.feedSubscription.removeListener("feed-subscription-questions-list")});p(this,"submitAnswer",async(n,a)=>{const s=za(n,this.transport),o=s.subscribe(()=>{}),r={...s.get().data||{}},c=()=>{var y;const l=this.feedList.getValues().data;if(!l)return;const m=l.findIndex(T=>T.id===n),u=l[m],d=((y=u==null?void 0:u.attributes)==null?void 0:y.attributes.case)==="question"&&u.attributes.attributes.value;if(d){de.emit("poll",{action:"voted",payload:{questionId:n,questionType:d.questionType}});const T=s.get().data;if(o(),T){const f=T.answers.find(b=>b.correct===!0),_=T.answers.findIndex(b=>b.id===a),N=T.answers[_],E=T.answers.every(({percentageDecimal:b},w)=>b===(r==null?void 0:r.answers[w].percentageDecimal));l[m].attributes.attributes.value.answerId=a,l[m].attributes.attributes.value.openForVoting=!1,l[m].attributes.attributes.value.text=(N==null?void 0:N.text)||"",f&&(l[m].attributes.attributes.value.status=f.id===a?Nt.WON:Nt.LOST),this.feedList.getStore().mutate([...l]),T.answers[_].correct=(f==null?void 0:f.id)===a,T.answers[_].youVoted=!0,E&&T.answers.forEach(b=>{b.percentageDecimal=0}),(f==null?void 0:f.id)===a&&(T.answers[_].pointsEarned=T.status===oe.RESOLVED?0:f.points),s.mutate({...T})}this.submitAnswerTimeout&&clearTimeout(this.submitAnswerTimeout),this.submitAnswerTimeout=setTimeout(()=>{this.userSummary.invalidate()},1e3)}};try{await Fk(this.transport,{questionId:n,answerId:a}),c()}catch(l){if(l.message===Xt.ALREADY_VOTED){this.userSummary.invalidate();const m=s.subscribe(()=>{});s.invalidate(),m()}throw l}});p(this,"openQuestion",(n,a)=>{var o,r,c,l;if(!n)return()=>{};this.notifications.close(this.background.getCurrentSessionId({prefix:"notification",entity:n}),{animateHiding:!1});let s=(o=a==null?void 0:a.attributes)==null?void 0:o.type;return s||(s=(l=(c=(((r=this.feedList.getStore().value)==null?void 0:r.data)||[]).find(m=>m.id===n))==null?void 0:c.attributes)==null?void 0:l.type),de.emit("poll",{action:"opened",payload:{questionId:n,questionType:s,questionOpenedFrom:a==null?void 0:a.openedFrom}}),this.background.openQuestion(n,a)});p(this,"getFeedItem",n=>_k(n,this.transport));p(this,"isOpenedQuestion",n=>!!this.notifications.isViewed(n));p(this,"closeQuestion",n=>(n&&this.onQuestionActivate({stage:"deactivate",id:n,isViewed:!!this.notifications.isViewed(this.background.getCurrentSessionId({prefix:"notification",entity:n}))}),this.background.closeQuestion(n)));p(this,"openUser",async n=>{var o,r;const a=(o=this.leaderboardList.$store.get().data)==null?void 0:o.find(c=>c.userId===n);if(!a){this.openedUser.set(a);return}if(a.summaryLoaded){this.openedUser.set(a);return}const s={...a};try{const c=await rh(this.background.slStreamId,this.background.userId,this.friends,n,this.transport);(c==null?void 0:c.inTop)!==void 0&&(this.leaderboardList.$store.setKey("data",(r=this.leaderboardList.$store.get().data)==null?void 0:r.map(l=>(l.userId===n&&(l.inTop=c.inTop),l))),s.inTop=c.inTop)}catch(c){console.error(c)}this.openedUser.set(s)});p(this,"closeUser",()=>{this.openedUser.set(void 0)});p(this,"showInApp",n=>{var s,o,r,c,l,m,u,d,y,T,f,_,N,E;const a=this.onboardingStatus.$store.get();if(n&&n.data&&a&&a!==ne.Unset&&((s=n.data.question)==null?void 0:s.id)!==void 0&&n.data.question.notification!==void 0&&((r=(o=n.data.question)==null?void 0:o.bypassNotifications)==null?void 0:r.inAppSilence)!==li.ON&&n.data.question.status===oe.ACTIVE&&!n.data.question.marketClosed){if(ih.has(n.data.question.type))this.isInteractiveAllowed&&this.notifications.add({type:Ze.QUESTION,action:()=>{var b,w,O;return this.openQuestion((w=(b=n.data)==null?void 0:b.question)==null?void 0:w.id,(O=n.data)==null?void 0:O.feedItem)},close:()=>{var b,w;return this.closeQuestion((w=(b=n.data)==null?void 0:b.question)==null?void 0:w.id)},autoHideDuration:1e3*60,id:this.background.getCurrentSessionId({prefix:"notification",entity:n.data.question.id}),emitEvent:!0,data:{questionId:n.data.question.id,questionType:n.data.question.type,question:{title:n.data.question.notification.title}}});else if(n.data.question.type===P.FACTOID){const b=(c=n.data.question.options)==null?void 0:c.options.value,w={heading:n.data.question.notification.title,body:n.data.question.notification.body,imageMode:b==null?void 0:b.imageMode,image:b==null?void 0:b.image,video:{id:((l=b==null?void 0:b.video)==null?void 0:l.id)||"",url:((m=b==null?void 0:b.video)==null?void 0:m.url)||"",thumbnailUrl:((u=b==null?void 0:b.video)==null?void 0:u.thumbnailUrl)||""},webLink:{label:"",url:""}};this.notifications.add({type:Ze.QUESTION,action:()=>{var O,A,L;return this.openQuestion((A=(O=n==null?void 0:n.data)==null?void 0:O.question)==null?void 0:A.id,(L=n==null?void 0:n.data)==null?void 0:L.feedItem)},close:()=>{var O,A;return this.closeQuestion((A=(O=n==null?void 0:n.data)==null?void 0:O.question)==null?void 0:A.id)},autoHideDuration:1e3*120,emitEvent:!0,id:this.background.getCurrentSessionId({prefix:"notification",entity:n.data.question.id}),data:{questionId:n.data.question.id,questionType:n.data.question.type,insight:w}})}else if(n.data.question.type===P.TWEET){const b=(d=n.data.question.options)==null?void 0:d.options.value,w={title:(y=n.data.question.notification)==null?void 0:y.title,body:(T=n.data.question.notification)==null?void 0:T.body,image:(f=n.data.question.notification)==null?void 0:f.image,account:((_=b==null?void 0:b.tweetMeta)==null?void 0:_.account)||"",accountVerified:!!((N=b==null?void 0:b.tweetMeta)!=null&&N.accountVerified),tweet:(E=b==null?void 0:b.tweetMeta)==null?void 0:E.tweet,tweetId:n.data.question.id};this.notifications.add({type:Ze.QUESTION,action:()=>{var O,A,L;return this.openQuestion((A=(O=n.data)==null?void 0:O.question)==null?void 0:A.id,(L=n.data)==null?void 0:L.feedItem)},close:()=>{var O,A;return this.closeQuestion((A=(O=n.data)==null?void 0:O.question)==null?void 0:A.id)},autoHideDuration:1e3*120,emitEvent:!0,id:this.background.getCurrentSessionId({prefix:"notification",entity:n.data.question.id}),data:{questionId:n.data.question.id,questionType:n.data.question.type,tweet:w}})}}});this.background=new Mk(s),this.advertisement=this.background.advertisement,this.onQuestionActivate=s.onQuestionActivate,this.feedSubscription=this.background.feedSubscription,this.activeQuestionId=this.background.activeQuestionId,this.openedQuestionId=this.background.openedQuestionId,this.storage=new sc,this.feedList=this.background.feedList,this.friends=new Ue(kk(this.background.userId,s.transport),"gamification:friends"),this.currentUserId=this.background.userId,this.openedUser=ie(void 0),this.onboardingProcessed=ie(!s.sdk.withAuth),this.leaderboardId=new be(ie(this.settings.getValue("pinnedLeaderboardId")),"pinnedLeaderboardId").getStore(),this.onboardingStatus=sh(this,this.background,s.transport,s.notifications),this.notifications=s.notifications,this.transport=s.transport,this.closeFeature=(o=!0)=>s.sdk.closeFeature(o),this.openFeature=()=>s.sdk.openFeature(H.GAMES),this.openedQuestion=this.background.openedQuestion,this.deepLink=nh(this.transport,this.background.slStreamId,s.stores.providerStreamId.getStore(),this.background.userId),this.userSummary=oh(this.background.slStreamId,this.background.userId,this.friends,this.transport),this.leaderboardList=qk(this.transport,this.background.slStreamId,this.background.userId,this.friends),this.connect(),this.cancels.add(this.userSummary.$store.listen((o,r)=>{r!=null&&r.summary&&(o!=null&&o.summary)&&this.leaderboardList.invalidate()})),this.cancels.add(this.onboardingStatus.$store.listen(this.checkInteractiveFlag)),this.cancels.add(this.background.moderation.getStore().listen(this.checkInteractiveFlag)),this.cancels.add(this.settings.subscribe(this.checkInteractiveFlag)),this.cancels.add(this.onboardingStatus.$store.listen((o,r)=>{(r===void 0||o!==ne.Unset)&&this.background.activeQuestionId.invalidate()})),this.background.activeQuestionId.listen(this.showInApp),s.sdk.onMount({name:"gamification",clear:!0},()=>()=>{for(const o of this.cancels)o(),this.cancels.delete(o)})}get isInteractiveAllowed(){return this.background.interactiveAllowed.get()===Tt.ALLOWED}}const lh={[H.GAMES]:!0};class mh extends Zi{constructor(t,n){super(t,n)}}const uh=(e,t,n)=>e.type===H.GAMES?new ch(e,t,n):new mh(e,t),dh=(e,t,n)=>{e.features=new Map,e.sdk.featuresList=new be(ie(new Set),"features-list"),e.activeFeature=new be(ie(H.UNSET),"activeFeature"),e.sdk.getFeatures=()=>e.features,e.sdk.getFeature=a=>e.features.get(a),e.sdk.getActiveFeature=()=>e.activeFeature.getStore(),e.sdk.openFeature=a=>{e.activeFeature.setValue(a)},e.sdk.closeFeature=(a=!1)=>{const s=e.activeFeature.getValue();if(e.activeFeature.setValue(H.UNSET),a&&s){e.features.delete(s);const o=e.sdk.featuresList.getValue();o&&o.delete(s),e.sdk.featuresList.setValue(o)}},e.initFeature=(a,s=Ve.ORGANIZATION)=>{if(a.type in lh&&!e.features.has(a.type)){const o=uh(a,s,e);e.features.set(a.type,o);let r=e.sdk.featuresList.getValue();r?r.add(a.type):r=new Set([a.type]),e.sdk.featuresList.setValue(new Set(r))}},e.updateFeature=(a,s)=>{var o;(o=e.features.get(a.type))==null||o.update(a,s)},e.destroyFeature=a=>{e.features.delete(a.type);const s=e.sdk.featuresList.getValue();s&&s.delete(a.type),e.sdk.featuresList.setValue(new Set(s))},e.reinitializeFeatures=async()=>{const a=await e.stores.organizationSettings.getValue();e.features.clear(),e.sdk.featuresList.setValue(new Set);for(const s of(a==null?void 0:a.overlays)||[])e.initFeature(s,Ve.ORGANIZATION)},e.stores.providerStreamId.listen(a=>{a||e.reinitializeFeatures()}),e.storeSubscribe=()=>{const a=(o,r)=>{var c;if(r!=null&&r.overlays&&!((c=e.contextConfig)!=null&&c.skipOrganizationSettings&&o===Ve.ORGANIZATION))for(const l of r.overlays)l.sdkEnable===!0&&(e.features.has(l.type)?e.updateFeature(l,o):e.initFeature(l,o))},s={organizationSettings:o=>{if(o.data)try{a(Ve.ORGANIZATION,o.data)}catch(r){console.log(r)}},streamSettings:o=>{if(o.data)try{a(Ve.STREAM,o.data)}catch(r){console.log(r)}}};e.store.subscribe(s)},n()};class ph{constructor(t){p(this,"analytics");p(this,"accepted",()=>{this.analytics.write("invitation",{common:{...this.analytics.commonStore.getValues(),kind:re.INVITATION_ACCEPTED},category:Ba.GAMES,from:Mn.UNSET})});p(this,"sent",({from:t})=>{this.analytics.write("invitation",{common:{...this.analytics.commonStore.getValues(),kind:re.INVITATION_SENT},category:Ba.GAMES,from:t||Mn.UNSET})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="invitation")switch(a.slEventBus.action){case"sent":this.sent(a.slEventBus.payload);break}};return de.listen(n)})}}class Th{constructor(t){p(this,"analytics");p(this,"tap",()=>{this.analytics.write("interactions",{common:{...this.analytics.commonStore.getValues(),kind:re.INTERACTIONS},actionType:Ya.TAP})});p(this,"scroll",()=>{this.analytics.write("interactions",{common:{...this.analytics.commonStore.getValues(),kind:re.INTERACTIONS},actionType:Ya.SCROLL})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="interactions")switch(a.slEventBus.action){case"tap":this.tap();break;case"scroll":this.scroll();break}};return de.listen(n)})}}const yh={[he.UNSET]:Re.UNSET,[he.INGAME_IAB21]:Re.PROMOTION_INGAME_IAB21,[he.INGAME_IAB11_LBAR]:Re.PROMOTION_INGAME_IAB11_LBAR,[he.INGAME_IAB11]:Re.PROMOTION_INGAME_IAB11,[he.INGAME_IAB21_LBAR]:Re.PROMOTION_INGAME_IAB21_LBAR,[he.INGAME_IAB61]:Re.PROMOTION_INGAME_IAB61,[he.EXTERNAL_AD]:Re.PROMOTION_GAM};class fh{constructor(t){p(this,"analytics");p(this,"received",({id:t},{topicSubType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.POLLS_RECEIVED,topicId:t,topicType:ae.POLLS_PROMOTION,topicSubType:n},pollOpenedFrom:_e.UNSET})});p(this,"opened",({id:t},{topicSubType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.POLLS_OPENED,topicId:t,topicType:ae.POLLS_PROMOTION,topicSubType:n},pollOpenedFrom:_e.UNSET})});p(this,"videoPlay",({id:t},{topicSubType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),topicId:t,kind:re.AD_VIDEO_PLAYED,topicType:ae.POLLS_PROMOTION,topicSubType:n},pollOpenedFrom:_e.UNSET})});p(this,"buttonSelect",({id:t},{topicSubType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),topicId:t,kind:re.AD_BUTTON_NAVIGATED,topicType:ae.POLLS_PROMOTION,topicSubType:n},pollOpenedFrom:_e.UNSET})});p(this,"bannerSelect",({id:t},{topicSubType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),topicId:t,kind:re.AD_BANNER_NAVIGATED,topicType:ae.POLLS_PROMOTION,topicSubType:n},pollOpenedFrom:_e.UNSET})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s,o;if(!((s=a.slEventBus)!=null&&s.skipAnalytics)&&((o=a.slEventBus)==null?void 0:o.type)==="advertisement"){const r=a.slEventBus.payload.type?yh[a.slEventBus.payload.type]:Re.UNSET;switch(a.slEventBus.action){case"videoPlay":this.videoPlay(a.slEventBus.payload,{topicSubType:r});break;case"buttonSelect":this.buttonSelect(a.slEventBus.payload,{topicSubType:r});break;case"bannerSelect":this.bannerSelect(a.slEventBus.payload,{topicSubType:r});break;case"received":this.received(a.slEventBus.payload,{topicSubType:r});break;case"opened":this.opened(a.slEventBus.payload,{topicSubType:r});break}}};return de.listen(n)})}}const Kt={[P.UNSET]:ae.UNSET,[P.FACTOID]:ae.POLLS_INSIGHT,[P.POLL]:ae.POLLS_POLL,[P.PREDICTION]:ae.POLLS_PREDICTION,[P.PROMOTION]:ae.POLLS_PROMOTION,[P.TRIVIA]:ae.POLLS_TRIVIA,[P.TWEET]:ae.POLLS_TWITTER};P.UNSET+"",Le.UNSET,P.FACTOID+"",Le.POLLS,P.POLL+"",Le.POLLS,P.PREDICTION+"",Le.POLLS,P.PROMOTION+"",Le.POLLS,P.TRIVIA+"",Le.POLLS,P.TWEET+"",Le.POLLS;const gh={[H.UNSET]:me.UNSET,[H.INPLAY]:me.INPLAY,[H.MESSAGING]:me.MESSAGING,[H.STATISTICS]:me.STATS,[H.BETTING]:me.BETTING,[H.TWITTER]:me.TWITTER,[H.MERCHANDISE]:me.MERCHANDISE,[H.CONTESTS]:me.CONTESTS,[H.VOICE_CHAT]:me.CALLING,[H.TICKETS]:me.TICKETS,[H.WHOIS_WATCHING]:me.WHOISWATCHING,[H.PROFILE]:me.PROFILE,[H.GAMES]:me.POLLS,[H.GOLF_STATISTICS]:me.STATS,[H.HIGHLIGHTS]:me.HIGHLIGHTS,[H.PUBLIC_CHAT]:me.PUBLIC_CHAT};class kh{constructor(t){p(this,"analytics");p(this,"received",({questionId:t,questionType:n})=>{this.analytics.write("notification",{common:{...this.analytics.commonStore.getValues(),kind:re.NOTIFICATION_RECEIVED,topicId:t,topicType:n?Kt[n]:ae.UNSET},notificationKind:Le.POLLS,notificationType:ja.IN_APP})});p(this,"opened",({questionId:t,questionType:n})=>{this.analytics.write("notification",{common:{...this.analytics.commonStore.getValues(),kind:re.NOTIFICATION_OPENED,topicId:t,topicType:n?Kt[n]:ae.UNSET},notificationKind:Le.POLLS,notificationType:ja.IN_APP})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="notification")switch(a.slEventBus.action){case"rendered":this.received(a.slEventBus.payload);break;case"opened":this.opened(a.slEventBus.payload);break}};return de.listen(n)})}}class hh{constructor(t){p(this,"analytics");p(this,"received",({questionId:t,questionType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.POLLS_RECEIVED,topicId:t,topicType:n?Kt[n]:ae.UNSET},pollOpenedFrom:_e.UNSET})});p(this,"opened",({questionId:t,questionType:n,questionOpenedFrom:a})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.POLLS_OPENED,topicId:t,topicType:n?Kt[n]:ae.UNSET},pollOpenedFrom:a==="list"?_e.PICK_HISTORY:_e.IN_APP})});p(this,"voted",({questionId:t,questionType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.POLLS_VOTE,topicId:t,topicType:n?Kt[n]:ae.UNSET},pollOpenedFrom:_e.UNSET})});p(this,"onboardingPassed",()=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.GAMES_JOINED},pollOpenedFrom:_e.UNSET})});p(this,"navigated",()=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.POLLS_NAVIGATED},pollOpenedFrom:_e.UNSET})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="poll")switch(a.slEventBus.action){case"voted":this.voted(a.slEventBus.payload);break;case"navigated":this.navigated();break;case"onboardingPassed":this.onboardingPassed();break;case"received":this.received(a.slEventBus.payload);break;case"opened":this.opened(a.slEventBus.payload);break}};return de.listen(n)})}}const Sh=({transport:e,$commonStore:t})=>{let n;const a=ie(!1),s=5e3,{client:o,queryKey:r}=e.createPromiseClient(Ki,{method:"send",params:[a]}),c=e.nanoquery.createFetcherStore(r,{fetcher:async()=>{const d=t.getStore().get();try{await o.unary({message:{case:"heartbeat",value:{common:{...d,kind:re.SESSION_HEARTBEAT}}}})}catch(y){xe.error(y,"send heartbeat failed")}return Date.now()},refetchInterval:s}),l=()=>{xe.debug("mounted heartbeat"),n=c.subscribe(()=>{})},m=()=>{xe.debug("enabled heartbeat"),a.set(!0),c.lc===0&&l()},u=()=>{xe.debug("disabled heartbeat"),a.set(!1)};return{enable:m,disable:u,mount:l,unmount:()=>{xe.debug("unmounted heartbeat"),c.off(),n==null||n(),n=void 0,u()}}},xe=We("analytics");class _h{constructor(t){p(this,"commonStore");p(this,"notifications");p(this,"polls");p(this,"invitation");p(this,"interactions");p(this,"advertisement");p(this,"heartbeat");p(this,"analyticsClient");p(this,"listeners");p(this,"listenersCancels");p(this,"connected",!1);p(this,"connect",()=>{this.writeCommon("sessionId",qa()),this.heartbeat.enable(),this.listeners.forEach(t=>this.listenersCancels.add(t())),this.connected=!0,xe.debug("analytics connected")});p(this,"disconnect",()=>{this.writeCommon("sessionId",""),this.writeCommon("overlaySessionId",""),this.heartbeat.unmount(),this.listenersCancels.forEach(t=>t()),this.connected=!1,xe.debug("analytics disconnected")});p(this,"write",(t,n)=>{n&&this.analyticsClient.unary({message:{case:t,value:n}}).then(()=>{xe.trace("send analytics success",t,n)}).catch(a=>{xe.error(a,"send analytics failed")})});p(this,"writeCommon",(t,n)=>{this.commonStore.setValue(t,n)});p(this,"onConnect",t=>{this.listeners.add(t),this.connected&&this.listenersCancels.add(t())});p(this,"connectToSDK",t=>{this.onConnect(()=>t.stores.slStreamId.getAtomStore().subscribe(n=>{this.writeCommon("eventId",n)})),this.onConnect(()=>t.sdk.getActiveFeature().subscribe(n=>{n&&this.writeCommon("category",gh[n]),n!==H.UNSET?this.writeCommon("overlaySessionId",qa()):this.writeCommon("overlaySessionId","")})),this.onConnect(()=>{const n=window.matchMedia("(orientation: portrait)"),a=s=>{this.writeCommon("screenOrientation",s.matches?Ga.PORTRAIT:Ga.LANDSCAPE)};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a)}}),this.onConnect(()=>t.deepLink.$store.subscribe(n=>{n!=null&&n.handled&&this.invitation.accepted()}))});this.listeners=new Set,this.listenersCancels=new Set,this.commonStore=new pt(Ee({}),"common-analytics"),this.connectToSDK(t),this.heartbeat=Sh({transport:t.analyticsTransport,$commonStore:this.commonStore}),this.notifications=new kh(this),this.polls=new hh(this),this.invitation=new ph(this),this.interactions=new Th(this),this.advertisement=new fh(this);const{client:n}=t.analyticsTransport.createPromiseClient(Ki,{method:"send"});this.analyticsClient=n}}const Eh=(e,t,n)=>{e.analytics=new _h(e),e.sdk.onMount({name:"analytics"},()=>(e.analytics.connect(),()=>{e.analytics.disconnect()})),n()};var vs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Qa<"u"?Qa:typeof self<"u"?self:{};function bh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var As={exports:{}},ws={exports:{}};function Nh(e){var t=new e,n=t;function a(){var o=t;return o.next?t=o.next:(t=new e,n=t),o.next=null,o}function s(o){n.next=o,n=o}return{get:a,release:s}}var Ih=Nh,Oh=Ih;function ic(e,t,n){if(typeof e=="function"&&(n=t,t=e,e=null),!(n>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var a=Oh(vh),s=null,o=null,r=0,c=null,l={push:_,drain:Se,saturated:Se,pause:u,paused:!1,get concurrency(){return n},set concurrency(A){if(!(A>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(n=A,!l.paused)for(;s&&r<n;)r++,E()},running:m,resume:T,idle:f,length:d,getQueue:y,unshift:N,empty:Se,kill:b,killAndDrain:w,error:O};return l;function m(){return r}function u(){l.paused=!0}function d(){for(var A=s,L=0;A;)A=A.next,L++;return L}function y(){for(var A=s,L=[];A;)L.push(A.value),A=A.next;return L}function T(){if(l.paused){if(l.paused=!1,s===null){r++,E();return}for(;s&&r<n;)r++,E()}}function f(){return r===0&&l.length()===0}function _(A,L){var v=a.get();v.context=e,v.release=E,v.value=A,v.callback=L||Se,v.errorHandler=c,r>=n||l.paused?o?(o.next=v,o=v):(s=v,o=v,l.saturated()):(r++,t.call(e,v.value,v.worked))}function N(A,L){var v=a.get();v.context=e,v.release=E,v.value=A,v.callback=L||Se,v.errorHandler=c,r>=n||l.paused?s?(v.next=s,s=v):(s=v,o=v,l.saturated()):(r++,t.call(e,v.value,v.worked))}function E(A){A&&a.release(A);var L=s;L&&r<=n?l.paused?r--:(o===s&&(o=null),s=L.next,L.next=null,t.call(e,L.value,L.worked),o===null&&l.empty()):--r===0&&l.drain()}function b(){s=null,o=null,l.drain=Se}function w(){s=null,o=null,l.drain(),l.drain=Se}function O(A){c=A}}function Se(){}function vh(){this.value=null,this.callback=Se,this.next=null,this.release=Se,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var a=e.callback,s=e.errorHandler,o=e.value;e.value=null,e.callback=Se,e.errorHandler&&s(t,o),a.call(e.context,t,n),e.release(e)}}function Ah(e,t,n){typeof e=="function"&&(n=t,t=e,e=null);function a(u,d){t.call(this,u).then(function(y){d(null,y)},d)}var s=ic(e,a,n),o=s.push,r=s.unshift;return s.push=c,s.unshift=l,s.drained=m,s;function c(u){var d=new Promise(function(y,T){o(u,function(f,_){if(f){T(f);return}y(_)})});return d.catch(Se),d}function l(u){var d=new Promise(function(y,T){r(u,function(f,_){if(f){T(f);return}y(_)})});return d.catch(Se),d}function m(){if(s.idle())return new Promise(function(y){y()});var u=s.drain,d=new Promise(function(y){s.drain=function(){u(),y()}});return d}}ws.exports=ic;ws.exports.promise=Ah;var cc=ws.exports,Rs={exports:{}},Lt=typeof Reflect=="object"?Reflect:null,rr=Lt&&typeof Lt.apply=="function"?Lt.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},_n;Lt&&typeof Lt.ownKeys=="function"?_n=Lt.ownKeys:Object.getOwnPropertySymbols?_n=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:_n=function(e){return Object.getOwnPropertyNames(e)};function wh(e){console&&console.warn&&console.warn(e)}var lc=Number.isNaN||function(e){return e!==e};function Y(){Y.init.call(this)}Rs.exports=Y;Rs.exports.once=Ph;Y.EventEmitter=Y;Y.prototype._events=void 0;Y.prototype._eventsCount=0;Y.prototype._maxListeners=void 0;var ir=10;function Xn(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Y,"defaultMaxListeners",{enumerable:!0,get:function(){return ir},set:function(e){if(typeof e!="number"||e<0||lc(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");ir=e}});Y.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Y.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||lc(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function mc(e){return e._maxListeners===void 0?Y.defaultMaxListeners:e._maxListeners}Y.prototype.getMaxListeners=function(){return mc(this)};Y.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var a=e==="error",s=this._events;if(s!==void 0)a=a&&s.error===void 0;else if(!a)return!1;if(a){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var r=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw r.context=o,r}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")rr(c,this,t);else for(var l=c.length,m=yc(c,l),n=0;n<l;++n)rr(m[n],this,t);return!0};function uc(e,t,n,a){var s,o,r;if(Xn(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),r=o[t]),r===void 0)r=o[t]=n,++e._eventsCount;else if(typeof r=="function"?r=o[t]=a?[n,r]:[r,n]:a?r.unshift(n):r.push(n),s=mc(e),s>0&&r.length>s&&!r.warned){r.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=r.length,wh(c)}return e}Y.prototype.addListener=function(e,t){return uc(this,e,t,!1)};Y.prototype.on=Y.prototype.addListener;Y.prototype.prependListener=function(e,t){return uc(this,e,t,!0)};function Rh(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function dc(e,t,n){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=Rh.bind(a);return s.listener=n,a.wrapFn=s,s}Y.prototype.once=function(e,t){return Xn(t),this.on(e,dc(this,e,t)),this};Y.prototype.prependOnceListener=function(e,t){return Xn(t),this.prependListener(e,dc(this,e,t)),this};Y.prototype.removeListener=function(e,t){var n,a,s,o,r;if(Xn(t),a=this._events,a===void 0)return this;if(n=a[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){r=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():Lh(n,s),n.length===1&&(a[e]=n[0]),a.removeListener!==void 0&&this.emit("removeListener",e,r||t)}return this};Y.prototype.off=Y.prototype.removeListener;Y.prototype.removeAllListeners=function(e){var t,n,a;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(a=0;a<s.length;++a)o=s[a],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(a=t.length-1;a>=0;a--)this.removeListener(e,t[a]);return this};function pc(e,t,n){var a=e._events;if(a===void 0)return[];var s=a[t];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?Mh(s):yc(s,s.length)}Y.prototype.listeners=function(e){return pc(this,e,!0)};Y.prototype.rawListeners=function(e){return pc(this,e,!1)};Y.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Tc.call(e,t)};Y.prototype.listenerCount=Tc;function Tc(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Y.prototype.eventNames=function(){return this._eventsCount>0?_n(this._events):[]};function yc(e,t){for(var n=new Array(t),a=0;a<t;++a)n[a]=e[a];return n}function Lh(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Mh(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function Ph(e,t){return new Promise(function(n,a){function s(r){e.removeListener(t,o),a(r)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",s),n([].slice.call(arguments))}fc(e,t,o,{once:!0}),t!=="error"&&Ch(e,s,{once:!0})})}function Ch(e,t,n){typeof e.on=="function"&&fc(e,"error",t,n)}function fc(e,t,n,a){if(typeof e.on=="function")a.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function s(o){a.once&&e.removeEventListener(t,s),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var gc=Rs.exports,Zn={},kc={},hc=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[t]=a;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==a||o.enumerable!==!0)return!1}return!0},Dh=hc,ea=function(){return Dh()&&!!Symbol.toStringTag},Uh=Error,Fh=EvalError,Gh=RangeError,Bh=ReferenceError,Sc=SyntaxError,ta=TypeError,Vh=URIError,cr=typeof Symbol<"u"&&Symbol,qh=hc,xh=function(){return typeof cr!="function"||typeof Symbol!="function"||typeof cr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:qh()},fa={__proto__:null,foo:{}},Hh=Object,Qh=function(){return{__proto__:fa}.foo===fa.foo&&!(fa instanceof Hh)},Yh="Function.prototype.bind called on incompatible ",jh=Object.prototype.toString,$h=Math.max,Kh="[object Function]",lr=function(e,t){for(var n=[],a=0;a<e.length;a+=1)n[a]=e[a];for(var s=0;s<t.length;s+=1)n[s+e.length]=t[s];return n},Wh=function(e,t){for(var n=[],a=t,s=0;a<e.length;a+=1,s+=1)n[s]=e[a];return n},zh=function(e,t){for(var n="",a=0;a<e.length;a+=1)n+=e[a],a+1<e.length&&(n+=t);return n},Jh=function(e){var t=this;if(typeof t!="function"||jh.apply(t)!==Kh)throw new TypeError(Yh+t);for(var n=Wh(arguments,1),a,s=function(){if(this instanceof a){var m=t.apply(this,lr(n,arguments));return Object(m)===m?m:this}return t.apply(e,lr(n,arguments))},o=$h(0,t.length-n.length),r=[],c=0;c<o;c++)r[c]="$"+c;if(a=Function("binder","return function ("+zh(r,",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var l=function(){};l.prototype=t.prototype,a.prototype=new l,l.prototype=null}return a},Xh=Jh,Ls=Function.prototype.bind||Xh,Zh=Function.prototype.call,eS=Object.prototype.hasOwnProperty,tS=Ls,nS=tS.call(Zh,eS),F,aS=Uh,sS=Fh,oS=Gh,rS=Bh,Ut=Sc,Mt=ta,iS=Vh,_c=Function,ga=function(e){try{return _c('"use strict"; return ('+e+").constructor;")()}catch{}},yt=Object.getOwnPropertyDescriptor;if(yt)try{yt({},"")}catch{yt=null}var ka=function(){throw new Mt},cS=yt?function(){try{return arguments.callee,ka}catch{try{return yt(arguments,"callee").get}catch{return ka}}}():ka,_t=xh(),lS=Qh(),se=Object.getPrototypeOf||(lS?function(e){return e.__proto__}:null),bt={},mS=typeof Uint8Array>"u"||!se?F:se(Uint8Array),ft={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?F:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?F:ArrayBuffer,"%ArrayIteratorPrototype%":_t&&se?se([][Symbol.iterator]()):F,"%AsyncFromSyncIteratorPrototype%":F,"%AsyncFunction%":bt,"%AsyncGenerator%":bt,"%AsyncGeneratorFunction%":bt,"%AsyncIteratorPrototype%":bt,"%Atomics%":typeof Atomics>"u"?F:Atomics,"%BigInt%":typeof BigInt>"u"?F:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?F:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?F:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?F:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":aS,"%eval%":eval,"%EvalError%":sS,"%Float32Array%":typeof Float32Array>"u"?F:Float32Array,"%Float64Array%":typeof Float64Array>"u"?F:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?F:FinalizationRegistry,"%Function%":_c,"%GeneratorFunction%":bt,"%Int8Array%":typeof Int8Array>"u"?F:Int8Array,"%Int16Array%":typeof Int16Array>"u"?F:Int16Array,"%Int32Array%":typeof Int32Array>"u"?F:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_t&&se?se(se([][Symbol.iterator]())):F,"%JSON%":typeof JSON=="object"?JSON:F,"%Map%":typeof Map>"u"?F:Map,"%MapIteratorPrototype%":typeof Map>"u"||!_t||!se?F:se(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?F:Promise,"%Proxy%":typeof Proxy>"u"?F:Proxy,"%RangeError%":oS,"%ReferenceError%":rS,"%Reflect%":typeof Reflect>"u"?F:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?F:Set,"%SetIteratorPrototype%":typeof Set>"u"||!_t||!se?F:se(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?F:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_t&&se?se(""[Symbol.iterator]()):F,"%Symbol%":_t?Symbol:F,"%SyntaxError%":Ut,"%ThrowTypeError%":cS,"%TypedArray%":mS,"%TypeError%":Mt,"%Uint8Array%":typeof Uint8Array>"u"?F:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?F:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?F:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?F:Uint32Array,"%URIError%":iS,"%WeakMap%":typeof WeakMap>"u"?F:WeakMap,"%WeakRef%":typeof WeakRef>"u"?F:WeakRef,"%WeakSet%":typeof WeakSet>"u"?F:WeakSet};if(se)try{null.error}catch(e){var uS=se(se(e));ft["%Error.prototype%"]=uS}var dS=function e(t){var n;if(t==="%AsyncFunction%")n=ga("async function () {}");else if(t==="%GeneratorFunction%")n=ga("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=ga("async function* () {}");else if(t==="%AsyncGenerator%"){var a=e("%AsyncGeneratorFunction%");a&&(n=a.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=e("%AsyncGenerator%");s&&se&&(n=se(s.prototype))}return ft[t]=n,n},mr={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},tn=Ls,Dn=nS,pS=tn.call(Function.call,Array.prototype.concat),TS=tn.call(Function.apply,Array.prototype.splice),ur=tn.call(Function.call,String.prototype.replace),Un=tn.call(Function.call,String.prototype.slice),yS=tn.call(Function.call,RegExp.prototype.exec),fS=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,gS=/\\(\\)?/g,kS=function(e){var t=Un(e,0,1),n=Un(e,-1);if(t==="%"&&n!=="%")throw new Ut("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Ut("invalid intrinsic syntax, expected opening `%`");var a=[];return ur(e,fS,function(s,o,r,c){a[a.length]=r?ur(c,gS,"$1"):o||s}),a},hS=function(e,t){var n=e,a;if(Dn(mr,n)&&(a=mr[n],n="%"+a[0]+"%"),Dn(ft,n)){var s=ft[n];if(s===bt&&(s=dS(n)),typeof s>"u"&&!t)throw new Mt("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:s}}throw new Ut("intrinsic "+e+" does not exist!")},nn=function(e,t){if(typeof e!="string"||e.length===0)throw new Mt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Mt('"allowMissing" argument must be a boolean');if(yS(/^%?[^%]*%?$/,e)===null)throw new Ut("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=kS(e),a=n.length>0?n[0]:"",s=hS("%"+a+"%",t),o=s.name,r=s.value,c=!1,l=s.alias;l&&(a=l[0],TS(n,pS([0,1],l)));for(var m=1,u=!0;m<n.length;m+=1){var d=n[m],y=Un(d,0,1),T=Un(d,-1);if((y==='"'||y==="'"||y==="`"||T==='"'||T==="'"||T==="`")&&y!==T)throw new Ut("property names with quotes must have matching quotes");if((d==="constructor"||!u)&&(c=!0),a+="."+d,o="%"+a+"%",Dn(ft,o))r=ft[o];else if(r!=null){if(!(d in r)){if(!t)throw new Mt("base intrinsic for "+e+" exists, but the property is not available.");return}if(yt&&m+1>=n.length){var f=yt(r,d);u=!!f,u&&"get"in f&&!("originalValue"in f.get)?r=f.get:r=r[d]}else u=Dn(r,d),r=r[d];u&&!c&&(ft[o]=r)}}return r},Ec={exports:{}},ha,dr;function Ms(){if(dr)return ha;dr=1;var e=nn,t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return ha=t,ha}var SS=nn,En=SS("%Object.getOwnPropertyDescriptor%",!0);if(En)try{En([],"length")}catch{En=null}var na=En,pr=Ms(),_S=Sc,Et=ta,Tr=na,ES=function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Et("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Et("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Et("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Et("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Et("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Et("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,r=arguments.length>6?arguments[6]:!1,c=!!Tr&&Tr(e,t);if(pr)pr(e,t,{configurable:o===null&&c?c.configurable:!o,enumerable:a===null&&c?c.enumerable:!a,value:n,writable:s===null&&c?c.writable:!s});else if(r||!a&&!s&&!o)e[t]=n;else throw new _S("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Ja=Ms(),bc=function(){return!!Ja};bc.hasArrayLengthDefineBug=function(){if(!Ja)return null;try{return Ja([],"length",{value:1}).length!==1}catch{return!0}};var bS=bc,NS=nn,yr=ES,IS=bS(),fr=na,gr=ta,OS=NS("%Math.floor%"),vS=function(e,t){if(typeof e!="function")throw new gr("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||OS(t)!==t)throw new gr("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],a=!0,s=!0;if("length"in e&&fr){var o=fr(e,"length");o&&!o.configurable&&(a=!1),o&&!o.writable&&(s=!1)}return(a||s||!n)&&(IS?yr(e,"length",t,!0,!0):yr(e,"length",t)),e};(function(e){var t=Ls,n=nn,a=vS,s=ta,o=n("%Function.prototype.apply%"),r=n("%Function.prototype.call%"),c=n("%Reflect.apply%",!0)||t.call(r,o),l=Ms(),m=n("%Math.max%");e.exports=function(d){if(typeof d!="function")throw new s("a function is required");var y=c(t,r,arguments);return a(y,1+m(0,d.length-(arguments.length-1)),!0)};var u=function(){return c(t,o,arguments)};l?l(e.exports,"apply",{value:u}):e.exports.apply=u})(Ec);var Ps=Ec.exports,Nc=nn,Ic=Ps,AS=Ic(Nc("String.prototype.indexOf")),Cs=function(e,t){var n=Nc(e,!!t);return typeof n=="function"&&AS(e,".prototype.")>-1?Ic(n):n},wS=ea(),RS=Cs,Xa=RS("Object.prototype.toString"),aa=function(e){return wS&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Xa(e)==="[object Arguments]"},Oc=function(e){return aa(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Xa(e)!=="[object Array]"&&Xa(e.callee)==="[object Function]"},LS=function(){return aa(arguments)}();aa.isLegacyArguments=Oc;var MS=LS?aa:Oc,PS=Object.prototype.toString,CS=Function.prototype.toString,DS=/^\s*(?:function)?\*/,vc=ea(),Sa=Object.getPrototypeOf,US=function(){if(!vc)return!1;try{return Function("return function*() {}")()}catch{}},_a,FS=function(e){if(typeof e!="function")return!1;if(DS.test(CS.call(e)))return!0;if(!vc){var t=PS.call(e);return t==="[object GeneratorFunction]"}if(!Sa)return!1;if(typeof _a>"u"){var n=US();_a=n?Sa(n):!1}return Sa(e)===_a},Ac=Function.prototype.toString,vt=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Za,bn;if(typeof vt=="function"&&typeof Object.defineProperty=="function")try{Za=Object.defineProperty({},"length",{get:function(){throw bn}}),bn={},vt(function(){throw 42},null,Za)}catch(e){e!==bn&&(vt=null)}else vt=null;var GS=/^\s*class\b/,es=function(e){try{var t=Ac.call(e);return GS.test(t)}catch{return!1}},Ea=function(e){try{return es(e)?!1:(Ac.call(e),!0)}catch{return!1}},Nn=Object.prototype.toString,BS="[object Object]",VS="[object Function]",qS="[object GeneratorFunction]",xS="[object HTMLAllCollection]",HS="[object HTML document.all class]",QS="[object HTMLCollection]",YS=typeof Symbol=="function"&&!!Symbol.toStringTag,jS=!(0 in[,]),ts=function(){return!1};if(typeof document=="object"){var $S=document.all;Nn.call($S)===Nn.call(document.all)&&(ts=function(e){if((jS||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=Nn.call(e);return(t===xS||t===HS||t===QS||t===BS)&&e("")==null}catch{}return!1})}var KS=vt?function(e){if(ts(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{vt(e,null,Za)}catch(t){if(t!==bn)return!1}return!es(e)&&Ea(e)}:function(e){if(ts(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(YS)return Ea(e);if(es(e))return!1;var t=Nn.call(e);return t!==VS&&t!==qS&&!/^\[object HTML/.test(t)?!1:Ea(e)},WS=KS,zS=Object.prototype.toString,wc=Object.prototype.hasOwnProperty,JS=function(e,t,n){for(var a=0,s=e.length;a<s;a++)wc.call(e,a)&&(n==null?t(e[a],a,e):t.call(n,e[a],a,e))},XS=function(e,t,n){for(var a=0,s=e.length;a<s;a++)n==null?t(e.charAt(a),a,e):t.call(n,e.charAt(a),a,e)},ZS=function(e,t,n){for(var a in e)wc.call(e,a)&&(n==null?t(e[a],a,e):t.call(n,e[a],a,e))},e_=function(e,t,n){if(!WS(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=n),zS.call(e)==="[object Array]"?JS(e,t,a):typeof e=="string"?XS(e,t,a):ZS(e,t,a)},Rc=e_,t_=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],ba=t_,n_=typeof globalThis>"u"?vs:globalThis,Lc=function(){for(var e=[],t=0;t<ba.length;t++)typeof n_[ba[t]]=="function"&&(e[e.length]=ba[t]);return e},Fn=Rc,a_=Lc,kr=Ps,Ds=Cs,In=na,s_=Ds("Object.prototype.toString"),Mc=ea(),hr=typeof globalThis>"u"?vs:globalThis,ns=a_(),Us=Ds("String.prototype.slice"),Na=Object.getPrototypeOf,o_=Ds("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},Gn={__proto__:null};Mc&&In&&Na?Fn(ns,function(e){var t=new hr[e];if(Symbol.toStringTag in t){var n=Na(t),a=In(n,Symbol.toStringTag);if(!a){var s=Na(n);a=In(s,Symbol.toStringTag)}Gn["$"+e]=kr(a.get)}}):Fn(ns,function(e){var t=new hr[e],n=t.slice||t.set;n&&(Gn["$"+e]=kr(n))});var r_=function(e){var t=!1;return Fn(Gn,function(n,a){if(!t)try{"$"+n(e)===a&&(t=Us(a,1))}catch{}}),t},i_=function(e){var t=!1;return Fn(Gn,function(n,a){if(!t)try{n(e),t=Us(a,1)}catch{}}),t},c_=function(e){if(!e||typeof e!="object")return!1;if(!Mc){var t=Us(s_(e),8,-1);return o_(ns,t)>-1?t:t!=="Object"?!1:i_(e)}return In?r_(e):null},Bn=Rc,l_=Lc,Sr=Ps,Fs=Cs,On=na,m_=Fs("Object.prototype.toString"),Pc=ea(),_r=typeof globalThis>"u"?vs:globalThis,as=l_(),Gs=Fs("String.prototype.slice"),Ia=Object.getPrototypeOf,u_=Fs("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},Vn={__proto__:null};Pc&&On&&Ia?Bn(as,function(e){var t=new _r[e];if(Symbol.toStringTag in t){var n=Ia(t),a=On(n,Symbol.toStringTag);if(!a){var s=Ia(n);a=On(s,Symbol.toStringTag)}Vn["$"+e]=Sr(a.get)}}):Bn(as,function(e){var t=new _r[e],n=t.slice||t.set;n&&(Vn["$"+e]=Sr(n))});var d_=function(e){var t=!1;return Bn(Vn,function(n,a){if(!t)try{"$"+n(e)===a&&(t=Gs(a,1))}catch{}}),t},p_=function(e){var t=!1;return Bn(Vn,function(n,a){if(!t)try{n(e),t=Gs(a,1)}catch{}}),t},T_=function(e){if(!e||typeof e!="object")return!1;if(!Pc){var t=Gs(m_(e),8,-1);return u_(as,t)>-1?t:t!=="Object"?!1:p_(e)}return On?d_(e):null},y_=T_,f_=function(e){return!!y_(e)};(function(e){var t=MS,n=FS,a=c_,s=f_;function o(S){return S.call.bind(S)}var r=typeof BigInt<"u",c=typeof Symbol<"u",l=o(Object.prototype.toString),m=o(Number.prototype.valueOf),u=o(String.prototype.valueOf),d=o(Boolean.prototype.valueOf);if(r)var y=o(BigInt.prototype.valueOf);if(c)var T=o(Symbol.prototype.valueOf);function f(S,Vc){if(typeof S!="object")return!1;try{return Vc(S),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=s;function _(S){return typeof Promise<"u"&&S instanceof Promise||S!==null&&typeof S=="object"&&typeof S.then=="function"&&typeof S.catch=="function"}e.isPromise=_;function N(S){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(S):s(S)||k(S)}e.isArrayBufferView=N;function E(S){return a(S)==="Uint8Array"}e.isUint8Array=E;function b(S){return a(S)==="Uint8ClampedArray"}e.isUint8ClampedArray=b;function w(S){return a(S)==="Uint16Array"}e.isUint16Array=w;function O(S){return a(S)==="Uint32Array"}e.isUint32Array=O;function A(S){return a(S)==="Int8Array"}e.isInt8Array=A;function L(S){return a(S)==="Int16Array"}e.isInt16Array=L;function v(S){return a(S)==="Int32Array"}e.isInt32Array=v;function D(S){return a(S)==="Float32Array"}e.isFloat32Array=D;function j(S){return a(S)==="Float64Array"}e.isFloat64Array=j;function te(S){return a(S)==="BigInt64Array"}e.isBigInt64Array=te;function $(S){return a(S)==="BigUint64Array"}e.isBigUint64Array=$;function K(S){return l(S)==="[object Map]"}K.working=typeof Map<"u"&&K(new Map);function G(S){return typeof Map>"u"?!1:K.working?K(S):S instanceof Map}e.isMap=G;function B(S){return l(S)==="[object Set]"}B.working=typeof Set<"u"&&B(new Set);function J(S){return typeof Set>"u"?!1:B.working?B(S):S instanceof Set}e.isSet=J;function Fe(S){return l(S)==="[object WeakMap]"}Fe.working=typeof WeakMap<"u"&&Fe(new WeakMap);function qt(S){return typeof WeakMap>"u"?!1:Fe.working?Fe(S):S instanceof WeakMap}e.isWeakMap=qt;function ze(S){return l(S)==="[object WeakSet]"}ze.working=typeof WeakSet<"u"&&ze(new WeakSet);function fe(S){return ze(S)}e.isWeakSet=fe;function ge(S){return l(S)==="[object ArrayBuffer]"}ge.working=typeof ArrayBuffer<"u"&&ge(new ArrayBuffer);function ke(S){return typeof ArrayBuffer>"u"?!1:ge.working?ge(S):S instanceof ArrayBuffer}e.isArrayBuffer=ke;function g(S){return l(S)==="[object DataView]"}g.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&g(new DataView(new ArrayBuffer(1),0,1));function k(S){return typeof DataView>"u"?!1:g.working?g(S):S instanceof DataView}e.isDataView=k;var I=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function M(S){return l(S)==="[object SharedArrayBuffer]"}function W(S){return typeof I>"u"?!1:(typeof M.working>"u"&&(M.working=M(new I)),M.working?M(S):S instanceof I)}e.isSharedArrayBuffer=W;function V(S){return l(S)==="[object AsyncFunction]"}e.isAsyncFunction=V;function U(S){return l(S)==="[object Map Iterator]"}e.isMapIterator=U;function q(S){return l(S)==="[object Set Iterator]"}e.isSetIterator=q;function Q(S){return l(S)==="[object Generator]"}e.isGeneratorObject=Q;function Oe(S){return l(S)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=Oe;function rt(S){return f(S,m)}e.isNumberObject=rt;function an(S){return f(S,u)}e.isStringObject=an;function ht(S){return f(S,d)}e.isBooleanObject=ht;function sn(S){return r&&f(S,y)}e.isBigIntObject=sn;function qs(S){return c&&f(S,T)}e.isSymbolObject=qs;function Gc(S){return rt(S)||an(S)||ht(S)||sn(S)||qs(S)}e.isBoxedPrimitive=Gc;function Bc(S){return typeof Uint8Array<"u"&&(ke(S)||W(S))}e.isAnyArrayBuffer=Bc,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(S){Object.defineProperty(e,S,{enumerable:!1,value:function(){throw new Error(S+" is not supported in userland")}})})})(kc);var g_=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},ss={exports:{}};typeof Object.create=="function"?ss.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ss.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var k_=ss.exports;(function(e){var t=Object.getOwnPropertyDescriptors||function(g){for(var k=Object.keys(g),I={},M=0;M<k.length;M++)I[k[M]]=Object.getOwnPropertyDescriptor(g,k[M]);return I},n=/%[sdj%]/g;e.format=function(g){if(!A(g)){for(var k=[],I=0;I<arguments.length;I++)k.push(r(arguments[I]));return k.join(" ")}for(var I=1,M=arguments,W=M.length,V=String(g).replace(n,function(Q){if(Q==="%%")return"%";if(I>=W)return Q;switch(Q){case"%s":return String(M[I++]);case"%d":return Number(M[I++]);case"%j":try{return JSON.stringify(M[I++])}catch{return"[Circular]"}default:return Q}}),U=M[I];I<W;U=M[++I])b(U)||!j(U)?V+=" "+U:V+=" "+r(U);return V},e.deprecate=function(g,k){if(typeof C<"u"&&C.noDeprecation===!0)return g;if(typeof C>"u")return function(){return e.deprecate(g,k).apply(this,arguments)};var I=!1;function M(){if(!I){if(C.throwDeprecation)throw new Error(k);C.traceDeprecation?console.trace(k):console.error(k),I=!0}return g.apply(this,arguments)}return M};var a={},s=/^$/;if(C.env.NODE_DEBUG){var o=C.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+o+"$","i")}e.debuglog=function(g){if(g=g.toUpperCase(),!a[g])if(s.test(g)){var k=C.pid;a[g]=function(){var I=e.format.apply(e,arguments);console.error("%s %d: %s",g,k,I)}}else a[g]=function(){};return a[g]};function r(g,k){var I={seen:[],stylize:l};return arguments.length>=3&&(I.depth=arguments[2]),arguments.length>=4&&(I.colors=arguments[3]),E(k)?I.showHidden=k:k&&e._extend(I,k),v(I.showHidden)&&(I.showHidden=!1),v(I.depth)&&(I.depth=2),v(I.colors)&&(I.colors=!1),v(I.customInspect)&&(I.customInspect=!0),I.colors&&(I.stylize=c),u(I,g,I.depth)}e.inspect=r,r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function c(g,k){var I=r.styles[k];return I?"\x1B["+r.colors[I][0]+"m"+g+"\x1B["+r.colors[I][1]+"m":g}function l(g,k){return g}function m(g){var k={};return g.forEach(function(I,M){k[I]=!0}),k}function u(g,k,I){if(g.customInspect&&k&&K(k.inspect)&&k.inspect!==e.inspect&&!(k.constructor&&k.constructor.prototype===k)){var M=k.inspect(I,g);return A(M)||(M=u(g,M,I)),M}var W=d(g,k);if(W)return W;var V=Object.keys(k),U=m(V);if(g.showHidden&&(V=Object.getOwnPropertyNames(k)),$(k)&&(V.indexOf("message")>=0||V.indexOf("description")>=0))return y(k);if(V.length===0){if(K(k)){var q=k.name?": "+k.name:"";return g.stylize("[Function"+q+"]","special")}if(D(k))return g.stylize(RegExp.prototype.toString.call(k),"regexp");if(te(k))return g.stylize(Date.prototype.toString.call(k),"date");if($(k))return y(k)}var Q="",Oe=!1,rt=["{","}"];if(N(k)&&(Oe=!0,rt=["[","]"]),K(k)){var an=k.name?": "+k.name:"";Q=" [Function"+an+"]"}if(D(k)&&(Q=" "+RegExp.prototype.toString.call(k)),te(k)&&(Q=" "+Date.prototype.toUTCString.call(k)),$(k)&&(Q=" "+y(k)),V.length===0&&(!Oe||k.length==0))return rt[0]+Q+rt[1];if(I<0)return D(k)?g.stylize(RegExp.prototype.toString.call(k),"regexp"):g.stylize("[Object]","special");g.seen.push(k);var ht;return Oe?ht=T(g,k,I,U,V):ht=V.map(function(sn){return f(g,k,I,U,sn,Oe)}),g.seen.pop(),_(ht,Q,rt)}function d(g,k){if(v(k))return g.stylize("undefined","undefined");if(A(k)){var I="'"+JSON.stringify(k).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return g.stylize(I,"string")}if(O(k))return g.stylize(""+k,"number");if(E(k))return g.stylize(""+k,"boolean");if(b(k))return g.stylize("null","null")}function y(g){return"["+Error.prototype.toString.call(g)+"]"}function T(g,k,I,M,W){for(var V=[],U=0,q=k.length;U<q;++U)ze(k,String(U))?V.push(f(g,k,I,M,String(U),!0)):V.push("");return W.forEach(function(Q){Q.match(/^\d+$/)||V.push(f(g,k,I,M,Q,!0))}),V}function f(g,k,I,M,W,V){var U,q,Q;if(Q=Object.getOwnPropertyDescriptor(k,W)||{value:k[W]},Q.get?Q.set?q=g.stylize("[Getter/Setter]","special"):q=g.stylize("[Getter]","special"):Q.set&&(q=g.stylize("[Setter]","special")),ze(M,W)||(U="["+W+"]"),q||(g.seen.indexOf(Q.value)<0?(b(I)?q=u(g,Q.value,null):q=u(g,Q.value,I-1),q.indexOf(`
4
+ `+a)}catch(s){tc(s)&&window.sessionStorage.removeItem("slstreamlogs"),window.sessionStorage.setItem("slstreamlogs",a)}});p(this,"addListener",(t,n)=>this.listeners.has(t)?(this.addStateLog(`listener '${t}' not added, already exists`),()=>{}):(this.listeners.set(t,n),this.addStateLog(`listener '${t}' added`),()=>this.removeListener(t)));p(this,"removeListener",t=>{this.listeners.delete(t),this.addStateLog(`listener '${t}' removed`)});p(this,"connect",()=>{this.updateState(Ie.Connecting),this.streamCancel&&(this.addStateLog("disconnect prev connection"),this.streamCancel.abort(),this.streamCancel=void 0);const t="get"in this.params&&typeof this.params.get=="function"?this.params.get():this.params;(async()=>{this.streamCancel=new AbortController;try{const n={headers:this.headers.getValues(),signal:this.streamCancel.signal},a=this.method(t,n);for await(const s of a)this.attempt=0,this.onData(s)}catch(n){n instanceof x&&n.code!=exports.Code.Canceled&&this.onStreamError(n)}})(),this.updateState(Ie.Connected)});p(this,"disconnect",()=>{var t;this.streamCancel&&this.streamCancel.abort(),this.listeners.clear(),(t=this.paramsListener)==null||t.call(this),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.updateState(Ie.Disconnected)});p(this,"reconnect",()=>{if(this.reconnectTimeout)this.addStateLog("already reconnecting");else if(this.attempt<this.options.reconnectMaxAttempts){this.updateState(Ie.Reconnect);const t=Math.min(this.options.reconnectMaxDelay,Math.pow(2,this.attempt)*this.options.reconnectDelay),n=Math.round(t*(1+Math.random())/2);this.reconnectTimeout=setTimeout(()=>{this.attempt++,this.updateState(Ie.Reconnecting),this.addStateLog(`reconnect attempt ${this.attempt} after ${n}ms`),this.connect(),this.reconnectTimeout=void 0},n)}else this.addStateLog("max reconnect attempts reached"),this.disconnect()});p(this,"getStore",()=>{var t;return(t=this.store)==null?void 0:t.getStore()});p(this,"onData",t=>{try{this.addStateLog(`received data => ${JSON.stringify(t)}`),this.store&&this.store.setValue(t);for(const[,n]of this.listeners)n(t);this.addStateLog(`data routed to ${this.listeners.size} listeners`)}catch(n){this.addStateLog(`error process data => ${n}`)}});p(this,"onStreamError",t=>{if(this.addStateLog(`error => ${t?JSON.stringify(t):"undefined"}}`),t!==void 0){if(t instanceof x&&t.code!==exports.Code.Canceled){this.updateState(Ie.Failed),this.state.setValue("error",t),this.reconnect();return}this.disconnect()}});const o={status:Ie.Init,ts:new Date,log:[]};this.state=new pt(Ee(o),`subscription:${s.name}:state`),this.options={...s,reconnectDelay:s.reconnectDelay??1e3,reconnectMaxDelay:s.reconnectMaxDelay??3e4,reconnectMaxAttempts:s.reconnectMaxAttempts??10,withStore:s.withStore??!1},this.headers=t,this.listeners=new Map,this.params=a,this.method=n,s.withStore&&(this.store=new be(ie(null),`subscription:${s.name}:store`)),"subscribe"in a&&typeof a.subscribe=="function"&&(this.paramsListener=a.subscribe(r=>{this.state.getValue("status")===Ie.Connected&&(this.addStateLog(`params updated, reconnect => ${JSON.stringify(r)}`),this.reconnect())})),this.updateState(Ie.Ready)}}const Zg=new Set([exports.Code.Unknown,exports.Code.Internal,exports.Code.DeadlineExceeded,exports.Code.ResourceExhausted,exports.Code.FailedPrecondition,exports.Code.Unavailable,exports.Code.DataLoss]),Zo=We("grpc:retry"),ek=e=>async t=>{const n=t.contextValues.get(Wa.retryAttempts),a=300,s=t.contextValues.get(Wa.retryDelay);if(t.stream||n===0)return e(t);Zo.trace({url:t.url,attempts:n,maxDelay:s},"retry options");for(let o=0;;o++)try{return await e(t)}catch(r){Zo.trace({attempt:o,error:r},"retry attempt");const c=x.from(r);if(o>=n||!(c instanceof x)||!Zg.has(c.code))throw r;const l=Math.min(s,Math.pow(2,o)*a),m=Math.round(l*(1+Math.random())/2);await new Promise(u=>setTimeout(u,m))}},Wa={retryAttempts:Ha(10,{description:"Number of attempts to retry"}),retryDelay:Ha(3e4,{description:"Max delay between retries in milliseconds"})},tk=()=>{const e=localStorage.getItem("sl-device-id");if(e)return e;const t=qa();return localStorage.setItem("sl-device-id",t),t},nk=()=>{var e;return((e=navigator.userAgentData)==null?void 0:e.platform)||navigator.platform};class er{constructor(t,n){p(this,"toJsonOptions",{emitDefaultValues:!1,enumAsInteger:!0,useProtoFieldName:!1});p(this,"transport");p(this,"streamTransport");p(this,"nanoquery");p(this,"host");p(this,"$headers");p(this,"interceptors",[]);p(this,"clients");p(this,"streamClients");p(this,"subscriptions");p(this,"opts");p(this,"addSubscription",(t,n,a)=>{const s=this.subscriptions.get(n);if(s)return s;const o=new Xg(this.$headers,t,n,a);return this.subscriptions.set(n,o),o});p(this,"removeSubscription",t=>{t.disconnect(),this.subscriptions.delete(t.params)});p(this,"disconnect",()=>{var s,o;for(const[r,c]of this.subscriptions)c.disconnect(),this.subscriptions.delete(r);this.clients.clear(),this.streamClients.clear(),this.subscriptions.clear();const[t,n,a]=vo({dedupeTime:(s=this.opts)==null?void 0:s.dedupeTime,refetchInterval:(o=this.opts)==null?void 0:o.refetchInterval});this.nanoquery={createFetcherStore:t,createMutatorStore:n,utils:a}});p(this,"registerInterceptor",t=>{this.interceptors.push(t)});p(this,"removeInterceptor",t=>{this.interceptors=this.interceptors.filter(n=>n!==t)});p(this,"getClient",t=>{const n=t.typeName;if(this.clients.has(n))return this.clients.get(n);const a=go(t,this.transport);return this.clients.set(n,a),a});p(this,"getStreamClient",t=>{const n=`stream-${t.typeName}`;if(this.clients.has(n))return this.clients.get(n);const a=go(t,this.streamTransport);return this.clients.set(n,a),a});p(this,"createPromiseClient",(t,{params:n=[],method:a})=>{const s=this.getClient(t),o=t.methods[a].name,r=[t.typeName,o.charAt(0).toLowerCase()+o.slice(1),...Array.isArray(n)?n:[n]],c=[t.typeName,o.charAt(0).toLowerCase()+o.slice(1)];return{client:s,createRequestOptions:l=>{const m=xa();for(const u in l){const d=Wa[u];m.set(d,l[u])}return m},queryKey:r,queryKeyStr:c.join("")}});p(this,"createStreamClient",t=>({client:this.getStreamClient(t)}));p(this,"setSdkKey",t=>{this.$headers.setValue("sdk",t)});p(this,"setAuth",(t,n)=>{this.$headers.setValue("authorization",t),this.$headers.setValue("sl-user-id",n)});p(this,"setHeader",(t,n)=>this.$headers.setValue(t,n));p(this,"getHeader",t=>this.$headers.getValue(t));p(this,"getHeaders",()=>this.$headers.getValues());p(this,"initInterceptors",()=>{var n;if(this.interceptors.length!==0)return;const t=a=>s=>{const o=this.$headers.getValues();for(const r in o)s.header.set(r,o[r]);return a(s)};this.interceptors.push(t),this.interceptors.push(Jg()),(n=this.opts)!=null&&n.retryable&&this.interceptors.push(ek)});this.host=t,this.opts=n,this.$headers=new pt(Ee({"sl-device-id":tk(),"sl-device-os":nk()}),"transport:headers"),this.initInterceptors(),this.clients=new Map,this.streamClients=new Map,this.subscriptions=new Map;const[a,s,o]=vo({dedupeTime:n==null?void 0:n.dedupeTime,refetchInterval:n==null?void 0:n.refetchInterval});this.nanoquery={createFetcherStore:a,createMutatorStore:s,utils:o},this.transport=Oo({baseUrl:t,defaultTimeoutMs:1e4,interceptors:this.interceptors}),this.streamTransport=Oo({baseUrl:t,interceptors:this.interceptors})}}const ak=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Qi,{method:"retrieveEventId",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var c;if(!r||typeof r!="string")return"";try{return((c=(await n.retrieveEventId({id:r})).data)==null?void 0:c.id)||""}catch{return""}}})},sk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(en,{method:"getStream",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var c;return r?(c=(await n.getStream({id:r})).data)==null?void 0:c.attributes:void 0}})},ok=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Qi,{method:"summary",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var c;return r?(c=(await n.summary({id:r})).data)==null?void 0:c.attributes:void 0}})},rk=(e,t)=>{const{queryKey:n,client:a}=t.createPromiseClient(Is,{method:"me",params:[e]});return t.nanoquery.createFetcherStore(n,{fetcher:async()=>{const{data:s}=await a.me({});return{data:s}}})},ik=e=>{const{client:t,createRequestOptions:n}=e.createPromiseClient(Is,{method:"bypassAuth"}),a=n({retryAttempts:0});return({userKey:s,schema:o,init:r,inviterKey:c})=>t.bypassAuth({userKey:s,schema:o,init:r,inviterKey:c},{contextValues:a})},ck=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(en,{method:"get",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async()=>{var s;return(s=(await n.get({})).data)==null?void 0:s.attributes}})},lk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(en,{method:"getOrganization",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async()=>{const s=await n.getOrganization({});return s.data?{...s.data.attributes,id:s.data.id}:void 0}})},mk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(en,{method:"getOrganizationAdvertising",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async()=>{var s;return(s=(await n.getOrganizationAdvertising({})).data)==null?void 0:s.attributes}})},uk=(e,t,n)=>{e.transport=new er(t.host,{dedupeTime:1e3*60*5,refetchInterval:1e3*60*5,retryable:!0}),e.analyticsTransport=new er(t.analyticsHost),e.sdk.host=e.transport.host,e.transport.setSdkKey(t.sdkKey),e.transport.setHeader("sl-sdk-version",t.version||"-"),e.transport.$headers.subscribe(a=>{e.analyticsTransport.$headers.getStore().set(a)}),e.sdk.onMount({name:"transport"},()=>()=>{e.transport.disconnect(),e.analyticsTransport.disconnect()}),n()};var Ge;(function(e){e.SCHEMA="schema",e.EXTERNAL_TOKEN="eToken",e.TOKEN="token"})(Ge||(Ge={}));class It extends Bt{constructor(){super("user");p(this,"setSchema",n=>{this.write(Ge.SCHEMA,n)});p(this,"getSchema",()=>this.read(Ge.SCHEMA));p(this,"setToken",n=>{this.write(Ge.TOKEN,n)});p(this,"getToken",()=>this.read(Ge.TOKEN));p(this,"setExternalToken",n=>{this.write(Ge.EXTERNAL_TOKEN,n)});p(this,"getExternalToken",()=>this.read(Ge.EXTERNAL_TOKEN));p(this,"removeToken",()=>{this.remove(Ge.TOKEN)})}}var qe;(function(e){e.DISABLED="disabled",e.INITIALIZATION="initialization",e.READY="ready",e.FAILED="failed",e.SUSPENDED="suspended"})(qe||(qe={}));const dk=e=>{const t=new It,n=new be(ie(t.getExternalToken()),"userKey"),a=new be(ie(t.getToken()),"userToken"),s=new Ue(rk(a.getStore(),e),"user",({data:r,error:c,loading:l},m)=>{var u;if(!c)return(u=r==null?void 0:r.data)!=null&&u.id?r.data.id:l===!1?void 0:m}),o=new Ue(ck(a.getStore(),e),"userSettings");return{userKey:n,userToken:a,user:s,userSettings:o}},pk=e=>{const t=new be(ie(void 0),"providerStreamId"),n=new Ue(ak(t.getStore(),e),"slStreamId",o=>o==null?void 0:o.data),a=new Ue(sk(n.getAtomStore(),e),"streamSettings"),s=new Ue(ok(n.getAtomStore(),e),"streamSettings");return n.getAtomStore().listen(o=>{(o===""||o===void 0)&&(a.getStore().mutate(void 0),s.getStore().mutate(void 0))}),{providerStreamId:t,slStreamId:n,streamSettings:a,streamSummary:s}},Tk=e=>{const t=new be(ie(void 0),"enabled"),n=new be(ie(qe.DISABLED),"status"),a=new Ue(lk(t.getStore(),e),"organizationSettings",c=>{var l;return(l=c==null?void 0:c.data)==null?void 0:l.id}),s=new Ue(mk(a.getAtomStore(),e),"organizationAdvertising"),o=dk(e),r=pk(e);return{enabled:t,status:n,providerStreamId:r.providerStreamId,slStreamId:r.slStreamId,streamSettings:r.streamSettings,streamSummary:r.streamSummary,user:o.user,userKey:o.userKey,userToken:o.userToken,userSettings:o.userSettings,organizationSettings:a,organizationAdvertising:s}};class yk extends zn{constructor(n){const a=Tk(n),s=Kg(a);super(s,"core");p(this,"stores");p(this,"subscribe",n=>{let a;for(a in this.stores){const s=n[a];a in n&&s!==void 0&&this.stores[a].subscribe(n[a])}});p(this,"unsubscribe",()=>this.getStore().off());this.stores=a}getValue(){throw new Error("Not implemented")}getValues(){return this.stores}setValue(){throw new Error("Not implemented")}}const fk=(e,t,n)=>{e.store=new yk(e.transport),e.stores=e.store.getValues(),e.sdk.enabled=e.stores.enabled.getStore(),e.sdk.status=e.stores.status.getStore(),e.sdk.sdkStore=Object.fromEntries(Object.entries(e.stores).map(([a,s])=>[a,s.getStore()])),e.sdk.organizationStore=()=>e.stores.organizationSettings.getStore(),e.sdk.streamStore=()=>e.stores.streamSettings.getStore(),e.sdk.streamSummary=()=>e.stores.streamSummary.getStore(),e.storeUnsubscribe=()=>{e.store.unsubscribe()},n()},gk=e=>{const{client:t}=e.createPromiseClient($i,{method:"list"});return n=>t.list(n)},nc=e=>{const{client:t}=e.createPromiseClient($i,{method:"summary"});return n=>t.summary(n)},kk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Is,{method:"getFriends",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{if(!r)return[];try{return(await n.getFriends({})).data}catch{return[]}}})},hk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ne,{method:"get",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var c;return(c=(await n.get({eventId:r})).data)==null?void 0:c.attributes},refetchInterval:0,dedupeTime:1e3*60*60})},Sk=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ne,{method:"syncQuestion",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var l,m,u,d;if(!r)return;const c=await n.syncQuestion({filter:{eventId:r}});if(((u=(m=(l=c.data)==null?void 0:l.attributes)==null?void 0:m.question)==null?void 0:u.type)!==P.PROMOTION)return(d=c.data)==null?void 0:d.attributes},dedupeTime:1e3*60*10,refetchInterval:0})},_k=async(e,t)=>{const{client:n}=t.createPromiseClient(Ne,{method:"item",params:[e]});return(await n.item({id:e})).data},Ek=(e,t)=>{const{client:n}=t.createStreamClient(Ne),a=nt({eventId:e.get()||"",feedId:""});return e.subscribe((s="")=>{a.set({eventId:s,feedId:""})}),t.addSubscription(n.subscription,a,{name:"feedSubscription"})},bk=(e,t)=>{const{client:n}=t.createStreamClient(Ne);return t.addSubscription(n.questionSubscription,{questionId:e},{name:"questionSubscription"})},Nk=async(e,t)=>{var a,s;const{client:n}=t.createPromiseClient(Ne,{method:"questionByUser",params:[e]});return(s=(a=(await n.questionByUser({questionId:e})).data)==null?void 0:a.attributes)==null?void 0:s.question},za=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ne,{method:"questionByUser",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var c,l;return(l=(c=(await n.questionByUser({questionId:r})).data)==null?void 0:c.attributes)==null?void 0:l.question},dedupeTime:1e3*60*5})},ac=async(e,t)=>{var l;if(!e)return;const{client:n}=t.createPromiseClient(Ne,{method:"getQuestion",params:[e]}),a=await n.getQuestion({id:e});if(!((l=a.data)!=null&&l.attributes))return;const{options:s,notification:o,...r}=a.data.attributes,c=(s==null?void 0:s.options.case)==="promotion"?s==null?void 0:s.options.value:void 0;return{id:r.id,question:r,promotion:c,notification:o}},Ik=(e,t,n)=>{const{client:a,queryKey:s}=n.createPromiseClient(Ne,{method:"list",params:[e,t]});return n.nanoquery.createFetcherStore(s,{fetcher:async(o,r,c,l)=>c?(await a.list({eventId:c,filter:{types:l===Tt.ALLOWED?[]:[P.FACTOID,P.PROMOTION,P.TWEET],statuses:[oe.ACTIVE,oe.RESOLVED]}})).data:[],dedupeTime:0,refetchInterval:0})},Ok=(e,t)=>{const{client:n,queryKey:a}=t.createPromiseClient(Ne,{method:"list",params:[e]});return t.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r)=>{var l;if(!r)return;const c=(l=(await n.list({eventId:r,filter:{types:[P.PROMOTION],statuses:[oe.ACTIVE]},pagination:{page:0,pageSize:1}})).data)==null?void 0:l[0];if(c.type==="promotion")return ac(c.id,t)},dedupeTime:0,refetchInterval:0})},vk=(e,t,n)=>{const a=uo([t,n],()=>{var m,u;const r=t.get();if(!r)return;const c=(m=n.get().data)==null?void 0:m.find(d=>d.id===(r==null?void 0:r.questionId)),l=(u=r==null?void 0:r.question)==null?void 0:u.openedFrom;return c?(c.openedFrom=l,c):r.question}),s=uo(a,r=>r&&r.type==="question"?r.id:void 0),o=za(s,e);return{$store:a,$extendedStore:o,updateExtendedQuestion:r=>{const c=o.get().data,l=(m,u)=>{if(!m||!u)return m||u||[];const d=[];for(let y=0;y<m.length;y++)d.push({...m[y],...u[y],correct:m[y].correct,youVoted:m[y].youVoted,pointsEarned:m[y].pointsEarned});return d};o.mutate({...r,options:c==null?void 0:c.options,subject:c==null?void 0:c.subject,appearance:c==null?void 0:c.appearance,answers:l(c==null?void 0:c.answers,r==null?void 0:r.answers)})}}};var Pn;(function(e){e.SHOWED="showed"})(Pn||(Pn={}));class Ak extends Bt{constructor(){super("advertisement");p(this,"setShowed",n=>{this.write(Pn.SHOWED,n,"true")});p(this,"isViewed",n=>this.read(Pn.SHOWED,n))}}const wk=e=>{var r,c,l,m,u;const t=(c=(r=e.data)==null?void 0:r.attributes)==null?void 0:c.question;if((((u=(m=(l=e.data)==null?void 0:l.attributes)==null?void 0:m.feedItem)==null?void 0:u.type)==="promotion"?e.data.attributes.feedItem:void 0)===void 0||!t)return;const{options:n,notification:a,...s}=t,o=(n==null?void 0:n.options.case)==="promotion"?n.options.value:void 0;return{id:s.id,question:s,notification:a,promotion:o}},un=e=>e.startsWith("http://")||e.startsWith("https://")?new URL(e).toString():e,Rk=({gamOptions:e,gamBaseUrl:t})=>{const n=`${t}?`,a=[];for(const s in e){const o=s.replace(/([a-zA-Z])(?=[A-Z])/g,"$1_").toLowerCase(),r=e[s];if(r)if(typeof r=="string")a.push(`${o}=${un(r)}`);else if(Array.isArray(r))a.push(`${o}=${r.map(un).join(",")}`);else{const c=Object.entries(r).map(([l,m])=>Array.isArray(m)?`${l}=${m.map(un).join(",")}`:typeof m=="string"?`${l}=${un(m)}`:`${l}=${m}`).join("&").replaceAll("=","%3D").replaceAll("&","%26").replaceAll(",","%2C");a.push(`${o}=${c}`)}}return n+a.join("&")},Lk=(e,t,n)=>{let a=!1;const s=n.transport,o=We("advertisement"),r=new Ak,c=Ee({}),l=Ok(e,s),m=()=>{var N,E,b;c.setKey("hasNotification",!1);const T=c.get(),f=(N=T.data)==null?void 0:N.question.id,_=(b=(E=T.data)==null?void 0:E.promotion)==null?void 0:b.type;f&&de.emit("advertisement",{action:"notification-opened",payload:{id:f,type:_}})},u=()=>{var E,b,w,O;const T=c.get(),f=(E=T.data)==null?void 0:E.question.id,_=(w=(b=T.data)==null?void 0:b.promotion)==null?void 0:w.type,N=(O=c.get())==null?void 0:O.isOpened;f&&!N&&(o.debug({id:f},"markAsViewed: %o"),r.setShowed(f),c.setKey("isOpened",!0),de.emit("advertisement",{action:"opened",payload:{id:f,type:_}}))},d=(T,f)=>{var _;f?c.set({loading:!1,error:void 0,data:f,hasNotification:((_=f==null?void 0:f.notification)==null?void 0:_.enabled)===Rn.NOTIFICATION_ENABLED,close:()=>y(f.question.id),isViewed:!!r.isViewed(f.question.id)}):(c.setKey("loading",!0),ac(T,s).then(N=>{var E;return c.set({loading:!1,error:void 0,data:N,hasNotification:((E=N==null?void 0:N.notification)==null?void 0:E.enabled)===Rn.NOTIFICATION_ENABLED,close:()=>y(N==null?void 0:N.question.id),isViewed:N&&!!r.isViewed(N.question.id)})}).catch(N=>c.set({loading:!1,error:N,data:void 0})))};c.subscribe((T,f)=>{var _,N,E,b,w,O,A;if(((N=(_=T.data)==null?void 0:_.promotion)==null?void 0:N.type)===he.EXTERNAL_AD&&!(T!=null&&T.externalAd)&&((E=T.data.promotion.adCampaigns)!=null&&E.gamOptions)&&((b=T.data.promotion.adCampaigns)!=null&&b.gamBaseUrl)){const L=Rk(T.data.promotion.adCampaigns);c.setKey("externalAd",{type:"gam",url:L})}(w=T.data)!=null&&w.promotion&&!T.isOpened&&de.emit("advertisement",{action:"received",payload:{id:T.data.question.id,type:T.data.promotion.type,hasNotification:!!T.hasNotification,isViewed:!!r.isViewed(T.data.question.id)},skipAnalytics:T.data.question.id===((O=f==null?void 0:f.data)==null?void 0:O.question.id)}),!(T!=null&&T.data)&&(f!=null&&f.data)&&de.emit("advertisement",{action:"closed",payload:{id:f.data.question.id,type:(A=f.data.promotion)==null?void 0:A.type,hasNotification:!!f.hasNotification,isViewed:!!r.isViewed(f.data.question.id)}})});const y=T=>{var f,_;(!T||((_=(f=c.get())==null?void 0:f.data)==null?void 0:_.question.id)===T)&&c.set({})};return{connect:()=>{a||(a=!0,l.subscribe((T,f)=>{T.data&&(!(f!=null&&f.data)||T.data.id!==f.data.id)&&d(T.data.question.id,T.data)}),t.addListener("promotion",T=>{const f=wk(T);if(f){if(f.question.status===oe.RESOLVED){y(f.question.id),o.debug({promotion:f},"resolved: %o");return}if(f.question.status===oe.ACTIVE){o.debug({promotion:f},"active: %o"),d(f.question.id,f);return}o.debug({promotion:f},"skip: %o")}}))},hide:y,show:d,open:m,markAsViewed:u,$store:c}};var Tt;(function(e){e.ALLOWED="allowed",e.DISALLOWED="disallowed"})(Tt||(Tt={}));class Mk{constructor(t){p(this,"slStreamId");p(this,"organizationId");p(this,"userId");p(this,"interactiveAllowed");p(this,"openedQuestionId");p(this,"openedQuestion");p(this,"activeQuestionId");p(this,"feedList");p(this,"moderationId");p(this,"moderation");p(this,"feedSubscription");p(this,"questionSubscription");p(this,"advertisement");p(this,"notifications");p(this,"log");p(this,"transport");p(this,"cancels",new Set);p(this,"getCurrentSessionId",t=>{const n=t.eventId||this.slStreamId.get()||"",a=t.userId||this.userId.get()||"",s=t.organizationId||this.organizationId.get()||"",o=t.entity||"",r=t.prefix||"";return[s,n,a,r,o].join(":")});p(this,"disconnect",()=>{var t;(t=this.feedSubscription)==null||t.disconnect(),this.questionSubscription!==void 0&&(this.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0)});p(this,"openQuestion",(t,n)=>{this.openedQuestionId.set({questionId:t,question:n}),this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:t}))});p(this,"closeQuestion",t=>{this.openedQuestionId.set(void 0),t&&this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:t}))});this.transport=t.transport,this.log=We("gamification-background"),this.slStreamId=t.stores.slStreamId.getAtomStore(),this.organizationId=t.stores.organizationSettings.getAtomStore(),this.userId=t.stores.user.getAtomStore(),this.moderationId=new be(ie(void 0),"moderationId").getStore(),this.interactiveAllowed=new be(ie(Tt.DISALLOWED),"interactiveAllowed").getStore(),this.openedQuestionId=new be(ie(void 0),"openedQuestionId").getStore(),this.notifications=t.notifications,this.moderation=new Ue(hk(this.slStreamId,t.transport),"gamification:moderation"),this.feedList=new Ue(Ik(this.slStreamId,this.interactiveAllowed,t.transport),"gamification:feedList"),this.activeQuestionId=Sk(this.slStreamId,t.transport),this.openedQuestion=vk(t.transport,this.openedQuestionId,this.feedList.getStore()),this.cancels.add(this.openedQuestionId.listen(n=>{this.log.debug({item:n},"received question"),n!=null&&n.questionId?(this.questionSubscription=bk(n.questionId,t.transport),this.questionSubscription.addListener("feed-subscription-opened-question",a=>{var s,o;this.openedQuestion.updateExtendedQuestion((o=(s=a.data)==null?void 0:s.attributes)==null?void 0:o.question)}),this.questionSubscription.connect()):(this.log.info("cleanup on close question"),this.questionSubscription!==void 0&&(t.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0))})),this.feedSubscription=Ek(this.slStreamId,t.transport),this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question",n=>{var o,r,c,l;const a=(r=(o=this.activeQuestionId.get().data)==null?void 0:o.question)==null?void 0:r.id,s=(l=(c=n.data)==null?void 0:c.attributes)==null?void 0:l.question;if(!(!s||s.type===P.PROMOTION)){if(s.status===oe.RESOLVED){a===s.id&&this.activeQuestionId.mutate(void 0);return}window.requestAnimationFrame(()=>{var m;this.activeQuestionId.mutate((m=n.data)==null?void 0:m.attributes)})}})),this.cancels.add(this.feedSubscription.addListener("moderation update",n=>{window.requestAnimationFrame(()=>{var a,s,o,r;((s=(a=n.data)==null?void 0:a.attributes)==null?void 0:s.question)===void 0&&((r=(o=n.data)==null?void 0:o.attributes)!=null&&r.moderation)&&this.moderation.invalidate()})})),this.cancels.add(this.activeQuestionId.subscribe((n,a)=>{var s,o,r,c,l,m,u;(s=n.data)!=null&&s.feedItem&&((r=(o=n.data)==null?void 0:o.feedItem)==null?void 0:r.id)!==((l=(c=a==null?void 0:a.data)==null?void 0:c.feedItem)==null?void 0:l.id)&&t.onQuestionActivate({stage:"activate",id:n.data.feedItem.id,isViewed:!!this.notifications.isViewed(this.getCurrentSessionId({prefix:"notification",entity:n.data.feedItem.id})),hasNotification:!0,type:n.data.feedItem.type}),!((m=n.data)!=null&&m.feedItem)&&((u=a==null?void 0:a.data)!=null&&u.feedItem)&&t.onQuestionActivate({stage:"deactivate",id:a.data.feedItem.id,isViewed:!!this.notifications.isViewed(this.getCurrentSessionId({prefix:"notification",entity:a.data.feedItem.id})),hasNotification:!0,type:a.data.feedItem.type})})),this.feedSubscription.connect(),this.cancels.add(this.interactiveAllowed.listen(()=>{window.requestAnimationFrame(()=>{this.activeQuestionId.invalidate()})})),t.sdk.onMount({name:"gamification-background"},()=>()=>{this.activeQuestionId.off();for(const n of this.cancels)n(),this.cancels.delete(n)}),this.advertisement=Lk(this.slStreamId,this.feedSubscription,t)}}class Pk{constructor(t){p(this,"notificationsList");p(this,"store");p(this,"timeouts");p(this,"waitingQueue");p(this,"activeQueue");p(this,"options");p(this,"logger");p(this,"addToQueue",t=>{var s;if(this.store.has(t.id)){this.logger.debug({notification:t},"skip existed notification: %o");return}const n=t.close,a=t.action;if(this.store.set(t.id,{...t,close:(...o)=>{n&&n(...o),this.closeNotification(t.id)},action:(...o)=>{a&&a(...o),this.closeNotification(t.id,{animateHiding:!1})}}),this.waitingQueue.add(t.id),this.activeQueue.size===this.options.concurrency){const[o]=this.activeQueue;if(((s=this.store.get(o))==null?void 0:s.persistent)!==!0)this.closeNotification(o);else{const[r]=this.waitingQueue;this.waitingQueue.size>1&&this.closeNotification(r),this.tickWaitingQueue()}}else this.tickWaitingQueue()});p(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[t]=this.waitingQueue;if(!t)return;this.activeQueue.add(t),this.waitingQueue.delete(t),this.logger.debug({job:t},"waiting queue tick"),this.tickActiveQueue(t)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});p(this,"tickActiveQueue",t=>{if(!t)return;const n=this.store.get(t);if(!n){this.logger.debug({notificationId:t},"active queue tick skipped, notification not exist");return}de.emit("notification",{action:"received",payload:{questionId:n.data.questionId,questionType:n.data.questionType}});const a=setTimeout(()=>{const s=t,o=new Map(this.notificationsList.get());o.set(n.id,n),this.notificationsList.set(o);const r=setTimeout(()=>{this.logger.debug({notificationId:s,delay:n.autoHideDuration||5e3},"notification hiding by autoHideDuration"),this.closeNotification(s)},n.autoHideDuration||5e3);this.timeouts.set(s,r),this.logger.debug({notificationId:s,queue:[...o.values()]},"notification displayed")},n.delay||0);this.timeouts.set(t,a),this.logger.debug({notificationId:t},"active queue tick completed"),this.tickWaitingQueue()});p(this,"closeNotification",(t,{animateHiding:n=!0}={})=>{const a=new Map(this.notificationsList.get()),s=a.get(t);if(s){s.hiding=!(this.waitingQueue.size>=this.options.concurrency)&&n,this.notificationsList.set(a);const o=setTimeout(()=>{const r=new Map(this.notificationsList.get());r.delete(t),this.notificationsList.set(r);const c=this.timeouts.get(t);c!==void 0&&(clearTimeout(c),this.timeouts.delete(t)),this.logger.debug({notificationId:t},"notification hidden"),s.hiding&&de.emit("notification",{action:"closed",payload:{questionId:s.data.questionId,questionType:s.data.questionType}})},this.options.animationDelay||0);this.timeouts.set(t,o)}return this.store.delete(t),this.activeQueue.delete(t),this.waitingQueue.delete(t),this.tickWaitingQueue(),this.logger.debug({notificationId:t},"notification hiding"),s});p(this,"drain",()=>{this.store.clear(),this.timeouts.clear(),this.waitingQueue.clear(),this.activeQueue.clear(),this.notificationsList.off(),this.notificationsList.set(new Map)});this.options=t,this.logger=We("notifications"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.notificationsList=ie(new Map)}}var Cn;(function(e){e.OPENED="opened"})(Cn||(Cn={}));class Ck extends Bt{constructor(){super("notification");p(this,"setOpened",n=>{this.write(Cn.OPENED,n,"true")});p(this,"isOpened",n=>this.read(Cn.OPENED,n));p(this,"clearNotification",()=>{this.clear()})}}var Ze;(function(e){e[e.ONBOARDING=1]="ONBOARDING",e[e.QUESTION=2]="QUESTION",e[e.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(Ze||(Ze={}));class Dk{constructor(t={}){p(this,"queue");p(this,"storage");p(this,"isViewed",t=>this.storage.isOpened(t));p(this,"add",t=>{if(!this.isViewed(t.id)){if(t.data&&t.emitEvent){const n=t.action;t.action=(...a)=>{n&&n(...a),de.emit("notification",{action:"opened",payload:{questionId:t.data.questionId,questionType:t.data.questionType}})}}this.queue.addToQueue(t)}});p(this,"close",(t,{markAsViewed:n=!0,animateHiding:a}={})=>{this.queue.closeNotification(t,{animateHiding:a}),n&&this.markAsViewed(t)});p(this,"getActiveNotification",()=>{const t=this.queue.notificationsList.get();if(!(t!=null&&t.size))return null;for(const n of t.values())if(n.type===Ze.ONBOARDING)return n;return t.values().next().value});p(this,"getQueueStore",()=>this.queue.notificationsList);p(this,"markAsViewed",t=>{this.storage.setOpened(t)});this.storage=new Ck,this.queue=new Pk({concurrency:1,animationDelay:1600,...t})}}const Uk=(e,t,n)=>{e.notifications=new Dk(void 0),e.addNotification=e.notifications.add,e.sdk.getNotificationsStore=()=>e.notifications.getQueueStore(),e.sdk.getActiveNotification=()=>e.notifications.getActiveNotification(),e.sdk.onMount({name:"notifications"},()=>()=>{e.notifications.queue.drain()}),n()};var Xt;(function(e){e.UNKNOWN="unknown",e.ALREADY_VOTED="already_voted"})(Xt||(Xt={}));const Fk=async(e,t)=>{var o;const{client:n,createRequestOptions:a}=e.createPromiseClient(Ne,{method:"submitAnswer"}),s=a({retryAttempts:0});try{return await n.submitAnswer({data:t},{contextValues:s})}catch(r){throw((o=x.from(r))==null?void 0:o.code)===exports.Code.AlreadyExists?new Error(Xt.ALREADY_VOTED):new Error(Xt.UNKNOWN)}},Gk=(e,t)=>{const{client:n,createRequestOptions:a}=e.createPromiseClient(Ne,{method:"submitInplay"}),s=a({retryAttempts:0});return n.submitInplay({data:{eventId:+t}},{contextValues:s})};var Ot;(function(e){e.ONBOARDING="onboarding",e.ONBOARDING_IO="onboarding_io"})(Ot||(Ot={}));class Bk extends Bt{constructor(){super("gamification-session",window.sessionStorage);p(this,"writeValue",(n,a)=>{this.write(...n,a)});p(this,"readValue",n=>this.read(...n))}}class sc extends Bt{constructor(){super("gamification");p(this,"sessionStorage");p(this,"saveOnboardingStatus",({userId:n,eventId:a,organizationId:s},o)=>{this.write(Ot.ONBOARDING,s,n,a,o)});p(this,"getOnboardingStatus",({userId:n,eventId:a,organizationId:s})=>this.read(Ot.ONBOARDING,s,n,a));p(this,"setOnboardingInstantOpen",({userId:n,eventId:a,organizationId:s})=>{this.sessionStorage.writeValue([Ot.ONBOARDING_IO,s,n,a],"1")});p(this,"getOnboardingInstantOpen",({userId:n,eventId:a,organizationId:s})=>this.sessionStorage.readValue([Ot.ONBOARDING_IO,s,n,a]));this.sessionStorage=new Bk}}const Vk={pageSize:10},qk=(e,t,n,a,s)=>{let o=0;const r=ie({pageSize:Vk.pageSize,page:0}),c=Ee({data:[],key:Date.now(),hasMore:!0,loading:void 0,error:void 0}),l=gk(e),m=async()=>{var f;const y=t.get(),T=((f=a.getStore().get().data)==null?void 0:f.map(_=>_.slId))||[];if(y&&(T!=null&&T.length)){const _=n.get();_&&T.push(_),c.setKey("loading",!0),c.setKey("data",[]);const N=await l({eventId:y,usersIds:T});c.set({data:N.data.map((E,b)=>({...E.attributes,friendsRank:b+1})),hasMore:!1,key:Date.now(),loading:!1}),N.meta&&(o=Math.round(N.meta.count/N.meta.pageSize))}},u=()=>{m()},d=y=>{const T=r.get(),f=y||T.page+1;f<=o&&r.set({...T,page:f})};return jn(c,()=>{const y=t.listen(m),T=a.listen(m);return()=>{y(),T()}}),{$store:c,fetchMore:d,invalidate:u}};class xk extends Bt{constructor(){super("deep-link-context",window.sessionStorage);p(this,"get",this.read);p(this,"set",this.write);p(this,"del",this.remove)}}const tr="sldl",Jn="sldl_uid",oc="sldl_eid",rc="sldl_e_eid",Hk=new Set([Jn,oc,rc]),nr=e=>{const t={},n={};for(const[a,s]of e)Hk.has(a)?t[a]=s:n[a]=s;return{result:t,remain:n}},Qk=({hash:e,search:t})=>{if(e&&e.includes(tr)){const n=new URLSearchParams(e.substr(1));return{hash:nr(n)}}if(t&&t.includes(tr)){const n=new URLSearchParams(t);return{search:nr(n)}}return null},ar=We("deep_link"),Ce={debug:(...e)=>{ar.debug(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)},trace:(...e)=>{ar.trace(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)}},Yk=(e,t)=>{const{hash:n,search:a}=window.location;if(Ce.debug({hash:n,search:a},"get deep link data from"),n||a){const s=Qk({hash:n,search:a});if(Ce.debug(s,"parse deep link result"),s){const{hash:o,search:r}=s,{result:c,remain:l}=o||r;if(Object.keys(c).length!==0){e.setValue("data",c);const m=Object.keys(l).length!==0;if(o){let u="";m&&(u=`#${new URLSearchParams(l).toString()}`,Ce.debug({updatedHash:u},"update hash")),window.history.replaceState(null,"",window.location.pathname+window.location.search+u)}if(r){let u="";m&&(u=`?${new URLSearchParams(l).toString()}`,Ce.debug({updatedSearch:u},"update search")),window.history.replaceState(null,"",window.location.pathname+u+window.location.hash)}t(c)}}}e.setValue("parsed",!0)},jk=(e,t,n)=>{const a=new xk,s=a.get("sl-deep-link-store");let o={};if(s)try{o=JSON.parse(s)}catch(c){Ce.debug(c)}e.deepLink={$store:new pt(Ee(o),"deep-link-context"),getDeepLinkData:()=>{const{data:c,used:l}=e.deepLink.$store.getValues();return{data:c,used:l}},deepLinkUsed:c=>{Ce.debug(`logged in with inviterId: ${c}`),e.deepLink.$store.setValue("used",!0)},onDeepLinkHandlers:new Set},e.sdk.getInviter=()=>{const{data:c,used:l}=e.deepLink.getDeepLinkData();return l?c==null?void 0:c[Jn]:void 0},e.sdk.inviteDisplayed=()=>{e.deepLink.$store.getStore().set({}),e.deepLink.$store.getStore().off(),a.del("sl-deep-link-store")},e.deepLink.$store.subscribe(c=>a.set("sl-deep-link-store",JSON.stringify(c))),e.sdk.addDeepLinkHandler=c=>{localStorage.getItem("SL_DEBUG")&&Ce.trace("adding deep link handler"),e.deepLink.onDeepLinkHandlers.add(c)},t.onDeepLinkHandled&&e.sdk.addDeepLinkHandler(t.onDeepLinkHandled),e.sdk.removeDeepLinkHandler=c=>{Ce.trace("removing deep link handler"),e.deepLink.onDeepLinkHandlers.delete(c)};const r=c=>{e.deepLink.$store.setValue("handled",!0),Ce.trace({size:e.deepLink.onDeepLinkHandlers.size},"deep link handled, call callbacks");for(const l of e.deepLink.onDeepLinkHandlers)try{Ce.trace("called handler"),l(c)}catch(m){console.error(m)}};Yk(e.deepLink.$store,r),n()},$k=We("bypass");class Kk extends $g{constructor(n,a,s){super();p(this,"$coreStore");p(this,"deepLink");p(this,"transport");p(this,"bypassLogin");p(this,"me",async()=>{var n;return this.$coreStore.getValues().user.invalidate(),(n=await this.$coreStore.getValues().user.getValue())==null?void 0:n.data});p(this,"login",async(n,a)=>{var u,d,y;this.$coreStore.getValues().userKey.setValue(a);const{used:s,data:o}=this.deepLink.getDeepLinkData(),r=s?"":o==null?void 0:o[Jn];$k.debug({inviterKey:r},"login with inviterKey");const c=await this.bypassLogin({schema:n,userKey:a,inviterKey:r,init:!1}),l=(u=c.meta)==null?void 0:u.jwt,m=(d=c.data)==null?void 0:d.id;if(!l||!m)throw new Error("internal: token missing");return(y=c.meta)!=null&&y.inviterKey&&this.deepLink.deepLinkUsed(c.meta.inviterKey),this.$coreStore.getValues().user.getStore().mutate({data:c.data}),this.saveUser(l,m),l});p(this,"isAuthenticated",()=>this.me());p(this,"logout",()=>{this.$coreStore.getValues().user.setValue(),this.$coreStore.getValues().userKey.setValue(),this.$coreStore.getValues().userToken.setValue(),this.transport.setAuth("",""),new It().clear()});p(this,"softLogout",()=>{const n=new It;this.transport.setAuth("",""),n.setToken(""),this.reLogin()});p(this,"reLogin",()=>{const n=new It,a=n.getToken(),s=n.getExternalToken();if(this.$coreStore.getValues().userKey.setValue(s),a)return this.saveUser(a,""),this.me().then(o=>{if(o!=null&&o.id){const r=o.id;this.saveUser(a,r)}});if(s&&!a){const o=n.getSchema();o&&s&&this.login(o,s).catch(()=>{this.logout()})}});p(this,"saveUser",(n,a)=>{this.transport.setAuth(n,a),this.$coreStore.getValues().userToken.setValue(n),new It().setToken(n)});p(this,"connect",()=>{this.transport.registerInterceptor(n=>async a=>{try{return await n(a)}catch(s){throw s.code&&(s.code===7||s.code===16)&&this.transport.getHeader("authorization")&&this.softLogout(),s}})});this.$coreStore=n,this.deepLink=s,this.transport=a,this.bypassLogin=ik(this.transport),this.connect()}}const Ht=new It,Wk=(e,t,n)=>{e.auth=new Kk(e.store,e.transport,e.deepLink),e.stores.status.listen(a=>{a===qe.READY&&e.auth.reLogin()}),e.sdk.userId=e.stores.user.getAtomStore,e.sdk.authorizationBypass=async(a,s)=>{if(!(Ht.getSchema()===a&&Ht.getExternalToken()===s&&e.transport.getHeader("authorization")))try{await e.auth.login(a,s),Ht.setSchema(a),Ht.setExternalToken(s)}catch{e.sdk.logout()}},e.sdk.logout=()=>{e.auth.logout(),Ht.clear()},e.sdk.getUserStore=()=>e.stores.user.getStore(),e.sdk.isUserAuthorized=()=>e.auth.isAuthenticated(),n()},sr=We("video_player"),dn={debug:(...e)=>{sr.debug(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)},trace:(...e)=>{sr.trace(...e),localStorage.getItem("SL_DEBUG")&&console.log(...e)}},zk=(e,t,n)=>{e.videoPlayer={controllers:new Set},e.sdk.addVideoPlayerController=a=>{dn.trace("adding video player controller"),e.videoPlayer.controllers.add(a)},t.videoPlayerController&&e.sdk.addVideoPlayerController(t.videoPlayerController),e.sdk.removeVideoPlayerController=a=>{dn.trace("removing video player controller"),e.videoPlayer.controllers.delete(a)},e.sdk.controlVideoPlayer=a=>{dn.trace("controlling video player");for(const s of e.videoPlayer.controllers){dn.trace("calling video player controller");try{s(a)}catch(o){console.error(o)}}},n()},Jk={[P.FACTOID]:"insight",[P.POLL]:"poll",[P.TRIVIA]:"trivia",[P.PREDICTION]:"prediction",[P.TWEET]:"tweet"},Xk=(e,t,n)=>{e.sdk.uiState=Ee({}),e.ui={enableAppNotification:function(){e.sdk.uiState.setKey("appNotification",!0)},disableAppNotification:function(){e.sdk.uiState.get().app||e.sdk.uiState.setKey("appNotification",!1)},enableApp:function(){e.sdk.uiState.set({app:!0,appNotification:!0})},disableApp:function(){e.sdk.uiState.set({...e.sdk.uiState.get(),appNotification:!1,app:!1})}},t.onContentActivate&&(e.ui.onContentActivate=t.onContentActivate);const a=s=>{e.ui.onContentActivate&&e.ui.onContentActivate({...s,type:"advertisement"})};e.onQuestionActivate=({questionType:s,...o})=>{if(e.ui.onContentActivate){const r=o.type||s&&Jk[s]||"question";e.ui.onContentActivate({...o,type:r})}},e.sdk.onMount({name:"ui"},()=>{const s=c=>{var l,m;if(((l=c.slEventBus)==null?void 0:l.type)==="notification")switch(c.slEventBus.action){case"received":e.ui.enableAppNotification();break;case"closed":e.ui.disableAppNotification();break}if(((m=c.slEventBus)==null?void 0:m.type)==="advertisement"&&t.withAd){const u=c.slEventBus,{hasNotification:d,id:y,isViewed:T,type:f}=u.payload;switch(u.action){case"notification-opened":e.sdk.uiState.set({promotionExternalAd:f===he.EXTERNAL_AD,promotionBanner:!0,promotionNotification:!1,promotionOverlay:!0,promotionSidebar:!0});break;case"received":if(e.sdk.closeFeature(),a({stage:"activate",id:y,hasNotification:d,isViewed:T}),!t.withAdNotification){e.sdk.uiState.set({promotionBanner:!0,promotionOverlay:!0,promotionSidebar:!0,promotionExternalAd:f===he.EXTERNAL_AD});break}d?e.sdk.uiState.set({promotionNotification:!0}):e.sdk.uiState.set({promotionBanner:!0,promotionOverlay:!0,promotionSidebar:!0,promotionExternalAd:f===he.EXTERNAL_AD});break;case"closed":console.log("closed",u.payload),e.sdk.uiState.set({...e.sdk.uiState.get(),promotionNotification:!1,promotionBanner:!1,promotionOverlay:!1,promotionExternalAd:!1,promotionSidebar:!1}),a({stage:"deactivate",id:y,hasNotification:d,isViewed:T});break}}},o=de.listen(s),r=e.activeFeature.subscribe(c=>{c?e.ui.enableApp():e.ui.disableApp()});return()=>{o(),r()}}),n()},Zk=(e,t,n)=>{const a={onMountedFired:!1},s=new Map,o=new Map;e.sdk=Object.create(null),e.sdk.withAuth=!1,e.sdk.onMount=({name:r,clear:c},l)=>{var m,u;if(s.has(r)){const d=o.get(r);d&&d(),s.delete(r),o.delete(r)}s.set(r,{cb:l,clear:c}),((u=(m=e==null?void 0:e.stores)==null?void 0:m.enabled)==null?void 0:u.get())==="on"&&o.set(r,l())},e.ready=()=>{e.stores.enabled.subscribe(r=>{r==="on"&&a.onMountedFired===!1&&(s.forEach(({cb:c},l)=>o.set(l,c())),a.onMountedFired=!0),r!=="on"&&a.onMountedFired===!0&&(o.forEach(c=>c()),o.clear(),s.forEach(({clear:c},l)=>c&&s.delete(l)),a.onMountedFired=!1)})},e.sdk.initializeApp=async r=>{if(e.contextConfig=r,e.stores.enabled.get()==="on")return{enabled:!0};e.storeSubscribe(),e.stores.enabled.setValue("on"),e.stores.status.setValue(qe.INITIALIZATION);try{const c=await e.stores.organizationSettings.getValue();return c?(e.stores.status.setValue(qe.READY),{enabled:!!c}):(e.stores.status.setValue(qe.FAILED),{err:"failed"})}catch(c){return e.stores.enabled.setValue(),e.stores.status.setValue(qe.FAILED),{err:`${c}`}}},e.sdk.disableApp=()=>{e.stores.enabled.get()==="on"&&(e.stores.enabled.setValue(),e.stores.status.setValue(qe.DISABLED),e.stores.slStreamId.setValue(),e.stores.providerStreamId.setValue(),e.sdk.closeFeature(!0),e.storeUnsubscribe(),e.transport.disconnect())},e.sdk.createEventSession=r=>{e.stores.providerStreamId.setValue(r)},n()},eh=(e,t)=>{const{client:n,queryKey:a}=e.createPromiseClient(en,{method:"generateDeepLink",params:t});return e.nanoquery.createFetcherStore(a,{fetcher:async(s,o,r,c)=>{var l;if(!r)return{};try{return(l=(await n.generateDeepLink({data:{gamification:!0,externalEventId:c,eventId:r}})).data)==null?void 0:l.attributes}catch{return}},dedupeTime:1e3*60*60*24,refetchInterval:0})},th=(e,{web:t,mobile:n})=>{const{client:a}=e.createPromiseClient(Sg,{method:"generate"});return a.generate({web:t,mobile:n})},or=(e,t)=>{const n=new URLSearchParams(e);for(const[a,s]of Object.entries(t))n.append(a,s);return n.toString()},nh=(e,t,n,a)=>{const s=Ee({});return jn(s,()=>eh(e,[t,n]).subscribe(async({data:o,loading:r})=>{var y;const c=o===void 0&&r===!1?"https://streamlayer.io":o==null?void 0:o.url,l=a.get()||"",m=t.get()||"",u=n.get()||"",d={[Jn]:l,[oc]:m,[rc]:u};if(!r&&c){s.setKey("loading",!0);let T=window.location.search,f=window.location.hash;T&&f||f?T=`?${or(T,d)}`:f=`#${or("",d)}`;const _=window.location.origin+window.location.pathname+T+f;try{const N=await th(e,{web:_,mobile:c});s.set({data:(y=N.data)==null?void 0:y.link,loading:!1})}catch{s.set({loading:!1,error:"Failed to generate short link",data:void 0})}}else s.setKey("loading",!0)})),{$store:s,fetch}};var ne;(function(e){e.Unset="unset",e.Required="required",e.Optional="optional",e.Completed="completed",e.Disabled="disabled",e.Unavailable="unavailable"})(ne||(ne={}));const ah=(e,t,n,a)=>{const{inplayGame:s}=e.featureSettings.get(),o=t.getCurrentSessionId({prefix:"onboarding"});s&&n.add({type:Ze.ONBOARDING,id:o,action:e.openFeature,close:()=>{e.onboardingProcessed.set(!0)},persistent:!0,autoHideDuration:1e6,data:{questionId:"onboarding",questionType:P.UNSET,onboarding:{...s,instantOpen:!a.getOnboardingInstantOpen({userId:t.userId.get()||"",organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""})}}})},pn=(e,t,n,a,s,o)=>{var r,c,l;try{const m=t.userId.get();if(!m)return;if(s.getOnboardingStatus({userId:m,organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""})===ne.Completed){e.set(ne.Completed);for(const f of o)f();return}const u=(r=t.moderation.getStore().value)==null?void 0:r.data,d=n.featureSettings.get().inplayGame;if(u===void 0||d===void 0)return;const y=(c=u==null?void 0:u.options)==null?void 0:c.onboardingEnabled,T=(l=d==null?void 0:d.titleCard)==null?void 0:l.optIn;y?T?e.set(ne.Required):e.set(ne.Optional):(T?e.set(ne.Unavailable):e.set(ne.Disabled),a.close(t.getCurrentSessionId({prefix:"onboarding"}),{markAsViewed:!1}))}catch(m){console.error(m)}},sh=(e,t,n,a)=>{let s=!1;const o=new sc,r=ie(ne.Unset);r.subscribe(l=>{l!==ne.Unset&&(l===ne.Optional||l===ne.Required?s===!1&&(ah(e,t,a,o),s=!0):e.onboardingProcessed.set(!0),l===ne.Completed&&t.activeQuestionId.invalidate(),o.setOnboardingInstantOpen({userId:t.userId.get()||"",organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""}))});const c=[];return pn(r,t,e,a,o,c),r.get()!==ne.Completed&&(c.push(t.userId.listen(l=>{l&&pn(r,t,e,a,o,c)})),c.push(t.moderation.listen(l=>{l.data&&pn(r,t,e,a,o,c)})),c.push(e.featureSettings.listen(l=>{l&&pn(r,t,e,a,o,c)}))),{$store:r,submitInplay:async()=>{const l=t.slStreamId.get();if(l){await Gk(n,l),r.set(ne.Completed),o.saveOnboardingStatus({organizationId:t.organizationId.get()||"",userId:t.userId.get()||"",eventId:l},ne.Completed),de.emit("poll",{action:"onboardingPassed",payload:{}}),e.openFeature();const m=t.getCurrentSessionId({prefix:"onboarding"});a.close(m)}}}},oh=(e,t,n,a)=>{const s=Ee(void 0),o=nc(a),r=async()=>{var T,f;const l=e.get(),m=t.get(),u=(T=n.getStore().get().data)==null?void 0:T.map(_=>_.slId);if(!u)return;const d={eventId:l,userId:m,usersIds:[...u,m]},y=await o(d);s.set((f=y.data)==null?void 0:f.attributes)},c=()=>{r()};return jn(s,()=>{const l=e.listen(r),m=n.listen(r),u=t.listen(r);return()=>{l(),m(),u()}}),{$store:s,invalidate:c}},rh=async(e,t,n,a,s)=>{var u,d,y;const o=nc(s),r=e.get(),c=t.get(),l=((u=n.getStore().get().data)==null?void 0:u.map(T=>T.slId))||[],m={eventId:r,userId:a,usersIds:[...l,c]};return(y=(d=(await o(m)).data)==null?void 0:d.attributes)==null?void 0:y.summary},ih=new Set([P.POLL,P.PREDICTION,P.TRIVIA]);class ch extends Zi{constructor(n,a,s){super(n,a);p(this,"userSummary");p(this,"feedList");p(this,"friends");p(this,"leaderboardId");p(this,"leaderboardList");p(this,"deepLink");p(this,"onboardingStatus");p(this,"openedQuestion");p(this,"currentUserId");p(this,"openedUser");p(this,"closeFeature");p(this,"openFeature");p(this,"feedSubscription");p(this,"activeQuestionId");p(this,"openedQuestionId");p(this,"advertisement");p(this,"onboardingProcessed");p(this,"notifications");p(this,"transport");p(this,"background");p(this,"storage");p(this,"submitAnswerTimeout");p(this,"cancels",new Set);p(this,"onQuestionActivate");p(this,"checkInteractiveFlag",()=>{var c,l,m,u,d;const n=this.onboardingStatus.$store.get(),a=(m=(l=(c=this.background.moderation.getStore().value)==null?void 0:c.data)==null?void 0:l.options)==null?void 0:m.onboardingEnabled,s=(d=(u=this.settings.getValues().inplayGame)==null?void 0:u.titleCard)==null?void 0:d.optIn,o=n===ne.Completed,r=!a||o||s!==!0;this.background.interactiveAllowed.set(r?Tt.ALLOWED:Tt.DISALLOWED)});p(this,"connect",()=>{this.onboardingProcessed.subscribe(n=>{n&&this.advertisement.connect()}),this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-prediction-close",async n=>{var m,u,d,y,T,f,_,N,E,b,w;if(!this.isInteractiveAllowed)return;const a=(u=(m=n.data)==null?void 0:m.attributes)==null?void 0:u.question,s=(y=(d=n.data)==null?void 0:d.attributes)==null?void 0:y.feedItem;if(!a||!(s!=null&&s.attributes))return;const{status:o,type:r,id:c,answers:l}=a;if(o===oe.RESOLVED&&r===P.PREDICTION){const O=this.background.getCurrentSessionId({prefix:`notification-id:${c}`}),A=[...this.feedList.getValues().data||[]],L=A.findIndex(J=>J.id===c),v=A[L];let D=(_=(f=(T=v==null?void 0:v.attributes)==null?void 0:T.attributes)==null?void 0:f.value)==null?void 0:_.answerId;const j=za(c,this.transport),te=j.subscribe(()=>{});await j.get().promise;let $=j.get().data;$||($=await Nk(c,this.transport)),te(),window.requestAnimationFrame(()=>{j.invalidate()}),D||(D=(N=$==null?void 0:$.answers.find(({youVoted:J})=>J))==null?void 0:N.id);const K=l.find(({correct:J})=>J),G=D?l.find(({id:J})=>J===D):void 0,B=!!(G!=null&&G.correct);if(v&&((b=(E=A[L])==null?void 0:E.attributes)==null?void 0:b.attributes.case)==="question"){try{A[L].attributes.attributes.value.answerId=D,A[L].attributes.attributes.value.openForVoting=!1,D&&(A[L].attributes.attributes.value.status=B?Nt.WON:Nt.LOST)}catch{}this.feedList.getStore().mutate(A)}if(!G||!K)return;((w=this.openedQuestionId.get())==null?void 0:w.questionId)!==a.id&&this.notifications.add({type:Ze.QUESTION_RESOLVED,action:()=>this.openQuestion(a.id,s),close:()=>this.closeQuestion(c),autoHideDuration:B?15e3:12e3,id:O,emitEvent:!1,data:{questionId:c,questionType:P.PREDICTION,question:{title:B?`Congratulations! You answered correctly! You won ${K.points} pts!`:`Better luck next time! Correct: ${K==null?void 0:K.text}!`,votedAnswer:{title:G==null?void 0:G.text,points:G==null?void 0:G.points},correctAnswerTitle:K==null?void 0:K.text,correct:!!B,predictionResult:o===oe.RESOLVED,questionTitle:a==null?void 0:a.subject}}}),this.userSummary.invalidate()}})),this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list",n=>{var r,c,l,m,u;const a=[...((r=this.feedList.getStore().value)==null?void 0:r.data)||[]],s=(l=(c=n.data)==null?void 0:c.attributes)==null?void 0:l.feedItem,o=a.findIndex(d=>d.id===(s==null?void 0:s.id));if(s!=null&&s.attributes&&s.attributes.attributes.case!=="promotion"&&!(s.attributes.status!==oe.ACTIVE&&s.attributes.status!==oe.RESOLVED)){if(o!==-1)if(s.attributes.attributes.case==="question"&&((m=a[o].attributes)==null?void 0:m.attributes.case)==="question"){const d=a[o];d.attributes&&(a[o]={...a[o],attributes:{...d.attributes,attributes:{...d.attributes.attributes,value:{...d.attributes.attributes.value,...s.attributes.attributes.value,answerId:d.attributes.attributes.value.answerId,status:d.attributes.attributes.value.status,openForVoting:d.attributes.attributes.value.openForVoting}}}})}else{const d=a[o];d.attributes&&s.attributes&&(a[o]={...a[o],attributes:{...d.attributes,attributes:{...d.attributes.attributes,value:{...d.attributes.attributes.value,...s.attributes.attributes.value}}}})}o===-1&&(a.unshift(s),de.emit("poll",{action:"received",payload:{questionId:s.id,questionType:(u=s.attributes)==null?void 0:u.type}})),this.feedList.getStore().mutate(a)}}))});p(this,"disconnect",()=>{this.background.feedSubscription.removeListener("feed-subscription-prediction-close"),this.background.feedSubscription.removeListener("feed-subscription-questions-list")});p(this,"submitAnswer",async(n,a)=>{const s=za(n,this.transport),o=s.subscribe(()=>{}),r={...s.get().data||{}},c=()=>{var y;const l=this.feedList.getValues().data;if(!l)return;const m=l.findIndex(T=>T.id===n),u=l[m],d=((y=u==null?void 0:u.attributes)==null?void 0:y.attributes.case)==="question"&&u.attributes.attributes.value;if(d){de.emit("poll",{action:"voted",payload:{questionId:n,questionType:d.questionType}});const T=s.get().data;if(o(),T){const f=T.answers.find(b=>b.correct===!0),_=T.answers.findIndex(b=>b.id===a),N=T.answers[_],E=T.answers.every(({percentageDecimal:b},w)=>b===(r==null?void 0:r.answers[w].percentageDecimal));l[m].attributes.attributes.value.answerId=a,l[m].attributes.attributes.value.openForVoting=!1,l[m].attributes.attributes.value.text=(N==null?void 0:N.text)||"",f&&(l[m].attributes.attributes.value.status=f.id===a?Nt.WON:Nt.LOST),this.feedList.getStore().mutate([...l]),T.answers[_].correct=(f==null?void 0:f.id)===a,T.answers[_].youVoted=!0,E&&T.answers.forEach(b=>{b.percentageDecimal=0}),(f==null?void 0:f.id)===a&&(T.answers[_].pointsEarned=T.status===oe.RESOLVED?0:f.points),s.mutate({...T})}this.submitAnswerTimeout&&clearTimeout(this.submitAnswerTimeout),this.submitAnswerTimeout=setTimeout(()=>{this.userSummary.invalidate()},1e3)}};try{await Fk(this.transport,{questionId:n,answerId:a}),c()}catch(l){if(l.message===Xt.ALREADY_VOTED){this.userSummary.invalidate();const m=s.subscribe(()=>{});s.invalidate(),m()}throw l}});p(this,"openQuestion",(n,a)=>{var o,r,c,l;if(!n)return()=>{};this.notifications.close(this.background.getCurrentSessionId({prefix:"notification",entity:n}),{animateHiding:!1});let s=(o=a==null?void 0:a.attributes)==null?void 0:o.type;return s||(s=(l=(c=(((r=this.feedList.getStore().value)==null?void 0:r.data)||[]).find(m=>m.id===n))==null?void 0:c.attributes)==null?void 0:l.type),de.emit("poll",{action:"opened",payload:{questionId:n,questionType:s,questionOpenedFrom:a==null?void 0:a.openedFrom}}),this.background.openQuestion(n,a)});p(this,"getFeedItem",n=>_k(n,this.transport));p(this,"isOpenedQuestion",n=>!!this.notifications.isViewed(n));p(this,"closeQuestion",n=>(n&&this.onQuestionActivate({stage:"deactivate",id:n,isViewed:!!this.notifications.isViewed(this.background.getCurrentSessionId({prefix:"notification",entity:n}))}),this.background.closeQuestion(n)));p(this,"openUser",async n=>{var o,r;const a=(o=this.leaderboardList.$store.get().data)==null?void 0:o.find(c=>c.userId===n);if(!a){this.openedUser.set(a);return}if(a.summaryLoaded){this.openedUser.set(a);return}const s={...a};try{const c=await rh(this.background.slStreamId,this.background.userId,this.friends,n,this.transport);(c==null?void 0:c.inTop)!==void 0&&(this.leaderboardList.$store.setKey("data",(r=this.leaderboardList.$store.get().data)==null?void 0:r.map(l=>(l.userId===n&&(l.inTop=c.inTop),l))),s.inTop=c.inTop)}catch(c){console.error(c)}this.openedUser.set(s)});p(this,"closeUser",()=>{this.openedUser.set(void 0)});p(this,"showInApp",n=>{var s,o,r,c,l,m,u,d,y,T,f,_,N,E;const a=this.onboardingStatus.$store.get();if(n&&n.data&&a&&a!==ne.Unset&&((s=n.data.question)==null?void 0:s.id)!==void 0&&n.data.question.notification!==void 0&&((r=(o=n.data.question)==null?void 0:o.bypassNotifications)==null?void 0:r.inAppSilence)!==li.ON&&n.data.question.status===oe.ACTIVE&&!n.data.question.marketClosed){if(ih.has(n.data.question.type))this.isInteractiveAllowed&&this.notifications.add({type:Ze.QUESTION,action:()=>{var b,w,O;return this.openQuestion((w=(b=n.data)==null?void 0:b.question)==null?void 0:w.id,(O=n.data)==null?void 0:O.feedItem)},close:()=>{var b,w;return this.closeQuestion((w=(b=n.data)==null?void 0:b.question)==null?void 0:w.id)},autoHideDuration:1e3*60,id:this.background.getCurrentSessionId({prefix:"notification",entity:n.data.question.id}),emitEvent:!0,data:{questionId:n.data.question.id,questionType:n.data.question.type,question:{title:n.data.question.notification.title}}});else if(n.data.question.type===P.FACTOID){const b=(c=n.data.question.options)==null?void 0:c.options.value,w={heading:n.data.question.notification.title,body:n.data.question.notification.body,imageMode:b==null?void 0:b.imageMode,image:b==null?void 0:b.image,video:{id:((l=b==null?void 0:b.video)==null?void 0:l.id)||"",url:((m=b==null?void 0:b.video)==null?void 0:m.url)||"",thumbnailUrl:((u=b==null?void 0:b.video)==null?void 0:u.thumbnailUrl)||""},webLink:{label:"",url:""}};this.notifications.add({type:Ze.QUESTION,action:()=>{var O,A,L;return this.openQuestion((A=(O=n==null?void 0:n.data)==null?void 0:O.question)==null?void 0:A.id,(L=n==null?void 0:n.data)==null?void 0:L.feedItem)},close:()=>{var O,A;return this.closeQuestion((A=(O=n==null?void 0:n.data)==null?void 0:O.question)==null?void 0:A.id)},autoHideDuration:1e3*120,emitEvent:!0,id:this.background.getCurrentSessionId({prefix:"notification",entity:n.data.question.id}),data:{questionId:n.data.question.id,questionType:n.data.question.type,insight:w}})}else if(n.data.question.type===P.TWEET){const b=(d=n.data.question.options)==null?void 0:d.options.value,w={title:(y=n.data.question.notification)==null?void 0:y.title,body:(T=n.data.question.notification)==null?void 0:T.body,image:(f=n.data.question.notification)==null?void 0:f.image,account:((_=b==null?void 0:b.tweetMeta)==null?void 0:_.account)||"",accountVerified:!!((N=b==null?void 0:b.tweetMeta)!=null&&N.accountVerified),tweet:(E=b==null?void 0:b.tweetMeta)==null?void 0:E.tweet,tweetId:n.data.question.id};this.notifications.add({type:Ze.QUESTION,action:()=>{var O,A,L;return this.openQuestion((A=(O=n.data)==null?void 0:O.question)==null?void 0:A.id,(L=n.data)==null?void 0:L.feedItem)},close:()=>{var O,A;return this.closeQuestion((A=(O=n.data)==null?void 0:O.question)==null?void 0:A.id)},autoHideDuration:1e3*120,emitEvent:!0,id:this.background.getCurrentSessionId({prefix:"notification",entity:n.data.question.id}),data:{questionId:n.data.question.id,questionType:n.data.question.type,tweet:w}})}}});this.background=new Mk(s),this.advertisement=this.background.advertisement,this.onQuestionActivate=s.onQuestionActivate,this.feedSubscription=this.background.feedSubscription,this.activeQuestionId=this.background.activeQuestionId,this.openedQuestionId=this.background.openedQuestionId,this.storage=new sc,this.feedList=this.background.feedList,this.friends=new Ue(kk(this.background.userId,s.transport),"gamification:friends"),this.currentUserId=this.background.userId,this.openedUser=ie(void 0),this.onboardingProcessed=ie(!s.sdk.withAuth),this.leaderboardId=new be(ie(this.settings.getValue("pinnedLeaderboardId")),"pinnedLeaderboardId").getStore(),this.onboardingStatus=sh(this,this.background,s.transport,s.notifications),this.notifications=s.notifications,this.transport=s.transport,this.closeFeature=(o=!0)=>s.sdk.closeFeature(o),this.openFeature=()=>s.sdk.openFeature(H.GAMES),this.openedQuestion=this.background.openedQuestion,this.deepLink=nh(this.transport,this.background.slStreamId,s.stores.providerStreamId.getStore(),this.background.userId),this.userSummary=oh(this.background.slStreamId,this.background.userId,this.friends,this.transport),this.leaderboardList=qk(this.transport,this.background.slStreamId,this.background.userId,this.friends),this.connect(),this.cancels.add(this.userSummary.$store.listen((o,r)=>{r!=null&&r.summary&&(o!=null&&o.summary)&&this.leaderboardList.invalidate()})),this.cancels.add(this.onboardingStatus.$store.listen(this.checkInteractiveFlag)),this.cancels.add(this.background.moderation.getStore().listen(this.checkInteractiveFlag)),this.cancels.add(this.settings.subscribe(this.checkInteractiveFlag)),this.cancels.add(this.onboardingStatus.$store.listen((o,r)=>{(r===void 0||o!==ne.Unset)&&this.background.activeQuestionId.invalidate()})),this.background.activeQuestionId.listen(this.showInApp),s.sdk.onMount({name:"gamification",clear:!0},()=>()=>{for(const o of this.cancels)o(),this.cancels.delete(o)})}get isInteractiveAllowed(){return this.background.interactiveAllowed.get()===Tt.ALLOWED}}const lh={[H.GAMES]:!0};class mh extends Zi{constructor(t,n){super(t,n)}}const uh=(e,t,n)=>e.type===H.GAMES?new ch(e,t,n):new mh(e,t),dh=(e,t,n)=>{e.features=new Map,e.sdk.featuresList=new be(ie(new Set),"features-list"),e.activeFeature=new be(ie(H.UNSET),"activeFeature"),e.sdk.getFeatures=()=>e.features,e.sdk.getFeature=a=>e.features.get(a),e.sdk.getActiveFeature=()=>e.activeFeature.getStore(),e.sdk.openFeature=a=>{e.activeFeature.setValue(a)},e.sdk.closeFeature=(a=!1)=>{const s=e.activeFeature.getValue();if(e.activeFeature.setValue(H.UNSET),a&&s){e.features.delete(s);const o=e.sdk.featuresList.getValue();o&&o.delete(s),e.sdk.featuresList.setValue(o)}},e.initFeature=(a,s=Ve.ORGANIZATION)=>{if(a.type in lh&&!e.features.has(a.type)){const o=uh(a,s,e);e.features.set(a.type,o);let r=e.sdk.featuresList.getValue();r?r.add(a.type):r=new Set([a.type]),e.sdk.featuresList.setValue(new Set(r))}},e.updateFeature=(a,s)=>{var o;(o=e.features.get(a.type))==null||o.update(a,s)},e.destroyFeature=a=>{e.features.delete(a.type);const s=e.sdk.featuresList.getValue();s&&s.delete(a.type),e.sdk.featuresList.setValue(new Set(s))},e.reinitializeFeatures=async()=>{const a=await e.stores.organizationSettings.getValue();e.features.clear(),e.sdk.featuresList.setValue(new Set);for(const s of(a==null?void 0:a.overlays)||[])e.initFeature(s,Ve.ORGANIZATION)},e.stores.providerStreamId.listen(a=>{a||e.reinitializeFeatures()}),e.storeSubscribe=()=>{const a=(o,r)=>{var c;if(r!=null&&r.overlays&&!((c=e.contextConfig)!=null&&c.skipOrganizationSettings&&o===Ve.ORGANIZATION))for(const l of r.overlays)l.sdkEnable===!0&&(e.features.has(l.type)?e.updateFeature(l,o):e.initFeature(l,o))},s={organizationSettings:o=>{if(o.data)try{a(Ve.ORGANIZATION,o.data)}catch(r){console.log(r)}},streamSettings:o=>{if(o.data)try{a(Ve.STREAM,o.data)}catch(r){console.log(r)}}};e.store.subscribe(s)},n()};class ph{constructor(t){p(this,"analytics");p(this,"accepted",()=>{this.analytics.write("invitation",{common:{...this.analytics.commonStore.getValues(),kind:re.INVITATION_ACCEPTED},category:Ba.GAMES,from:Mn.UNSET})});p(this,"sent",({from:t})=>{this.analytics.write("invitation",{common:{...this.analytics.commonStore.getValues(),kind:re.INVITATION_SENT},category:Ba.GAMES,from:t||Mn.UNSET})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="invitation")switch(a.slEventBus.action){case"sent":this.sent(a.slEventBus.payload);break}};return de.listen(n)})}}class Th{constructor(t){p(this,"analytics");p(this,"tap",()=>{this.analytics.write("interactions",{common:{...this.analytics.commonStore.getValues(),kind:re.INTERACTIONS},actionType:Ya.TAP})});p(this,"scroll",()=>{this.analytics.write("interactions",{common:{...this.analytics.commonStore.getValues(),kind:re.INTERACTIONS},actionType:Ya.SCROLL})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="interactions")switch(a.slEventBus.action){case"tap":this.tap();break;case"scroll":this.scroll();break}};return de.listen(n)})}}const yh={[he.UNSET]:Re.UNSET,[he.INGAME_IAB21]:Re.PROMOTION_INGAME_IAB21,[he.INGAME_IAB11_LBAR]:Re.PROMOTION_INGAME_IAB11_LBAR,[he.INGAME_IAB11]:Re.PROMOTION_INGAME_IAB11,[he.INGAME_IAB21_LBAR]:Re.PROMOTION_INGAME_IAB21_LBAR,[he.INGAME_IAB61]:Re.PROMOTION_INGAME_IAB61,[he.EXTERNAL_AD]:Re.PROMOTION_GAM};class fh{constructor(t){p(this,"analytics");p(this,"received",({id:t},{topicSubType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.POLLS_RECEIVED,topicId:t,topicType:ae.POLLS_PROMOTION,topicSubType:n},pollOpenedFrom:_e.UNSET})});p(this,"opened",({id:t},{topicSubType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.POLLS_OPENED,topicId:t,topicType:ae.POLLS_PROMOTION,topicSubType:n},pollOpenedFrom:_e.UNSET})});p(this,"videoPlay",({id:t},{topicSubType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),topicId:t,kind:re.AD_VIDEO_PLAYED,topicType:ae.POLLS_PROMOTION,topicSubType:n},pollOpenedFrom:_e.UNSET})});p(this,"buttonSelect",({id:t},{topicSubType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),topicId:t,kind:re.AD_BUTTON_NAVIGATED,topicType:ae.POLLS_PROMOTION,topicSubType:n},pollOpenedFrom:_e.UNSET})});p(this,"bannerSelect",({id:t},{topicSubType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),topicId:t,kind:re.AD_BANNER_NAVIGATED,topicType:ae.POLLS_PROMOTION,topicSubType:n},pollOpenedFrom:_e.UNSET})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s,o;if(!((s=a.slEventBus)!=null&&s.skipAnalytics)&&((o=a.slEventBus)==null?void 0:o.type)==="advertisement"){const r=a.slEventBus.payload.type?yh[a.slEventBus.payload.type]:Re.UNSET;switch(a.slEventBus.action){case"videoPlay":this.videoPlay(a.slEventBus.payload,{topicSubType:r});break;case"buttonSelect":this.buttonSelect(a.slEventBus.payload,{topicSubType:r});break;case"bannerSelect":this.bannerSelect(a.slEventBus.payload,{topicSubType:r});break;case"received":this.received(a.slEventBus.payload,{topicSubType:r});break;case"opened":this.opened(a.slEventBus.payload,{topicSubType:r});break}}};return de.listen(n)})}}const Kt={[P.UNSET]:ae.UNSET,[P.FACTOID]:ae.POLLS_INSIGHT,[P.POLL]:ae.POLLS_POLL,[P.PREDICTION]:ae.POLLS_PREDICTION,[P.PROMOTION]:ae.POLLS_PROMOTION,[P.TRIVIA]:ae.POLLS_TRIVIA,[P.TWEET]:ae.POLLS_TWITTER};P.UNSET+"",Le.UNSET,P.FACTOID+"",Le.POLLS,P.POLL+"",Le.POLLS,P.PREDICTION+"",Le.POLLS,P.PROMOTION+"",Le.POLLS,P.TRIVIA+"",Le.POLLS,P.TWEET+"",Le.POLLS;const gh={[H.UNSET]:me.UNSET,[H.INPLAY]:me.INPLAY,[H.MESSAGING]:me.MESSAGING,[H.STATISTICS]:me.STATS,[H.BETTING]:me.BETTING,[H.TWITTER]:me.TWITTER,[H.MERCHANDISE]:me.MERCHANDISE,[H.CONTESTS]:me.CONTESTS,[H.VOICE_CHAT]:me.CALLING,[H.TICKETS]:me.TICKETS,[H.WHOIS_WATCHING]:me.WHOISWATCHING,[H.PROFILE]:me.PROFILE,[H.GAMES]:me.POLLS,[H.GOLF_STATISTICS]:me.STATS,[H.HIGHLIGHTS]:me.HIGHLIGHTS,[H.PUBLIC_CHAT]:me.PUBLIC_CHAT};class kh{constructor(t){p(this,"analytics");p(this,"received",({questionId:t,questionType:n})=>{this.analytics.write("notification",{common:{...this.analytics.commonStore.getValues(),kind:re.NOTIFICATION_RECEIVED,topicId:t,topicType:n?Kt[n]:ae.UNSET},notificationKind:Le.POLLS,notificationType:ja.IN_APP})});p(this,"opened",({questionId:t,questionType:n})=>{this.analytics.write("notification",{common:{...this.analytics.commonStore.getValues(),kind:re.NOTIFICATION_OPENED,topicId:t,topicType:n?Kt[n]:ae.UNSET},notificationKind:Le.POLLS,notificationType:ja.IN_APP})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="notification")switch(a.slEventBus.action){case"rendered":this.received(a.slEventBus.payload);break;case"opened":this.opened(a.slEventBus.payload);break}};return de.listen(n)})}}class hh{constructor(t){p(this,"analytics");p(this,"received",({questionId:t,questionType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.POLLS_RECEIVED,topicId:t,topicType:n?Kt[n]:ae.UNSET},pollOpenedFrom:_e.UNSET})});p(this,"opened",({questionId:t,questionType:n,questionOpenedFrom:a})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.POLLS_OPENED,topicId:t,topicType:n?Kt[n]:ae.UNSET},pollOpenedFrom:a==="list"?_e.PICK_HISTORY:_e.IN_APP})});p(this,"voted",({questionId:t,questionType:n})=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.POLLS_VOTE,topicId:t,topicType:n?Kt[n]:ae.UNSET},pollOpenedFrom:_e.UNSET})});p(this,"onboardingPassed",()=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.GAMES_JOINED},pollOpenedFrom:_e.UNSET})});p(this,"navigated",()=>{this.analytics.write("games",{common:{...this.analytics.commonStore.getValues(),kind:re.POLLS_NAVIGATED},pollOpenedFrom:_e.UNSET})});this.analytics=t,this.analytics.onConnect(()=>{const n=a=>{var s;if(((s=a.slEventBus)==null?void 0:s.type)==="poll")switch(a.slEventBus.action){case"voted":this.voted(a.slEventBus.payload);break;case"navigated":this.navigated();break;case"onboardingPassed":this.onboardingPassed();break;case"received":this.received(a.slEventBus.payload);break;case"opened":this.opened(a.slEventBus.payload);break}};return de.listen(n)})}}const Sh=({transport:e,$commonStore:t})=>{let n;const a=ie(!1),s=5e3,{client:o,queryKey:r}=e.createPromiseClient(Ki,{method:"send",params:[a]}),c=e.nanoquery.createFetcherStore(r,{fetcher:async()=>{const d=t.getStore().get();try{await o.unary({message:{case:"heartbeat",value:{common:{...d,kind:re.SESSION_HEARTBEAT}}}})}catch(y){xe.error(y,"send heartbeat failed")}return Date.now()},refetchInterval:s}),l=()=>{xe.debug("mounted heartbeat"),n=c.subscribe(()=>{})},m=()=>{xe.debug("enabled heartbeat"),a.set(!0),c.lc===0&&l()},u=()=>{xe.debug("disabled heartbeat"),a.set(!1)};return{enable:m,disable:u,mount:l,unmount:()=>{xe.debug("unmounted heartbeat"),c.off(),n==null||n(),n=void 0,u()}}},xe=We("analytics");class _h{constructor(t){p(this,"commonStore");p(this,"notifications");p(this,"polls");p(this,"invitation");p(this,"interactions");p(this,"advertisement");p(this,"heartbeat");p(this,"analyticsClient");p(this,"listeners");p(this,"listenersCancels");p(this,"connected",!1);p(this,"connect",()=>{this.writeCommon("sessionId",qa()),this.heartbeat.enable(),this.listeners.forEach(t=>this.listenersCancels.add(t())),this.connected=!0,xe.debug("analytics connected")});p(this,"disconnect",()=>{this.writeCommon("sessionId",""),this.writeCommon("overlaySessionId",""),this.heartbeat.unmount(),this.listenersCancels.forEach(t=>t()),this.connected=!1,xe.debug("analytics disconnected")});p(this,"write",(t,n)=>{n&&this.analyticsClient.unary({message:{case:t,value:n}}).then(()=>{xe.trace("send analytics success",t,n)}).catch(a=>{xe.error(a,"send analytics failed")})});p(this,"writeCommon",(t,n)=>{this.commonStore.setValue(t,n)});p(this,"onConnect",t=>{this.listeners.add(t),this.connected&&this.listenersCancels.add(t())});p(this,"connectToSDK",t=>{this.onConnect(()=>t.stores.slStreamId.getAtomStore().subscribe(n=>{this.writeCommon("eventId",n)})),this.onConnect(()=>t.sdk.getActiveFeature().subscribe(n=>{n&&this.writeCommon("category",gh[n]),n!==H.UNSET?this.writeCommon("overlaySessionId",qa()):this.writeCommon("overlaySessionId","")})),this.onConnect(()=>{const n=window.matchMedia("(orientation: portrait)"),a=s=>{this.writeCommon("screenOrientation",s.matches?Ga.PORTRAIT:Ga.LANDSCAPE)};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a)}}),this.onConnect(()=>t.deepLink.$store.subscribe(n=>{n!=null&&n.handled&&this.invitation.accepted()}))});this.listeners=new Set,this.listenersCancels=new Set,this.commonStore=new pt(Ee({}),"common-analytics"),this.connectToSDK(t),this.heartbeat=Sh({transport:t.analyticsTransport,$commonStore:this.commonStore}),this.notifications=new kh(this),this.polls=new hh(this),this.invitation=new ph(this),this.interactions=new Th(this),this.advertisement=new fh(this);const{client:n}=t.analyticsTransport.createPromiseClient(Ki,{method:"send"});this.analyticsClient=n}}const Eh=(e,t,n)=>{e.analytics=new _h(e),e.sdk.onMount({name:"analytics"},()=>(e.analytics.connect(),()=>{e.analytics.disconnect()})),n()};var vs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Qa<"u"?Qa:typeof self<"u"?self:{};function bh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var As={exports:{}},ws={exports:{}};function Nh(e){var t=new e,n=t;function a(){var o=t;return o.next?t=o.next:(t=new e,n=t),o.next=null,o}function s(o){n.next=o,n=o}return{get:a,release:s}}var Ih=Nh,Oh=Ih;function ic(e,t,n){if(typeof e=="function"&&(n=t,t=e,e=null),!(n>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var a=Oh(vh),s=null,o=null,r=0,c=null,l={push:_,drain:Se,saturated:Se,pause:u,paused:!1,get concurrency(){return n},set concurrency(A){if(!(A>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(n=A,!l.paused)for(;s&&r<n;)r++,E()},running:m,resume:T,idle:f,length:d,getQueue:y,unshift:N,empty:Se,kill:b,killAndDrain:w,error:O};return l;function m(){return r}function u(){l.paused=!0}function d(){for(var A=s,L=0;A;)A=A.next,L++;return L}function y(){for(var A=s,L=[];A;)L.push(A.value),A=A.next;return L}function T(){if(l.paused){if(l.paused=!1,s===null){r++,E();return}for(;s&&r<n;)r++,E()}}function f(){return r===0&&l.length()===0}function _(A,L){var v=a.get();v.context=e,v.release=E,v.value=A,v.callback=L||Se,v.errorHandler=c,r>=n||l.paused?o?(o.next=v,o=v):(s=v,o=v,l.saturated()):(r++,t.call(e,v.value,v.worked))}function N(A,L){var v=a.get();v.context=e,v.release=E,v.value=A,v.callback=L||Se,v.errorHandler=c,r>=n||l.paused?s?(v.next=s,s=v):(s=v,o=v,l.saturated()):(r++,t.call(e,v.value,v.worked))}function E(A){A&&a.release(A);var L=s;L&&r<=n?l.paused?r--:(o===s&&(o=null),s=L.next,L.next=null,t.call(e,L.value,L.worked),o===null&&l.empty()):--r===0&&l.drain()}function b(){s=null,o=null,l.drain=Se}function w(){s=null,o=null,l.drain(),l.drain=Se}function O(A){c=A}}function Se(){}function vh(){this.value=null,this.callback=Se,this.next=null,this.release=Se,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var a=e.callback,s=e.errorHandler,o=e.value;e.value=null,e.callback=Se,e.errorHandler&&s(t,o),a.call(e.context,t,n),e.release(e)}}function Ah(e,t,n){typeof e=="function"&&(n=t,t=e,e=null);function a(u,d){t.call(this,u).then(function(y){d(null,y)},d)}var s=ic(e,a,n),o=s.push,r=s.unshift;return s.push=c,s.unshift=l,s.drained=m,s;function c(u){var d=new Promise(function(y,T){o(u,function(f,_){if(f){T(f);return}y(_)})});return d.catch(Se),d}function l(u){var d=new Promise(function(y,T){r(u,function(f,_){if(f){T(f);return}y(_)})});return d.catch(Se),d}function m(){if(s.idle())return new Promise(function(y){y()});var u=s.drain,d=new Promise(function(y){s.drain=function(){u(),y()}});return d}}ws.exports=ic;ws.exports.promise=Ah;var cc=ws.exports,Rs={exports:{}},Lt=typeof Reflect=="object"?Reflect:null,rr=Lt&&typeof Lt.apply=="function"?Lt.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},_n;Lt&&typeof Lt.ownKeys=="function"?_n=Lt.ownKeys:Object.getOwnPropertySymbols?_n=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:_n=function(e){return Object.getOwnPropertyNames(e)};function wh(e){console&&console.warn&&console.warn(e)}var lc=Number.isNaN||function(e){return e!==e};function Y(){Y.init.call(this)}Rs.exports=Y;Rs.exports.once=Ph;Y.EventEmitter=Y;Y.prototype._events=void 0;Y.prototype._eventsCount=0;Y.prototype._maxListeners=void 0;var ir=10;function Xn(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Y,"defaultMaxListeners",{enumerable:!0,get:function(){return ir},set:function(e){if(typeof e!="number"||e<0||lc(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");ir=e}});Y.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Y.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||lc(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function mc(e){return e._maxListeners===void 0?Y.defaultMaxListeners:e._maxListeners}Y.prototype.getMaxListeners=function(){return mc(this)};Y.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var a=e==="error",s=this._events;if(s!==void 0)a=a&&s.error===void 0;else if(!a)return!1;if(a){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var r=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw r.context=o,r}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")rr(c,this,t);else for(var l=c.length,m=yc(c,l),n=0;n<l;++n)rr(m[n],this,t);return!0};function uc(e,t,n,a){var s,o,r;if(Xn(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),r=o[t]),r===void 0)r=o[t]=n,++e._eventsCount;else if(typeof r=="function"?r=o[t]=a?[n,r]:[r,n]:a?r.unshift(n):r.push(n),s=mc(e),s>0&&r.length>s&&!r.warned){r.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=r.length,wh(c)}return e}Y.prototype.addListener=function(e,t){return uc(this,e,t,!1)};Y.prototype.on=Y.prototype.addListener;Y.prototype.prependListener=function(e,t){return uc(this,e,t,!0)};function Rh(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function dc(e,t,n){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=Rh.bind(a);return s.listener=n,a.wrapFn=s,s}Y.prototype.once=function(e,t){return Xn(t),this.on(e,dc(this,e,t)),this};Y.prototype.prependOnceListener=function(e,t){return Xn(t),this.prependListener(e,dc(this,e,t)),this};Y.prototype.removeListener=function(e,t){var n,a,s,o,r;if(Xn(t),a=this._events,a===void 0)return this;if(n=a[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){r=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():Lh(n,s),n.length===1&&(a[e]=n[0]),a.removeListener!==void 0&&this.emit("removeListener",e,r||t)}return this};Y.prototype.off=Y.prototype.removeListener;Y.prototype.removeAllListeners=function(e){var t,n,a;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(a=0;a<s.length;++a)o=s[a],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(a=t.length-1;a>=0;a--)this.removeListener(e,t[a]);return this};function pc(e,t,n){var a=e._events;if(a===void 0)return[];var s=a[t];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?Mh(s):yc(s,s.length)}Y.prototype.listeners=function(e){return pc(this,e,!0)};Y.prototype.rawListeners=function(e){return pc(this,e,!1)};Y.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Tc.call(e,t)};Y.prototype.listenerCount=Tc;function Tc(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Y.prototype.eventNames=function(){return this._eventsCount>0?_n(this._events):[]};function yc(e,t){for(var n=new Array(t),a=0;a<t;++a)n[a]=e[a];return n}function Lh(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Mh(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function Ph(e,t){return new Promise(function(n,a){function s(r){e.removeListener(t,o),a(r)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",s),n([].slice.call(arguments))}fc(e,t,o,{once:!0}),t!=="error"&&Ch(e,s,{once:!0})})}function Ch(e,t,n){typeof e.on=="function"&&fc(e,"error",t,n)}function fc(e,t,n,a){if(typeof e.on=="function")a.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function s(o){a.once&&e.removeEventListener(t,s),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var gc=Rs.exports,Zn={},kc={},hc=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[t]=a;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==a||o.enumerable!==!0)return!1}return!0},Dh=hc,ea=function(){return Dh()&&!!Symbol.toStringTag},Uh=Error,Fh=EvalError,Gh=RangeError,Bh=ReferenceError,Sc=SyntaxError,ta=TypeError,Vh=URIError,cr=typeof Symbol<"u"&&Symbol,qh=hc,xh=function(){return typeof cr!="function"||typeof Symbol!="function"||typeof cr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:qh()},fa={__proto__:null,foo:{}},Hh=Object,Qh=function(){return{__proto__:fa}.foo===fa.foo&&!(fa instanceof Hh)},Yh="Function.prototype.bind called on incompatible ",jh=Object.prototype.toString,$h=Math.max,Kh="[object Function]",lr=function(e,t){for(var n=[],a=0;a<e.length;a+=1)n[a]=e[a];for(var s=0;s<t.length;s+=1)n[s+e.length]=t[s];return n},Wh=function(e,t){for(var n=[],a=t,s=0;a<e.length;a+=1,s+=1)n[s]=e[a];return n},zh=function(e,t){for(var n="",a=0;a<e.length;a+=1)n+=e[a],a+1<e.length&&(n+=t);return n},Jh=function(e){var t=this;if(typeof t!="function"||jh.apply(t)!==Kh)throw new TypeError(Yh+t);for(var n=Wh(arguments,1),a,s=function(){if(this instanceof a){var m=t.apply(this,lr(n,arguments));return Object(m)===m?m:this}return t.apply(e,lr(n,arguments))},o=$h(0,t.length-n.length),r=[],c=0;c<o;c++)r[c]="$"+c;if(a=Function("binder","return function ("+zh(r,",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var l=function(){};l.prototype=t.prototype,a.prototype=new l,l.prototype=null}return a},Xh=Jh,Ls=Function.prototype.bind||Xh,Zh=Function.prototype.call,eS=Object.prototype.hasOwnProperty,tS=Ls,nS=tS.call(Zh,eS),F,aS=Uh,sS=Fh,oS=Gh,rS=Bh,Ut=Sc,Mt=ta,iS=Vh,_c=Function,ga=function(e){try{return _c('"use strict"; return ('+e+").constructor;")()}catch{}},yt=Object.getOwnPropertyDescriptor;if(yt)try{yt({},"")}catch{yt=null}var ka=function(){throw new Mt},cS=yt?function(){try{return arguments.callee,ka}catch{try{return yt(arguments,"callee").get}catch{return ka}}}():ka,_t=xh(),lS=Qh(),se=Object.getPrototypeOf||(lS?function(e){return e.__proto__}:null),bt={},mS=typeof Uint8Array>"u"||!se?F:se(Uint8Array),ft={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?F:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?F:ArrayBuffer,"%ArrayIteratorPrototype%":_t&&se?se([][Symbol.iterator]()):F,"%AsyncFromSyncIteratorPrototype%":F,"%AsyncFunction%":bt,"%AsyncGenerator%":bt,"%AsyncGeneratorFunction%":bt,"%AsyncIteratorPrototype%":bt,"%Atomics%":typeof Atomics>"u"?F:Atomics,"%BigInt%":typeof BigInt>"u"?F:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?F:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?F:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?F:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":aS,"%eval%":eval,"%EvalError%":sS,"%Float32Array%":typeof Float32Array>"u"?F:Float32Array,"%Float64Array%":typeof Float64Array>"u"?F:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?F:FinalizationRegistry,"%Function%":_c,"%GeneratorFunction%":bt,"%Int8Array%":typeof Int8Array>"u"?F:Int8Array,"%Int16Array%":typeof Int16Array>"u"?F:Int16Array,"%Int32Array%":typeof Int32Array>"u"?F:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_t&&se?se(se([][Symbol.iterator]())):F,"%JSON%":typeof JSON=="object"?JSON:F,"%Map%":typeof Map>"u"?F:Map,"%MapIteratorPrototype%":typeof Map>"u"||!_t||!se?F:se(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?F:Promise,"%Proxy%":typeof Proxy>"u"?F:Proxy,"%RangeError%":oS,"%ReferenceError%":rS,"%Reflect%":typeof Reflect>"u"?F:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?F:Set,"%SetIteratorPrototype%":typeof Set>"u"||!_t||!se?F:se(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?F:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_t&&se?se(""[Symbol.iterator]()):F,"%Symbol%":_t?Symbol:F,"%SyntaxError%":Ut,"%ThrowTypeError%":cS,"%TypedArray%":mS,"%TypeError%":Mt,"%Uint8Array%":typeof Uint8Array>"u"?F:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?F:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?F:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?F:Uint32Array,"%URIError%":iS,"%WeakMap%":typeof WeakMap>"u"?F:WeakMap,"%WeakRef%":typeof WeakRef>"u"?F:WeakRef,"%WeakSet%":typeof WeakSet>"u"?F:WeakSet};if(se)try{null.error}catch(e){var uS=se(se(e));ft["%Error.prototype%"]=uS}var dS=function e(t){var n;if(t==="%AsyncFunction%")n=ga("async function () {}");else if(t==="%GeneratorFunction%")n=ga("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=ga("async function* () {}");else if(t==="%AsyncGenerator%"){var a=e("%AsyncGeneratorFunction%");a&&(n=a.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=e("%AsyncGenerator%");s&&se&&(n=se(s.prototype))}return ft[t]=n,n},mr={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},tn=Ls,Dn=nS,pS=tn.call(Function.call,Array.prototype.concat),TS=tn.call(Function.apply,Array.prototype.splice),ur=tn.call(Function.call,String.prototype.replace),Un=tn.call(Function.call,String.prototype.slice),yS=tn.call(Function.call,RegExp.prototype.exec),fS=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,gS=/\\(\\)?/g,kS=function(e){var t=Un(e,0,1),n=Un(e,-1);if(t==="%"&&n!=="%")throw new Ut("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Ut("invalid intrinsic syntax, expected opening `%`");var a=[];return ur(e,fS,function(s,o,r,c){a[a.length]=r?ur(c,gS,"$1"):o||s}),a},hS=function(e,t){var n=e,a;if(Dn(mr,n)&&(a=mr[n],n="%"+a[0]+"%"),Dn(ft,n)){var s=ft[n];if(s===bt&&(s=dS(n)),typeof s>"u"&&!t)throw new Mt("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:s}}throw new Ut("intrinsic "+e+" does not exist!")},nn=function(e,t){if(typeof e!="string"||e.length===0)throw new Mt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Mt('"allowMissing" argument must be a boolean');if(yS(/^%?[^%]*%?$/,e)===null)throw new Ut("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=kS(e),a=n.length>0?n[0]:"",s=hS("%"+a+"%",t),o=s.name,r=s.value,c=!1,l=s.alias;l&&(a=l[0],TS(n,pS([0,1],l)));for(var m=1,u=!0;m<n.length;m+=1){var d=n[m],y=Un(d,0,1),T=Un(d,-1);if((y==='"'||y==="'"||y==="`"||T==='"'||T==="'"||T==="`")&&y!==T)throw new Ut("property names with quotes must have matching quotes");if((d==="constructor"||!u)&&(c=!0),a+="."+d,o="%"+a+"%",Dn(ft,o))r=ft[o];else if(r!=null){if(!(d in r)){if(!t)throw new Mt("base intrinsic for "+e+" exists, but the property is not available.");return}if(yt&&m+1>=n.length){var f=yt(r,d);u=!!f,u&&"get"in f&&!("originalValue"in f.get)?r=f.get:r=r[d]}else u=Dn(r,d),r=r[d];u&&!c&&(ft[o]=r)}}return r},Ec={exports:{}},ha,dr;function Ms(){if(dr)return ha;dr=1;var e=nn,t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return ha=t,ha}var SS=nn,En=SS("%Object.getOwnPropertyDescriptor%",!0);if(En)try{En([],"length")}catch{En=null}var na=En,pr=Ms(),_S=Sc,Et=ta,Tr=na,ES=function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Et("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Et("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Et("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Et("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Et("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Et("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,r=arguments.length>6?arguments[6]:!1,c=!!Tr&&Tr(e,t);if(pr)pr(e,t,{configurable:o===null&&c?c.configurable:!o,enumerable:a===null&&c?c.enumerable:!a,value:n,writable:s===null&&c?c.writable:!s});else if(r||!a&&!s&&!o)e[t]=n;else throw new _S("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Ja=Ms(),bc=function(){return!!Ja};bc.hasArrayLengthDefineBug=function(){if(!Ja)return null;try{return Ja([],"length",{value:1}).length!==1}catch{return!0}};var bS=bc,NS=nn,yr=ES,IS=bS(),fr=na,gr=ta,OS=NS("%Math.floor%"),vS=function(e,t){if(typeof e!="function")throw new gr("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||OS(t)!==t)throw new gr("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],a=!0,s=!0;if("length"in e&&fr){var o=fr(e,"length");o&&!o.configurable&&(a=!1),o&&!o.writable&&(s=!1)}return(a||s||!n)&&(IS?yr(e,"length",t,!0,!0):yr(e,"length",t)),e};(function(e){var t=Ls,n=nn,a=vS,s=ta,o=n("%Function.prototype.apply%"),r=n("%Function.prototype.call%"),c=n("%Reflect.apply%",!0)||t.call(r,o),l=Ms(),m=n("%Math.max%");e.exports=function(d){if(typeof d!="function")throw new s("a function is required");var y=c(t,r,arguments);return a(y,1+m(0,d.length-(arguments.length-1)),!0)};var u=function(){return c(t,o,arguments)};l?l(e.exports,"apply",{value:u}):e.exports.apply=u})(Ec);var Ps=Ec.exports,Nc=nn,Ic=Ps,AS=Ic(Nc("String.prototype.indexOf")),Cs=function(e,t){var n=Nc(e,!!t);return typeof n=="function"&&AS(e,".prototype.")>-1?Ic(n):n},wS=ea(),RS=Cs,Xa=RS("Object.prototype.toString"),aa=function(e){return wS&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Xa(e)==="[object Arguments]"},Oc=function(e){return aa(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Xa(e)!=="[object Array]"&&Xa(e.callee)==="[object Function]"},LS=function(){return aa(arguments)}();aa.isLegacyArguments=Oc;var MS=LS?aa:Oc,PS=Object.prototype.toString,CS=Function.prototype.toString,DS=/^\s*(?:function)?\*/,vc=ea(),Sa=Object.getPrototypeOf,US=function(){if(!vc)return!1;try{return Function("return function*() {}")()}catch{}},_a,FS=function(e){if(typeof e!="function")return!1;if(DS.test(CS.call(e)))return!0;if(!vc){var t=PS.call(e);return t==="[object GeneratorFunction]"}if(!Sa)return!1;if(typeof _a>"u"){var n=US();_a=n?Sa(n):!1}return Sa(e)===_a},Ac=Function.prototype.toString,vt=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Za,bn;if(typeof vt=="function"&&typeof Object.defineProperty=="function")try{Za=Object.defineProperty({},"length",{get:function(){throw bn}}),bn={},vt(function(){throw 42},null,Za)}catch(e){e!==bn&&(vt=null)}else vt=null;var GS=/^\s*class\b/,es=function(e){try{var t=Ac.call(e);return GS.test(t)}catch{return!1}},Ea=function(e){try{return es(e)?!1:(Ac.call(e),!0)}catch{return!1}},Nn=Object.prototype.toString,BS="[object Object]",VS="[object Function]",qS="[object GeneratorFunction]",xS="[object HTMLAllCollection]",HS="[object HTML document.all class]",QS="[object HTMLCollection]",YS=typeof Symbol=="function"&&!!Symbol.toStringTag,jS=!(0 in[,]),ts=function(){return!1};if(typeof document=="object"){var $S=document.all;Nn.call($S)===Nn.call(document.all)&&(ts=function(e){if((jS||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=Nn.call(e);return(t===xS||t===HS||t===QS||t===BS)&&e("")==null}catch{}return!1})}var KS=vt?function(e){if(ts(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{vt(e,null,Za)}catch(t){if(t!==bn)return!1}return!es(e)&&Ea(e)}:function(e){if(ts(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(YS)return Ea(e);if(es(e))return!1;var t=Nn.call(e);return t!==VS&&t!==qS&&!/^\[object HTML/.test(t)?!1:Ea(e)},WS=KS,zS=Object.prototype.toString,wc=Object.prototype.hasOwnProperty,JS=function(e,t,n){for(var a=0,s=e.length;a<s;a++)wc.call(e,a)&&(n==null?t(e[a],a,e):t.call(n,e[a],a,e))},XS=function(e,t,n){for(var a=0,s=e.length;a<s;a++)n==null?t(e.charAt(a),a,e):t.call(n,e.charAt(a),a,e)},ZS=function(e,t,n){for(var a in e)wc.call(e,a)&&(n==null?t(e[a],a,e):t.call(n,e[a],a,e))},e_=function(e,t,n){if(!WS(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=n),zS.call(e)==="[object Array]"?JS(e,t,a):typeof e=="string"?XS(e,t,a):ZS(e,t,a)},Rc=e_,t_=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],ba=t_,n_=typeof globalThis>"u"?vs:globalThis,Lc=function(){for(var e=[],t=0;t<ba.length;t++)typeof n_[ba[t]]=="function"&&(e[e.length]=ba[t]);return e},Fn=Rc,a_=Lc,kr=Ps,Ds=Cs,In=na,s_=Ds("Object.prototype.toString"),Mc=ea(),hr=typeof globalThis>"u"?vs:globalThis,ns=a_(),Us=Ds("String.prototype.slice"),Na=Object.getPrototypeOf,o_=Ds("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},Gn={__proto__:null};Mc&&In&&Na?Fn(ns,function(e){var t=new hr[e];if(Symbol.toStringTag in t){var n=Na(t),a=In(n,Symbol.toStringTag);if(!a){var s=Na(n);a=In(s,Symbol.toStringTag)}Gn["$"+e]=kr(a.get)}}):Fn(ns,function(e){var t=new hr[e],n=t.slice||t.set;n&&(Gn["$"+e]=kr(n))});var r_=function(e){var t=!1;return Fn(Gn,function(n,a){if(!t)try{"$"+n(e)===a&&(t=Us(a,1))}catch{}}),t},i_=function(e){var t=!1;return Fn(Gn,function(n,a){if(!t)try{n(e),t=Us(a,1)}catch{}}),t},c_=function(e){if(!e||typeof e!="object")return!1;if(!Mc){var t=Us(s_(e),8,-1);return o_(ns,t)>-1?t:t!=="Object"?!1:i_(e)}return In?r_(e):null},Bn=Rc,l_=Lc,Sr=Ps,Fs=Cs,On=na,m_=Fs("Object.prototype.toString"),Pc=ea(),_r=typeof globalThis>"u"?vs:globalThis,as=l_(),Gs=Fs("String.prototype.slice"),Ia=Object.getPrototypeOf,u_=Fs("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},Vn={__proto__:null};Pc&&On&&Ia?Bn(as,function(e){var t=new _r[e];if(Symbol.toStringTag in t){var n=Ia(t),a=On(n,Symbol.toStringTag);if(!a){var s=Ia(n);a=On(s,Symbol.toStringTag)}Vn["$"+e]=Sr(a.get)}}):Bn(as,function(e){var t=new _r[e],n=t.slice||t.set;n&&(Vn["$"+e]=Sr(n))});var d_=function(e){var t=!1;return Bn(Vn,function(n,a){if(!t)try{"$"+n(e)===a&&(t=Gs(a,1))}catch{}}),t},p_=function(e){var t=!1;return Bn(Vn,function(n,a){if(!t)try{n(e),t=Gs(a,1)}catch{}}),t},T_=function(e){if(!e||typeof e!="object")return!1;if(!Pc){var t=Gs(m_(e),8,-1);return u_(as,t)>-1?t:t!=="Object"?!1:p_(e)}return On?d_(e):null},y_=T_,f_=function(e){return!!y_(e)};(function(e){var t=MS,n=FS,a=c_,s=f_;function o(S){return S.call.bind(S)}var r=typeof BigInt<"u",c=typeof Symbol<"u",l=o(Object.prototype.toString),m=o(Number.prototype.valueOf),u=o(String.prototype.valueOf),d=o(Boolean.prototype.valueOf);if(r)var y=o(BigInt.prototype.valueOf);if(c)var T=o(Symbol.prototype.valueOf);function f(S,Vc){if(typeof S!="object")return!1;try{return Vc(S),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=s;function _(S){return typeof Promise<"u"&&S instanceof Promise||S!==null&&typeof S=="object"&&typeof S.then=="function"&&typeof S.catch=="function"}e.isPromise=_;function N(S){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(S):s(S)||k(S)}e.isArrayBufferView=N;function E(S){return a(S)==="Uint8Array"}e.isUint8Array=E;function b(S){return a(S)==="Uint8ClampedArray"}e.isUint8ClampedArray=b;function w(S){return a(S)==="Uint16Array"}e.isUint16Array=w;function O(S){return a(S)==="Uint32Array"}e.isUint32Array=O;function A(S){return a(S)==="Int8Array"}e.isInt8Array=A;function L(S){return a(S)==="Int16Array"}e.isInt16Array=L;function v(S){return a(S)==="Int32Array"}e.isInt32Array=v;function D(S){return a(S)==="Float32Array"}e.isFloat32Array=D;function j(S){return a(S)==="Float64Array"}e.isFloat64Array=j;function te(S){return a(S)==="BigInt64Array"}e.isBigInt64Array=te;function $(S){return a(S)==="BigUint64Array"}e.isBigUint64Array=$;function K(S){return l(S)==="[object Map]"}K.working=typeof Map<"u"&&K(new Map);function G(S){return typeof Map>"u"?!1:K.working?K(S):S instanceof Map}e.isMap=G;function B(S){return l(S)==="[object Set]"}B.working=typeof Set<"u"&&B(new Set);function J(S){return typeof Set>"u"?!1:B.working?B(S):S instanceof Set}e.isSet=J;function Fe(S){return l(S)==="[object WeakMap]"}Fe.working=typeof WeakMap<"u"&&Fe(new WeakMap);function qt(S){return typeof WeakMap>"u"?!1:Fe.working?Fe(S):S instanceof WeakMap}e.isWeakMap=qt;function ze(S){return l(S)==="[object WeakSet]"}ze.working=typeof WeakSet<"u"&&ze(new WeakSet);function fe(S){return ze(S)}e.isWeakSet=fe;function ge(S){return l(S)==="[object ArrayBuffer]"}ge.working=typeof ArrayBuffer<"u"&&ge(new ArrayBuffer);function ke(S){return typeof ArrayBuffer>"u"?!1:ge.working?ge(S):S instanceof ArrayBuffer}e.isArrayBuffer=ke;function g(S){return l(S)==="[object DataView]"}g.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&g(new DataView(new ArrayBuffer(1),0,1));function k(S){return typeof DataView>"u"?!1:g.working?g(S):S instanceof DataView}e.isDataView=k;var I=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function M(S){return l(S)==="[object SharedArrayBuffer]"}function W(S){return typeof I>"u"?!1:(typeof M.working>"u"&&(M.working=M(new I)),M.working?M(S):S instanceof I)}e.isSharedArrayBuffer=W;function V(S){return l(S)==="[object AsyncFunction]"}e.isAsyncFunction=V;function U(S){return l(S)==="[object Map Iterator]"}e.isMapIterator=U;function q(S){return l(S)==="[object Set Iterator]"}e.isSetIterator=q;function Q(S){return l(S)==="[object Generator]"}e.isGeneratorObject=Q;function Oe(S){return l(S)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=Oe;function rt(S){return f(S,m)}e.isNumberObject=rt;function an(S){return f(S,u)}e.isStringObject=an;function ht(S){return f(S,d)}e.isBooleanObject=ht;function sn(S){return r&&f(S,y)}e.isBigIntObject=sn;function qs(S){return c&&f(S,T)}e.isSymbolObject=qs;function Gc(S){return rt(S)||an(S)||ht(S)||sn(S)||qs(S)}e.isBoxedPrimitive=Gc;function Bc(S){return typeof Uint8Array<"u"&&(ke(S)||W(S))}e.isAnyArrayBuffer=Bc,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(S){Object.defineProperty(e,S,{enumerable:!1,value:function(){throw new Error(S+" is not supported in userland")}})})})(kc);var g_=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},ss={exports:{}};typeof Object.create=="function"?ss.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ss.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var k_=ss.exports;(function(e){var t=Object.getOwnPropertyDescriptors||function(g){for(var k=Object.keys(g),I={},M=0;M<k.length;M++)I[k[M]]=Object.getOwnPropertyDescriptor(g,k[M]);return I},n=/%[sdj%]/g;e.format=function(g){if(!A(g)){for(var k=[],I=0;I<arguments.length;I++)k.push(r(arguments[I]));return k.join(" ")}for(var I=1,M=arguments,W=M.length,V=String(g).replace(n,function(Q){if(Q==="%%")return"%";if(I>=W)return Q;switch(Q){case"%s":return String(M[I++]);case"%d":return Number(M[I++]);case"%j":try{return JSON.stringify(M[I++])}catch{return"[Circular]"}default:return Q}}),U=M[I];I<W;U=M[++I])b(U)||!j(U)?V+=" "+U:V+=" "+r(U);return V},e.deprecate=function(g,k){if(typeof C<"u"&&C.noDeprecation===!0)return g;if(typeof C>"u")return function(){return e.deprecate(g,k).apply(this,arguments)};var I=!1;function M(){if(!I){if(C.throwDeprecation)throw new Error(k);C.traceDeprecation?console.trace(k):console.error(k),I=!0}return g.apply(this,arguments)}return M};var a={},s=/^$/;if(C.env.NODE_DEBUG){var o=C.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+o+"$","i")}e.debuglog=function(g){if(g=g.toUpperCase(),!a[g])if(s.test(g)){var k=C.pid;a[g]=function(){var I=e.format.apply(e,arguments);console.error("%s %d: %s",g,k,I)}}else a[g]=function(){};return a[g]};function r(g,k){var I={seen:[],stylize:l};return arguments.length>=3&&(I.depth=arguments[2]),arguments.length>=4&&(I.colors=arguments[3]),E(k)?I.showHidden=k:k&&e._extend(I,k),v(I.showHidden)&&(I.showHidden=!1),v(I.depth)&&(I.depth=2),v(I.colors)&&(I.colors=!1),v(I.customInspect)&&(I.customInspect=!0),I.colors&&(I.stylize=c),u(I,g,I.depth)}e.inspect=r,r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function c(g,k){var I=r.styles[k];return I?"\x1B["+r.colors[I][0]+"m"+g+"\x1B["+r.colors[I][1]+"m":g}function l(g,k){return g}function m(g){var k={};return g.forEach(function(I,M){k[I]=!0}),k}function u(g,k,I){if(g.customInspect&&k&&K(k.inspect)&&k.inspect!==e.inspect&&!(k.constructor&&k.constructor.prototype===k)){var M=k.inspect(I,g);return A(M)||(M=u(g,M,I)),M}var W=d(g,k);if(W)return W;var V=Object.keys(k),U=m(V);if(g.showHidden&&(V=Object.getOwnPropertyNames(k)),$(k)&&(V.indexOf("message")>=0||V.indexOf("description")>=0))return y(k);if(V.length===0){if(K(k)){var q=k.name?": "+k.name:"";return g.stylize("[Function"+q+"]","special")}if(D(k))return g.stylize(RegExp.prototype.toString.call(k),"regexp");if(te(k))return g.stylize(Date.prototype.toString.call(k),"date");if($(k))return y(k)}var Q="",Oe=!1,rt=["{","}"];if(N(k)&&(Oe=!0,rt=["[","]"]),K(k)){var an=k.name?": "+k.name:"";Q=" [Function"+an+"]"}if(D(k)&&(Q=" "+RegExp.prototype.toString.call(k)),te(k)&&(Q=" "+Date.prototype.toUTCString.call(k)),$(k)&&(Q=" "+y(k)),V.length===0&&(!Oe||k.length==0))return rt[0]+Q+rt[1];if(I<0)return D(k)?g.stylize(RegExp.prototype.toString.call(k),"regexp"):g.stylize("[Object]","special");g.seen.push(k);var ht;return Oe?ht=T(g,k,I,U,V):ht=V.map(function(sn){return f(g,k,I,U,sn,Oe)}),g.seen.pop(),_(ht,Q,rt)}function d(g,k){if(v(k))return g.stylize("undefined","undefined");if(A(k)){var I="'"+JSON.stringify(k).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return g.stylize(I,"string")}if(O(k))return g.stylize(""+k,"number");if(E(k))return g.stylize(""+k,"boolean");if(b(k))return g.stylize("null","null")}function y(g){return"["+Error.prototype.toString.call(g)+"]"}function T(g,k,I,M,W){for(var V=[],U=0,q=k.length;U<q;++U)ze(k,String(U))?V.push(f(g,k,I,M,String(U),!0)):V.push("");return W.forEach(function(Q){Q.match(/^\d+$/)||V.push(f(g,k,I,M,Q,!0))}),V}function f(g,k,I,M,W,V){var U,q,Q;if(Q=Object.getOwnPropertyDescriptor(k,W)||{value:k[W]},Q.get?Q.set?q=g.stylize("[Getter/Setter]","special"):q=g.stylize("[Getter]","special"):Q.set&&(q=g.stylize("[Setter]","special")),ze(M,W)||(U="["+W+"]"),q||(g.seen.indexOf(Q.value)<0?(b(I)?q=u(g,Q.value,null):q=u(g,Q.value,I-1),q.indexOf(`
5
5
  `)>-1&&(V?q=q.split(`
6
6
  `).map(function(Oe){return" "+Oe}).join(`
7
7
  `).slice(2):q=`
@@ -14,4 +14,4 @@
14
14
  `),c=`
15
15
  `+n+(o.length?s("│"):" ")+" ";return n+r.join(c)+`
16
16
  `+o.map(function(l,m){var u=m===o.length-1,d=l.nodes&&l.nodes.length,y=n+(u?" ":s("│"))+" ";return n+s(u?"└":"├")+s("─")+s(d?"┬":"─")+" "+e(l,y,a).slice(n.length+2)}).join("")};const __=S_,Er=Symbol("avvio.TimeTree.untrackNode"),va=Symbol("avvio.TimeTree.trackNode"),br=Symbol("avvio.TimeTree.getParent"),Nr=Symbol("avvio.TimeTree.getNode"),Ir=Symbol("avvio.TimeTree.addNode");let E_=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[va](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[Er](e){this.tableId.delete(e.id);const t=this.tableLabel.get(e.label);if(t.id){this.tableLabel.delete(e.label);return}t.pop(),t.length===0&&this.tableLabel.delete(e.label)}[br](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[Nr](e){return this.tableId.get(e)}[Ir](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[va](this.root),this.root.id;const a=this[br](e),s=`${t}-${Math.random()}`,o={id:s,parent:e,start:n,label:t,nodes:[]};return a.nodes.push(o),this[va](o),s}start(e,t,n=Date.now()){return this[Ir](e,t,n)}stop(e,t=Date.now()){const n=this[Nr](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[Er](n))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const e=n=>(n.label=`${n.label} ${n.diff} ms`,n.nodes.length>0&&(n.nodes=n.nodes.map(a=>e(a))),n),t=e(this.toJSON());return __(t)}};var b_=E_,Bs={exports:{}},os={exports:{}},Aa,Or;function N_(){if(Or)return Aa;Or=1;var e=1e3,t=e*60,n=t*60,a=n*24,s=a*7,o=a*365.25;Aa=function(u,d){d=d||{};var y=typeof u;if(y==="string"&&u.length>0)return r(u);if(y==="number"&&isFinite(u))return d.long?l(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function r(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var y=parseFloat(d[1]),T=(d[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return y*o;case"weeks":case"week":case"w":return y*s;case"days":case"day":case"d":return y*a;case"hours":case"hour":case"hrs":case"hr":case"h":return y*n;case"minutes":case"minute":case"mins":case"min":case"m":return y*t;case"seconds":case"second":case"secs":case"sec":case"s":return y*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function c(u){var d=Math.abs(u);return d>=a?Math.round(u/a)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var d=Math.abs(u);return d>=a?m(u,d,a,"day"):d>=n?m(u,d,n,"hour"):d>=t?m(u,d,t,"minute"):d>=e?m(u,d,e,"second"):u+" ms"}function m(u,d,y,T){var f=d>=y*1.5;return Math.round(u/y)+" "+T+(f?"s":"")}return Aa}function I_(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=s,n.enabled=r,n.humanize=N_(),n.destroy=m,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let y=0;y<u.length;y++)d=(d<<5)-d+u.charCodeAt(y),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,y=null,T,f;function _(...N){if(!_.enabled)return;const E=_,b=Number(new Date),w=b-(d||b);E.diff=w,E.prev=d,E.curr=b,d=b,N[0]=n.coerce(N[0]),typeof N[0]!="string"&&N.unshift("%O");let O=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(A,L)=>{if(A==="%%")return"%";O++;const v=n.formatters[L];if(typeof v=="function"){const D=N[O];A=v.call(E,D),N.splice(O,1),O--}return A}),n.formatArgs.call(E,N),(E.log||n.log).apply(E,N)}return _.namespace=u,_.useColors=n.useColors(),_.color=n.selectColor(u),_.extend=a,_.destroy=n.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(T!==n.namespaces&&(T=n.namespaces,f=n.enabled(u)),f),set:N=>{y=N}}),typeof n.init=="function"&&n.init(_),_}function a(u,d){const y=n(this.namespace+(typeof d>"u"?":":d)+u);return y.log=this.log,y}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const y=(typeof u=="string"?u:"").split(/[\s,]+/),T=y.length;for(d=0;d<T;d++)y[d]&&(u=y[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function o(){const u=[...n.names.map(c),...n.skips.map(c).map(d=>"-"+d)].join(",");return n.enable(""),u}function r(u){if(u[u.length-1]==="*")return!0;let d,y;for(d=0,y=n.skips.length;d<y;d++)if(n.skips[d].test(u))return!1;for(d=0,y=n.names.length;d<y;d++)if(n.names[d].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var O_=I_;(function(e,t){t.formatArgs=a,t.save=s,t.load=o,t.useColors=n,t.storage=r(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;l.splice(1,0,m,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,y=>{y!=="%%"&&(u++,y==="%c"&&(d=u))}),l.splice(d,0,m)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof C<"u"&&"env"in C&&(l=C.env.DEBUG),l}function r(){try{return localStorage}catch{}}e.exports=O_(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(os,os.exports);var Dc=os.exports;const v_=cc,A_=gc.EventEmitter,w_=Zn.inherits,ue=Dc("avvio"),{AVV_ERR_READY_TIMEOUT:R_}=Cc,wa=Symbol.for("plugin-meta");function L_(e,t){return e[wa]&&e[wa].name?e[wa].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
17
- `).slice(0,2).map(n=>n.trim()).join(" -- ")}function M_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function Vt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=L_(t,n),this.isAfter=a,this.q=v_(e,P_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}w_(Vt,A_);Vt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){ue("skipping loading of plugin as parent errored and it is not an after",s),C.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return ue("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,ue("exec",s);let o;const r=l=>{if(a){ue("loading complete",s);return}this._error=l,ue(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(ue("setting up timeout",s,this.timeout),o=setTimeout(function(){ue("timed out",s),o=null;const l=new R_(s);l.fn=n,r(l)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,r);c&&typeof c.then=="function"&&(ue("exec: resolving promise",s),c.then(()=>C.nextTick(r),l=>C.nextTick(r,l)))};Vt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(ue("rejecting promise",this.name,n),this._promise.reject(n)):(ue("resolving promise",this.name),this._promise.resolve()),this._promise=null,C.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=M_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};Vt.prototype.enqueue=function(e,t){ue("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};Vt.prototype.finish=function(e,t){ue("finish",this.name,e);const n=()=>{this.loaded||(ue("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const a=()=>{if(ue("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{ue("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else ue("delayed",this.name),this.q.drain=()=>{ue("drain",this.name),this.q.drain=C_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function P_(e,t){const n=this;C.nextTick(Vs.bind(n),e,t)}function Vs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Vs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function C_(){}Bs.exports=Vt;Bs.exports.loadPlugin=Vs;var D_=Bs.exports;const vr=cc,U_=gc.EventEmitter,F_=Zn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Ra,AVV_ERR_CALLBACK_NOT_FN:Wt,AVV_ERR_PLUGIN_NOT_VALID:G_,AVV_ERR_ROOT_PLG_BOOTED:B_,AVV_ERR_READY_TIMEOUT:V_}=Cc,q_=b_,rs=D_,Ft=Dc("avvio"),qn=Symbol("kAvvio"),La=Symbol("kThenifyDoNotWrap");function x_(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new Ra(s);if(e[o])throw new Ra(o);if(e[r])throw new Ra(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:Uc.bind(n)}),e[qn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Ma(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new Wt(r,typeof m);return n.ready(m?Ma(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new Wt(c,typeof m);return n.onClose($_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new Wt(l,typeof m);return m?(n.close(Ma(m,this)),this):n.close()}}function ce(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof ce)){const a=new ce(e,t,n);return e&&x_(e,t,a),a}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new q_,this._readyQ=vr(this,Fc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Ar},this._closeQ=vr(this,j_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Ar},this._doStart=null,this._root=new rs(this,H_.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),rs.loadPlugin.call(this,this._root,a=>{Ft("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function H_(e,t,n){this._doStart=n,t.autostart&&this.start()}F_(ce,U_);ce.prototype.start=function(){return this.started=!0,C.nextTick(this._doStart),this};ce.prototype.override=function(e,t,n){return e};function Q_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new G_(typeof e);return e}ce.prototype[qn]=!0;ce.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};ce.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&C.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(ce.prototype,"then",{get:Uc});ce.prototype._addPlugin=function(e,t,n){if(e=Q_(e),t=t||{},this.booted)throw new B_;const a=this._current[0],s=new rs(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};ce.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Fc.call(this,e,s)}return this};ce.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};ce.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Wt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),C.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};ce.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Wt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),C.nextTick(c)}})};ce.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ce.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Ar(){}function Uc(){if(this.booted){Ft("thenify returning null because we are already booted");return}if(this[La]){this[La]=!1;return}return Ft("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[La]=!0,e(this._server)),t)}function Fc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[qn]&&typeof s.then=="function"?s.then(()=>C.nextTick(t),o=>C.nextTick(t,o)):C.nextTick(t);else if(e.length===1)s=e(a),s&&!s[qn]&&typeof s.then=="function"?s.then(()=>C.nextTick(t),o=>C.nextTick(t,o)):C.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else Y_.call(this,e,a,n,t)}function Y_(e,t,n,a){const s=e.name;Ft("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Ft("timed out",s),o=null;const c=new V_(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function j_(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Ft("resolving close/onClose promise"),s.then(()=>C.nextTick(t),o=>C.nextTick(t,o))):C.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function $_(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){C.nextTick(s)},s):C.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){C.nextTick(s)},s):C.nextTick(s)):e(this,s)}}function Ma(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){C.nextTick(s,a)},s):C.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){C.nextTick(s)},s):C.nextTick(s)):e.length===2?e(a,s):e(a,this,s):C.nextTick(s)}}As.exports=ce;As.exports.express=function(e){return ce(e,{expose:{use:"load"}})};var K_=As.exports;const W_=bh(K_);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function z_(e,t=!0,n=!0,a){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=W_(Object.create({}),{autostart:!1});return r.use(Zk),r.use(jk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(zk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(Xk,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(uk,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(fk),r.use(Wk),r.use(dh),r.use(Uk),r.use(Eh),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const J_=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l})=>{const[m,u]=xs.useState(null);return xs.useEffect(()=>{let d=!1;if(!e)return console.error("streamlayer sdk key should be provided"),u(T=>(T!==null&&typeof T.disableApp=="function"&&T.disableApp(),null)),()=>{d=!0};const y=z_(e,n,a,{version:"1.8.5",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l});if(t)for(const T of t)y.use(T);return y.ready().then(T=>{d||(u(T.sdk),typeof window<"u")}).catch(T=>console.log(T)),()=>{d=!0,y.close(function(T){if(T)throw T})}},[e,n]),m};exports.AutoPlayVideo=Hn;exports.CloseTimerAuto=ci;exports.CtaIconMode=ai;exports.InvitationFrom=Mn;exports.NotificationEnabled=Rn;exports.NotificationPromotionImagePosition=ti;exports.NotificationPromotionMode=ei;exports.NotificationSponsorLogoMode=ni;exports.PickHistoryStatus=Nt;exports.PromotionButtonType=oi;exports.PromotionLogoMode=ri;exports.PromotionType=he;exports.QuestionImages=ot;exports.QuestionStatus=oe;exports.QuestionType=P;exports.SdkOverlayType=H;exports.createContextKey=Ha;exports.global=Qa;exports.pino_1=Dr;exports.useStreamLayerApp=J_;
17
+ `).slice(0,2).map(n=>n.trim()).join(" -- ")}function M_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function Vt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=L_(t,n),this.isAfter=a,this.q=v_(e,P_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}w_(Vt,A_);Vt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){ue("skipping loading of plugin as parent errored and it is not an after",s),C.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return ue("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,ue("exec",s);let o;const r=l=>{if(a){ue("loading complete",s);return}this._error=l,ue(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(ue("setting up timeout",s,this.timeout),o=setTimeout(function(){ue("timed out",s),o=null;const l=new R_(s);l.fn=n,r(l)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,r);c&&typeof c.then=="function"&&(ue("exec: resolving promise",s),c.then(()=>C.nextTick(r),l=>C.nextTick(r,l)))};Vt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(ue("rejecting promise",this.name,n),this._promise.reject(n)):(ue("resolving promise",this.name),this._promise.resolve()),this._promise=null,C.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=M_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};Vt.prototype.enqueue=function(e,t){ue("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};Vt.prototype.finish=function(e,t){ue("finish",this.name,e);const n=()=>{this.loaded||(ue("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const a=()=>{if(ue("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{ue("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else ue("delayed",this.name),this.q.drain=()=>{ue("drain",this.name),this.q.drain=C_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function P_(e,t){const n=this;C.nextTick(Vs.bind(n),e,t)}function Vs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Vs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function C_(){}Bs.exports=Vt;Bs.exports.loadPlugin=Vs;var D_=Bs.exports;const vr=cc,U_=gc.EventEmitter,F_=Zn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Ra,AVV_ERR_CALLBACK_NOT_FN:Wt,AVV_ERR_PLUGIN_NOT_VALID:G_,AVV_ERR_ROOT_PLG_BOOTED:B_,AVV_ERR_READY_TIMEOUT:V_}=Cc,q_=b_,rs=D_,Ft=Dc("avvio"),qn=Symbol("kAvvio"),La=Symbol("kThenifyDoNotWrap");function x_(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new Ra(s);if(e[o])throw new Ra(o);if(e[r])throw new Ra(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:Uc.bind(n)}),e[qn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Ma(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new Wt(r,typeof m);return n.ready(m?Ma(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new Wt(c,typeof m);return n.onClose($_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new Wt(l,typeof m);return m?(n.close(Ma(m,this)),this):n.close()}}function ce(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof ce)){const a=new ce(e,t,n);return e&&x_(e,t,a),a}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new q_,this._readyQ=vr(this,Fc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Ar},this._closeQ=vr(this,j_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Ar},this._doStart=null,this._root=new rs(this,H_.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),rs.loadPlugin.call(this,this._root,a=>{Ft("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function H_(e,t,n){this._doStart=n,t.autostart&&this.start()}F_(ce,U_);ce.prototype.start=function(){return this.started=!0,C.nextTick(this._doStart),this};ce.prototype.override=function(e,t,n){return e};function Q_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new G_(typeof e);return e}ce.prototype[qn]=!0;ce.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};ce.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&C.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(ce.prototype,"then",{get:Uc});ce.prototype._addPlugin=function(e,t,n){if(e=Q_(e),t=t||{},this.booted)throw new B_;const a=this._current[0],s=new rs(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};ce.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Fc.call(this,e,s)}return this};ce.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};ce.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Wt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),C.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};ce.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Wt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),C.nextTick(c)}})};ce.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ce.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Ar(){}function Uc(){if(this.booted){Ft("thenify returning null because we are already booted");return}if(this[La]){this[La]=!1;return}return Ft("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[La]=!0,e(this._server)),t)}function Fc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[qn]&&typeof s.then=="function"?s.then(()=>C.nextTick(t),o=>C.nextTick(t,o)):C.nextTick(t);else if(e.length===1)s=e(a),s&&!s[qn]&&typeof s.then=="function"?s.then(()=>C.nextTick(t),o=>C.nextTick(t,o)):C.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else Y_.call(this,e,a,n,t)}function Y_(e,t,n,a){const s=e.name;Ft("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Ft("timed out",s),o=null;const c=new V_(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function j_(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Ft("resolving close/onClose promise"),s.then(()=>C.nextTick(t),o=>C.nextTick(t,o))):C.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function $_(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){C.nextTick(s)},s):C.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){C.nextTick(s)},s):C.nextTick(s)):e(this,s)}}function Ma(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){C.nextTick(s,a)},s):C.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){C.nextTick(s)},s):C.nextTick(s)):e.length===2?e(a,s):e(a,this,s):C.nextTick(s)}}As.exports=ce;As.exports.express=function(e){return ce(e,{expose:{use:"load"}})};var K_=As.exports;const W_=bh(K_);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function z_(e,t=!0,n=!0,a){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=W_(Object.create({}),{autostart:!1});return r.use(Zk),r.use(jk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(zk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(Xk,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(uk,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(fk),r.use(Wk),r.use(dh),r.use(Uk),r.use(Eh),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const J_=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l})=>{const[m,u]=xs.useState(null);return xs.useEffect(()=>{let d=!1;if(!e)return console.error("streamlayer sdk key should be provided"),u(T=>(T!==null&&typeof T.disableApp=="function"&&T.disableApp(),null)),()=>{d=!0};const y=z_(e,n,a,{version:"1.8.6",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l});if(t)for(const T of t)y.use(T);return y.ready().then(T=>{d||(u(T.sdk),typeof window<"u")}).catch(T=>console.log(T)),()=>{d=!0,y.close(function(T){if(T)throw T})}},[e,n]),m};exports.AutoPlayVideo=Hn;exports.CloseTimerAuto=ci;exports.CtaIconMode=ai;exports.InvitationFrom=Mn;exports.NotificationEnabled=Rn;exports.NotificationPromotionImagePosition=ti;exports.NotificationPromotionMode=ei;exports.NotificationSponsorLogoMode=ni;exports.PickHistoryStatus=Nt;exports.PromotionButtonType=oi;exports.PromotionLogoMode=ri;exports.PromotionType=he;exports.QuestionImages=ot;exports.QuestionStatus=oe;exports.QuestionType=P;exports.SdkOverlayType=H;exports.createContextKey=Ha;exports.global=Qa;exports.pino_1=Dr;exports.useStreamLayerApp=J_;