@streamlayer/sdk-web 0.29.4 → 0.29.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +2 -8
- package/package.json +5 -5
package/lib/cjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
5
|
* @license MIT
|
|
6
|
-
*/(function(t){const e=Ct,r=lr,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=_,t.INSPECT_MAX_BYTES=50;const s=2147483647;t.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=u(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{const a=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(a,n),a.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function f(a){if(a>s)throw new RangeError('The value "'+a+'" is invalid for option "size"');const n=new Uint8Array(a);return Object.setPrototypeOf(n,c.prototype),n}function c(a,n,i){if(typeof a=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(a)}return h(a,n,i)}c.poolSize=8192;function h(a,n,i){if(typeof a=="string")return E(a,n);if(ArrayBuffer.isView(a))return L(a);if(a==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof a);if(me(a,ArrayBuffer)||a&&me(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(a,SharedArrayBuffer)||a&&me(a.buffer,SharedArrayBuffer)))return P(a,n,i);if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const l=a.valueOf&&a.valueOf();if(l!=null&&l!==a)return c.from(l,n,i);const d=K(a);if(d)return d;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof a[Symbol.toPrimitive]=="function")return c.from(a[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof a)}c.from=function(a,n,i){return h(a,n,i)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function b(a){if(typeof a!="number")throw new TypeError('"size" argument must be of type number');if(a<0)throw new RangeError('The value "'+a+'" is invalid for option "size"')}function g(a,n,i){return b(a),a<=0?f(a):n!==void 0?typeof i=="string"?f(a).fill(n,i):f(a).fill(n):f(a)}c.alloc=function(a,n,i){return g(a,n,i)};function m(a){return b(a),f(a<0?0:I(a)|0)}c.allocUnsafe=function(a){return m(a)},c.allocUnsafeSlow=function(a){return m(a)};function E(a,n){if((typeof n!="string"||n==="")&&(n="utf8"),!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);const i=j(a,n)|0;let l=f(i);const d=l.write(a,n);return d!==i&&(l=l.slice(0,d)),l}function T(a){const n=a.length<0?0:I(a.length)|0,i=f(n);for(let l=0;l<n;l+=1)i[l]=a[l]&255;return i}function L(a){if(me(a,Uint8Array)){const n=new Uint8Array(a);return P(n.buffer,n.byteOffset,n.byteLength)}return T(a)}function P(a,n,i){if(n<0||a.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<n+(i||0))throw new RangeError('"length" is outside of buffer bounds');let l;return n===void 0&&i===void 0?l=new Uint8Array(a):i===void 0?l=new Uint8Array(a,n):l=new Uint8Array(a,n,i),Object.setPrototypeOf(l,c.prototype),l}function K(a){if(c.isBuffer(a)){const n=I(a.length)|0,i=f(n);return i.length===0||a.copy(i,0,0,n),i}if(a.length!==void 0)return typeof a.length!="number"||Rt(a.length)?f(0):T(a);if(a.type==="Buffer"&&Array.isArray(a.data))return T(a.data)}function I(a){if(a>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return a|0}function _(a){return+a!=a&&(a=0),c.alloc(+a)}c.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==c.prototype},c.compare=function(n,i){if(me(n,Uint8Array)&&(n=c.from(n,n.offset,n.byteLength)),me(i,Uint8Array)&&(i=c.from(i,i.offset,i.byteLength)),!c.isBuffer(n)||!c.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===i)return 0;let l=n.length,d=i.length;for(let y=0,w=Math.min(l,d);y<w;++y)if(n[y]!==i[y]){l=n[y],d=i[y];break}return l<d?-1:d<l?1:0},c.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(n,i){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return c.alloc(0);let l;if(i===void 0)for(i=0,l=0;l<n.length;++l)i+=n[l].length;const d=c.allocUnsafe(i);let y=0;for(l=0;l<n.length;++l){let w=n[l];if(me(w,Uint8Array))y+w.length>d.length?(c.isBuffer(w)||(w=c.from(w)),w.copy(d,y)):Uint8Array.prototype.set.call(d,w,y);else if(c.isBuffer(w))w.copy(d,y);else throw new TypeError('"list" argument must be an Array of Buffers');y+=w.length}return d};function j(a,n){if(c.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||me(a,ArrayBuffer))return a.byteLength;if(typeof a!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof a);const i=a.length,l=arguments.length>2&&arguments[2]===!0;if(!l&&i===0)return 0;let d=!1;for(;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return ot(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return pt(a).length;default:if(d)return l?-1:ot(a).length;n=(""+n).toLowerCase(),d=!0}}c.byteLength=j;function U(a,n,i){let l=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,n>>>=0,i<=n))return"";for(a||(a="utf8");;)switch(a){case"hex":return de(this,n,i);case"utf8":case"utf-8":return fe(this,n,i);case"ascii":return it(this,n,i);case"latin1":case"binary":return ke(this,n,i);case"base64":return nt(this,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pe(this,n,i);default:if(l)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),l=!0}}c.prototype._isBuffer=!0;function F(a,n,i){const l=a[n];a[n]=a[i],a[i]=l}c.prototype.swap16=function(){const n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<n;i+=2)F(this,i,i+1);return this},c.prototype.swap32=function(){const n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<n;i+=4)F(this,i,i+3),F(this,i+1,i+2);return this},c.prototype.swap64=function(){const n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<n;i+=8)F(this,i,i+7),F(this,i+1,i+6),F(this,i+2,i+5),F(this,i+3,i+4);return this},c.prototype.toString=function(){const n=this.length;return n===0?"":arguments.length===0?fe(this,0,n):U.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(n){if(!c.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:c.compare(this,n)===0},c.prototype.inspect=function(){let n="";const i=t.INSPECT_MAX_BYTES;return n=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(n+=" ... "),"<Buffer "+n+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(n,i,l,d,y){if(me(n,Uint8Array)&&(n=c.from(n,n.offset,n.byteLength)),!c.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(i===void 0&&(i=0),l===void 0&&(l=n?n.length:0),d===void 0&&(d=0),y===void 0&&(y=this.length),i<0||l>n.length||d<0||y>this.length)throw new RangeError("out of range index");if(d>=y&&i>=l)return 0;if(d>=y)return-1;if(i>=l)return 1;if(i>>>=0,l>>>=0,d>>>=0,y>>>=0,this===n)return 0;let w=y-d,R=l-i;const W=Math.min(w,R),z=this.slice(d,y),J=n.slice(i,l);for(let Q=0;Q<W;++Q)if(z[Q]!==J[Q]){w=z[Q],R=J[Q];break}return w<R?-1:R<w?1:0};function x(a,n,i,l,d){if(a.length===0)return-1;if(typeof i=="string"?(l=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,Rt(i)&&(i=d?0:a.length-1),i<0&&(i=a.length+i),i>=a.length){if(d)return-1;i=a.length-1}else if(i<0)if(d)i=0;else return-1;if(typeof n=="string"&&(n=c.from(n,l)),c.isBuffer(n))return n.length===0?-1:k(a,n,i,l,d);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?d?Uint8Array.prototype.indexOf.call(a,n,i):Uint8Array.prototype.lastIndexOf.call(a,n,i):k(a,[n],i,l,d);throw new TypeError("val must be string, number or Buffer")}function k(a,n,i,l,d){let y=1,w=a.length,R=n.length;if(l!==void 0&&(l=String(l).toLowerCase(),l==="ucs2"||l==="ucs-2"||l==="utf16le"||l==="utf-16le")){if(a.length<2||n.length<2)return-1;y=2,w/=2,R/=2,i/=2}function W(J,Q){return y===1?J[Q]:J.readUInt16BE(Q*y)}let z;if(d){let J=-1;for(z=i;z<w;z++)if(W(a,z)===W(n,J===-1?0:z-J)){if(J===-1&&(J=z),z-J+1===R)return J*y}else J!==-1&&(z-=z-J),J=-1}else for(i+R>w&&(i=w-R),z=i;z>=0;z--){let J=!0;for(let Q=0;Q<R;Q++)if(W(a,z+Q)!==W(n,Q)){J=!1;break}if(J)return z}return-1}c.prototype.includes=function(n,i,l){return this.indexOf(n,i,l)!==-1},c.prototype.indexOf=function(n,i,l){return x(this,n,i,l,!0)},c.prototype.lastIndexOf=function(n,i,l){return x(this,n,i,l,!1)};function G(a,n,i,l){i=Number(i)||0;const d=a.length-i;l?(l=Number(l),l>d&&(l=d)):l=d;const y=n.length;l>y/2&&(l=y/2);let w;for(w=0;w<l;++w){const R=parseInt(n.substr(w*2,2),16);if(Rt(R))return w;a[i+w]=R}return w}function oe(a,n,i,l){return st(ot(n,a.length-i),a,i,l)}function Oe(a,n,i,l){return st(Pt(n),a,i,l)}function Ae(a,n,i,l){return st(pt(n),a,i,l)}function le(a,n,i,l){return st(S(n,a.length-i),a,i,l)}c.prototype.write=function(n,i,l,d){if(i===void 0)d="utf8",l=this.length,i=0;else if(l===void 0&&typeof i=="string")d=i,l=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(l)?(l=l>>>0,d===void 0&&(d="utf8")):(d=l,l=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const y=this.length-i;if((l===void 0||l>y)&&(l=y),n.length>0&&(l<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");let w=!1;for(;;)switch(d){case"hex":return G(this,n,i,l);case"utf8":case"utf-8":return oe(this,n,i,l);case"ascii":case"latin1":case"binary":return Oe(this,n,i,l);case"base64":return Ae(this,n,i,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return le(this,n,i,l);default:if(w)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),w=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(a,n,i){return n===0&&i===a.length?e.fromByteArray(a):e.fromByteArray(a.slice(n,i))}function fe(a,n,i){i=Math.min(a.length,i);const l=[];let d=n;for(;d<i;){const y=a[d];let w=null,R=y>239?4:y>223?3:y>191?2:1;if(d+R<=i){let W,z,J,Q;switch(R){case 1:y<128&&(w=y);break;case 2:W=a[d+1],(W&192)===128&&(Q=(y&31)<<6|W&63,Q>127&&(w=Q));break;case 3:W=a[d+1],z=a[d+2],(W&192)===128&&(z&192)===128&&(Q=(y&15)<<12|(W&63)<<6|z&63,Q>2047&&(Q<55296||Q>57343)&&(w=Q));break;case 4:W=a[d+1],z=a[d+2],J=a[d+3],(W&192)===128&&(z&192)===128&&(J&192)===128&&(Q=(y&15)<<18|(W&63)<<12|(z&63)<<6|J&63,Q>65535&&Q<1114112&&(w=Q))}}w===null?(w=65533,R=1):w>65535&&(w-=65536,l.push(w>>>10&1023|55296),w=56320|w&1023),l.push(w),d+=R}return Be(l)}const xe=4096;function Be(a){const n=a.length;if(n<=xe)return String.fromCharCode.apply(String,a);let i="",l=0;for(;l<n;)i+=String.fromCharCode.apply(String,a.slice(l,l+=xe));return i}function it(a,n,i){let l="";i=Math.min(a.length,i);for(let d=n;d<i;++d)l+=String.fromCharCode(a[d]&127);return l}function ke(a,n,i){let l="";i=Math.min(a.length,i);for(let d=n;d<i;++d)l+=String.fromCharCode(a[d]);return l}function de(a,n,i){const l=a.length;(!n||n<0)&&(n=0),(!i||i<0||i>l)&&(i=l);let d="";for(let y=n;y<i;++y)d+=jn[a[y]];return d}function Pe(a,n,i){const l=a.slice(n,i);let d="";for(let y=0;y<l.length-1;y+=2)d+=String.fromCharCode(l[y]+l[y+1]*256);return d}c.prototype.slice=function(n,i){const l=this.length;n=~~n,i=i===void 0?l:~~i,n<0?(n+=l,n<0&&(n=0)):n>l&&(n=l),i<0?(i+=l,i<0&&(i=0)):i>l&&(i=l),i<n&&(i=n);const d=this.subarray(n,i);return Object.setPrototypeOf(d,c.prototype),d};function H(a,n,i){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+n>i)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(n,i,l){n=n>>>0,i=i>>>0,l||H(n,i,this.length);let d=this[n],y=1,w=0;for(;++w<i&&(y*=256);)d+=this[n+w]*y;return d},c.prototype.readUintBE=c.prototype.readUIntBE=function(n,i,l){n=n>>>0,i=i>>>0,l||H(n,i,this.length);let d=this[n+--i],y=1;for(;i>0&&(y*=256);)d+=this[n+--i]*y;return d},c.prototype.readUint8=c.prototype.readUInt8=function(n,i){return n=n>>>0,i||H(n,1,this.length),this[n]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(n,i){return n=n>>>0,i||H(n,2,this.length),this[n]|this[n+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(n,i){return n=n>>>0,i||H(n,2,this.length),this[n]<<8|this[n+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(n,i){return n=n>>>0,i||H(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(n,i){return n=n>>>0,i||H(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},c.prototype.readBigUInt64LE=Re(function(n){n=n>>>0,he(n,"offset");const i=this[n],l=this[n+7];(i===void 0||l===void 0)&&se(n,this.length-8);const d=i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24,y=this[++n]+this[++n]*2**8+this[++n]*2**16+l*2**24;return BigInt(d)+(BigInt(y)<<BigInt(32))}),c.prototype.readBigUInt64BE=Re(function(n){n=n>>>0,he(n,"offset");const i=this[n],l=this[n+7];(i===void 0||l===void 0)&&se(n,this.length-8);const d=i*2**24+this[++n]*2**16+this[++n]*2**8+this[++n],y=this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+l;return(BigInt(d)<<BigInt(32))+BigInt(y)}),c.prototype.readIntLE=function(n,i,l){n=n>>>0,i=i>>>0,l||H(n,i,this.length);let d=this[n],y=1,w=0;for(;++w<i&&(y*=256);)d+=this[n+w]*y;return y*=128,d>=y&&(d-=Math.pow(2,8*i)),d},c.prototype.readIntBE=function(n,i,l){n=n>>>0,i=i>>>0,l||H(n,i,this.length);let d=i,y=1,w=this[n+--d];for(;d>0&&(y*=256);)w+=this[n+--d]*y;return y*=128,w>=y&&(w-=Math.pow(2,8*i)),w},c.prototype.readInt8=function(n,i){return n=n>>>0,i||H(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},c.prototype.readInt16LE=function(n,i){n=n>>>0,i||H(n,2,this.length);const l=this[n]|this[n+1]<<8;return l&32768?l|4294901760:l},c.prototype.readInt16BE=function(n,i){n=n>>>0,i||H(n,2,this.length);const l=this[n+1]|this[n]<<8;return l&32768?l|4294901760:l},c.prototype.readInt32LE=function(n,i){return n=n>>>0,i||H(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},c.prototype.readInt32BE=function(n,i){return n=n>>>0,i||H(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},c.prototype.readBigInt64LE=Re(function(n){n=n>>>0,he(n,"offset");const i=this[n],l=this[n+7];(i===void 0||l===void 0)&&se(n,this.length-8);const d=this[n+4]+this[n+5]*2**8+this[n+6]*2**16+(l<<24);return(BigInt(d)<<BigInt(32))+BigInt(i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24)}),c.prototype.readBigInt64BE=Re(function(n){n=n>>>0,he(n,"offset");const i=this[n],l=this[n+7];(i===void 0||l===void 0)&&se(n,this.length-8);const d=(i<<24)+this[++n]*2**16+this[++n]*2**8+this[++n];return(BigInt(d)<<BigInt(32))+BigInt(this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+l)}),c.prototype.readFloatLE=function(n,i){return n=n>>>0,i||H(n,4,this.length),r.read(this,n,!0,23,4)},c.prototype.readFloatBE=function(n,i){return n=n>>>0,i||H(n,4,this.length),r.read(this,n,!1,23,4)},c.prototype.readDoubleLE=function(n,i){return n=n>>>0,i||H(n,8,this.length),r.read(this,n,!0,52,8)},c.prototype.readDoubleBE=function(n,i){return n=n>>>0,i||H(n,8,this.length),r.read(this,n,!1,52,8)};function p(a,n,i,l,d,y){if(!c.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>d||n<y)throw new RangeError('"value" argument is out of bounds');if(i+l>a.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(n,i,l,d){if(n=+n,i=i>>>0,l=l>>>0,!d){const R=Math.pow(2,8*l)-1;p(this,n,i,l,R,0)}let y=1,w=0;for(this[i]=n&255;++w<l&&(y*=256);)this[i+w]=n/y&255;return i+l},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(n,i,l,d){if(n=+n,i=i>>>0,l=l>>>0,!d){const R=Math.pow(2,8*l)-1;p(this,n,i,l,R,0)}let y=l-1,w=1;for(this[i+y]=n&255;--y>=0&&(w*=256);)this[i+y]=n/w&255;return i+l},c.prototype.writeUint8=c.prototype.writeUInt8=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,1,255,0),this[i]=n&255,i+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,2,65535,0),this[i]=n&255,this[i+1]=n>>>8,i+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,2,65535,0),this[i]=n>>>8,this[i+1]=n&255,i+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,4,4294967295,0),this[i+3]=n>>>24,this[i+2]=n>>>16,this[i+1]=n>>>8,this[i]=n&255,i+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,4,4294967295,0),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4};function v(a,n,i,l,d){ge(n,l,d,a,i,7);let y=Number(n&BigInt(4294967295));a[i++]=y,y=y>>8,a[i++]=y,y=y>>8,a[i++]=y,y=y>>8,a[i++]=y;let w=Number(n>>BigInt(32)&BigInt(4294967295));return a[i++]=w,w=w>>8,a[i++]=w,w=w>>8,a[i++]=w,w=w>>8,a[i++]=w,i}function A(a,n,i,l,d){ge(n,l,d,a,i,7);let y=Number(n&BigInt(4294967295));a[i+7]=y,y=y>>8,a[i+6]=y,y=y>>8,a[i+5]=y,y=y>>8,a[i+4]=y;let w=Number(n>>BigInt(32)&BigInt(4294967295));return a[i+3]=w,w=w>>8,a[i+2]=w,w=w>>8,a[i+1]=w,w=w>>8,a[i]=w,i+8}c.prototype.writeBigUInt64LE=Re(function(n,i=0){return v(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Re(function(n,i=0){return A(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(n,i,l,d){if(n=+n,i=i>>>0,!d){const W=Math.pow(2,8*l-1);p(this,n,i,l,W-1,-W)}let y=0,w=1,R=0;for(this[i]=n&255;++y<l&&(w*=256);)n<0&&R===0&&this[i+y-1]!==0&&(R=1),this[i+y]=(n/w>>0)-R&255;return i+l},c.prototype.writeIntBE=function(n,i,l,d){if(n=+n,i=i>>>0,!d){const W=Math.pow(2,8*l-1);p(this,n,i,l,W-1,-W)}let y=l-1,w=1,R=0;for(this[i+y]=n&255;--y>=0&&(w*=256);)n<0&&R===0&&this[i+y+1]!==0&&(R=1),this[i+y]=(n/w>>0)-R&255;return i+l},c.prototype.writeInt8=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,1,127,-128),n<0&&(n=255+n+1),this[i]=n&255,i+1},c.prototype.writeInt16LE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,2,32767,-32768),this[i]=n&255,this[i+1]=n>>>8,i+2},c.prototype.writeInt16BE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,2,32767,-32768),this[i]=n>>>8,this[i+1]=n&255,i+2},c.prototype.writeInt32LE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,4,2147483647,-2147483648),this[i]=n&255,this[i+1]=n>>>8,this[i+2]=n>>>16,this[i+3]=n>>>24,i+4},c.prototype.writeInt32BE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4},c.prototype.writeBigInt64LE=Re(function(n,i=0){return v(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Re(function(n,i=0){return A(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function C(a,n,i,l,d,y){if(i+l>a.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function D(a,n,i,l,d){return n=+n,i=i>>>0,d||C(a,n,i,4),r.write(a,n,i,l,23,4),i+4}c.prototype.writeFloatLE=function(n,i,l){return D(this,n,i,!0,l)},c.prototype.writeFloatBE=function(n,i,l){return D(this,n,i,!1,l)};function V(a,n,i,l,d){return n=+n,i=i>>>0,d||C(a,n,i,8),r.write(a,n,i,l,52,8),i+8}c.prototype.writeDoubleLE=function(n,i,l){return V(this,n,i,!0,l)},c.prototype.writeDoubleBE=function(n,i,l){return V(this,n,i,!1,l)},c.prototype.copy=function(n,i,l,d){if(!c.isBuffer(n))throw new TypeError("argument should be a Buffer");if(l||(l=0),!d&&d!==0&&(d=this.length),i>=n.length&&(i=n.length),i||(i=0),d>0&&d<l&&(d=l),d===l||n.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(l<0||l>=this.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),n.length-i<d-l&&(d=n.length-i+l);const y=d-l;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,l,d):Uint8Array.prototype.set.call(n,this.subarray(l,d),i),y},c.prototype.fill=function(n,i,l,d){if(typeof n=="string"){if(typeof i=="string"?(d=i,i=0,l=this.length):typeof l=="string"&&(d=l,l=this.length),d!==void 0&&typeof d!="string")throw new TypeError("encoding must be a string");if(typeof d=="string"&&!c.isEncoding(d))throw new TypeError("Unknown encoding: "+d);if(n.length===1){const w=n.charCodeAt(0);(d==="utf8"&&w<128||d==="latin1")&&(n=w)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(i<0||this.length<i||this.length<l)throw new RangeError("Out of range index");if(l<=i)return this;i=i>>>0,l=l===void 0?this.length:l>>>0,n||(n=0);let y;if(typeof n=="number")for(y=i;y<l;++y)this[y]=n;else{const w=c.isBuffer(n)?n:c.from(n,d),R=w.length;if(R===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(y=0;y<l-i;++y)this[y+i]=w[y%R]}return this};const B={};function N(a,n,i){B[a]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:n.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${a}]`,this.stack,delete this.name}get code(){return a}set code(d){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:d,writable:!0})}toString(){return`${this.name} [${a}]: ${this.message}`}}}N("ERR_BUFFER_OUT_OF_BOUNDS",function(a){return a?`${a} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),N("ERR_INVALID_ARG_TYPE",function(a,n){return`The "${a}" argument must be of type number. Received type ${typeof n}`},TypeError),N("ERR_OUT_OF_RANGE",function(a,n,i){let l=`The value of "${a}" is out of range.`,d=i;return Number.isInteger(i)&&Math.abs(i)>2**32?d=M(String(i)):typeof i=="bigint"&&(d=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(d=M(d)),d+="n"),l+=` It must be ${n}. Received ${d}`,l},RangeError);function M(a){let n="",i=a.length;const l=a[0]==="-"?1:0;for(;i>=l+4;i-=3)n=`_${a.slice(i-3,i)}${n}`;return`${a.slice(0,i)}${n}`}function re(a,n,i){he(n,"offset"),(a[n]===void 0||a[n+i]===void 0)&&se(n,a.length-(i+1))}function ge(a,n,i,l,d,y){if(a>i||a<n){const w=typeof n=="bigint"?"n":"";let R;throw y>3?n===0||n===BigInt(0)?R=`>= 0${w} and < 2${w} ** ${(y+1)*8}${w}`:R=`>= -(2${w} ** ${(y+1)*8-1}${w}) and < 2 ** ${(y+1)*8-1}${w}`:R=`>= ${n}${w} and <= ${i}${w}`,new B.ERR_OUT_OF_RANGE("value",R,a)}re(l,d,y)}function he(a,n){if(typeof a!="number")throw new B.ERR_INVALID_ARG_TYPE(n,"number",a)}function se(a,n,i){throw Math.floor(a)!==a?(he(a,i),new B.ERR_OUT_OF_RANGE(i||"offset","an integer",a)):n<0?new B.ERR_BUFFER_OUT_OF_BOUNDS:new B.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${n}`,a)}const qe=/[^+/0-9A-Za-z-_]/g;function ht(a){if(a=a.split("=")[0],a=a.trim().replace(qe,""),a.length<2)return"";for(;a.length%4!==0;)a=a+"=";return a}function ot(a,n){n=n||1/0;let i;const l=a.length;let d=null;const y=[];for(let w=0;w<l;++w){if(i=a.charCodeAt(w),i>55295&&i<57344){if(!d){if(i>56319){(n-=3)>-1&&y.push(239,191,189);continue}else if(w+1===l){(n-=3)>-1&&y.push(239,191,189);continue}d=i;continue}if(i<56320){(n-=3)>-1&&y.push(239,191,189),d=i;continue}i=(d-55296<<10|i-56320)+65536}else d&&(n-=3)>-1&&y.push(239,191,189);if(d=null,i<128){if((n-=1)<0)break;y.push(i)}else if(i<2048){if((n-=2)<0)break;y.push(i>>6|192,i&63|128)}else if(i<65536){if((n-=3)<0)break;y.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((n-=4)<0)break;y.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return y}function Pt(a){const n=[];for(let i=0;i<a.length;++i)n.push(a.charCodeAt(i)&255);return n}function S(a,n){let i,l,d;const y=[];for(let w=0;w<a.length&&!((n-=2)<0);++w)i=a.charCodeAt(w),l=i>>8,d=i%256,y.push(d),y.push(l);return y}function pt(a){return e.toByteArray(ht(a))}function st(a,n,i,l){let d;for(d=0;d<l&&!(d+i>=n.length||d>=a.length);++d)n[d+i]=a[d];return d}function me(a,n){return a instanceof n||a!=null&&a.constructor!=null&&a.constructor.name!=null&&a.constructor.name===n.name}function Rt(a){return a!==a}const jn=function(){const a="0123456789abcdef",n=new Array(256);for(let i=0;i<16;++i){const l=i*16;for(let d=0;d<16;++d)n[l+d]=a[i]+a[d]}return n}();function Re(a){return typeof BigInt>"u"?Dn:a}function Dn(){throw new Error("BigInt not supported")}})(Jr);var Xr={exports:{}},Y=Xr.exports={},we,be;function Xt(){throw new Error("setTimeout has not been defined")}function Zt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?we=setTimeout:we=Xt}catch{we=Xt}try{typeof clearTimeout=="function"?be=clearTimeout:be=Zt}catch{be=Zt}})();function Zr(t){if(we===setTimeout)return setTimeout(t,0);if((we===Xt||!we)&&setTimeout)return we=setTimeout,setTimeout(t,0);try{return we(t,0)}catch{try{return we.call(null,t,0)}catch{return we.call(this,t,0)}}}function ri(t){if(be===clearTimeout)return clearTimeout(t);if((be===Zt||!be)&&clearTimeout)return be=clearTimeout,clearTimeout(t);try{return be(t)}catch{try{return be.call(null,t)}catch{return be.call(this,t)}}}var _e=[],Je=!1,Ue,yt=-1;function ni(){!Je||!Ue||(Je=!1,Ue.length?_e=Ue.concat(_e):yt=-1,_e.length&&en())}function en(){if(!Je){var t=Zr(ni);Je=!0;for(var e=_e.length;e;){for(Ue=_e,_e=[];++yt<e;)Ue&&Ue[yt].run();yt=-1,e=_e.length}Ue=null,Je=!1,ri(t)}}Y.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];_e.push(new tn(t,e)),_e.length===1&&!Je&&Zr(en)};function tn(t,e){this.fun=t,this.array=e}tn.prototype.run=function(){this.fun.apply(null,this.array)};Y.title="browser";Y.browser=!0;Y.env={};Y.argv=[];Y.version="";Y.versions={};function Ce(){}Y.on=Ce;Y.addListener=Ce;Y.once=Ce;Y.off=Ce;Y.removeListener=Ce;Y.removeAllListeners=Ce;Y.emit=Ce;Y.prependListener=Ce;Y.prependOnceListener=Ce;Y.listeners=function(t){return[]};Y.binding=function(t){throw new Error("process.binding is not supported")};Y.cwd=function(){return"/"};Y.chdir=function(t){throw new Error("process.chdir is not supported")};Y.umask=function(){return 0};var ii=Xr.exports;(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Jr,r=ii,o=f=>f&&f.__esModule?f:{default:f},s=o(r),u=globalThis||void 0||self;Object.defineProperty(t,"Buffer",{enumerable:!0,get:()=>e.Buffer}),Object.defineProperty(t,"process",{enumerable:!0,get:()=>s.default}),t.global=u})(O);class oi{}window.slStore=Object.create(null);const si=(t,e)=>Vn.buildLogger(t,e,{mount:({storeName:r})=>{window.slStore[r]||(window.slStore[r]={mounted:!0,history:[{type:"mount"}]}),window.slStore[r].store=t},unmount:({storeName:r})=>{window.slStore[r].mounted=!1,window.slStore[r]?.history.push({type:"unmount"})},change:({actionName:r,storeName:o,changed:s,newValue:u,oldValue:f,valueMessage:c})=>{window.slStore[o]?.history.push({type:"change",changed:s,newValue:u,oldValue:f,diff:Mn({...f},{...u},{cyclesFix:!1}),actionName:r,valueMessage:c})},action:{start:({actionName:r,args:o,storeName:s})=>{window.slStore[s]?.history.push({type:"action:start",actionName:r,args:o,storeName:s})},error:({actionName:r,error:o,storeName:s})=>{window.slStore[s]?.history.push({type:"action:error",actionName:r,error:o})},end:({actionName:r,storeName:o})=>{window.slStore[o]?.history.push({type:"action:end",actionName:r})}}});class Ot{store;name;constructor(e,r){this.store=e,this.name=r,si(this.store,this.name)}getStore(){return this.store}}const ai=t=>{const e=Object.keys(t);return Me.computed(e.map(r=>t[r].getStore()),(...r)=>Object.fromEntries(e.map((o,s)=>[o,r[s]])))};class ut extends Ot{getValues=()=>this.getStore().get();getValue=e=>this.getStore().get()[e];setValue=(e,r)=>this.getStore().setKey(e,r);subscribe=(...e)=>this.getStore().subscribe(...e);unsubscribe=()=>this.getStore().off()}const $e=t=>Me.map(t);var Te;(function(t){t.ORGANIZATION="ORGANIZATION",t.STREAM="STREAM"})(Te||(Te={}));const ui={[ce.SdkOverlayType.BETTING]:"betting",[ce.SdkOverlayType.GAMES]:"games",[ce.SdkOverlayType.PUBLIC_CHAT]:"publicChat",[ce.SdkOverlayType.TWITTER]:"twitter"};var je;(function(t){t.Ready="ready",t.Suspended="suspended"})(je||(je={}));class fr{status;source;config;settings;listeners=new Set;settingsKey;constructor({settings:e,...r},o){this.settingsKey=ui[r.type],this.status=Me.atom(je.Suspended),this.config=new ut($e(r),`feature:config:${this.settingsKey}`),this.settingsKey!==void 0&&e?.overlaySettings.case===this.settingsKey?this.settings=new ut($e(e.overlaySettings.value),`feature:settings:${this.settingsKey}`):this.settings=new ut($e({}),`feature:settings:${this.settingsKey}`),this.source=o}get featureConfig(){return this.config.getStore()}get featureSettings(){return this.settings.getStore()}registerEventListener(e){this.listeners.add(e)}enable=()=>{this.status.set(je.Ready)};disable=()=>{this.status.set(je.Suspended)};setFeatureConfig=({settings:e,...r})=>{let o;for(o in r)this.config.setValue(o,r[o]);if(e?.overlaySettings?.case!==void 0&&e?.overlaySettings.case===this.settingsKey){const s=e.overlaySettings.value;if(s!==void 0){let u;for(u in s)console.log(u,s[u]),s[u]!==0&&s[u]!==""&&this.settings.setValue(u,s[u])}}};update=(e,r)=>{this.source===Te.STREAM&&r===Te.ORGANIZATION||(this.setFeatureConfig(e),this.source=r)};fireEvent(e){for(const r of this.listeners.values())try{r.onEvent(e)}catch(o){console.error(o)}}}class ye extends Ot{getValue=()=>this.getStore().get();getValues(){throw new Error("not implemented")}setValue=e=>this.getStore().set(e);subscribe=e=>this.getStore().subscribe(e);unsubscribe=()=>this.getStore().off();listen(e){return this.getStore().listen(e)}get(){return this.getStore().get()}}const ie=t=>Me.atom(t);class pe extends Ot{atomStore;constructor(e,r,o){super(e,`api:${r}`),this.atomStore=Me.atom(),o&&e.subscribe(s=>{const u=this.atomStore.get(),f=o(s,u);u!==f&&this.atomStore.set(f)})}getAtomStore=()=>this.atomStore;getValue=async()=>{const e=this.getStore();if(e.value===void 0)throw new Error("no store");return await e.value.promise,e.get().data};getValues=()=>{throw new Error("not implemented")};setValue=e=>this.getStore().set({loading:!1,data:e?.data});subscribe=e=>this.getStore().subscribe(e);unsubscribe=()=>{throw new Error("not implemented")};invalidate=()=>{this.store.invalidate()};listen=e=>this.getStore().listen(e);get(){throw new Error("not implemented")}key=()=>this.getStore().key;off=()=>this.getStore().off()}async function*ci(t,e){for await(const r of e){t.response.message=r,t.received_at=Date.now();const o={type:"__GRPC_DEVTOOLS_EXTENSION__",data:t};window.postMessage(o),yield r}}const li=()=>t=>async e=>{const r={name:e.url,request:{},response:{}};r.request.header=Object.fromEntries(e.header.entries()),r.sent_at=Date.now();try{const o=await t(e);if(r.received_at=Date.now(),r.stream=o.stream,r.response.header=Object.fromEntries(o.header.entries()),r.response.trailer=Object.fromEntries(o.trailer.entries()),o.stream)return{...o,message:ci(r,o.message)};{r.request.message=e.message,r.response.message=o.message,r.latency=r.received_at-r.sent_at;const s={type:"__GRPC_DEVTOOLS_EXTENSION__",data:r};window.postMessage(s)}return o}catch(o){r.received_at=Date.now(),r.request.message=e.message,r.response.trailer={"grpc-status":o.code,"grpc-message":o.rawMessage},r.response.message=o.rawMessage,r.latency=r.received_at-r.sent_at;const s={type:"__GRPC_DEVTOOLS_EXTENSION__",data:r};throw window.postMessage(s),o}};window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));var Ee;(function(t){t.Init="init",t.Ready="ready",t.Connecting="connecting",t.Connected="connected",t.Disconnected="disconnected",t.Failed="failed",t.Reconnecting="reconnecting"})(Ee||(Ee={}));class fi{params;stream;method;name;headers;listeners;state;store;constructor(e,r,o,s){const u={status:Ee.Init,ts:new Date,log:[]};this.state=new ut($e(u),`subscription:${s.name}:state`),this.name=s.name,this.headers=e,this.listeners=new Map,this.params=o,this.method=r,s.withStore&&(this.store=new ye(ie(null),`subscription:${s.name}:store`)),"subscribe"in o&&typeof o.subscribe=="function"&&o.subscribe(()=>{this.reconnect()}),this.updateState(Ee.Ready)}updateState=e=>{this.state.setValue("status",e),this.state.setValue("ts",new Date),this.addStateLog(`status => ${e}`)};addStateLog=e=>{const r=this.state.getStore().get().log;this.state.setValue("log",[...r,`${new Date().toLocaleString()}: ${e}`])};addListener=(e,r)=>this.listeners.has(e)?(this.addStateLog(`listener '${e}' not added`),!1):(this.listeners.set(e,r),this.addStateLog(`listener '${e}' added`),!0);removeListener=e=>{this.listeners.delete(e),this.addStateLog(`listener '${e}' removed`)};connect=()=>{this.updateState(Ee.Connecting),this.stream&&(this.addStateLog("disconnect prev connection"),this.stream());const e="get"in this.params&&typeof this.params.get=="function"?this.params.get():this.params;this.stream=this.method(e,this.onData,this.onStreamError,{headers:this.headers.getValues()}),this.updateState(Ee.Connected)};disconnect=()=>{this.stream&&this.stream(),this.listeners.clear(),this.updateState(Ee.Disconnected)};reconnect=()=>{this.updateState(Ee.Reconnecting),this.connect()};getStore=()=>this.store?.getStore();onData=e=>{this.addStateLog(`received data => ${JSON.stringify(e)}`),this.store&&this.store.setValue(e);for(const[,r]of this.listeners)r(e);this.addStateLog(`data routed to ${this.listeners.size} listeners`)};onStreamError=e=>{e!==void 0&&(e.code!==Yt.Code.Canceled&&e.rawMessage!=="[canceled] BodyStreamBuffer was aborted"?(this.updateState(Ee.Failed),this.state.setValue("error",e),this.reconnect()):this.disconnect())}}class di{toJsonOptions={emitDefaultValues:!1,enumAsInteger:!0,useProtoFieldName:!1};transport;nanoquery;host;interceptors=[];$headers;clients;callbackClients;subscriptions;constructor(e){this.host=e,this.$headers=new ut($e({"sl-device-id":O.process?.env?.NX_DEVICE_ID||"sdk-web-dev"}),"transport:headers"),this.initInterceptors(),this.clients=new Map,this.callbackClients=new Map,this.subscriptions=new Map;const[r,o,s]=Qn.nanoquery();this.nanoquery={createFetcherStore:r,createMutatorStore:o,utils:s},this.transport=qn.createGrpcWebTransport({baseUrl:e,interceptors:this.interceptors,useBinaryFormat:!0})}addSubscription=(e,r,o)=>{const s=this.subscriptions.get(r);if(s)return s;const u=new fi(this.$headers,e,r,o);return this.subscriptions.set(r,u),u};removeSubscription=e=>{e.disconnect(),this.subscriptions.delete(e.params)};disconnect=()=>{for(const[e,r]of this.subscriptions)r.disconnect(),this.subscriptions.delete(e)};registerInterceptor=e=>{this.interceptors.push(e)};removeInterceptor=e=>{this.interceptors=this.interceptors.filter(r=>r!==e)};getClient=e=>{const r=e.typeName;if(this.clients.has(r))return this.clients.get(r);const o=Yt.createPromiseClient(e,this.transport);return this.clients.set(r,o),o};getCallbackClient=e=>{const r=e.typeName;if(this.callbackClients.has(r))return this.callbackClients.get(r);const o=Yt.createCallbackClient(e,this.transport);return this.callbackClients.set(r,o),o};createPromiseClient=(e,{params:r=[],method:o})=>{const s=this.getClient(e),u=e.methods[o].name,f=[e.typeName,u.charAt(0).toLowerCase()+u.slice(1),...Array.isArray(r)?r:[r]],c=[e.typeName,u.charAt(0).toLowerCase()+u.slice(1)];return{client:s,queryKey:f,queryKeyStr:c.join("")}};createCallbackClient=e=>({client:this.getCallbackClient(e)});setSdkKey=e=>{this.$headers.setValue("sdk",e)};setAuth=(e,r)=>{this.$headers.setValue("authorization",e),this.$headers.setValue("sl-user-id",r)};setHeader=(e,r)=>this.$headers.setValue(e,r);getHeader=e=>this.$headers.getValue(e);getHeaders=()=>this.$headers.getValues();initInterceptors=()=>{if(this.interceptors.length!==0)return;const e=r=>o=>{const s=this.$headers.getValues();for(const u in s)o.header.set(u,s[u]);return r(o)};this.interceptors.push(e),this.interceptors.push(li())}}const hi=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(Gn.Events,{method:"retrieveEventId",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>{if(!f||typeof f!="string")return"";try{return(await r.retrieveEventId({id:f})).data?.id||""}catch{return""}}})},pi=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(ft.Client,{method:"getStream",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>f?(await r.getStream({id:f})).data?.attributes:void 0})},yi=(t,e)=>{const{queryKey:r,client:o}=e.createPromiseClient(Kr.Users,{method:"me",params:[t]});return e.nanoquery.createFetcherStore(r,{fetcher:()=>o.me({})})},gi=t=>{const{client:e}=t.createPromiseClient(Kr.Users,{method:"bypassAuth"});return({userKey:r,schema:o,init:s})=>e.bypassAuth({userKey:r,schema:o,init:s})},mi=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(ft.Client,{method:"get",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async()=>(await r.get({})).data?.attributes})},wi=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(ft.Client,{method:"getOrganization",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async()=>{const s=await r.getOrganization({});return s.data?{...s.data.attributes,id:s.data.id}:void 0}})},bi=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(ft.Client,{method:"getOrganizationAdvertising",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async()=>(await r.getOrganizationAdvertising({})).data?.attributes})},vi=(t,e,r)=>{t.transport=new di(e.host),t.sdk.host=t.transport.host,t.transport.setSdkKey(e.sdkKey),r()};class dr{delimiter=":";prefix;constructor(e="main"){this.prefix=`sl-sdk${this.delimiter}${e}`}clear=()=>{for(const e in window.localStorage)e.startsWith(this.prefix)&&window.localStorage.removeItem(e)};generateKey=e=>`${this.prefix}${this.delimiter}${e.join(this.delimiter)}`;write=(...e)=>{const r=e.pop()||"";window.localStorage.setItem(this.generateKey(e),r)};read=(...e)=>{const r=window.localStorage.getItem(this.generateKey(e));return r===null?void 0:r};remove=(...e)=>{window.localStorage.removeItem(this.generateKey(e))}}var Ie;(function(t){t.SCHEMA="schema",t.EXTERNAL_TOKEN="eToken",t.TOKEN="token"})(Ie||(Ie={}));class He extends dr{constructor(){super("user")}setSchema=e=>{this.write(Ie.SCHEMA,e)};getSchema=()=>this.read(Ie.SCHEMA);setToken=e=>{this.write(Ie.TOKEN,e)};getToken=()=>this.read(Ie.TOKEN);setExternalToken=e=>{this.write(Ie.EXTERNAL_TOKEN,e)};getExternalToken=()=>this.read(Ie.EXTERNAL_TOKEN);removeToken=()=>{this.remove(Ie.TOKEN)}}var Fe;(function(t){t.DISABLED="disabled",t.INITIALIZATION="initialization",t.READY="ready",t.FAILED="failed",t.SUSPENDED="suspended"})(Fe||(Fe={}));const Si=t=>{const e=new He,r=new ye(ie(e.getExternalToken()),"userKey"),o=new ye(ie(e.getToken()),"userToken"),s=new pe(yi(o.getStore(),t),"user",({data:f,error:c,loading:h},b)=>{if(!c)return f?.data?.id?f.data.id:h===!1?void 0:b}),u=new pe(mi(o.getStore(),t),"userSettings");return{userKey:r,userToken:o,user:s,userSettings:u}},Ai=t=>{const e=new ye(ie(void 0),"providerStreamId"),r=new pe(hi(e.getStore(),t),"slStreamId",s=>s?.data),o=new pe(pi(r.getAtomStore(),t),"streamSettings");return r.getAtomStore().listen(s=>{(s===""||s===void 0)&&o.getStore().mutate(void 0)}),{providerStreamId:e,slStreamId:r,streamSettings:o}},Ei=t=>{const e=new ye(ie(void 0),"enabled"),r=new ye(ie(Fe.DISABLED),"status"),o=new pe(wi(e.getStore(),t),"organizationSettings",c=>c?.data?.id),s=new pe(bi(o.getAtomStore(),t),"organizationAdvertising"),u=Si(t),f=Ai(t);return{enabled:e,status:r,providerStreamId:f.providerStreamId,slStreamId:f.slStreamId,streamSettings:f.streamSettings,user:u.user,userKey:u.userKey,userToken:u.userToken,userSettings:u.userSettings,organizationSettings:o,organizationAdvertising:s}};class Ii extends Ot{stores;constructor(e){const r=Ei(e),o=ai(r);super(o,"core"),this.stores=r}getValue(){throw new Error("Not implemented")}getValues(){return this.stores}setValue(){throw new Error("Not implemented")}subscribe=e=>{let r;for(r in this.stores){const o=e[r];r in e&&o!==void 0&&this.stores[r].subscribe(e[r])}};unsubscribe=()=>this.getStore().off()}class Ti extends oi{$coreStore;transport;bypassLogin;constructor(e,r){super(),this.$coreStore=e,this.transport=r,this.bypassLogin=gi(this.transport),this.connect()}me=async()=>(this.$coreStore.getValues().user.invalidate(),(await this.$coreStore.getValues().user.getValue())?.data);login=async(e,r)=>{this.$coreStore.getValues().userKey.setValue(r);const o=await this.bypassLogin({schema:e,userKey:r,init:!1}),s=o.meta?.jwt,u=o.data?.id;if(!s||!u)throw new Error("internal: token missing");return this.$coreStore.getValues().user.getStore().mutate(o),this.saveUser(s,u),s};isAuthenticated=()=>this.me();logout=()=>{this.$coreStore.getValues().user.setValue(),this.$coreStore.getValues().userKey.setValue(),this.$coreStore.getValues().userToken.setValue(),this.transport.setAuth("",""),new He().clear()};softLogout=()=>{const e=new He;this.transport.setAuth("",""),e.setToken(""),this.reLogin()};reLogin=()=>{const e=new He,r=e.getToken(),o=e.getExternalToken();if(this.$coreStore.getValues().userKey.setValue(o),r)return this.saveUser(r,""),this.me().then(s=>{if(s?.id){const u=s.id;this.saveUser(r,u)}});if(o&&!r){const s=e.getSchema();s&&o&&this.login(s,o).catch(()=>{this.logout()})}};saveUser=(e,r)=>{this.transport.setAuth(e,r),this.$coreStore.getValues().userToken.setValue(e),new He().setToken(e)};connect=()=>{this.transport.registerInterceptor(e=>async r=>{try{return await e(r)}catch(o){throw o.code&&(o.code===7||o.code===16)&&this.transport.getHeader("authorization")&&this.softLogout(),o}})}}const at=new He,Fi=(t,e,r)=>{t.auth=new Ti(t.store,t.transport),t.stores.status.listen(o=>{o===Fe.READY&&t.auth.reLogin()}),t.sdk.userId=t.stores.user.getAtomStore,t.sdk.authorizationBypass=async(o,s)=>{if(!(at.getSchema()===o&&at.getExternalToken()===s&&t.transport.getHeader("authorization")))try{await t.auth.login(o,s),at.setSchema(o),at.setExternalToken(s)}catch{t.sdk.logout()}},t.sdk.logout=()=>{t.auth.logout(),at.clear()},t.sdk.getUserStore=()=>t.stores.user.getStore(),t.sdk.isUserAuthorized=()=>t.auth.isAuthenticated(),r()},_i=(t,e,r)=>{t.store=new Ii(t.transport),t.stores=t.store.getValues(),t.sdk.enabled=t.stores.enabled.getStore(),t.sdk.status=t.stores.status.getStore(),t.sdk.sdkStore=Object.fromEntries(Object.entries(t.stores).map(([o,s])=>[o,s.getStore()])),t.sdk.organizationStore=()=>t.stores.organizationSettings.getStore(),t.sdk.streamStore=()=>t.stores.streamSettings.getStore(),t.storeUnsubscribe=()=>{t.store.unsubscribe()},r()},Ci=(t,e,r)=>{t.sdk=Object.create(null),t.sdk.initializeApp=async()=>{if(t.stores.enabled.get()==="on")return{enabled:!0};t.storeSubscribe(),t.stores.enabled.setValue("on"),t.stores.status.setValue(Fe.INITIALIZATION);try{const o=await t.stores.organizationSettings.getValue();return o?(t.stores.status.setValue(Fe.READY),{enabled:!!o}):(t.stores.status.setValue(Fe.FAILED),{err:"failed"})}catch(o){return t.stores.enabled.setValue(),t.stores.status.setValue(Fe.FAILED),{err:`${o}`}}},t.sdk.disableApp=()=>{t.stores.enabled.get()==="on"&&(t.stores.enabled.setValue(),t.stores.status.setValue(Fe.DISABLED),t.sdk.closeFeature(),t.storeUnsubscribe())},t.sdk.createEventSession=o=>{t.stores.providerStreamId.setValue(o)},r()},Oi=zn.pino({level:"trace",enabled:!1,browser:{write:t=>{console.log(t)}}}),rn=(t,e)=>Oi.child({name:t},e),xi=(t,e,r)=>{const{client:o,queryKey:s}=r.createPromiseClient(Hr.Leaderboard,{method:"summary",params:[t,e]});return r.nanoquery.createFetcherStore(s,{fetcher:async(u,f,c,h)=>(await o.summary({eventId:c,userId:h})).data?.attributes})},Bi=t=>{const{client:e}=t.createPromiseClient(Hr.Leaderboard,{method:"list"});return r=>e.list(r)},ki=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(Se.Feed,{method:"get",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>(await r.get({eventId:f})).data?.attributes})},Pi=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(Se.Feed,{method:"syncQuestion",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>f?(await r.syncQuestion({filter:{eventId:f}})).data?.attributes:void 0})},Ri=(t,e)=>{const{client:r}=e.createCallbackClient(Se.Feed),o=Me.atom({eventId:t.get()||"",feedId:""});return t.subscribe((u="")=>{o.set({eventId:u,feedId:""})}),e.addSubscription(r.subscription,o,{name:"feedSubscription"})},Li=(t,e)=>{const{client:r}=e.createCallbackClient(Se.Feed);return e.addSubscription(r.questionSubscription,{questionId:t},{name:"questionSubscription"})},nn=async(t,e)=>{const{client:r}=e.createPromiseClient(Se.Feed,{method:"questionByUser",params:[t]});return(await r.questionByUser({questionId:t})).data?.attributes?.question},Ni=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(Se.Feed,{method:"list",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>f?(await r.list({eventId:f,filter:{statuses:[te.QuestionStatus.ACTIVE,te.QuestionStatus.RESOLVED]}})).data:[]})},Ui=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(Se.Feed,{method:"insightHistory",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>f?(await r.insightHistory({eventId:f})).data?.map(({attributes:h})=>h):void 0})};var hr={exports:{}};const $i=Object.getPrototypeOf({});function pr(t){function e(I){return I!=="constructor"&&I!=="prototype"&&I!=="__proto__"}function r(I){let _=0;const j=I.length,U=new Array(j);for(_=0;_<j;++_)U[_]=T(I[_]);return U}function o(I){const _={};if(h&&Object.getPrototypeOf(I)!==$i)return h(I);const j=c(I);let U,F,x;for(U=0,F=j.length;U<F;++U)e(x=j[U])&&(_[x]=T(I[x]));return _}function s(I,_){const j=I.length,U=_.length;let F=0;const x=new Array(j+U);for(F=0;F<j;++F)x[F]=T(I[F]);for(F=0;F<U;++F)x[F+j]=T(_[F]);return x}const u=Object.prototype.propertyIsEnumerable;function f(I){const _=Object.keys(I),j=Object.getOwnPropertySymbols(I);for(let U=0,F=j.length;U<F;++U)u.call(I,j[U])&&_.push(j[U]);return _}const c=t&&t.symbols?f:Object.keys,h=typeof t?.cloneProtoObject=="function"?t.cloneProtoObject:void 0;function b(I){return typeof I=="object"&&I!==null&&!(I instanceof RegExp)&&!(I instanceof Date)}function g(I){return typeof I!="object"||I===null}const m=typeof O.Buffer<"u"?I=>typeof I!="object"||I===null||I instanceof RegExp||I instanceof Date||I instanceof O.Buffer:I=>typeof I!="object"||I===null||I instanceof RegExp||I instanceof Date,E=t&&typeof t.mergeArray=="function"?t.mergeArray({clone:T,deepmerge:P,getKeys:c,isMergeableObject:b}):s;function T(I){return b(I)?Array.isArray(I)?r(I):o(I):I}function L(I,_){const j={},U=c(I),F=c(_);let x,k,G;for(x=0,k=U.length;x<k;++x)e(G=U[x])&&F.indexOf(G)===-1&&(j[G]=T(I[G]));for(x=0,k=F.length;x<k;++x)e(G=F[x])&&(G in I&&(U.indexOf(G)!==-1&&(j[G]=P(I[G],_[G])),!0)||(j[G]=T(_[G])));return j}function P(I,_){const j=Array.isArray(_),U=Array.isArray(I);return g(_)?_:m(I)?T(_):j&&U?E(I,_):j!==U?T(_):L(I,_)}function K(){switch(arguments.length){case 0:return{};case 1:return T(arguments[0]);case 2:return P(arguments[0],arguments[1])}let I;for(let _=0,j=arguments.length;_<j;++_)I=P(I,arguments[_]);return I}return t&&t.all?K:P}hr.exports=pr;hr.exports.default=pr;var ji=hr.exports.deepmerge=pr;const Di=t=>(e,r)=>{let o=0;const s=e.length,u=r.length,f=Math.max(s,u),c=new Array(f);for(o=0;o<f;++o)o<u?c[o]=t.deepmerge(e[o],r[o]):c[o]=t.clone(e[o]);return c},Vi=ji({mergeArray:Di}),Mi=(t,e,r)=>{const o=Me.computed([e,r],(f,c)=>{if(f){if(c.data)return c.data.find(h=>h.id===f);console.error("Feed list is not loaded yet. Issue with the opened question.")}}),s=$e({data:void 0,loading:void 0,error:void 0});return o.subscribe(async f=>{if(f&&f.type==="question"){s.setKey("loading",!0);const c=await nn(f.id,t);s.set({data:c,loading:!1});return}s.set({data:void 0,loading:!1})}),{$store:o,$extendedStore:s,updateExtendedQuestion:f=>{const c=s.get().data;if(c)for(const h of f?.answers||[])h.youVoted!==!0&&delete h.youVoted;s.set({data:Vi(c,f)})}}},on=t=>(t.gamification||(t.gamification=new qi(t)),t.gamification);class qi{slStreamId;organizationId;userId;openedQuestionId;openedQuestion;activeQuestionId;feedList;moderationId;moderation;feedSubscription;questionSubscription;notifications;log;constructor(e){if(e.gamification)throw new Error("GamificationBackground Singleton error");this.log=rn("gamification-background"),this.slStreamId=e.stores.slStreamId.getAtomStore(),this.organizationId=e.stores.organizationSettings.getAtomStore(),this.userId=e.stores.user.getAtomStore(),this.moderationId=new ye(ie(void 0),"moderationId").getStore(),this.openedQuestionId=new ye(ie(void 0),"openedQuestionId").getStore(),this.notifications=e.notifications,this.moderation=new pe(ki(this.slStreamId,e.transport),"gamification:moderation"),this.feedList=new pe(Ni(this.slStreamId,e.transport),"gamification:feedList"),this.activeQuestionId=new pe(Pi(this.slStreamId,e.transport),"gamification:activeQuestionId"),this.openedQuestion=Mi(e.transport,this.openedQuestionId,this.feedList.getStore()),this.openedQuestionId.listen(r=>{this.log.debug({questionId:r},"received question"),r?(this.questionSubscription=Li(r,e.transport),this.questionSubscription.addListener("feed-subscription-opened-question",o=>{window.requestAnimationFrame(()=>{this.openedQuestion.updateExtendedQuestion(o.data?.attributes?.question)})}),this.questionSubscription.connect()):(this.log.info("cleanup on close question"),this.questionSubscription!==void 0&&(e.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0))}),this.feedSubscription=Ri(this.slStreamId,e.transport),this.feedSubscription.addListener("feed-subscription-active-question",r=>{window.requestAnimationFrame(()=>{const o=this.activeQuestionId.getStore();o&&o.mutate(r.data?.attributes)})})}getCurrentSessionId=e=>{const r=e.eventId||this.slStreamId.get()||"",o=e.userId||this.userId.get()||"",s=e.organizationId||this.organizationId.get()||"",u=e.entity||"",f=e.prefix||"";return[s,r,o,f,u].join(":")};disconnect=()=>{this.feedSubscription?.disconnect()};openQuestion=e=>{this.openedQuestionId.set(e),this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:e}))};closeQuestion=e=>{this.openedQuestionId.set(void 0),e&&this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:e}))}}class Qi{notificationsList;notifications;store;timeouts;waitingQueue;activeQueue;options;logger;constructor(e){this.options=e,this.logger=rn("notifications"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.notifications=new ye(ie(new Map),"notifications-queue"),this.notificationsList=this.notifications.getStore()}addToQueue=e=>{if(this.store.has(e.id)){this.logger.debug({notification:e},"skip existed notification: %o");return}const r=e.close,o=e.action;if(this.store.set(e.id,{...e,close:(...s)=>{r&&r(...s),this.closeNotification(e.id)},action:(...s)=>{o&&o(...s),this.closeNotification(e.id)}}),this.waitingQueue.add(e.id),this.activeQueue.size===this.options.concurrency){const[s]=this.activeQueue;this.closeNotification(s)}else this.tickWaitingQueue()};tickWaitingQueue=()=>{if(this.activeQueue.size<this.options.concurrency){const[e]=this.waitingQueue;if(!e)return;this.activeQueue.add(e),this.waitingQueue.delete(e),this.logger.debug({job:e},"waiting queue tick"),this.tickActiveQueue(e)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")};tickActiveQueue=e=>{if(!e)return;const r=this.store.get(e);if(!r){this.logger.debug({notificationId:e},"active queue tick skipped, notification not exist");return}const o=setTimeout(()=>{const s=e,u=new Map(this.notifications.getValue());u.set(r.id,r),this.notifications.setValue(u);const f=setTimeout(()=>{this.logger.debug({notificationId:s,delay:r.autoHideDuration||5e3},"notification hiding by autoHideDuration"),this.closeNotification(s)},r.autoHideDuration||5e3);this.timeouts.set(s,f),this.logger.debug({notificationId:s,queue:[...u.values()]},"notification displayed")},r.delay||0);this.timeouts.set(e,o),this.logger.debug({notificationId:e},"active queue tick completed"),this.tickWaitingQueue()};closeNotification=e=>{const r=new Map(this.notifications.getValue()),o=r.get(e);if(o){o.hiding=!(this.waitingQueue.size>=this.options.concurrency),this.notifications.setValue(r);const s=setTimeout(()=>{const u=new Map(this.notifications.getValue());u.delete(e),this.notifications.setValue(u);const f=this.timeouts.get(e);f!==void 0&&(clearTimeout(f),this.timeouts.delete(e)),this.logger.debug({notificationId:e},"notification hidden")},this.options.animationDelay||0);this.timeouts.set(e,s)}this.store.delete(e),this.activeQueue.delete(e),this.waitingQueue.delete(e),this.tickWaitingQueue(),this.logger.debug({notificationId:e},"notification hiding")}}var St;(function(t){t.OPENED="opened"})(St||(St={}));class Gi extends dr{constructor(){super("notification")}setOpened=e=>{this.write(St.OPENED,e,"true")};isOpened=e=>this.read(St.OPENED,e);clearNotification=()=>{this.clear()}}var Le;(function(t){t[t.ONBOARDING=1]="ONBOARDING",t[t.QUESTION=2]="QUESTION",t[t.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(Le||(Le={}));class zi{queue;storage;constructor(e={}){this.storage=new Gi,this.queue=new Qi({concurrency:1,animationDelay:1600,...e})}add=e=>{this.storage.isOpened(e.id)||this.queue.addToQueue(e)};close=e=>{this.queue.closeNotification(e),this.markAsViewed(e)};getQueueStore=()=>this.queue.notificationsList;markAsViewed=e=>{this.storage.setOpened(e)}}const Ki=(t,e,r)=>{t.notifications=new zi,t.addNotification=t.notifications.add,t.sdk.getNotificationsStore=()=>t.notifications.getQueueStore(),r()},Hi=(t,e)=>{const{client:r}=t.createPromiseClient(Se.Feed,{method:"submitAnswer"});return r.submitAnswer({data:e})},Wi=(t,e)=>{const{client:r}=t.createPromiseClient(Se.Feed,{method:"submitInplay"});return r.submitInplay({data:{eventId:+e}})},Ji=(t,e)=>{const{client:r}=t.createPromiseClient(Se.Feed,{method:"skipQuestion"});return r.skipQuestion({data:{id:e}})};var At;(function(t){t.ONBOARDING="onboarding"})(At||(At={}));class sn extends dr{constructor(){super("gamification")}saveOnboardingStatus=({userId:e,eventId:r,organizationId:o},s)=>{this.write(At.ONBOARDING,o,e,r,s)};getOnboardingStatus=({userId:e,eventId:r,organizationId:o})=>this.read(At.ONBOARDING,o,e,r)}const Tr={pageSize:10},Yi=(t,e,r)=>{const o=ie({pageSize:r?.pageSize||Tr.pageSize,page:0}),s=$e({data:[],loading:void 0,error:void 0}),u=Bi(t),f=async b=>{if(b){s.setKey("loading",!0);const g={eventId:b,pagination:{page:0,pageSize:r?.pageSize||Tr.pageSize}},m=await u(g);s.set({data:m.data.map(E=>E.attributes),loading:!1}),o.set(g.pagination)}};e.listen(f);const c=()=>{f(e.get())};return o.listen(async b=>{const g=e.get(),m=s.get().data?.length||0;if(b.page>0&&g&&m>=b.page*b.pageSize){s.setKey("loading",!0);const T=await u({eventId:g,pagination:b}),L=s.get().data||[];s.set({data:[...L,...T.data.map(P=>P.attributes)],loading:!1})}}),{$store:s,fetchMore:()=>{const b=o.get();o.set({...b,page:b.page+1})},invalidate:c}},Xi=(t,e)=>{const{client:r,queryKey:o}=t.createPromiseClient(ft.Client,{method:"generateDeepLink",params:e});return t.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>f?(await r.generateDeepLink({data:{eventId:f}})).data?.attributes:{}})},Zi=(t,e,r)=>{const o=Xi(t,[e]),s=`${window.location.host+window.location.pathname}%23sl_eid=${e.get()}&sl_uid=${r.get()}`;return{$store:o,fetch,desktopLink:s}};var ne;(function(t){t.Unset="unset",t.Required="required",t.Optional="optional",t.Completed="completed",t.Disabled="disabled",t.Unavailable="unavailable"})(ne||(ne={}));const eo=(t,e,r,o)=>{const s=new sn,u=ie(ne.Unset),f=()=>{const{inplayGame:b}=t.featureSettings.get(),g=e.getCurrentSessionId({prefix:"onboarding"});b&&o.add({type:Le.ONBOARDING,id:g,action:t.openFeature,close:()=>{o.markAsViewed(g)},delay:1e3,autoHideDuration:1e6,data:{questionType:te.QuestionType.UNSET,onboarding:{...b}}})};u.subscribe(b=>{(b===ne.Optional||ne.Required)&&f(),b===ne.Completed&&e.activeQuestionId.invalidate()});const c=async()=>{const b=e.userId.get();if(!b){u.set(ne.Unset);return}s.getOnboardingStatus({userId:b,organizationId:e.organizationId.get()||"",eventId:e.slStreamId.get()||""})===ne.Completed&&u.set(ne.Completed);const m=await e.moderation.getValue();if(u.get()===ne.Completed)return;const E=!!(m?.options?.onboardingEnabled&&t.featureSettings.get().inplayGame?.onboarding?.completed),T=!!t.featureSettings.get().inplayGame?.titleCard?.optIn;E?T?u.set(ne.Required):u.set(ne.Optional):T?u.set(ne.Unavailable):u.set(ne.Disabled)};return c(),e.userId.subscribe(b=>{b&&c()}),e.moderation.subscribe(b=>{b.data&&c()}),{$store:u,submitInplay:async()=>{const b=e.slStreamId.get();if(b){await Wi(r,b),u.set(ne.Completed),s.saveOnboardingStatus({organizationId:e.organizationId.get()||"",userId:e.userId.get()||"",eventId:b},ne.Completed);const g=e.getCurrentSessionId({prefix:"onboarding"});o.close(g)}}}},to=new Set([te.QuestionType.POLL,te.QuestionType.PREDICTION,te.QuestionType.TRIVIA]);class ro extends fr{userSummary;feedList;leaderboardId;leaderboardList;deepLink;onboardingStatus;openedQuestion;currentUserId;openedUser;closeFeature;openFeature;notifications;transport;background;storage;constructor(e,r,o){super(e,r),this.background=on(o),this.storage=new sn,this.userSummary=new pe(xi(this.background.slStreamId,this.background.userId,o.transport),"gamification:userSummary"),this.feedList=this.background.feedList,this.currentUserId=this.background.userId,this.openedUser=ie(void 0),this.leaderboardId=new ye(ie(this.settings.getValue("pinnedLeaderboardId")),"pinnedLeaderboardId").getStore(),this.onboardingStatus=eo(this,this.background,o.transport,o.notifications),this.notifications=o.notifications,this.transport=o.transport,this.closeFeature=o.sdk.closeFeature,this.openFeature=()=>o.sdk.openFeature(ce.SdkOverlayType.GAMES),this.openedQuestion=this.background.openedQuestion,this.deepLink=Zi(this.transport,this.background.slStreamId,this.background.userId),this.leaderboardList=Yi(this.transport,this.background.slStreamId),this.status.subscribe(s=>{s===je.Ready?this.connect(o.transport):this.disconnect()}),this.background.activeQuestionId.listen(s=>{if(s&&s.data&&this.onboardingStatus.$store.get()&&s.data.question?.id!==void 0&&s.data.question.notification!==void 0&&s.data.moderation?.bypassNotifications?.inAppSilence!==te.SilenceSetting.ON&&s.data.question.status===te.QuestionStatus.ACTIVE){if(to.has(s.data.question.type))this.notifications.add({type:Le.QUESTION,action:()=>s.data?.question&&this.openQuestion(s.data.question.id),close:()=>s.data?.question&&this.closeQuestion(s.data.question.id),autoHideDuration:1e3*60,id:this.background.getCurrentSessionId({prefix:"notification",entity:s.data.question.id}),data:{questionType:s.data.question.type,question:{title:s.data.question.notification.title}}});else if(s.data.question.type===te.QuestionType.FACTOID){const u=s.data.question.options?.options.value,f={heading:s.data.question.notification.title,body:s.data.question.notification.body,image:s.data.question.notification.image,video:{id:u?.video?.id||"",url:u?.video?.url||"",thumbnailUrl:u?.video?.thumbnailUrl||""},webLink:{label:"",url:""}};this.notifications.add({type:Le.QUESTION,action:()=>s.data?.question&&this.openQuestion(s.data.question.id),close:()=>s.data?.question&&this.closeQuestion(s.data.question.id),autoHideDuration:1e3*120,id:this.background.getCurrentSessionId({prefix:"notification",entity:s.data.question.id}),data:{questionType:s.data.question.type,insight:f}})}else if(s.data.question.type===te.QuestionType.TWEET){const u=s.data.question.options?.options.value,f={title:s.data.question.notification.title,body:s.data.question.notification.body,image:s.data.question.notification.image,account:{image:"",name:u?.tweetMeta?.account||"",userName:"",verified:!!u?.tweetMeta?.accountVerified}};this.notifications.add({type:Le.QUESTION,action:()=>s.data?.question&&this.openQuestion(s.data.question.id),close:()=>s.data?.question&&this.closeQuestion(s.data.question.id),autoHideDuration:1e3*120,id:this.background.getCurrentSessionId({prefix:"notification",entity:s.data.question.id}),data:{questionType:s.data.question.type,tweet:f}})}}})}connect=e=>{this.userSummary.invalidate(),this.leaderboardList.invalidate(),this.feedList.invalidate(),this.background.feedSubscription.addListener("feed-subscription-prediction-close",r=>{window.requestAnimationFrame(async()=>{const o=r.data?.attributes?.question;if(!o)return;const{status:s,type:u,id:f}=o;if(s===te.QuestionStatus.RESOLVED&&u===te.QuestionType.PREDICTION){const c=this.background.getCurrentSessionId({prefix:`notification-id:${f}`}),h=await nn(f,e),b=h?.answers.find(({correct:m})=>m),g=h?.answers.find(({youVoted:m})=>m);if(!g)return;this.notifications.add({type:Le.QUESTION_RESOLVED,action:()=>this.openQuestion(f),close:()=>this.closeQuestion(f),autoHideDuration:35e3,id:c,data:{questionType:te.QuestionType.PREDICTION,question:{title:b?.youVoted?`Congratulations! You answered correctly! You won ${b.points} pts!`:`Better luck next time! Correct: ${b?.text}!`,votedAnswer:{title:g?.text,points:g?.points},correctAnswerTitle:b?.text,correct:b?.youVoted,predictionResult:s===te.QuestionStatus.RESOLVED,questionTitle:h?.subject}}}),this.userSummary.invalidate()}})}),this.background.feedSubscription.addListener("feed-subscription-questions-list",()=>{window.requestAnimationFrame(()=>{this.feedList?.invalidate()})})};disconnect=()=>{this.background.feedSubscription.removeListener("feed-subscription-questions-list")};submitAnswer=async(e,r)=>{await Hi(this.transport,{questionId:e,answerId:r}),this.feedList.invalidate(),this.userSummary.invalidate()};skipQuestion=async e=>{await Ji(this.transport,e),this.feedList.invalidate(),this.userSummary.invalidate()};openQuestion=e=>(this.openFeature(),this.background.openQuestion(e));closeQuestion=e=>this.background.closeQuestion(e);openUser=e=>{const r=this.leaderboardList.$store.get().data?.find(o=>o.userId===e);this.openedUser.set(r)};closeUser=()=>{this.openedUser.set(void 0)}}class no extends fr{insights;closeFeature;openFeature;openedInsight;notifications;transport;background;constructor(e,r,o){super(e,r),this.background=on(o),this.notifications=o.notifications,this.transport=o.transport,this.closeFeature=o.sdk.closeFeature,this.openFeature=()=>o.sdk.openFeature(ce.SdkOverlayType.HIGHLIGHTS),this.status.subscribe(s=>{s===je.Ready?this.connect():this.disconnect()}),this.background.activeQuestionId.listen(s=>{s?.data?.question?.id&&s?.data?.question?.notification&&s.data.moderation?.bypassNotifications?.inAppSilence!==te.SilenceSetting.ON&&s.data.question.type===te.QuestionType.FACTOID&&s.data.question.status===te.QuestionStatus.ACTIVE&&this.notifications.add({type:Le.QUESTION,action:()=>s.data?.question&&this.openHighlight(s.data.question.id),close:()=>s.data?.question&&this.closeHighlight(s.data.question.id),autoHideDuration:1e3*+(s.data.question?.appearance?.autoHideInterval||"5"),id:this.background.getCurrentSessionId({prefix:"notification",entity:s.data.question.id}),data:{questionType:s.data.question.type,question:{title:s.data.question.notification.title}}})}),this.openedInsight=this.background.openedQuestion}connect=()=>{this.insights?this.insights.invalidate():this.insights=new pe(Ui(this.background.slStreamId,this.transport),"gamification:insights"),this.background.feedSubscription.addListener("feed-subscription-insights-list",()=>{window.requestAnimationFrame(()=>{this.insights?.invalidate()})})};disconnect=()=>{this.background.feedSubscription.removeListener("feed-subscription-insights-list")};openHighlight=e=>(this.openFeature(),this.background.openQuestion(e));closeHighlight=e=>this.background.closeQuestion(e)}ce.SdkOverlayType.GAMES+"",ce.SdkOverlayType.HIGHLIGHTS+"";class io extends fr{constructor(e,r){super(e,r)}}const oo=(t,e,r)=>t.type===ce.SdkOverlayType.GAMES?new ro(t,e,r):t.type===ce.SdkOverlayType.HIGHLIGHTS?new no(t,e,r):new io(t,e),so=(t,e,r)=>{t.features=new Map,t.activeFeature=new ye(ie(ce.SdkOverlayType.UNSET),"activeFeature"),t.sdk.getFeatures=()=>t.features,t.sdk.getFeature=o=>t.features.get(o),t.sdk.getActiveFeature=()=>t.activeFeature.getStore(),t.sdk.openFeature=o=>{t.activeFeature.setValue(o)},t.sdk.closeFeature=()=>{t.activeFeature.setValue(ce.SdkOverlayType.UNSET)},t.initFeature=(o,s=Te.ORGANIZATION)=>{const u=oo(o,s,t);t.features.set(o.type,u)},t.updateFeature=(o,s)=>{t.features.get(o.type)?.update(o,s)},t.destroyFeature=o=>{t.features.delete(o.type)},t.reinitializeFeatures=async()=>{const o=await t.stores.organizationSettings.getValue();t.features.clear();for(const s of o?.overlays||[])t.initFeature(s,Te.ORGANIZATION)},t.stores.providerStreamId.listen(o=>{o||t.reinitializeFeatures()}),t.storeSubscribe=()=>{const o=(u,f)=>{if(f?.overlays){u===Te.STREAM&&t.features.clear();for(const c of f.overlays)c.sdkEnable===!0&&(t.features.has(c.type)?t.updateFeature(c,u):t.initFeature(c,u))}},s={organizationSettings:u=>{if(u.data)try{o(Te.ORGANIZATION,u.data)}catch(f){console.log(f)}},streamSettings:u=>{if(u.data)try{o(Te.STREAM,u.data)}catch(f){console.log(f)}}};t.store.subscribe(s)},r()};var yr={exports:{}},gr={exports:{}};function ao(t){var e=new t,r=e;function o(){var u=e;return u.next?e=u.next:(e=new t,r=e),u.next=null,u}function s(u){r.next=u,r=u}return{get:o,release:s}}var uo=ao,co=uo;function an(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),r<1)throw new Error("fastqueue concurrency must be greater than 1");var o=co(lo),s=null,u=null,f=0,c=null,h={push:P,drain:ue,saturated:ue,pause:g,paused:!1,concurrency:r,running:b,resume:T,idle:L,length:m,getQueue:E,unshift:K,empty:ue,kill:_,killAndDrain:j,error:U};return h;function b(){return f}function g(){h.paused=!0}function m(){for(var F=s,x=0;F;)F=F.next,x++;return x}function E(){for(var F=s,x=[];F;)x.push(F.value),F=F.next;return x}function T(){if(h.paused){h.paused=!1;for(var F=0;F<h.concurrency;F++)f++,I()}}function L(){return f===0&&h.length()===0}function P(F,x){var k=o.get();k.context=t,k.release=I,k.value=F,k.callback=x||ue,k.errorHandler=c,f===h.concurrency||h.paused?u?(u.next=k,u=k):(s=k,u=k,h.saturated()):(f++,e.call(t,k.value,k.worked))}function K(F,x){var k=o.get();k.context=t,k.release=I,k.value=F,k.callback=x||ue,f===h.concurrency||h.paused?s?(k.next=s,s=k):(s=k,u=k,h.saturated()):(f++,e.call(t,k.value,k.worked))}function I(F){F&&o.release(F);var x=s;x?h.paused?f--:(u===s&&(u=null),s=x.next,x.next=null,e.call(t,x.value,x.worked),u===null&&h.empty()):--f===0&&h.drain()}function _(){s=null,u=null,h.drain=ue}function j(){s=null,u=null,h.drain(),h.drain=ue}function U(F){c=F}}function ue(){}function lo(){this.value=null,this.callback=ue,this.next=null,this.release=ue,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,o){var s=t.callback,u=t.errorHandler,f=t.value;t.value=null,t.callback=ue,t.errorHandler&&u(r,f),s.call(t.context,r,o),t.release(t)}}function fo(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function o(g,m){e.call(this,g).then(function(E){m(null,E)},m)}var s=an(t,o,r),u=s.push,f=s.unshift;return s.push=c,s.unshift=h,s.drained=b,s;function c(g){var m=new Promise(function(E,T){u(g,function(L,P){if(L){T(L);return}E(P)})});return m.catch(ue),m}function h(g){var m=new Promise(function(E,T){f(g,function(L,P){if(L){T(L);return}E(P)})});return m.catch(ue),m}function b(){if(s.idle())return new Promise(function(E){E()});var g=s.drain,m=new Promise(function(E){s.drain=function(){g(),E()}});return m}}gr.exports=an;gr.exports.promise=fo;var un=gr.exports,mr={exports:{}},Ye=typeof Reflect=="object"?Reflect:null,Fr=Ye&&typeof Ye.apply=="function"?Ye.apply:function(e,r,o){return Function.prototype.apply.call(e,r,o)},gt;Ye&&typeof Ye.ownKeys=="function"?gt=Ye.ownKeys:Object.getOwnPropertySymbols?gt=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:gt=function(e){return Object.getOwnPropertyNames(e)};function ho(t){console&&console.warn&&console.warn(t)}var cn=Number.isNaN||function(e){return e!==e};function q(){q.init.call(this)}mr.exports=q;mr.exports.once=mo;q.EventEmitter=q;q.prototype._events=void 0;q.prototype._eventsCount=0;q.prototype._maxListeners=void 0;var _r=10;function xt(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(q,"defaultMaxListeners",{enumerable:!0,get:function(){return _r},set:function(t){if(typeof t!="number"||t<0||cn(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");_r=t}});q.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};q.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||cn(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 ln(t){return t._maxListeners===void 0?q.defaultMaxListeners:t._maxListeners}q.prototype.getMaxListeners=function(){return ln(this)};q.prototype.emit=function(e){for(var r=[],o=1;o<arguments.length;o++)r.push(arguments[o]);var s=e==="error",u=this._events;if(u!==void 0)s=s&&u.error===void 0;else if(!s)return!1;if(s){var f;if(r.length>0&&(f=r[0]),f instanceof Error)throw f;var c=new Error("Unhandled error."+(f?" ("+f.message+")":""));throw c.context=f,c}var h=u[e];if(h===void 0)return!1;if(typeof h=="function")Fr(h,this,r);else for(var b=h.length,g=yn(h,b),o=0;o<b;++o)Fr(g[o],this,r);return!0};function fn(t,e,r,o){var s,u,f;if(xt(r),u=t._events,u===void 0?(u=t._events=Object.create(null),t._eventsCount=0):(u.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),u=t._events),f=u[e]),f===void 0)f=u[e]=r,++t._eventsCount;else if(typeof f=="function"?f=u[e]=o?[r,f]:[f,r]:o?f.unshift(r):f.push(r),s=ln(t),s>0&&f.length>s&&!f.warned){f.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=f.length,ho(c)}return t}q.prototype.addListener=function(e,r){return fn(this,e,r,!1)};q.prototype.on=q.prototype.addListener;q.prototype.prependListener=function(e,r){return fn(this,e,r,!0)};function po(){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 dn(t,e,r){var o={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},s=po.bind(o);return s.listener=r,o.wrapFn=s,s}q.prototype.once=function(e,r){return xt(r),this.on(e,dn(this,e,r)),this};q.prototype.prependOnceListener=function(e,r){return xt(r),this.prependListener(e,dn(this,e,r)),this};q.prototype.removeListener=function(e,r){var o,s,u,f,c;if(xt(r),s=this._events,s===void 0)return this;if(o=s[e],o===void 0)return this;if(o===r||o.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,o.listener||r));else if(typeof o!="function"){for(u=-1,f=o.length-1;f>=0;f--)if(o[f]===r||o[f].listener===r){c=o[f].listener,u=f;break}if(u<0)return this;u===0?o.shift():yo(o,u),o.length===1&&(s[e]=o[0]),s.removeListener!==void 0&&this.emit("removeListener",e,c||r)}return this};q.prototype.off=q.prototype.removeListener;q.prototype.removeAllListeners=function(e){var r,o,s;if(o=this._events,o===void 0)return this;if(o.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):o[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete o[e]),this;if(arguments.length===0){var u=Object.keys(o),f;for(s=0;s<u.length;++s)f=u[s],f!=="removeListener"&&this.removeAllListeners(f);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=o[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(s=r.length-1;s>=0;s--)this.removeListener(e,r[s]);return this};function hn(t,e,r){var o=t._events;if(o===void 0)return[];var s=o[e];return s===void 0?[]:typeof s=="function"?r?[s.listener||s]:[s]:r?go(s):yn(s,s.length)}q.prototype.listeners=function(e){return hn(this,e,!0)};q.prototype.rawListeners=function(e){return hn(this,e,!1)};q.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):pn.call(t,e)};q.prototype.listenerCount=pn;function pn(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}q.prototype.eventNames=function(){return this._eventsCount>0?gt(this._events):[]};function yn(t,e){for(var r=new Array(e),o=0;o<e;++o)r[o]=t[o];return r}function yo(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function go(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function mo(t,e){return new Promise(function(r,o){function s(f){t.removeListener(e,u),o(f)}function u(){typeof t.removeListener=="function"&&t.removeListener("error",s),r([].slice.call(arguments))}gn(t,e,u,{once:!0}),e!=="error"&&wo(t,s,{once:!0})})}function wo(t,e,r){typeof t.on=="function"&&gn(t,"error",e,r)}function gn(t,e,r,o){if(typeof t.on=="function")o.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function s(u){o.once&&t.removeEventListener(e,s),r(u)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var mn=mr.exports,Bt={},wn={},bn=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),o=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var s=42;e[r]=s;for(r 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 u=Object.getOwnPropertySymbols(e);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(e,r);if(f.value!==s||f.enumerable!==!0)return!1}return!0},bo=bn,wr=function(){return bo()&&!!Symbol.toStringTag},Cr=typeof Symbol<"u"&&Symbol,vo=bn,So=function(){return typeof Cr!="function"||typeof Symbol!="function"||typeof Cr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vo()},Or={foo:{}},Ao=Object,Eo=function(){return{__proto__:Or}.foo===Or.foo&&!({__proto__:null}instanceof Ao)},Io="Function.prototype.bind called on incompatible ",To=Object.prototype.toString,Fo=Math.max,_o="[object Function]",xr=function(e,r){for(var o=[],s=0;s<e.length;s+=1)o[s]=e[s];for(var u=0;u<r.length;u+=1)o[u+e.length]=r[u];return o},Co=function(e,r){for(var o=[],s=r||0,u=0;s<e.length;s+=1,u+=1)o[u]=e[s];return o},Oo=function(t,e){for(var r="",o=0;o<t.length;o+=1)r+=t[o],o+1<t.length&&(r+=e);return r},xo=function(e){var r=this;if(typeof r!="function"||To.apply(r)!==_o)throw new TypeError(Io+r);for(var o=Co(arguments,1),s,u=function(){if(this instanceof s){var g=r.apply(this,xr(o,arguments));return Object(g)===g?g:this}return r.apply(e,xr(o,arguments))},f=Fo(0,r.length-o.length),c=[],h=0;h<f;h++)c[h]="$"+h;if(s=Function("binder","return function ("+Oo(c,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var b=function(){};b.prototype=r.prototype,s.prototype=new b,b.prototype=null}return s},Bo=xo,vn=Function.prototype.bind||Bo,Br={}.hasOwnProperty,Nt=Function.prototype.call,ko=Nt.bind?Nt.bind(Br):function(t,e){return Nt.call(Br,t,e)},$,Ze=SyntaxError,Sn=Function,Xe=TypeError,Ut=function(t){try{return Sn('"use strict"; return ('+t+").constructor;")()}catch{}},De=Object.getOwnPropertyDescriptor;if(De)try{De({},"")}catch{De=null}var $t=function(){throw new Xe},Po=De?function(){try{return arguments.callee,$t}catch{try{return De(arguments,"callee").get}catch{return $t}}}():$t,Ge=So(),Ro=Eo(),X=Object.getPrototypeOf||(Ro?function(t){return t.__proto__}:null),Ke={},Lo=typeof Uint8Array>"u"||!X?$:X(Uint8Array),Ve={"%AggregateError%":typeof AggregateError>"u"?$:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?$:ArrayBuffer,"%ArrayIteratorPrototype%":Ge&&X?X([][Symbol.iterator]()):$,"%AsyncFromSyncIteratorPrototype%":$,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?$:Atomics,"%BigInt%":typeof BigInt>"u"?$:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?$:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?$:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?$:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?$:Float32Array,"%Float64Array%":typeof Float64Array>"u"?$:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?$:FinalizationRegistry,"%Function%":Sn,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?$:Int8Array,"%Int16Array%":typeof Int16Array>"u"?$:Int16Array,"%Int32Array%":typeof Int32Array>"u"?$:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ge&&X?X(X([][Symbol.iterator]())):$,"%JSON%":typeof JSON=="object"?JSON:$,"%Map%":typeof Map>"u"?$:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ge||!X?$:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?$:Promise,"%Proxy%":typeof Proxy>"u"?$:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?$:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?$:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ge||!X?$:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?$:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ge&&X?X(""[Symbol.iterator]()):$,"%Symbol%":Ge?Symbol:$,"%SyntaxError%":Ze,"%ThrowTypeError%":Po,"%TypedArray%":Lo,"%TypeError%":Xe,"%Uint8Array%":typeof Uint8Array>"u"?$:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?$:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?$:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?$:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?$:WeakMap,"%WeakRef%":typeof WeakRef>"u"?$:WeakRef,"%WeakSet%":typeof WeakSet>"u"?$:WeakSet};if(X)try{null.error}catch(t){var No=X(X(t));Ve["%Error.prototype%"]=No}var Uo=function t(e){var r;if(e==="%AsyncFunction%")r=Ut("async function () {}");else if(e==="%GeneratorFunction%")r=Ut("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Ut("async function* () {}");else if(e==="%AsyncGenerator%"){var o=t("%AsyncGeneratorFunction%");o&&(r=o.prototype)}else if(e==="%AsyncIteratorPrototype%"){var s=t("%AsyncGenerator%");s&&X&&(r=X(s.prototype))}return Ve[e]=r,r},kr={"%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"]},dt=vn,Et=ko,$o=dt.call(Function.call,Array.prototype.concat),jo=dt.call(Function.apply,Array.prototype.splice),Pr=dt.call(Function.call,String.prototype.replace),It=dt.call(Function.call,String.prototype.slice),Do=dt.call(Function.call,RegExp.prototype.exec),Vo=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Mo=/\\(\\)?/g,qo=function(e){var r=It(e,0,1),o=It(e,-1);if(r==="%"&&o!=="%")throw new Ze("invalid intrinsic syntax, expected closing `%`");if(o==="%"&&r!=="%")throw new Ze("invalid intrinsic syntax, expected opening `%`");var s=[];return Pr(e,Vo,function(u,f,c,h){s[s.length]=c?Pr(h,Mo,"$1"):f||u}),s},Qo=function(e,r){var o=e,s;if(Et(kr,o)&&(s=kr[o],o="%"+s[0]+"%"),Et(Ve,o)){var u=Ve[o];if(u===Ke&&(u=Uo(o)),typeof u>"u"&&!r)throw new Xe("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:s,name:o,value:u}}throw new Ze("intrinsic "+e+" does not exist!")},tt=function(e,r){if(typeof e!="string"||e.length===0)throw new Xe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Xe('"allowMissing" argument must be a boolean');if(Do(/^%?[^%]*%?$/,e)===null)throw new Ze("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var o=qo(e),s=o.length>0?o[0]:"",u=Qo("%"+s+"%",r),f=u.name,c=u.value,h=!1,b=u.alias;b&&(s=b[0],jo(o,$o([0,1],b)));for(var g=1,m=!0;g<o.length;g+=1){var E=o[g],T=It(E,0,1),L=It(E,-1);if((T==='"'||T==="'"||T==="`"||L==='"'||L==="'"||L==="`")&&T!==L)throw new Ze("property names with quotes must have matching quotes");if((E==="constructor"||!m)&&(h=!0),s+="."+E,f="%"+s+"%",Et(Ve,f))c=Ve[f];else if(c!=null){if(!(E in c)){if(!r)throw new Xe("base intrinsic for "+e+" exists, but the property is not available.");return}if(De&&g+1>=o.length){var P=De(c,E);m=!!P,m&&"get"in P&&!("originalValue"in P.get)?c=P.get:c=c[E]}else m=Et(c,E),c=c[E];m&&!h&&(Ve[f]=c)}}return c},An={exports:{}},Go=tt,er=Go("%Object.defineProperty%",!0),tr=function(){if(er)try{return er({},"a",{value:1}),!0}catch{return!1}return!1};tr.hasArrayLengthDefineBug=function(){if(!tr())return null;try{return er([],"length",{value:1}).length!==1}catch{return!0}};var En=tr,zo=tt,mt=zo("%Object.getOwnPropertyDescriptor%",!0);if(mt)try{mt([],"length")}catch{mt=null}var br=mt,Ko=En(),vr=tt,ct=Ko&&vr("%Object.defineProperty%",!0);if(ct)try{ct({},"a",{value:1})}catch{ct=!1}var Ho=vr("%SyntaxError%"),ze=vr("%TypeError%"),Rr=br,Wo=function(e,r,o){if(!e||typeof e!="object"&&typeof e!="function")throw new ze("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new ze("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ze("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ze("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ze("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ze("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,h=!!Rr&&Rr(e,r);if(ct)ct(e,r,{configurable:f===null&&h?h.configurable:!f,enumerable:s===null&&h?h.enumerable:!s,value:o,writable:u===null&&h?h.writable:!u});else if(c||!s&&!u&&!f)e[r]=o;else throw new Ho("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},In=tt,Lr=Wo,Jo=En(),Nr=br,Ur=In("%TypeError%"),Yo=In("%Math.floor%"),Xo=function(e,r){if(typeof e!="function")throw new Ur("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Yo(r)!==r)throw new Ur("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],s=!0,u=!0;if("length"in e&&Nr){var f=Nr(e,"length");f&&!f.configurable&&(s=!1),f&&!f.writable&&(u=!1)}return(s||u||!o)&&(Jo?Lr(e,"length",r,!0,!0):Lr(e,"length",r)),e};(function(t){var e=vn,r=tt,o=Xo,s=r("%TypeError%"),u=r("%Function.prototype.apply%"),f=r("%Function.prototype.call%"),c=r("%Reflect.apply%",!0)||e.call(f,u),h=r("%Object.defineProperty%",!0),b=r("%Math.max%");if(h)try{h({},"a",{value:1})}catch{h=null}t.exports=function(E){if(typeof E!="function")throw new s("a function is required");var T=c(e,f,arguments);return o(T,1+b(0,E.length-(arguments.length-1)),!0)};var g=function(){return c(e,u,arguments)};h?h(t.exports,"apply",{value:g}):t.exports.apply=g})(An);var Tn=An.exports,Fn=tt,_n=Tn,Zo=_n(Fn("String.prototype.indexOf")),Cn=function(e,r){var o=Fn(e,!!r);return typeof o=="function"&&Zo(e,".prototype.")>-1?_n(o):o},es=wr(),ts=Cn,rr=ts("Object.prototype.toString"),kt=function(e){return es&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:rr(e)==="[object Arguments]"},On=function(e){return kt(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&rr(e)!=="[object Array]"&&rr(e.callee)==="[object Function]"},rs=function(){return kt(arguments)}();kt.isLegacyArguments=On;var ns=rs?kt:On,is=Object.prototype.toString,os=Function.prototype.toString,ss=/^\s*(?:function)?\*/,xn=wr(),jt=Object.getPrototypeOf,as=function(){if(!xn)return!1;try{return Function("return function*() {}")()}catch{}},Dt,us=function(e){if(typeof e!="function")return!1;if(ss.test(os.call(e)))return!0;if(!xn){var r=is.call(e);return r==="[object GeneratorFunction]"}if(!jt)return!1;if(typeof Dt>"u"){var o=as();Dt=o?jt(o):!1}return jt(e)===Dt},Bn=Function.prototype.toString,We=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,nr,wt;if(typeof We=="function"&&typeof Object.defineProperty=="function")try{nr=Object.defineProperty({},"length",{get:function(){throw wt}}),wt={},We(function(){throw 42},null,nr)}catch(t){t!==wt&&(We=null)}else We=null;var cs=/^\s*class\b/,ir=function(e){try{var r=Bn.call(e);return cs.test(r)}catch{return!1}},Vt=function(e){try{return ir(e)?!1:(Bn.call(e),!0)}catch{return!1}},bt=Object.prototype.toString,ls="[object Object]",fs="[object Function]",ds="[object GeneratorFunction]",hs="[object HTMLAllCollection]",ps="[object HTML document.all class]",ys="[object HTMLCollection]",gs=typeof Symbol=="function"&&!!Symbol.toStringTag,ms=!(0 in[,]),or=function(){return!1};if(typeof document=="object"){var ws=document.all;bt.call(ws)===bt.call(document.all)&&(or=function(e){if((ms||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=bt.call(e);return(r===hs||r===ps||r===ys||r===ls)&&e("")==null}catch{}return!1})}var bs=We?function(e){if(or(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{We(e,null,nr)}catch(r){if(r!==wt)return!1}return!ir(e)&&Vt(e)}:function(e){if(or(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(gs)return Vt(e);if(ir(e))return!1;var r=bt.call(e);return r!==fs&&r!==ds&&!/^\[object HTML/.test(r)?!1:Vt(e)},vs=bs,Ss=Object.prototype.toString,kn=Object.prototype.hasOwnProperty,As=function(e,r,o){for(var s=0,u=e.length;s<u;s++)kn.call(e,s)&&(o==null?r(e[s],s,e):r.call(o,e[s],s,e))},Es=function(e,r,o){for(var s=0,u=e.length;s<u;s++)o==null?r(e.charAt(s),s,e):r.call(o,e.charAt(s),s,e)},Is=function(e,r,o){for(var s in e)kn.call(e,s)&&(o==null?r(e[s],s,e):r.call(o,e[s],s,e))},Ts=function(e,r,o){if(!vs(r))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=o),Ss.call(e)==="[object Array]"?As(e,r,s):typeof e=="string"?Es(e,r,s):Is(e,r,s)},Fs=Ts,Mt=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],_s=typeof globalThis>"u"?Wr:globalThis,Cs=function(){for(var e=[],r=0;r<Mt.length;r++)typeof _s[Mt[r]]=="function"&&(e[e.length]=Mt[r]);return e},Tt=Fs,Os=Cs,$r=Tn,Sr=Cn,vt=br,xs=Sr("Object.prototype.toString"),Pn=wr(),jr=typeof globalThis>"u"?Wr:globalThis,sr=Os(),Ar=Sr("String.prototype.slice"),qt=Object.getPrototypeOf,Bs=Sr("Array.prototype.indexOf",!0)||function(e,r){for(var o=0;o<e.length;o+=1)if(e[o]===r)return o;return-1},Ft={__proto__:null};Pn&&vt&&qt?Tt(sr,function(t){var e=new jr[t];if(Symbol.toStringTag in e){var r=qt(e),o=vt(r,Symbol.toStringTag);if(!o){var s=qt(r);o=vt(s,Symbol.toStringTag)}Ft["$"+t]=$r(o.get)}}):Tt(sr,function(t){var e=new jr[t],r=e.slice||e.set;r&&(Ft["$"+t]=$r(r))});var ks=function(e){var r=!1;return Tt(Ft,function(o,s){if(!r)try{"$"+o(e)===s&&(r=Ar(s,1))}catch{}}),r},Ps=function(e){var r=!1;return Tt(Ft,function(o,s){if(!r)try{o(e),r=Ar(s,1)}catch{}}),r},Rn=function(e){if(!e||typeof e!="object")return!1;if(!Pn){var r=Ar(xs(e),8,-1);return Bs(sr,r)>-1?r:r!=="Object"?!1:Ps(e)}return vt?ks(e):null},Rs=Rn,Ls=function(e){return!!Rs(e)};(function(t){var e=ns,r=us,o=Rn,s=Ls;function u(S){return S.call.bind(S)}var f=typeof BigInt<"u",c=typeof Symbol<"u",h=u(Object.prototype.toString),b=u(Number.prototype.valueOf),g=u(String.prototype.valueOf),m=u(Boolean.prototype.valueOf);if(f)var E=u(BigInt.prototype.valueOf);if(c)var T=u(Symbol.prototype.valueOf);function L(S,pt){if(typeof S!="object")return!1;try{return pt(S),!0}catch{return!1}}t.isArgumentsObject=e,t.isGeneratorFunction=r,t.isTypedArray=s;function P(S){return typeof Promise<"u"&&S instanceof Promise||S!==null&&typeof S=="object"&&typeof S.then=="function"&&typeof S.catch=="function"}t.isPromise=P;function K(S){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(S):s(S)||v(S)}t.isArrayBufferView=K;function I(S){return o(S)==="Uint8Array"}t.isUint8Array=I;function _(S){return o(S)==="Uint8ClampedArray"}t.isUint8ClampedArray=_;function j(S){return o(S)==="Uint16Array"}t.isUint16Array=j;function U(S){return o(S)==="Uint32Array"}t.isUint32Array=U;function F(S){return o(S)==="Int8Array"}t.isInt8Array=F;function x(S){return o(S)==="Int16Array"}t.isInt16Array=x;function k(S){return o(S)==="Int32Array"}t.isInt32Array=k;function G(S){return o(S)==="Float32Array"}t.isFloat32Array=G;function oe(S){return o(S)==="Float64Array"}t.isFloat64Array=oe;function Oe(S){return o(S)==="BigInt64Array"}t.isBigInt64Array=Oe;function Ae(S){return o(S)==="BigUint64Array"}t.isBigUint64Array=Ae;function le(S){return h(S)==="[object Map]"}le.working=typeof Map<"u"&&le(new Map);function nt(S){return typeof Map>"u"?!1:le.working?le(S):S instanceof Map}t.isMap=nt;function fe(S){return h(S)==="[object Set]"}fe.working=typeof Set<"u"&&fe(new Set);function xe(S){return typeof Set>"u"?!1:fe.working?fe(S):S instanceof Set}t.isSet=xe;function Be(S){return h(S)==="[object WeakMap]"}Be.working=typeof WeakMap<"u"&&Be(new WeakMap);function it(S){return typeof WeakMap>"u"?!1:Be.working?Be(S):S instanceof WeakMap}t.isWeakMap=it;function ke(S){return h(S)==="[object WeakSet]"}ke.working=typeof WeakSet<"u"&&ke(new WeakSet);function de(S){return ke(S)}t.isWeakSet=de;function Pe(S){return h(S)==="[object ArrayBuffer]"}Pe.working=typeof ArrayBuffer<"u"&&Pe(new ArrayBuffer);function H(S){return typeof ArrayBuffer>"u"?!1:Pe.working?Pe(S):S instanceof ArrayBuffer}t.isArrayBuffer=H;function p(S){return h(S)==="[object DataView]"}p.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&p(new DataView(new ArrayBuffer(1),0,1));function v(S){return typeof DataView>"u"?!1:p.working?p(S):S instanceof DataView}t.isDataView=v;var A=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function C(S){return h(S)==="[object SharedArrayBuffer]"}function D(S){return typeof A>"u"?!1:(typeof C.working>"u"&&(C.working=C(new A)),C.working?C(S):S instanceof A)}t.isSharedArrayBuffer=D;function V(S){return h(S)==="[object AsyncFunction]"}t.isAsyncFunction=V;function B(S){return h(S)==="[object Map Iterator]"}t.isMapIterator=B;function N(S){return h(S)==="[object Set Iterator]"}t.isSetIterator=N;function M(S){return h(S)==="[object Generator]"}t.isGeneratorObject=M;function re(S){return h(S)==="[object WebAssembly.Module]"}t.isWebAssemblyCompiledModule=re;function ge(S){return L(S,b)}t.isNumberObject=ge;function he(S){return L(S,g)}t.isStringObject=he;function se(S){return L(S,m)}t.isBooleanObject=se;function qe(S){return f&&L(S,E)}t.isBigIntObject=qe;function ht(S){return c&&L(S,T)}t.isSymbolObject=ht;function ot(S){return ge(S)||he(S)||se(S)||qe(S)||ht(S)}t.isBoxedPrimitive=ot;function Pt(S){return typeof Uint8Array<"u"&&(H(S)||D(S))}t.isAnyArrayBuffer=Pt,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(S){Object.defineProperty(t,S,{enumerable:!1,value:function(){throw new Error(S+" is not supported in userland")}})})})(wn);var Ns=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},ar={exports:{}};typeof Object.create=="function"?ar.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ar.exports=function(e,r){if(r){e.super_=r;var o=function(){};o.prototype=r.prototype,e.prototype=new o,e.prototype.constructor=e}};var Us=ar.exports;(function(t){var e=Object.getOwnPropertyDescriptors||function(v){for(var A=Object.keys(v),C={},D=0;D<A.length;D++)C[A[D]]=Object.getOwnPropertyDescriptor(v,A[D]);return C},r=/%[sdj%]/g;t.format=function(p){if(!F(p)){for(var v=[],A=0;A<arguments.length;A++)v.push(f(arguments[A]));return v.join(" ")}for(var A=1,C=arguments,D=C.length,V=String(p).replace(r,function(N){if(N==="%%")return"%";if(A>=D)return N;switch(N){case"%s":return String(C[A++]);case"%d":return Number(C[A++]);case"%j":try{return JSON.stringify(C[A++])}catch{return"[Circular]"}default:return N}}),B=C[A];A<D;B=C[++A])_(B)||!oe(B)?V+=" "+B:V+=" "+f(B);return V},t.deprecate=function(p,v){if(typeof O.process<"u"&&O.process.noDeprecation===!0)return p;if(typeof O.process>"u")return function(){return t.deprecate(p,v).apply(this,arguments)};var A=!1;function C(){if(!A){if(O.process.throwDeprecation)throw new Error(v);O.process.traceDeprecation?console.trace(v):console.error(v),A=!0}return p.apply(this,arguments)}return C};var o={},s=/^$/;if(O.process.env.NODE_DEBUG){var u=O.process.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+u+"$","i")}t.debuglog=function(p){if(p=p.toUpperCase(),!o[p])if(s.test(p)){var v=O.process.pid;o[p]=function(){var A=t.format.apply(t,arguments);console.error("%s %d: %s",p,v,A)}}else o[p]=function(){};return o[p]};function f(p,v){var A={seen:[],stylize:h};return arguments.length>=3&&(A.depth=arguments[2]),arguments.length>=4&&(A.colors=arguments[3]),I(v)?A.showHidden=v:v&&t._extend(A,v),k(A.showHidden)&&(A.showHidden=!1),k(A.depth)&&(A.depth=2),k(A.colors)&&(A.colors=!1),k(A.customInspect)&&(A.customInspect=!0),A.colors&&(A.stylize=c),g(A,p,A.depth)}t.inspect=f,f.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]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function c(p,v){var A=f.styles[v];return A?"\x1B["+f.colors[A][0]+"m"+p+"\x1B["+f.colors[A][1]+"m":p}function h(p,v){return p}function b(p){var v={};return p.forEach(function(A,C){v[A]=!0}),v}function g(p,v,A){if(p.customInspect&&v&&le(v.inspect)&&v.inspect!==t.inspect&&!(v.constructor&&v.constructor.prototype===v)){var C=v.inspect(A,p);return F(C)||(C=g(p,C,A)),C}var D=m(p,v);if(D)return D;var V=Object.keys(v),B=b(V);if(p.showHidden&&(V=Object.getOwnPropertyNames(v)),Ae(v)&&(V.indexOf("message")>=0||V.indexOf("description")>=0))return E(v);if(V.length===0){if(le(v)){var N=v.name?": "+v.name:"";return p.stylize("[Function"+N+"]","special")}if(G(v))return p.stylize(RegExp.prototype.toString.call(v),"regexp");if(Oe(v))return p.stylize(Date.prototype.toString.call(v),"date");if(Ae(v))return E(v)}var M="",re=!1,ge=["{","}"];if(K(v)&&(re=!0,ge=["[","]"]),le(v)){var he=v.name?": "+v.name:"";M=" [Function"+he+"]"}if(G(v)&&(M=" "+RegExp.prototype.toString.call(v)),Oe(v)&&(M=" "+Date.prototype.toUTCString.call(v)),Ae(v)&&(M=" "+E(v)),V.length===0&&(!re||v.length==0))return ge[0]+M+ge[1];if(A<0)return G(v)?p.stylize(RegExp.prototype.toString.call(v),"regexp"):p.stylize("[Object]","special");p.seen.push(v);var se;return re?se=T(p,v,A,B,V):se=V.map(function(qe){return L(p,v,A,B,qe,re)}),p.seen.pop(),P(se,M,ge)}function m(p,v){if(k(v))return p.stylize("undefined","undefined");if(F(v)){var A="'"+JSON.stringify(v).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return p.stylize(A,"string")}if(U(v))return p.stylize(""+v,"number");if(I(v))return p.stylize(""+v,"boolean");if(_(v))return p.stylize("null","null")}function E(p){return"["+Error.prototype.toString.call(p)+"]"}function T(p,v,A,C,D){for(var V=[],B=0,N=v.length;B<N;++B)ke(v,String(B))?V.push(L(p,v,A,C,String(B),!0)):V.push("");return D.forEach(function(M){M.match(/^\d+$/)||V.push(L(p,v,A,C,M,!0))}),V}function L(p,v,A,C,D,V){var B,N,M;if(M=Object.getOwnPropertyDescriptor(v,D)||{value:v[D]},M.get?M.set?N=p.stylize("[Getter/Setter]","special"):N=p.stylize("[Getter]","special"):M.set&&(N=p.stylize("[Setter]","special")),ke(C,D)||(B="["+D+"]"),N||(p.seen.indexOf(M.value)<0?(_(A)?N=g(p,M.value,null):N=g(p,M.value,A-1),N.indexOf(`
|
|
6
|
+
*/(function(t){const e=Ct,r=lr,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=_,t.INSPECT_MAX_BYTES=50;const s=2147483647;t.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=u(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{const a=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(a,n),a.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function f(a){if(a>s)throw new RangeError('The value "'+a+'" is invalid for option "size"');const n=new Uint8Array(a);return Object.setPrototypeOf(n,c.prototype),n}function c(a,n,i){if(typeof a=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(a)}return h(a,n,i)}c.poolSize=8192;function h(a,n,i){if(typeof a=="string")return E(a,n);if(ArrayBuffer.isView(a))return L(a);if(a==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof a);if(me(a,ArrayBuffer)||a&&me(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(a,SharedArrayBuffer)||a&&me(a.buffer,SharedArrayBuffer)))return P(a,n,i);if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const l=a.valueOf&&a.valueOf();if(l!=null&&l!==a)return c.from(l,n,i);const d=K(a);if(d)return d;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof a[Symbol.toPrimitive]=="function")return c.from(a[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof a)}c.from=function(a,n,i){return h(a,n,i)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function b(a){if(typeof a!="number")throw new TypeError('"size" argument must be of type number');if(a<0)throw new RangeError('The value "'+a+'" is invalid for option "size"')}function g(a,n,i){return b(a),a<=0?f(a):n!==void 0?typeof i=="string"?f(a).fill(n,i):f(a).fill(n):f(a)}c.alloc=function(a,n,i){return g(a,n,i)};function m(a){return b(a),f(a<0?0:I(a)|0)}c.allocUnsafe=function(a){return m(a)},c.allocUnsafeSlow=function(a){return m(a)};function E(a,n){if((typeof n!="string"||n==="")&&(n="utf8"),!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);const i=j(a,n)|0;let l=f(i);const d=l.write(a,n);return d!==i&&(l=l.slice(0,d)),l}function T(a){const n=a.length<0?0:I(a.length)|0,i=f(n);for(let l=0;l<n;l+=1)i[l]=a[l]&255;return i}function L(a){if(me(a,Uint8Array)){const n=new Uint8Array(a);return P(n.buffer,n.byteOffset,n.byteLength)}return T(a)}function P(a,n,i){if(n<0||a.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<n+(i||0))throw new RangeError('"length" is outside of buffer bounds');let l;return n===void 0&&i===void 0?l=new Uint8Array(a):i===void 0?l=new Uint8Array(a,n):l=new Uint8Array(a,n,i),Object.setPrototypeOf(l,c.prototype),l}function K(a){if(c.isBuffer(a)){const n=I(a.length)|0,i=f(n);return i.length===0||a.copy(i,0,0,n),i}if(a.length!==void 0)return typeof a.length!="number"||Rt(a.length)?f(0):T(a);if(a.type==="Buffer"&&Array.isArray(a.data))return T(a.data)}function I(a){if(a>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return a|0}function _(a){return+a!=a&&(a=0),c.alloc(+a)}c.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==c.prototype},c.compare=function(n,i){if(me(n,Uint8Array)&&(n=c.from(n,n.offset,n.byteLength)),me(i,Uint8Array)&&(i=c.from(i,i.offset,i.byteLength)),!c.isBuffer(n)||!c.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===i)return 0;let l=n.length,d=i.length;for(let y=0,w=Math.min(l,d);y<w;++y)if(n[y]!==i[y]){l=n[y],d=i[y];break}return l<d?-1:d<l?1:0},c.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(n,i){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return c.alloc(0);let l;if(i===void 0)for(i=0,l=0;l<n.length;++l)i+=n[l].length;const d=c.allocUnsafe(i);let y=0;for(l=0;l<n.length;++l){let w=n[l];if(me(w,Uint8Array))y+w.length>d.length?(c.isBuffer(w)||(w=c.from(w)),w.copy(d,y)):Uint8Array.prototype.set.call(d,w,y);else if(c.isBuffer(w))w.copy(d,y);else throw new TypeError('"list" argument must be an Array of Buffers');y+=w.length}return d};function j(a,n){if(c.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||me(a,ArrayBuffer))return a.byteLength;if(typeof a!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof a);const i=a.length,l=arguments.length>2&&arguments[2]===!0;if(!l&&i===0)return 0;let d=!1;for(;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return ot(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return pt(a).length;default:if(d)return l?-1:ot(a).length;n=(""+n).toLowerCase(),d=!0}}c.byteLength=j;function U(a,n,i){let l=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,n>>>=0,i<=n))return"";for(a||(a="utf8");;)switch(a){case"hex":return de(this,n,i);case"utf8":case"utf-8":return fe(this,n,i);case"ascii":return it(this,n,i);case"latin1":case"binary":return ke(this,n,i);case"base64":return nt(this,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pe(this,n,i);default:if(l)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),l=!0}}c.prototype._isBuffer=!0;function F(a,n,i){const l=a[n];a[n]=a[i],a[i]=l}c.prototype.swap16=function(){const n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<n;i+=2)F(this,i,i+1);return this},c.prototype.swap32=function(){const n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<n;i+=4)F(this,i,i+3),F(this,i+1,i+2);return this},c.prototype.swap64=function(){const n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<n;i+=8)F(this,i,i+7),F(this,i+1,i+6),F(this,i+2,i+5),F(this,i+3,i+4);return this},c.prototype.toString=function(){const n=this.length;return n===0?"":arguments.length===0?fe(this,0,n):U.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(n){if(!c.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:c.compare(this,n)===0},c.prototype.inspect=function(){let n="";const i=t.INSPECT_MAX_BYTES;return n=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(n+=" ... "),"<Buffer "+n+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(n,i,l,d,y){if(me(n,Uint8Array)&&(n=c.from(n,n.offset,n.byteLength)),!c.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(i===void 0&&(i=0),l===void 0&&(l=n?n.length:0),d===void 0&&(d=0),y===void 0&&(y=this.length),i<0||l>n.length||d<0||y>this.length)throw new RangeError("out of range index");if(d>=y&&i>=l)return 0;if(d>=y)return-1;if(i>=l)return 1;if(i>>>=0,l>>>=0,d>>>=0,y>>>=0,this===n)return 0;let w=y-d,R=l-i;const W=Math.min(w,R),z=this.slice(d,y),J=n.slice(i,l);for(let Q=0;Q<W;++Q)if(z[Q]!==J[Q]){w=z[Q],R=J[Q];break}return w<R?-1:R<w?1:0};function x(a,n,i,l,d){if(a.length===0)return-1;if(typeof i=="string"?(l=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,Rt(i)&&(i=d?0:a.length-1),i<0&&(i=a.length+i),i>=a.length){if(d)return-1;i=a.length-1}else if(i<0)if(d)i=0;else return-1;if(typeof n=="string"&&(n=c.from(n,l)),c.isBuffer(n))return n.length===0?-1:k(a,n,i,l,d);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?d?Uint8Array.prototype.indexOf.call(a,n,i):Uint8Array.prototype.lastIndexOf.call(a,n,i):k(a,[n],i,l,d);throw new TypeError("val must be string, number or Buffer")}function k(a,n,i,l,d){let y=1,w=a.length,R=n.length;if(l!==void 0&&(l=String(l).toLowerCase(),l==="ucs2"||l==="ucs-2"||l==="utf16le"||l==="utf-16le")){if(a.length<2||n.length<2)return-1;y=2,w/=2,R/=2,i/=2}function W(J,Q){return y===1?J[Q]:J.readUInt16BE(Q*y)}let z;if(d){let J=-1;for(z=i;z<w;z++)if(W(a,z)===W(n,J===-1?0:z-J)){if(J===-1&&(J=z),z-J+1===R)return J*y}else J!==-1&&(z-=z-J),J=-1}else for(i+R>w&&(i=w-R),z=i;z>=0;z--){let J=!0;for(let Q=0;Q<R;Q++)if(W(a,z+Q)!==W(n,Q)){J=!1;break}if(J)return z}return-1}c.prototype.includes=function(n,i,l){return this.indexOf(n,i,l)!==-1},c.prototype.indexOf=function(n,i,l){return x(this,n,i,l,!0)},c.prototype.lastIndexOf=function(n,i,l){return x(this,n,i,l,!1)};function G(a,n,i,l){i=Number(i)||0;const d=a.length-i;l?(l=Number(l),l>d&&(l=d)):l=d;const y=n.length;l>y/2&&(l=y/2);let w;for(w=0;w<l;++w){const R=parseInt(n.substr(w*2,2),16);if(Rt(R))return w;a[i+w]=R}return w}function oe(a,n,i,l){return st(ot(n,a.length-i),a,i,l)}function Oe(a,n,i,l){return st(Pt(n),a,i,l)}function Ae(a,n,i,l){return st(pt(n),a,i,l)}function le(a,n,i,l){return st(S(n,a.length-i),a,i,l)}c.prototype.write=function(n,i,l,d){if(i===void 0)d="utf8",l=this.length,i=0;else if(l===void 0&&typeof i=="string")d=i,l=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(l)?(l=l>>>0,d===void 0&&(d="utf8")):(d=l,l=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const y=this.length-i;if((l===void 0||l>y)&&(l=y),n.length>0&&(l<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");let w=!1;for(;;)switch(d){case"hex":return G(this,n,i,l);case"utf8":case"utf-8":return oe(this,n,i,l);case"ascii":case"latin1":case"binary":return Oe(this,n,i,l);case"base64":return Ae(this,n,i,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return le(this,n,i,l);default:if(w)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),w=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(a,n,i){return n===0&&i===a.length?e.fromByteArray(a):e.fromByteArray(a.slice(n,i))}function fe(a,n,i){i=Math.min(a.length,i);const l=[];let d=n;for(;d<i;){const y=a[d];let w=null,R=y>239?4:y>223?3:y>191?2:1;if(d+R<=i){let W,z,J,Q;switch(R){case 1:y<128&&(w=y);break;case 2:W=a[d+1],(W&192)===128&&(Q=(y&31)<<6|W&63,Q>127&&(w=Q));break;case 3:W=a[d+1],z=a[d+2],(W&192)===128&&(z&192)===128&&(Q=(y&15)<<12|(W&63)<<6|z&63,Q>2047&&(Q<55296||Q>57343)&&(w=Q));break;case 4:W=a[d+1],z=a[d+2],J=a[d+3],(W&192)===128&&(z&192)===128&&(J&192)===128&&(Q=(y&15)<<18|(W&63)<<12|(z&63)<<6|J&63,Q>65535&&Q<1114112&&(w=Q))}}w===null?(w=65533,R=1):w>65535&&(w-=65536,l.push(w>>>10&1023|55296),w=56320|w&1023),l.push(w),d+=R}return Be(l)}const xe=4096;function Be(a){const n=a.length;if(n<=xe)return String.fromCharCode.apply(String,a);let i="",l=0;for(;l<n;)i+=String.fromCharCode.apply(String,a.slice(l,l+=xe));return i}function it(a,n,i){let l="";i=Math.min(a.length,i);for(let d=n;d<i;++d)l+=String.fromCharCode(a[d]&127);return l}function ke(a,n,i){let l="";i=Math.min(a.length,i);for(let d=n;d<i;++d)l+=String.fromCharCode(a[d]);return l}function de(a,n,i){const l=a.length;(!n||n<0)&&(n=0),(!i||i<0||i>l)&&(i=l);let d="";for(let y=n;y<i;++y)d+=jn[a[y]];return d}function Pe(a,n,i){const l=a.slice(n,i);let d="";for(let y=0;y<l.length-1;y+=2)d+=String.fromCharCode(l[y]+l[y+1]*256);return d}c.prototype.slice=function(n,i){const l=this.length;n=~~n,i=i===void 0?l:~~i,n<0?(n+=l,n<0&&(n=0)):n>l&&(n=l),i<0?(i+=l,i<0&&(i=0)):i>l&&(i=l),i<n&&(i=n);const d=this.subarray(n,i);return Object.setPrototypeOf(d,c.prototype),d};function H(a,n,i){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+n>i)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(n,i,l){n=n>>>0,i=i>>>0,l||H(n,i,this.length);let d=this[n],y=1,w=0;for(;++w<i&&(y*=256);)d+=this[n+w]*y;return d},c.prototype.readUintBE=c.prototype.readUIntBE=function(n,i,l){n=n>>>0,i=i>>>0,l||H(n,i,this.length);let d=this[n+--i],y=1;for(;i>0&&(y*=256);)d+=this[n+--i]*y;return d},c.prototype.readUint8=c.prototype.readUInt8=function(n,i){return n=n>>>0,i||H(n,1,this.length),this[n]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(n,i){return n=n>>>0,i||H(n,2,this.length),this[n]|this[n+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(n,i){return n=n>>>0,i||H(n,2,this.length),this[n]<<8|this[n+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(n,i){return n=n>>>0,i||H(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(n,i){return n=n>>>0,i||H(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},c.prototype.readBigUInt64LE=Re(function(n){n=n>>>0,he(n,"offset");const i=this[n],l=this[n+7];(i===void 0||l===void 0)&&se(n,this.length-8);const d=i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24,y=this[++n]+this[++n]*2**8+this[++n]*2**16+l*2**24;return BigInt(d)+(BigInt(y)<<BigInt(32))}),c.prototype.readBigUInt64BE=Re(function(n){n=n>>>0,he(n,"offset");const i=this[n],l=this[n+7];(i===void 0||l===void 0)&&se(n,this.length-8);const d=i*2**24+this[++n]*2**16+this[++n]*2**8+this[++n],y=this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+l;return(BigInt(d)<<BigInt(32))+BigInt(y)}),c.prototype.readIntLE=function(n,i,l){n=n>>>0,i=i>>>0,l||H(n,i,this.length);let d=this[n],y=1,w=0;for(;++w<i&&(y*=256);)d+=this[n+w]*y;return y*=128,d>=y&&(d-=Math.pow(2,8*i)),d},c.prototype.readIntBE=function(n,i,l){n=n>>>0,i=i>>>0,l||H(n,i,this.length);let d=i,y=1,w=this[n+--d];for(;d>0&&(y*=256);)w+=this[n+--d]*y;return y*=128,w>=y&&(w-=Math.pow(2,8*i)),w},c.prototype.readInt8=function(n,i){return n=n>>>0,i||H(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},c.prototype.readInt16LE=function(n,i){n=n>>>0,i||H(n,2,this.length);const l=this[n]|this[n+1]<<8;return l&32768?l|4294901760:l},c.prototype.readInt16BE=function(n,i){n=n>>>0,i||H(n,2,this.length);const l=this[n+1]|this[n]<<8;return l&32768?l|4294901760:l},c.prototype.readInt32LE=function(n,i){return n=n>>>0,i||H(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},c.prototype.readInt32BE=function(n,i){return n=n>>>0,i||H(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},c.prototype.readBigInt64LE=Re(function(n){n=n>>>0,he(n,"offset");const i=this[n],l=this[n+7];(i===void 0||l===void 0)&&se(n,this.length-8);const d=this[n+4]+this[n+5]*2**8+this[n+6]*2**16+(l<<24);return(BigInt(d)<<BigInt(32))+BigInt(i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24)}),c.prototype.readBigInt64BE=Re(function(n){n=n>>>0,he(n,"offset");const i=this[n],l=this[n+7];(i===void 0||l===void 0)&&se(n,this.length-8);const d=(i<<24)+this[++n]*2**16+this[++n]*2**8+this[++n];return(BigInt(d)<<BigInt(32))+BigInt(this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+l)}),c.prototype.readFloatLE=function(n,i){return n=n>>>0,i||H(n,4,this.length),r.read(this,n,!0,23,4)},c.prototype.readFloatBE=function(n,i){return n=n>>>0,i||H(n,4,this.length),r.read(this,n,!1,23,4)},c.prototype.readDoubleLE=function(n,i){return n=n>>>0,i||H(n,8,this.length),r.read(this,n,!0,52,8)},c.prototype.readDoubleBE=function(n,i){return n=n>>>0,i||H(n,8,this.length),r.read(this,n,!1,52,8)};function p(a,n,i,l,d,y){if(!c.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>d||n<y)throw new RangeError('"value" argument is out of bounds');if(i+l>a.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(n,i,l,d){if(n=+n,i=i>>>0,l=l>>>0,!d){const R=Math.pow(2,8*l)-1;p(this,n,i,l,R,0)}let y=1,w=0;for(this[i]=n&255;++w<l&&(y*=256);)this[i+w]=n/y&255;return i+l},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(n,i,l,d){if(n=+n,i=i>>>0,l=l>>>0,!d){const R=Math.pow(2,8*l)-1;p(this,n,i,l,R,0)}let y=l-1,w=1;for(this[i+y]=n&255;--y>=0&&(w*=256);)this[i+y]=n/w&255;return i+l},c.prototype.writeUint8=c.prototype.writeUInt8=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,1,255,0),this[i]=n&255,i+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,2,65535,0),this[i]=n&255,this[i+1]=n>>>8,i+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,2,65535,0),this[i]=n>>>8,this[i+1]=n&255,i+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,4,4294967295,0),this[i+3]=n>>>24,this[i+2]=n>>>16,this[i+1]=n>>>8,this[i]=n&255,i+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,4,4294967295,0),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4};function v(a,n,i,l,d){ge(n,l,d,a,i,7);let y=Number(n&BigInt(4294967295));a[i++]=y,y=y>>8,a[i++]=y,y=y>>8,a[i++]=y,y=y>>8,a[i++]=y;let w=Number(n>>BigInt(32)&BigInt(4294967295));return a[i++]=w,w=w>>8,a[i++]=w,w=w>>8,a[i++]=w,w=w>>8,a[i++]=w,i}function A(a,n,i,l,d){ge(n,l,d,a,i,7);let y=Number(n&BigInt(4294967295));a[i+7]=y,y=y>>8,a[i+6]=y,y=y>>8,a[i+5]=y,y=y>>8,a[i+4]=y;let w=Number(n>>BigInt(32)&BigInt(4294967295));return a[i+3]=w,w=w>>8,a[i+2]=w,w=w>>8,a[i+1]=w,w=w>>8,a[i]=w,i+8}c.prototype.writeBigUInt64LE=Re(function(n,i=0){return v(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Re(function(n,i=0){return A(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(n,i,l,d){if(n=+n,i=i>>>0,!d){const W=Math.pow(2,8*l-1);p(this,n,i,l,W-1,-W)}let y=0,w=1,R=0;for(this[i]=n&255;++y<l&&(w*=256);)n<0&&R===0&&this[i+y-1]!==0&&(R=1),this[i+y]=(n/w>>0)-R&255;return i+l},c.prototype.writeIntBE=function(n,i,l,d){if(n=+n,i=i>>>0,!d){const W=Math.pow(2,8*l-1);p(this,n,i,l,W-1,-W)}let y=l-1,w=1,R=0;for(this[i+y]=n&255;--y>=0&&(w*=256);)n<0&&R===0&&this[i+y+1]!==0&&(R=1),this[i+y]=(n/w>>0)-R&255;return i+l},c.prototype.writeInt8=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,1,127,-128),n<0&&(n=255+n+1),this[i]=n&255,i+1},c.prototype.writeInt16LE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,2,32767,-32768),this[i]=n&255,this[i+1]=n>>>8,i+2},c.prototype.writeInt16BE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,2,32767,-32768),this[i]=n>>>8,this[i+1]=n&255,i+2},c.prototype.writeInt32LE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,4,2147483647,-2147483648),this[i]=n&255,this[i+1]=n>>>8,this[i+2]=n>>>16,this[i+3]=n>>>24,i+4},c.prototype.writeInt32BE=function(n,i,l){return n=+n,i=i>>>0,l||p(this,n,i,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4},c.prototype.writeBigInt64LE=Re(function(n,i=0){return v(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Re(function(n,i=0){return A(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function C(a,n,i,l,d,y){if(i+l>a.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function D(a,n,i,l,d){return n=+n,i=i>>>0,d||C(a,n,i,4),r.write(a,n,i,l,23,4),i+4}c.prototype.writeFloatLE=function(n,i,l){return D(this,n,i,!0,l)},c.prototype.writeFloatBE=function(n,i,l){return D(this,n,i,!1,l)};function V(a,n,i,l,d){return n=+n,i=i>>>0,d||C(a,n,i,8),r.write(a,n,i,l,52,8),i+8}c.prototype.writeDoubleLE=function(n,i,l){return V(this,n,i,!0,l)},c.prototype.writeDoubleBE=function(n,i,l){return V(this,n,i,!1,l)},c.prototype.copy=function(n,i,l,d){if(!c.isBuffer(n))throw new TypeError("argument should be a Buffer");if(l||(l=0),!d&&d!==0&&(d=this.length),i>=n.length&&(i=n.length),i||(i=0),d>0&&d<l&&(d=l),d===l||n.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(l<0||l>=this.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),n.length-i<d-l&&(d=n.length-i+l);const y=d-l;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,l,d):Uint8Array.prototype.set.call(n,this.subarray(l,d),i),y},c.prototype.fill=function(n,i,l,d){if(typeof n=="string"){if(typeof i=="string"?(d=i,i=0,l=this.length):typeof l=="string"&&(d=l,l=this.length),d!==void 0&&typeof d!="string")throw new TypeError("encoding must be a string");if(typeof d=="string"&&!c.isEncoding(d))throw new TypeError("Unknown encoding: "+d);if(n.length===1){const w=n.charCodeAt(0);(d==="utf8"&&w<128||d==="latin1")&&(n=w)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(i<0||this.length<i||this.length<l)throw new RangeError("Out of range index");if(l<=i)return this;i=i>>>0,l=l===void 0?this.length:l>>>0,n||(n=0);let y;if(typeof n=="number")for(y=i;y<l;++y)this[y]=n;else{const w=c.isBuffer(n)?n:c.from(n,d),R=w.length;if(R===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(y=0;y<l-i;++y)this[y+i]=w[y%R]}return this};const B={};function N(a,n,i){B[a]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:n.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${a}]`,this.stack,delete this.name}get code(){return a}set code(d){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:d,writable:!0})}toString(){return`${this.name} [${a}]: ${this.message}`}}}N("ERR_BUFFER_OUT_OF_BOUNDS",function(a){return a?`${a} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),N("ERR_INVALID_ARG_TYPE",function(a,n){return`The "${a}" argument must be of type number. Received type ${typeof n}`},TypeError),N("ERR_OUT_OF_RANGE",function(a,n,i){let l=`The value of "${a}" is out of range.`,d=i;return Number.isInteger(i)&&Math.abs(i)>2**32?d=M(String(i)):typeof i=="bigint"&&(d=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(d=M(d)),d+="n"),l+=` It must be ${n}. Received ${d}`,l},RangeError);function M(a){let n="",i=a.length;const l=a[0]==="-"?1:0;for(;i>=l+4;i-=3)n=`_${a.slice(i-3,i)}${n}`;return`${a.slice(0,i)}${n}`}function re(a,n,i){he(n,"offset"),(a[n]===void 0||a[n+i]===void 0)&&se(n,a.length-(i+1))}function ge(a,n,i,l,d,y){if(a>i||a<n){const w=typeof n=="bigint"?"n":"";let R;throw y>3?n===0||n===BigInt(0)?R=`>= 0${w} and < 2${w} ** ${(y+1)*8}${w}`:R=`>= -(2${w} ** ${(y+1)*8-1}${w}) and < 2 ** ${(y+1)*8-1}${w}`:R=`>= ${n}${w} and <= ${i}${w}`,new B.ERR_OUT_OF_RANGE("value",R,a)}re(l,d,y)}function he(a,n){if(typeof a!="number")throw new B.ERR_INVALID_ARG_TYPE(n,"number",a)}function se(a,n,i){throw Math.floor(a)!==a?(he(a,i),new B.ERR_OUT_OF_RANGE(i||"offset","an integer",a)):n<0?new B.ERR_BUFFER_OUT_OF_BOUNDS:new B.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${n}`,a)}const qe=/[^+/0-9A-Za-z-_]/g;function ht(a){if(a=a.split("=")[0],a=a.trim().replace(qe,""),a.length<2)return"";for(;a.length%4!==0;)a=a+"=";return a}function ot(a,n){n=n||1/0;let i;const l=a.length;let d=null;const y=[];for(let w=0;w<l;++w){if(i=a.charCodeAt(w),i>55295&&i<57344){if(!d){if(i>56319){(n-=3)>-1&&y.push(239,191,189);continue}else if(w+1===l){(n-=3)>-1&&y.push(239,191,189);continue}d=i;continue}if(i<56320){(n-=3)>-1&&y.push(239,191,189),d=i;continue}i=(d-55296<<10|i-56320)+65536}else d&&(n-=3)>-1&&y.push(239,191,189);if(d=null,i<128){if((n-=1)<0)break;y.push(i)}else if(i<2048){if((n-=2)<0)break;y.push(i>>6|192,i&63|128)}else if(i<65536){if((n-=3)<0)break;y.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((n-=4)<0)break;y.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return y}function Pt(a){const n=[];for(let i=0;i<a.length;++i)n.push(a.charCodeAt(i)&255);return n}function S(a,n){let i,l,d;const y=[];for(let w=0;w<a.length&&!((n-=2)<0);++w)i=a.charCodeAt(w),l=i>>8,d=i%256,y.push(d),y.push(l);return y}function pt(a){return e.toByteArray(ht(a))}function st(a,n,i,l){let d;for(d=0;d<l&&!(d+i>=n.length||d>=a.length);++d)n[d+i]=a[d];return d}function me(a,n){return a instanceof n||a!=null&&a.constructor!=null&&a.constructor.name!=null&&a.constructor.name===n.name}function Rt(a){return a!==a}const jn=function(){const a="0123456789abcdef",n=new Array(256);for(let i=0;i<16;++i){const l=i*16;for(let d=0;d<16;++d)n[l+d]=a[i]+a[d]}return n}();function Re(a){return typeof BigInt>"u"?Dn:a}function Dn(){throw new Error("BigInt not supported")}})(Jr);var Xr={exports:{}},Y=Xr.exports={},we,be;function Xt(){throw new Error("setTimeout has not been defined")}function Zt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?we=setTimeout:we=Xt}catch{we=Xt}try{typeof clearTimeout=="function"?be=clearTimeout:be=Zt}catch{be=Zt}})();function Zr(t){if(we===setTimeout)return setTimeout(t,0);if((we===Xt||!we)&&setTimeout)return we=setTimeout,setTimeout(t,0);try{return we(t,0)}catch{try{return we.call(null,t,0)}catch{return we.call(this,t,0)}}}function ri(t){if(be===clearTimeout)return clearTimeout(t);if((be===Zt||!be)&&clearTimeout)return be=clearTimeout,clearTimeout(t);try{return be(t)}catch{try{return be.call(null,t)}catch{return be.call(this,t)}}}var _e=[],Je=!1,Ue,yt=-1;function ni(){!Je||!Ue||(Je=!1,Ue.length?_e=Ue.concat(_e):yt=-1,_e.length&&en())}function en(){if(!Je){var t=Zr(ni);Je=!0;for(var e=_e.length;e;){for(Ue=_e,_e=[];++yt<e;)Ue&&Ue[yt].run();yt=-1,e=_e.length}Ue=null,Je=!1,ri(t)}}Y.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];_e.push(new tn(t,e)),_e.length===1&&!Je&&Zr(en)};function tn(t,e){this.fun=t,this.array=e}tn.prototype.run=function(){this.fun.apply(null,this.array)};Y.title="browser";Y.browser=!0;Y.env={};Y.argv=[];Y.version="";Y.versions={};function Ce(){}Y.on=Ce;Y.addListener=Ce;Y.once=Ce;Y.off=Ce;Y.removeListener=Ce;Y.removeAllListeners=Ce;Y.emit=Ce;Y.prependListener=Ce;Y.prependOnceListener=Ce;Y.listeners=function(t){return[]};Y.binding=function(t){throw new Error("process.binding is not supported")};Y.cwd=function(){return"/"};Y.chdir=function(t){throw new Error("process.chdir is not supported")};Y.umask=function(){return 0};var ii=Xr.exports;(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Jr,r=ii,o=f=>f&&f.__esModule?f:{default:f},s=o(r),u=globalThis||void 0||self;Object.defineProperty(t,"Buffer",{enumerable:!0,get:()=>e.Buffer}),Object.defineProperty(t,"process",{enumerable:!0,get:()=>s.default}),t.global=u})(O);class oi{}window.slStore=Object.create(null);const si=(t,e)=>Vn.buildLogger(t,e,{mount:({storeName:r})=>{window.slStore[r]||(window.slStore[r]={mounted:!0,history:[{type:"mount"}]}),window.slStore[r].store=t},unmount:({storeName:r})=>{window.slStore[r].mounted=!1,window.slStore[r]?.history.push({type:"unmount"})},change:({actionName:r,storeName:o,changed:s,newValue:u,oldValue:f,valueMessage:c})=>{window.slStore[o]?.history.push({type:"change",changed:s,newValue:u,oldValue:f,diff:Mn({...f},{...u},{cyclesFix:!1}),actionName:r,valueMessage:c})},action:{start:({actionName:r,args:o,storeName:s})=>{window.slStore[s]?.history.push({type:"action:start",actionName:r,args:o,storeName:s})},error:({actionName:r,error:o,storeName:s})=>{window.slStore[s]?.history.push({type:"action:error",actionName:r,error:o})},end:({actionName:r,storeName:o})=>{window.slStore[o]?.history.push({type:"action:end",actionName:r})}}});class Ot{store;name;constructor(e,r){this.store=e,this.name=r,si(this.store,this.name)}getStore(){return this.store}}const ai=t=>{const e=Object.keys(t);return Me.computed(e.map(r=>t[r].getStore()),(...r)=>Object.fromEntries(e.map((o,s)=>[o,r[s]])))};class ut extends Ot{getValues=()=>this.getStore().get();getValue=e=>this.getStore().get()[e];setValue=(e,r)=>this.getStore().setKey(e,r);subscribe=(...e)=>this.getStore().subscribe(...e);unsubscribe=()=>this.getStore().off()}const $e=t=>Me.map(t);var Te;(function(t){t.ORGANIZATION="ORGANIZATION",t.STREAM="STREAM"})(Te||(Te={}));const ui={[ce.SdkOverlayType.BETTING]:"betting",[ce.SdkOverlayType.GAMES]:"games",[ce.SdkOverlayType.PUBLIC_CHAT]:"publicChat",[ce.SdkOverlayType.TWITTER]:"twitter"};var je;(function(t){t.Ready="ready",t.Suspended="suspended"})(je||(je={}));class fr{status;source;config;settings;listeners=new Set;settingsKey;constructor({settings:e,...r},o){this.settingsKey=ui[r.type],this.status=Me.atom(je.Suspended),this.config=new ut($e(r),`feature:config:${this.settingsKey}`),this.settingsKey!==void 0&&e?.overlaySettings.case===this.settingsKey?this.settings=new ut($e(e.overlaySettings.value),`feature:settings:${this.settingsKey}`):this.settings=new ut($e({}),`feature:settings:${this.settingsKey}`),this.source=o}get featureConfig(){return this.config.getStore()}get featureSettings(){return this.settings.getStore()}registerEventListener(e){this.listeners.add(e)}enable=()=>{this.status.set(je.Ready)};disable=()=>{this.status.set(je.Suspended)};setFeatureConfig=({settings:e,...r})=>{let o;for(o in r)this.config.setValue(o,r[o]);if(e?.overlaySettings?.case!==void 0&&e?.overlaySettings.case===this.settingsKey){const s=e.overlaySettings.value;if(s!==void 0){let u;for(u in s)console.log(u,s[u]),s[u]!==0&&s[u]!==""&&this.settings.setValue(u,s[u])}}};update=(e,r)=>{this.source===Te.STREAM&&r===Te.ORGANIZATION||(this.setFeatureConfig(e),this.source=r)};fireEvent(e){for(const r of this.listeners.values())try{r.onEvent(e)}catch(o){console.error(o)}}}class ye extends Ot{getValue=()=>this.getStore().get();getValues(){throw new Error("not implemented")}setValue=e=>this.getStore().set(e);subscribe=e=>this.getStore().subscribe(e);unsubscribe=()=>this.getStore().off();listen(e){return this.getStore().listen(e)}get(){return this.getStore().get()}}const ie=t=>Me.atom(t);class pe extends Ot{atomStore;constructor(e,r,o){super(e,`api:${r}`),this.atomStore=Me.atom(),o&&e.subscribe(s=>{const u=this.atomStore.get(),f=o(s,u);u!==f&&this.atomStore.set(f)})}getAtomStore=()=>this.atomStore;getValue=async()=>{const e=this.getStore();if(e.value===void 0)throw new Error("no store");return await e.value.promise,e.get().data};getValues=()=>{throw new Error("not implemented")};setValue=e=>this.getStore().set({loading:!1,data:e?.data});subscribe=e=>this.getStore().subscribe(e);unsubscribe=()=>{throw new Error("not implemented")};invalidate=()=>{this.store.invalidate()};listen=e=>this.getStore().listen(e);get(){throw new Error("not implemented")}key=()=>this.getStore().key;off=()=>this.getStore().off()}async function*ci(t,e){for await(const r of e){t.response.message=r,t.received_at=Date.now();const o={type:"__GRPC_DEVTOOLS_EXTENSION__",data:t};window.postMessage(o),yield r}}const li=()=>t=>async e=>{const r={name:e.url,request:{},response:{}};r.request.header=Object.fromEntries(e.header.entries()),r.sent_at=Date.now();try{const o=await t(e);if(r.received_at=Date.now(),r.stream=o.stream,r.response.header=Object.fromEntries(o.header.entries()),r.response.trailer=Object.fromEntries(o.trailer.entries()),o.stream)return{...o,message:ci(r,o.message)};{r.request.message=e.message,r.response.message=o.message,r.latency=r.received_at-r.sent_at;const s={type:"__GRPC_DEVTOOLS_EXTENSION__",data:r};window.postMessage(s)}return o}catch(o){r.received_at=Date.now(),r.request.message=e.message,r.response.trailer={"grpc-status":o.code,"grpc-message":o.rawMessage},r.response.message=o.rawMessage,r.latency=r.received_at-r.sent_at;const s={type:"__GRPC_DEVTOOLS_EXTENSION__",data:r};throw window.postMessage(s),o}};window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));var Ee;(function(t){t.Init="init",t.Ready="ready",t.Connecting="connecting",t.Connected="connected",t.Disconnected="disconnected",t.Failed="failed",t.Reconnecting="reconnecting"})(Ee||(Ee={}));class fi{params;stream;method;name;headers;listeners;state;store;constructor(e,r,o,s){const u={status:Ee.Init,ts:new Date,log:[]};this.state=new ut($e(u),`subscription:${s.name}:state`),this.name=s.name,this.headers=e,this.listeners=new Map,this.params=o,this.method=r,s.withStore&&(this.store=new ye(ie(null),`subscription:${s.name}:store`)),"subscribe"in o&&typeof o.subscribe=="function"&&o.subscribe(()=>{this.reconnect()}),this.updateState(Ee.Ready)}updateState=e=>{this.state.setValue("status",e),this.state.setValue("ts",new Date),this.addStateLog(`status => ${e}`)};addStateLog=e=>{const r=this.state.getStore().get().log;this.state.setValue("log",[...r,`${new Date().toLocaleString()}: ${e}`])};addListener=(e,r)=>this.listeners.has(e)?(this.addStateLog(`listener '${e}' not added`),!1):(this.listeners.set(e,r),this.addStateLog(`listener '${e}' added`),!0);removeListener=e=>{this.listeners.delete(e),this.addStateLog(`listener '${e}' removed`)};connect=()=>{this.updateState(Ee.Connecting),this.stream&&(this.addStateLog("disconnect prev connection"),this.stream());const e="get"in this.params&&typeof this.params.get=="function"?this.params.get():this.params;this.stream=this.method(e,this.onData,this.onStreamError,{headers:this.headers.getValues()}),this.updateState(Ee.Connected)};disconnect=()=>{this.stream&&this.stream(),this.listeners.clear(),this.updateState(Ee.Disconnected)};reconnect=()=>{this.updateState(Ee.Reconnecting),this.connect()};getStore=()=>this.store?.getStore();onData=e=>{this.addStateLog(`received data => ${JSON.stringify(e)}`),this.store&&this.store.setValue(e);for(const[,r]of this.listeners)r(e);this.addStateLog(`data routed to ${this.listeners.size} listeners`)};onStreamError=e=>{e!==void 0&&(e.code!==Yt.Code.Canceled&&e.rawMessage!=="[canceled] BodyStreamBuffer was aborted"?(this.updateState(Ee.Failed),this.state.setValue("error",e),this.reconnect()):this.disconnect())}}class di{toJsonOptions={emitDefaultValues:!1,enumAsInteger:!0,useProtoFieldName:!1};transport;nanoquery;host;interceptors=[];$headers;clients;callbackClients;subscriptions;constructor(e){this.host=e,this.$headers=new ut($e({"sl-device-id":O.process?.env?.NX_DEVICE_ID||"sdk-web-dev"}),"transport:headers"),this.initInterceptors(),this.clients=new Map,this.callbackClients=new Map,this.subscriptions=new Map;const[r,o,s]=Qn.nanoquery();this.nanoquery={createFetcherStore:r,createMutatorStore:o,utils:s},this.transport=qn.createGrpcWebTransport({baseUrl:e,interceptors:this.interceptors,useBinaryFormat:!0})}addSubscription=(e,r,o)=>{const s=this.subscriptions.get(r);if(s)return s;const u=new fi(this.$headers,e,r,o);return this.subscriptions.set(r,u),u};removeSubscription=e=>{e.disconnect(),this.subscriptions.delete(e.params)};disconnect=()=>{for(const[e,r]of this.subscriptions)r.disconnect(),this.subscriptions.delete(e)};registerInterceptor=e=>{this.interceptors.push(e)};removeInterceptor=e=>{this.interceptors=this.interceptors.filter(r=>r!==e)};getClient=e=>{const r=e.typeName;if(this.clients.has(r))return this.clients.get(r);const o=Yt.createPromiseClient(e,this.transport);return this.clients.set(r,o),o};getCallbackClient=e=>{const r=e.typeName;if(this.callbackClients.has(r))return this.callbackClients.get(r);const o=Yt.createCallbackClient(e,this.transport);return this.callbackClients.set(r,o),o};createPromiseClient=(e,{params:r=[],method:o})=>{const s=this.getClient(e),u=e.methods[o].name,f=[e.typeName,u.charAt(0).toLowerCase()+u.slice(1),...Array.isArray(r)?r:[r]],c=[e.typeName,u.charAt(0).toLowerCase()+u.slice(1)];return{client:s,queryKey:f,queryKeyStr:c.join("")}};createCallbackClient=e=>({client:this.getCallbackClient(e)});setSdkKey=e=>{this.$headers.setValue("sdk",e)};setAuth=(e,r)=>{this.$headers.setValue("authorization",e),this.$headers.setValue("sl-user-id",r)};setHeader=(e,r)=>this.$headers.setValue(e,r);getHeader=e=>this.$headers.getValue(e);getHeaders=()=>this.$headers.getValues();initInterceptors=()=>{if(this.interceptors.length!==0)return;const e=r=>o=>{const s=this.$headers.getValues();for(const u in s)o.header.set(u,s[u]);return r(o)};this.interceptors.push(e),this.interceptors.push(li())}}const hi=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(Gn.Events,{method:"retrieveEventId",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>{if(!f||typeof f!="string")return"";try{return(await r.retrieveEventId({id:f})).data?.id||""}catch{return""}}})},pi=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(ft.Client,{method:"getStream",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>f?(await r.getStream({id:f})).data?.attributes:void 0})},yi=(t,e)=>{const{queryKey:r,client:o}=e.createPromiseClient(Kr.Users,{method:"me",params:[t]});return e.nanoquery.createFetcherStore(r,{fetcher:()=>o.me({})})},gi=t=>{const{client:e}=t.createPromiseClient(Kr.Users,{method:"bypassAuth"});return({userKey:r,schema:o,init:s})=>e.bypassAuth({userKey:r,schema:o,init:s})},mi=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(ft.Client,{method:"get",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async()=>(await r.get({})).data?.attributes})},wi=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(ft.Client,{method:"getOrganization",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async()=>{const s=await r.getOrganization({});return s.data?{...s.data.attributes,id:s.data.id}:void 0}})},bi=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(ft.Client,{method:"getOrganizationAdvertising",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async()=>(await r.getOrganizationAdvertising({})).data?.attributes})},vi=(t,e,r)=>{t.transport=new di(e.host),t.sdk.host=t.transport.host,t.transport.setSdkKey(e.sdkKey),r()};class dr{delimiter=":";prefix;constructor(e="main"){this.prefix=`sl-sdk${this.delimiter}${e}`}clear=()=>{for(const e in window.localStorage)e.startsWith(this.prefix)&&window.localStorage.removeItem(e)};generateKey=e=>`${this.prefix}${this.delimiter}${e.join(this.delimiter)}`;write=(...e)=>{const r=e.pop()||"";window.localStorage.setItem(this.generateKey(e),r)};read=(...e)=>{const r=window.localStorage.getItem(this.generateKey(e));return r===null?void 0:r};remove=(...e)=>{window.localStorage.removeItem(this.generateKey(e))}}var Ie;(function(t){t.SCHEMA="schema",t.EXTERNAL_TOKEN="eToken",t.TOKEN="token"})(Ie||(Ie={}));class He extends dr{constructor(){super("user")}setSchema=e=>{this.write(Ie.SCHEMA,e)};getSchema=()=>this.read(Ie.SCHEMA);setToken=e=>{this.write(Ie.TOKEN,e)};getToken=()=>this.read(Ie.TOKEN);setExternalToken=e=>{this.write(Ie.EXTERNAL_TOKEN,e)};getExternalToken=()=>this.read(Ie.EXTERNAL_TOKEN);removeToken=()=>{this.remove(Ie.TOKEN)}}var Fe;(function(t){t.DISABLED="disabled",t.INITIALIZATION="initialization",t.READY="ready",t.FAILED="failed",t.SUSPENDED="suspended"})(Fe||(Fe={}));const Si=t=>{const e=new He,r=new ye(ie(e.getExternalToken()),"userKey"),o=new ye(ie(e.getToken()),"userToken"),s=new pe(yi(o.getStore(),t),"user",({data:f,error:c,loading:h},b)=>{if(!c)return f?.data?.id?f.data.id:h===!1?void 0:b}),u=new pe(mi(o.getStore(),t),"userSettings");return{userKey:r,userToken:o,user:s,userSettings:u}},Ai=t=>{const e=new ye(ie(void 0),"providerStreamId"),r=new pe(hi(e.getStore(),t),"slStreamId",s=>s?.data),o=new pe(pi(r.getAtomStore(),t),"streamSettings");return r.getAtomStore().listen(s=>{(s===""||s===void 0)&&o.getStore().mutate(void 0)}),{providerStreamId:e,slStreamId:r,streamSettings:o}},Ei=t=>{const e=new ye(ie(void 0),"enabled"),r=new ye(ie(Fe.DISABLED),"status"),o=new pe(wi(e.getStore(),t),"organizationSettings",c=>c?.data?.id),s=new pe(bi(o.getAtomStore(),t),"organizationAdvertising"),u=Si(t),f=Ai(t);return{enabled:e,status:r,providerStreamId:f.providerStreamId,slStreamId:f.slStreamId,streamSettings:f.streamSettings,user:u.user,userKey:u.userKey,userToken:u.userToken,userSettings:u.userSettings,organizationSettings:o,organizationAdvertising:s}};class Ii extends Ot{stores;constructor(e){const r=Ei(e),o=ai(r);super(o,"core"),this.stores=r}getValue(){throw new Error("Not implemented")}getValues(){return this.stores}setValue(){throw new Error("Not implemented")}subscribe=e=>{let r;for(r in this.stores){const o=e[r];r in e&&o!==void 0&&this.stores[r].subscribe(e[r])}};unsubscribe=()=>this.getStore().off()}class Ti extends oi{$coreStore;transport;bypassLogin;constructor(e,r){super(),this.$coreStore=e,this.transport=r,this.bypassLogin=gi(this.transport),this.connect()}me=async()=>(this.$coreStore.getValues().user.invalidate(),(await this.$coreStore.getValues().user.getValue())?.data);login=async(e,r)=>{this.$coreStore.getValues().userKey.setValue(r);const o=await this.bypassLogin({schema:e,userKey:r,init:!1}),s=o.meta?.jwt,u=o.data?.id;if(!s||!u)throw new Error("internal: token missing");return this.$coreStore.getValues().user.getStore().mutate(o),this.saveUser(s,u),s};isAuthenticated=()=>this.me();logout=()=>{this.$coreStore.getValues().user.setValue(),this.$coreStore.getValues().userKey.setValue(),this.$coreStore.getValues().userToken.setValue(),this.transport.setAuth("",""),new He().clear()};softLogout=()=>{const e=new He;this.transport.setAuth("",""),e.setToken(""),this.reLogin()};reLogin=()=>{const e=new He,r=e.getToken(),o=e.getExternalToken();if(this.$coreStore.getValues().userKey.setValue(o),r)return this.saveUser(r,""),this.me().then(s=>{if(s?.id){const u=s.id;this.saveUser(r,u)}});if(o&&!r){const s=e.getSchema();s&&o&&this.login(s,o).catch(()=>{this.logout()})}};saveUser=(e,r)=>{this.transport.setAuth(e,r),this.$coreStore.getValues().userToken.setValue(e),new He().setToken(e)};connect=()=>{this.transport.registerInterceptor(e=>async r=>{try{return await e(r)}catch(o){throw o.code&&(o.code===7||o.code===16)&&this.transport.getHeader("authorization")&&this.softLogout(),o}})}}const at=new He,Fi=(t,e,r)=>{t.auth=new Ti(t.store,t.transport),t.stores.status.listen(o=>{o===Fe.READY&&t.auth.reLogin()}),t.sdk.userId=t.stores.user.getAtomStore,t.sdk.authorizationBypass=async(o,s)=>{if(!(at.getSchema()===o&&at.getExternalToken()===s&&t.transport.getHeader("authorization")))try{await t.auth.login(o,s),at.setSchema(o),at.setExternalToken(s)}catch{t.sdk.logout()}},t.sdk.logout=()=>{t.auth.logout(),at.clear()},t.sdk.getUserStore=()=>t.stores.user.getStore(),t.sdk.isUserAuthorized=()=>t.auth.isAuthenticated(),r()},_i=(t,e,r)=>{t.store=new Ii(t.transport),t.stores=t.store.getValues(),t.sdk.enabled=t.stores.enabled.getStore(),t.sdk.status=t.stores.status.getStore(),t.sdk.sdkStore=Object.fromEntries(Object.entries(t.stores).map(([o,s])=>[o,s.getStore()])),t.sdk.organizationStore=()=>t.stores.organizationSettings.getStore(),t.sdk.streamStore=()=>t.stores.streamSettings.getStore(),t.storeUnsubscribe=()=>{t.store.unsubscribe()},r()},Ci=(t,e,r)=>{t.sdk=Object.create(null),t.sdk.initializeApp=async()=>{if(t.stores.enabled.get()==="on")return{enabled:!0};t.storeSubscribe(),t.stores.enabled.setValue("on"),t.stores.status.setValue(Fe.INITIALIZATION);try{const o=await t.stores.organizationSettings.getValue();return o?(t.stores.status.setValue(Fe.READY),{enabled:!!o}):(t.stores.status.setValue(Fe.FAILED),{err:"failed"})}catch(o){return t.stores.enabled.setValue(),t.stores.status.setValue(Fe.FAILED),{err:`${o}`}}},t.sdk.disableApp=()=>{t.stores.enabled.get()==="on"&&(t.stores.enabled.setValue(),t.stores.status.setValue(Fe.DISABLED),t.sdk.closeFeature(),t.storeUnsubscribe())},t.sdk.createEventSession=o=>{t.stores.providerStreamId.setValue(o)},r()},Oi=zn.pino({level:"trace",enabled:!1,browser:{write:t=>{console.log(t)}}}),rn=(t,e)=>Oi.child({name:t},e),xi=(t,e,r)=>{const{client:o,queryKey:s}=r.createPromiseClient(Hr.Leaderboard,{method:"summary",params:[t,e]});return r.nanoquery.createFetcherStore(s,{fetcher:async(u,f,c,h)=>(await o.summary({eventId:c,userId:h})).data?.attributes})},Bi=t=>{const{client:e}=t.createPromiseClient(Hr.Leaderboard,{method:"list"});return r=>e.list(r)},ki=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(Se.Feed,{method:"get",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>(await r.get({eventId:f})).data?.attributes})},Pi=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(Se.Feed,{method:"syncQuestion",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>f?(await r.syncQuestion({filter:{eventId:f}})).data?.attributes:void 0})},Ri=(t,e)=>{const{client:r}=e.createCallbackClient(Se.Feed),o=Me.atom({eventId:t.get()||"",feedId:""});return t.subscribe((u="")=>{o.set({eventId:u,feedId:""})}),e.addSubscription(r.subscription,o,{name:"feedSubscription"})},Li=(t,e)=>{const{client:r}=e.createCallbackClient(Se.Feed);return e.addSubscription(r.questionSubscription,{questionId:t},{name:"questionSubscription"})},nn=async(t,e)=>{const{client:r}=e.createPromiseClient(Se.Feed,{method:"questionByUser",params:[t]});return(await r.questionByUser({questionId:t})).data?.attributes?.question},Ni=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(Se.Feed,{method:"list",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>f?(await r.list({eventId:f,filter:{statuses:[te.QuestionStatus.ACTIVE,te.QuestionStatus.RESOLVED]}})).data:[]})},Ui=(t,e)=>{const{client:r,queryKey:o}=e.createPromiseClient(Se.Feed,{method:"insightHistory",params:[t]});return e.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>f?(await r.insightHistory({eventId:f})).data?.map(({attributes:h})=>h):void 0})};var hr={exports:{}};const $i=Object.getPrototypeOf({});function pr(t){function e(I){return I!=="constructor"&&I!=="prototype"&&I!=="__proto__"}function r(I){let _=0;const j=I.length,U=new Array(j);for(_=0;_<j;++_)U[_]=T(I[_]);return U}function o(I){const _={};if(h&&Object.getPrototypeOf(I)!==$i)return h(I);const j=c(I);let U,F,x;for(U=0,F=j.length;U<F;++U)e(x=j[U])&&(_[x]=T(I[x]));return _}function s(I,_){const j=I.length,U=_.length;let F=0;const x=new Array(j+U);for(F=0;F<j;++F)x[F]=T(I[F]);for(F=0;F<U;++F)x[F+j]=T(_[F]);return x}const u=Object.prototype.propertyIsEnumerable;function f(I){const _=Object.keys(I),j=Object.getOwnPropertySymbols(I);for(let U=0,F=j.length;U<F;++U)u.call(I,j[U])&&_.push(j[U]);return _}const c=t&&t.symbols?f:Object.keys,h=typeof t?.cloneProtoObject=="function"?t.cloneProtoObject:void 0;function b(I){return typeof I=="object"&&I!==null&&!(I instanceof RegExp)&&!(I instanceof Date)}function g(I){return typeof I!="object"||I===null}const m=typeof O.Buffer<"u"?I=>typeof I!="object"||I===null||I instanceof RegExp||I instanceof Date||I instanceof O.Buffer:I=>typeof I!="object"||I===null||I instanceof RegExp||I instanceof Date,E=t&&typeof t.mergeArray=="function"?t.mergeArray({clone:T,deepmerge:P,getKeys:c,isMergeableObject:b}):s;function T(I){return b(I)?Array.isArray(I)?r(I):o(I):I}function L(I,_){const j={},U=c(I),F=c(_);let x,k,G;for(x=0,k=U.length;x<k;++x)e(G=U[x])&&F.indexOf(G)===-1&&(j[G]=T(I[G]));for(x=0,k=F.length;x<k;++x)e(G=F[x])&&(G in I&&(U.indexOf(G)!==-1&&(j[G]=P(I[G],_[G])),!0)||(j[G]=T(_[G])));return j}function P(I,_){const j=Array.isArray(_),U=Array.isArray(I);return g(_)?_:m(I)?T(_):j&&U?E(I,_):j!==U?T(_):L(I,_)}function K(){switch(arguments.length){case 0:return{};case 1:return T(arguments[0]);case 2:return P(arguments[0],arguments[1])}let I;for(let _=0,j=arguments.length;_<j;++_)I=P(I,arguments[_]);return I}return t&&t.all?K:P}hr.exports=pr;hr.exports.default=pr;var ji=hr.exports.deepmerge=pr;const Di=t=>(e,r)=>{let o=0;const s=e.length,u=r.length,f=Math.max(s,u),c=new Array(f);for(o=0;o<f;++o)o<u?c[o]=t.deepmerge(e[o],r[o]):c[o]=t.clone(e[o]);return c},Vi=ji({mergeArray:Di}),Mi=(t,e,r)=>{const o=Me.computed([e,r],(f,c)=>{if(f){if(c.data)return c.data.find(h=>h.id===f);console.error("Feed list is not loaded yet. Issue with the opened question.")}}),s=$e({data:void 0,loading:void 0,error:void 0});return o.subscribe(async f=>{if(f&&f.type==="question"){s.setKey("loading",!0);const c=await nn(f.id,t);s.set({data:c,loading:!1});return}s.set({data:void 0,loading:!1})}),{$store:o,$extendedStore:s,updateExtendedQuestion:f=>{const c=s.get().data;if(c)for(const h of f?.answers||[])h.youVoted!==!0&&delete h.youVoted;s.set({data:Vi(c,f)})}}},on=t=>(t.gamification||(t.gamification=new qi(t)),t.gamification);class qi{slStreamId;organizationId;userId;openedQuestionId;openedQuestion;activeQuestionId;feedList;moderationId;moderation;feedSubscription;questionSubscription;notifications;log;constructor(e){if(e.gamification)throw new Error("GamificationBackground Singleton error");this.log=rn("gamification-background"),this.slStreamId=e.stores.slStreamId.getAtomStore(),this.organizationId=e.stores.organizationSettings.getAtomStore(),this.userId=e.stores.user.getAtomStore(),this.moderationId=new ye(ie(void 0),"moderationId").getStore(),this.openedQuestionId=new ye(ie(void 0),"openedQuestionId").getStore(),this.notifications=e.notifications,this.moderation=new pe(ki(this.slStreamId,e.transport),"gamification:moderation"),this.feedList=new pe(Ni(this.slStreamId,e.transport),"gamification:feedList"),this.activeQuestionId=new pe(Pi(this.slStreamId,e.transport),"gamification:activeQuestionId"),this.openedQuestion=Mi(e.transport,this.openedQuestionId,this.feedList.getStore()),this.openedQuestionId.listen(r=>{this.log.debug({questionId:r},"received question"),r?(this.questionSubscription=Li(r,e.transport),this.questionSubscription.addListener("feed-subscription-opened-question",o=>{window.requestAnimationFrame(()=>{this.openedQuestion.updateExtendedQuestion(o.data?.attributes?.question)})}),this.questionSubscription.connect()):(this.log.info("cleanup on close question"),this.questionSubscription!==void 0&&(e.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0))}),this.feedSubscription=Ri(this.slStreamId,e.transport),this.feedSubscription.addListener("feed-subscription-active-question",r=>{window.requestAnimationFrame(()=>{const o=this.activeQuestionId.getStore();o&&o.mutate(r.data?.attributes)})})}getCurrentSessionId=e=>{const r=e.eventId||this.slStreamId.get()||"",o=e.userId||this.userId.get()||"",s=e.organizationId||this.organizationId.get()||"",u=e.entity||"",f=e.prefix||"";return[s,r,o,f,u].join(":")};disconnect=()=>{this.feedSubscription?.disconnect()};openQuestion=e=>{this.openedQuestionId.set(e),this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:e}))};closeQuestion=e=>{this.openedQuestionId.set(void 0),e&&this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:e}))}}class Qi{notificationsList;notifications;store;timeouts;waitingQueue;activeQueue;options;logger;constructor(e){this.options=e,this.logger=rn("notifications"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.notifications=new ye(ie(new Map),"notifications-queue"),this.notificationsList=this.notifications.getStore()}addToQueue=e=>{if(this.store.has(e.id)){this.logger.debug({notification:e},"skip existed notification: %o");return}const r=e.close,o=e.action;if(this.store.set(e.id,{...e,close:(...s)=>{r&&r(...s),this.closeNotification(e.id)},action:(...s)=>{o&&o(...s),this.closeNotification(e.id)}}),this.waitingQueue.add(e.id),this.activeQueue.size===this.options.concurrency){const[s]=this.activeQueue;this.closeNotification(s)}else this.tickWaitingQueue()};tickWaitingQueue=()=>{if(this.activeQueue.size<this.options.concurrency){const[e]=this.waitingQueue;if(!e)return;this.activeQueue.add(e),this.waitingQueue.delete(e),this.logger.debug({job:e},"waiting queue tick"),this.tickActiveQueue(e)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")};tickActiveQueue=e=>{if(!e)return;const r=this.store.get(e);if(!r){this.logger.debug({notificationId:e},"active queue tick skipped, notification not exist");return}const o=setTimeout(()=>{const s=e,u=new Map(this.notifications.getValue());u.set(r.id,r),this.notifications.setValue(u);const f=setTimeout(()=>{this.logger.debug({notificationId:s,delay:r.autoHideDuration||5e3},"notification hiding by autoHideDuration"),this.closeNotification(s)},r.autoHideDuration||5e3);this.timeouts.set(s,f),this.logger.debug({notificationId:s,queue:[...u.values()]},"notification displayed")},r.delay||0);this.timeouts.set(e,o),this.logger.debug({notificationId:e},"active queue tick completed"),this.tickWaitingQueue()};closeNotification=e=>{const r=new Map(this.notifications.getValue()),o=r.get(e);if(o){o.hiding=!(this.waitingQueue.size>=this.options.concurrency),this.notifications.setValue(r);const s=setTimeout(()=>{const u=new Map(this.notifications.getValue());u.delete(e),this.notifications.setValue(u);const f=this.timeouts.get(e);f!==void 0&&(clearTimeout(f),this.timeouts.delete(e)),this.logger.debug({notificationId:e},"notification hidden")},this.options.animationDelay||0);this.timeouts.set(e,s)}this.store.delete(e),this.activeQueue.delete(e),this.waitingQueue.delete(e),this.tickWaitingQueue(),this.logger.debug({notificationId:e},"notification hiding")}}var St;(function(t){t.OPENED="opened"})(St||(St={}));class Gi extends dr{constructor(){super("notification")}setOpened=e=>{this.write(St.OPENED,e,"true")};isOpened=e=>this.read(St.OPENED,e);clearNotification=()=>{this.clear()}}var Le;(function(t){t[t.ONBOARDING=1]="ONBOARDING",t[t.QUESTION=2]="QUESTION",t[t.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(Le||(Le={}));class zi{queue;storage;constructor(e={}){this.storage=new Gi,this.queue=new Qi({concurrency:1,animationDelay:1600,...e})}add=e=>{this.storage.isOpened(e.id)||this.queue.addToQueue(e)};close=e=>{this.queue.closeNotification(e),this.markAsViewed(e)};getQueueStore=()=>this.queue.notificationsList;markAsViewed=e=>{this.storage.setOpened(e)}}const Ki=(t,e,r)=>{t.notifications=new zi,t.addNotification=t.notifications.add,t.sdk.getNotificationsStore=()=>t.notifications.getQueueStore(),r()},Hi=(t,e)=>{const{client:r}=t.createPromiseClient(Se.Feed,{method:"submitAnswer"});return r.submitAnswer({data:e})},Wi=(t,e)=>{const{client:r}=t.createPromiseClient(Se.Feed,{method:"submitInplay"});return r.submitInplay({data:{eventId:+e}})},Ji=(t,e)=>{const{client:r}=t.createPromiseClient(Se.Feed,{method:"skipQuestion"});return r.skipQuestion({data:{id:e}})};var At;(function(t){t.ONBOARDING="onboarding"})(At||(At={}));class sn extends dr{constructor(){super("gamification")}saveOnboardingStatus=({userId:e,eventId:r,organizationId:o},s)=>{this.write(At.ONBOARDING,o,e,r,s)};getOnboardingStatus=({userId:e,eventId:r,organizationId:o})=>this.read(At.ONBOARDING,o,e,r)}const Tr={pageSize:10},Yi=(t,e,r)=>{const o=ie({pageSize:r?.pageSize||Tr.pageSize,page:0}),s=$e({data:[],loading:void 0,error:void 0}),u=Bi(t),f=async b=>{if(b){s.setKey("loading",!0);const g={eventId:b,pagination:{page:0,pageSize:r?.pageSize||Tr.pageSize}},m=await u(g);s.set({data:m.data.map(E=>E.attributes),loading:!1}),o.set(g.pagination)}};e.listen(f);const c=()=>{f(e.get())};return o.listen(async b=>{const g=e.get(),m=s.get().data?.length||0;if(b.page>0&&g&&m>=b.page*b.pageSize){s.setKey("loading",!0);const T=await u({eventId:g,pagination:b}),L=s.get().data||[];s.set({data:[...L,...T.data.map(P=>P.attributes)],loading:!1})}}),{$store:s,fetchMore:()=>{const b=o.get();o.set({...b,page:b.page+1})},invalidate:c}},Xi=(t,e)=>{const{client:r,queryKey:o}=t.createPromiseClient(ft.Client,{method:"generateDeepLink",params:e});return t.nanoquery.createFetcherStore(o,{fetcher:async(s,u,f)=>f?(await r.generateDeepLink({data:{eventId:f}})).data?.attributes:{}})},Zi=(t,e,r)=>{const o=Xi(t,[e]),s=`${window.location.host+window.location.pathname}%23sl_eid=${e.get()}&sl_uid=${r.get()}`;return{$store:o,fetch,desktopLink:s}};var ne;(function(t){t.Unset="unset",t.Required="required",t.Optional="optional",t.Completed="completed",t.Disabled="disabled",t.Unavailable="unavailable"})(ne||(ne={}));const eo=(t,e,r,o)=>{const s=new sn,u=ie(ne.Unset),f=()=>{const{inplayGame:b}=t.featureSettings.get(),g=e.getCurrentSessionId({prefix:"onboarding"});b&&o.add({type:Le.ONBOARDING,id:g,action:t.openFeature,close:()=>{o.markAsViewed(g)},delay:1e3,autoHideDuration:1e6,data:{questionType:te.QuestionType.UNSET,onboarding:{...b}}})};u.subscribe(b=>{(b===ne.Optional||ne.Required)&&f(),b===ne.Completed&&e.activeQuestionId.invalidate()});const c=async()=>{const b=e.userId.get();if(!b){u.set(ne.Unset);return}s.getOnboardingStatus({userId:b,organizationId:e.organizationId.get()||"",eventId:e.slStreamId.get()||""})===ne.Completed&&u.set(ne.Completed);const m=await e.moderation.getValue();if(u.get()===ne.Completed)return;const E=!!(m?.options?.onboardingEnabled&&t.featureSettings.get().inplayGame?.onboarding?.completed),T=!!t.featureSettings.get().inplayGame?.titleCard?.optIn;E?T?u.set(ne.Required):u.set(ne.Optional):T?u.set(ne.Unavailable):u.set(ne.Disabled)};return c(),e.userId.subscribe(b=>{b&&c()}),e.moderation.subscribe(b=>{b.data&&c()}),{$store:u,submitInplay:async()=>{const b=e.slStreamId.get();if(b){await Wi(r,b),u.set(ne.Completed),s.saveOnboardingStatus({organizationId:e.organizationId.get()||"",userId:e.userId.get()||"",eventId:b},ne.Completed);const g=e.getCurrentSessionId({prefix:"onboarding"});o.close(g)}}}},to=new Set([te.QuestionType.POLL,te.QuestionType.PREDICTION,te.QuestionType.TRIVIA]);class ro extends fr{userSummary;feedList;leaderboardId;leaderboardList;deepLink;onboardingStatus;openedQuestion;currentUserId;openedUser;closeFeature;openFeature;notifications;transport;background;storage;constructor(e,r,o){super(e,r),this.background=on(o),this.storage=new sn,this.userSummary=new pe(xi(this.background.slStreamId,this.background.userId,o.transport),"gamification:userSummary"),this.feedList=this.background.feedList,this.currentUserId=this.background.userId,this.openedUser=ie(void 0),this.leaderboardId=new ye(ie(this.settings.getValue("pinnedLeaderboardId")),"pinnedLeaderboardId").getStore(),this.onboardingStatus=eo(this,this.background,o.transport,o.notifications),this.notifications=o.notifications,this.transport=o.transport,this.closeFeature=o.sdk.closeFeature,this.openFeature=()=>o.sdk.openFeature(ce.SdkOverlayType.GAMES),this.openedQuestion=this.background.openedQuestion,this.deepLink=Zi(this.transport,this.background.slStreamId,this.background.userId),this.leaderboardList=Yi(this.transport,this.background.slStreamId),this.status.subscribe(s=>{s===je.Ready?this.connect(o.transport):this.disconnect()}),this.background.activeQuestionId.listen(s=>{if(s&&s.data&&this.onboardingStatus.$store.get()&&s.data.question?.id!==void 0&&s.data.question.notification!==void 0&&s.data.moderation?.bypassNotifications?.inAppSilence!==te.SilenceSetting.ON&&s.data.question.status===te.QuestionStatus.ACTIVE){if(to.has(s.data.question.type))this.notifications.add({type:Le.QUESTION,action:()=>s.data?.question&&this.openQuestion(s.data.question.id),close:()=>s.data?.question&&this.closeQuestion(s.data.question.id),autoHideDuration:1e3*60,id:this.background.getCurrentSessionId({prefix:"notification",entity:s.data.question.id}),data:{questionType:s.data.question.type,question:{title:s.data.question.notification.title}}});else if(s.data.question.type===te.QuestionType.FACTOID){const u=s.data.question.options?.options.value,f={heading:s.data.question.notification.title,body:s.data.question.notification.body,image:s.data.question.notification.image,video:{id:u?.video?.id||"",url:u?.video?.url||"",thumbnailUrl:u?.video?.thumbnailUrl||""},webLink:{label:"",url:""}};this.notifications.add({type:Le.QUESTION,action:()=>s.data?.question&&this.openQuestion(s.data.question.id),close:()=>s.data?.question&&this.closeQuestion(s.data.question.id),autoHideDuration:1e3*120,id:this.background.getCurrentSessionId({prefix:"notification",entity:s.data.question.id}),data:{questionType:s.data.question.type,insight:f}})}else if(s.data.question.type===te.QuestionType.TWEET){const u=s.data.question.options?.options.value,f={title:s.data.question.notification.title,body:s.data.question.notification.body,image:s.data.question.notification.image,account:u?.tweetMeta?.account||"",accountVerified:!!u?.tweetMeta?.accountVerified};this.notifications.add({type:Le.QUESTION,action:()=>s.data?.question&&this.openQuestion(s.data.question.id),close:()=>s.data?.question&&this.closeQuestion(s.data.question.id),autoHideDuration:1e3*120,id:this.background.getCurrentSessionId({prefix:"notification",entity:s.data.question.id}),data:{questionType:s.data.question.type,tweet:f}})}}})}connect=e=>{this.userSummary.invalidate(),this.leaderboardList.invalidate(),this.feedList.invalidate(),this.background.feedSubscription.addListener("feed-subscription-prediction-close",r=>{window.requestAnimationFrame(async()=>{const o=r.data?.attributes?.question;if(!o)return;const{status:s,type:u,id:f}=o;if(s===te.QuestionStatus.RESOLVED&&u===te.QuestionType.PREDICTION){const c=this.background.getCurrentSessionId({prefix:`notification-id:${f}`}),h=await nn(f,e),b=h?.answers.find(({correct:m})=>m),g=h?.answers.find(({youVoted:m})=>m);if(!g)return;this.notifications.add({type:Le.QUESTION_RESOLVED,action:()=>this.openQuestion(f),close:()=>this.closeQuestion(f),autoHideDuration:35e3,id:c,data:{questionType:te.QuestionType.PREDICTION,question:{title:b?.youVoted?`Congratulations! You answered correctly! You won ${b.points} pts!`:`Better luck next time! Correct: ${b?.text}!`,votedAnswer:{title:g?.text,points:g?.points},correctAnswerTitle:b?.text,correct:b?.youVoted,predictionResult:s===te.QuestionStatus.RESOLVED,questionTitle:h?.subject}}}),this.userSummary.invalidate()}})}),this.background.feedSubscription.addListener("feed-subscription-questions-list",()=>{window.requestAnimationFrame(()=>{this.feedList?.invalidate()})})};disconnect=()=>{this.background.feedSubscription.removeListener("feed-subscription-questions-list")};submitAnswer=async(e,r)=>{await Hi(this.transport,{questionId:e,answerId:r}),this.feedList.invalidate(),this.userSummary.invalidate()};skipQuestion=async e=>{await Ji(this.transport,e),this.feedList.invalidate(),this.userSummary.invalidate()};openQuestion=e=>(this.openFeature(),this.background.openQuestion(e));closeQuestion=e=>this.background.closeQuestion(e);openUser=e=>{const r=this.leaderboardList.$store.get().data?.find(o=>o.userId===e);this.openedUser.set(r)};closeUser=()=>{this.openedUser.set(void 0)}}class no extends fr{insights;closeFeature;openFeature;openedInsight;notifications;transport;background;constructor(e,r,o){super(e,r),this.background=on(o),this.notifications=o.notifications,this.transport=o.transport,this.closeFeature=o.sdk.closeFeature,this.openFeature=()=>o.sdk.openFeature(ce.SdkOverlayType.HIGHLIGHTS),this.status.subscribe(s=>{s===je.Ready?this.connect():this.disconnect()}),this.background.activeQuestionId.listen(s=>{s?.data?.question?.id&&s?.data?.question?.notification&&s.data.moderation?.bypassNotifications?.inAppSilence!==te.SilenceSetting.ON&&s.data.question.type===te.QuestionType.FACTOID&&s.data.question.status===te.QuestionStatus.ACTIVE&&this.notifications.add({type:Le.QUESTION,action:()=>s.data?.question&&this.openHighlight(s.data.question.id),close:()=>s.data?.question&&this.closeHighlight(s.data.question.id),autoHideDuration:1e3*+(s.data.question?.appearance?.autoHideInterval||"5"),id:this.background.getCurrentSessionId({prefix:"notification",entity:s.data.question.id}),data:{questionType:s.data.question.type,question:{title:s.data.question.notification.title}}})}),this.openedInsight=this.background.openedQuestion}connect=()=>{this.insights?this.insights.invalidate():this.insights=new pe(Ui(this.background.slStreamId,this.transport),"gamification:insights"),this.background.feedSubscription.addListener("feed-subscription-insights-list",()=>{window.requestAnimationFrame(()=>{this.insights?.invalidate()})})};disconnect=()=>{this.background.feedSubscription.removeListener("feed-subscription-insights-list")};openHighlight=e=>(this.openFeature(),this.background.openQuestion(e));closeHighlight=e=>this.background.closeQuestion(e)}ce.SdkOverlayType.GAMES+"",ce.SdkOverlayType.HIGHLIGHTS+"";class io extends fr{constructor(e,r){super(e,r)}}const oo=(t,e,r)=>t.type===ce.SdkOverlayType.GAMES?new ro(t,e,r):t.type===ce.SdkOverlayType.HIGHLIGHTS?new no(t,e,r):new io(t,e),so=(t,e,r)=>{t.features=new Map,t.activeFeature=new ye(ie(ce.SdkOverlayType.UNSET),"activeFeature"),t.sdk.getFeatures=()=>t.features,t.sdk.getFeature=o=>t.features.get(o),t.sdk.getActiveFeature=()=>t.activeFeature.getStore(),t.sdk.openFeature=o=>{t.activeFeature.setValue(o)},t.sdk.closeFeature=()=>{t.activeFeature.setValue(ce.SdkOverlayType.UNSET)},t.initFeature=(o,s=Te.ORGANIZATION)=>{const u=oo(o,s,t);t.features.set(o.type,u)},t.updateFeature=(o,s)=>{t.features.get(o.type)?.update(o,s)},t.destroyFeature=o=>{t.features.delete(o.type)},t.reinitializeFeatures=async()=>{const o=await t.stores.organizationSettings.getValue();t.features.clear();for(const s of o?.overlays||[])t.initFeature(s,Te.ORGANIZATION)},t.stores.providerStreamId.listen(o=>{o||t.reinitializeFeatures()}),t.storeSubscribe=()=>{const o=(u,f)=>{if(f?.overlays){u===Te.STREAM&&t.features.clear();for(const c of f.overlays)c.sdkEnable===!0&&(t.features.has(c.type)?t.updateFeature(c,u):t.initFeature(c,u))}},s={organizationSettings:u=>{if(u.data)try{o(Te.ORGANIZATION,u.data)}catch(f){console.log(f)}},streamSettings:u=>{if(u.data)try{o(Te.STREAM,u.data)}catch(f){console.log(f)}}};t.store.subscribe(s)},r()};var yr={exports:{}},gr={exports:{}};function ao(t){var e=new t,r=e;function o(){var u=e;return u.next?e=u.next:(e=new t,r=e),u.next=null,u}function s(u){r.next=u,r=u}return{get:o,release:s}}var uo=ao,co=uo;function an(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),r<1)throw new Error("fastqueue concurrency must be greater than 1");var o=co(lo),s=null,u=null,f=0,c=null,h={push:P,drain:ue,saturated:ue,pause:g,paused:!1,concurrency:r,running:b,resume:T,idle:L,length:m,getQueue:E,unshift:K,empty:ue,kill:_,killAndDrain:j,error:U};return h;function b(){return f}function g(){h.paused=!0}function m(){for(var F=s,x=0;F;)F=F.next,x++;return x}function E(){for(var F=s,x=[];F;)x.push(F.value),F=F.next;return x}function T(){if(h.paused){h.paused=!1;for(var F=0;F<h.concurrency;F++)f++,I()}}function L(){return f===0&&h.length()===0}function P(F,x){var k=o.get();k.context=t,k.release=I,k.value=F,k.callback=x||ue,k.errorHandler=c,f===h.concurrency||h.paused?u?(u.next=k,u=k):(s=k,u=k,h.saturated()):(f++,e.call(t,k.value,k.worked))}function K(F,x){var k=o.get();k.context=t,k.release=I,k.value=F,k.callback=x||ue,f===h.concurrency||h.paused?s?(k.next=s,s=k):(s=k,u=k,h.saturated()):(f++,e.call(t,k.value,k.worked))}function I(F){F&&o.release(F);var x=s;x?h.paused?f--:(u===s&&(u=null),s=x.next,x.next=null,e.call(t,x.value,x.worked),u===null&&h.empty()):--f===0&&h.drain()}function _(){s=null,u=null,h.drain=ue}function j(){s=null,u=null,h.drain(),h.drain=ue}function U(F){c=F}}function ue(){}function lo(){this.value=null,this.callback=ue,this.next=null,this.release=ue,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,o){var s=t.callback,u=t.errorHandler,f=t.value;t.value=null,t.callback=ue,t.errorHandler&&u(r,f),s.call(t.context,r,o),t.release(t)}}function fo(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function o(g,m){e.call(this,g).then(function(E){m(null,E)},m)}var s=an(t,o,r),u=s.push,f=s.unshift;return s.push=c,s.unshift=h,s.drained=b,s;function c(g){var m=new Promise(function(E,T){u(g,function(L,P){if(L){T(L);return}E(P)})});return m.catch(ue),m}function h(g){var m=new Promise(function(E,T){f(g,function(L,P){if(L){T(L);return}E(P)})});return m.catch(ue),m}function b(){if(s.idle())return new Promise(function(E){E()});var g=s.drain,m=new Promise(function(E){s.drain=function(){g(),E()}});return m}}gr.exports=an;gr.exports.promise=fo;var un=gr.exports,mr={exports:{}},Ye=typeof Reflect=="object"?Reflect:null,Fr=Ye&&typeof Ye.apply=="function"?Ye.apply:function(e,r,o){return Function.prototype.apply.call(e,r,o)},gt;Ye&&typeof Ye.ownKeys=="function"?gt=Ye.ownKeys:Object.getOwnPropertySymbols?gt=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:gt=function(e){return Object.getOwnPropertyNames(e)};function ho(t){console&&console.warn&&console.warn(t)}var cn=Number.isNaN||function(e){return e!==e};function q(){q.init.call(this)}mr.exports=q;mr.exports.once=mo;q.EventEmitter=q;q.prototype._events=void 0;q.prototype._eventsCount=0;q.prototype._maxListeners=void 0;var _r=10;function xt(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(q,"defaultMaxListeners",{enumerable:!0,get:function(){return _r},set:function(t){if(typeof t!="number"||t<0||cn(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");_r=t}});q.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};q.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||cn(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 ln(t){return t._maxListeners===void 0?q.defaultMaxListeners:t._maxListeners}q.prototype.getMaxListeners=function(){return ln(this)};q.prototype.emit=function(e){for(var r=[],o=1;o<arguments.length;o++)r.push(arguments[o]);var s=e==="error",u=this._events;if(u!==void 0)s=s&&u.error===void 0;else if(!s)return!1;if(s){var f;if(r.length>0&&(f=r[0]),f instanceof Error)throw f;var c=new Error("Unhandled error."+(f?" ("+f.message+")":""));throw c.context=f,c}var h=u[e];if(h===void 0)return!1;if(typeof h=="function")Fr(h,this,r);else for(var b=h.length,g=yn(h,b),o=0;o<b;++o)Fr(g[o],this,r);return!0};function fn(t,e,r,o){var s,u,f;if(xt(r),u=t._events,u===void 0?(u=t._events=Object.create(null),t._eventsCount=0):(u.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),u=t._events),f=u[e]),f===void 0)f=u[e]=r,++t._eventsCount;else if(typeof f=="function"?f=u[e]=o?[r,f]:[f,r]:o?f.unshift(r):f.push(r),s=ln(t),s>0&&f.length>s&&!f.warned){f.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=f.length,ho(c)}return t}q.prototype.addListener=function(e,r){return fn(this,e,r,!1)};q.prototype.on=q.prototype.addListener;q.prototype.prependListener=function(e,r){return fn(this,e,r,!0)};function po(){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 dn(t,e,r){var o={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},s=po.bind(o);return s.listener=r,o.wrapFn=s,s}q.prototype.once=function(e,r){return xt(r),this.on(e,dn(this,e,r)),this};q.prototype.prependOnceListener=function(e,r){return xt(r),this.prependListener(e,dn(this,e,r)),this};q.prototype.removeListener=function(e,r){var o,s,u,f,c;if(xt(r),s=this._events,s===void 0)return this;if(o=s[e],o===void 0)return this;if(o===r||o.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,o.listener||r));else if(typeof o!="function"){for(u=-1,f=o.length-1;f>=0;f--)if(o[f]===r||o[f].listener===r){c=o[f].listener,u=f;break}if(u<0)return this;u===0?o.shift():yo(o,u),o.length===1&&(s[e]=o[0]),s.removeListener!==void 0&&this.emit("removeListener",e,c||r)}return this};q.prototype.off=q.prototype.removeListener;q.prototype.removeAllListeners=function(e){var r,o,s;if(o=this._events,o===void 0)return this;if(o.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):o[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete o[e]),this;if(arguments.length===0){var u=Object.keys(o),f;for(s=0;s<u.length;++s)f=u[s],f!=="removeListener"&&this.removeAllListeners(f);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=o[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(s=r.length-1;s>=0;s--)this.removeListener(e,r[s]);return this};function hn(t,e,r){var o=t._events;if(o===void 0)return[];var s=o[e];return s===void 0?[]:typeof s=="function"?r?[s.listener||s]:[s]:r?go(s):yn(s,s.length)}q.prototype.listeners=function(e){return hn(this,e,!0)};q.prototype.rawListeners=function(e){return hn(this,e,!1)};q.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):pn.call(t,e)};q.prototype.listenerCount=pn;function pn(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}q.prototype.eventNames=function(){return this._eventsCount>0?gt(this._events):[]};function yn(t,e){for(var r=new Array(e),o=0;o<e;++o)r[o]=t[o];return r}function yo(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function go(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function mo(t,e){return new Promise(function(r,o){function s(f){t.removeListener(e,u),o(f)}function u(){typeof t.removeListener=="function"&&t.removeListener("error",s),r([].slice.call(arguments))}gn(t,e,u,{once:!0}),e!=="error"&&wo(t,s,{once:!0})})}function wo(t,e,r){typeof t.on=="function"&&gn(t,"error",e,r)}function gn(t,e,r,o){if(typeof t.on=="function")o.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function s(u){o.once&&t.removeEventListener(e,s),r(u)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var mn=mr.exports,Bt={},wn={},bn=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),o=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var s=42;e[r]=s;for(r 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 u=Object.getOwnPropertySymbols(e);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(e,r);if(f.value!==s||f.enumerable!==!0)return!1}return!0},bo=bn,wr=function(){return bo()&&!!Symbol.toStringTag},Cr=typeof Symbol<"u"&&Symbol,vo=bn,So=function(){return typeof Cr!="function"||typeof Symbol!="function"||typeof Cr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vo()},Or={foo:{}},Ao=Object,Eo=function(){return{__proto__:Or}.foo===Or.foo&&!({__proto__:null}instanceof Ao)},Io="Function.prototype.bind called on incompatible ",To=Object.prototype.toString,Fo=Math.max,_o="[object Function]",xr=function(e,r){for(var o=[],s=0;s<e.length;s+=1)o[s]=e[s];for(var u=0;u<r.length;u+=1)o[u+e.length]=r[u];return o},Co=function(e,r){for(var o=[],s=r||0,u=0;s<e.length;s+=1,u+=1)o[u]=e[s];return o},Oo=function(t,e){for(var r="",o=0;o<t.length;o+=1)r+=t[o],o+1<t.length&&(r+=e);return r},xo=function(e){var r=this;if(typeof r!="function"||To.apply(r)!==_o)throw new TypeError(Io+r);for(var o=Co(arguments,1),s,u=function(){if(this instanceof s){var g=r.apply(this,xr(o,arguments));return Object(g)===g?g:this}return r.apply(e,xr(o,arguments))},f=Fo(0,r.length-o.length),c=[],h=0;h<f;h++)c[h]="$"+h;if(s=Function("binder","return function ("+Oo(c,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var b=function(){};b.prototype=r.prototype,s.prototype=new b,b.prototype=null}return s},Bo=xo,vn=Function.prototype.bind||Bo,Br={}.hasOwnProperty,Nt=Function.prototype.call,ko=Nt.bind?Nt.bind(Br):function(t,e){return Nt.call(Br,t,e)},$,Ze=SyntaxError,Sn=Function,Xe=TypeError,Ut=function(t){try{return Sn('"use strict"; return ('+t+").constructor;")()}catch{}},De=Object.getOwnPropertyDescriptor;if(De)try{De({},"")}catch{De=null}var $t=function(){throw new Xe},Po=De?function(){try{return arguments.callee,$t}catch{try{return De(arguments,"callee").get}catch{return $t}}}():$t,Ge=So(),Ro=Eo(),X=Object.getPrototypeOf||(Ro?function(t){return t.__proto__}:null),Ke={},Lo=typeof Uint8Array>"u"||!X?$:X(Uint8Array),Ve={"%AggregateError%":typeof AggregateError>"u"?$:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?$:ArrayBuffer,"%ArrayIteratorPrototype%":Ge&&X?X([][Symbol.iterator]()):$,"%AsyncFromSyncIteratorPrototype%":$,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?$:Atomics,"%BigInt%":typeof BigInt>"u"?$:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?$:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?$:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?$:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?$:Float32Array,"%Float64Array%":typeof Float64Array>"u"?$:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?$:FinalizationRegistry,"%Function%":Sn,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?$:Int8Array,"%Int16Array%":typeof Int16Array>"u"?$:Int16Array,"%Int32Array%":typeof Int32Array>"u"?$:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ge&&X?X(X([][Symbol.iterator]())):$,"%JSON%":typeof JSON=="object"?JSON:$,"%Map%":typeof Map>"u"?$:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ge||!X?$:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?$:Promise,"%Proxy%":typeof Proxy>"u"?$:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?$:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?$:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ge||!X?$:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?$:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ge&&X?X(""[Symbol.iterator]()):$,"%Symbol%":Ge?Symbol:$,"%SyntaxError%":Ze,"%ThrowTypeError%":Po,"%TypedArray%":Lo,"%TypeError%":Xe,"%Uint8Array%":typeof Uint8Array>"u"?$:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?$:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?$:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?$:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?$:WeakMap,"%WeakRef%":typeof WeakRef>"u"?$:WeakRef,"%WeakSet%":typeof WeakSet>"u"?$:WeakSet};if(X)try{null.error}catch(t){var No=X(X(t));Ve["%Error.prototype%"]=No}var Uo=function t(e){var r;if(e==="%AsyncFunction%")r=Ut("async function () {}");else if(e==="%GeneratorFunction%")r=Ut("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Ut("async function* () {}");else if(e==="%AsyncGenerator%"){var o=t("%AsyncGeneratorFunction%");o&&(r=o.prototype)}else if(e==="%AsyncIteratorPrototype%"){var s=t("%AsyncGenerator%");s&&X&&(r=X(s.prototype))}return Ve[e]=r,r},kr={"%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"]},dt=vn,Et=ko,$o=dt.call(Function.call,Array.prototype.concat),jo=dt.call(Function.apply,Array.prototype.splice),Pr=dt.call(Function.call,String.prototype.replace),It=dt.call(Function.call,String.prototype.slice),Do=dt.call(Function.call,RegExp.prototype.exec),Vo=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Mo=/\\(\\)?/g,qo=function(e){var r=It(e,0,1),o=It(e,-1);if(r==="%"&&o!=="%")throw new Ze("invalid intrinsic syntax, expected closing `%`");if(o==="%"&&r!=="%")throw new Ze("invalid intrinsic syntax, expected opening `%`");var s=[];return Pr(e,Vo,function(u,f,c,h){s[s.length]=c?Pr(h,Mo,"$1"):f||u}),s},Qo=function(e,r){var o=e,s;if(Et(kr,o)&&(s=kr[o],o="%"+s[0]+"%"),Et(Ve,o)){var u=Ve[o];if(u===Ke&&(u=Uo(o)),typeof u>"u"&&!r)throw new Xe("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:s,name:o,value:u}}throw new Ze("intrinsic "+e+" does not exist!")},tt=function(e,r){if(typeof e!="string"||e.length===0)throw new Xe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Xe('"allowMissing" argument must be a boolean');if(Do(/^%?[^%]*%?$/,e)===null)throw new Ze("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var o=qo(e),s=o.length>0?o[0]:"",u=Qo("%"+s+"%",r),f=u.name,c=u.value,h=!1,b=u.alias;b&&(s=b[0],jo(o,$o([0,1],b)));for(var g=1,m=!0;g<o.length;g+=1){var E=o[g],T=It(E,0,1),L=It(E,-1);if((T==='"'||T==="'"||T==="`"||L==='"'||L==="'"||L==="`")&&T!==L)throw new Ze("property names with quotes must have matching quotes");if((E==="constructor"||!m)&&(h=!0),s+="."+E,f="%"+s+"%",Et(Ve,f))c=Ve[f];else if(c!=null){if(!(E in c)){if(!r)throw new Xe("base intrinsic for "+e+" exists, but the property is not available.");return}if(De&&g+1>=o.length){var P=De(c,E);m=!!P,m&&"get"in P&&!("originalValue"in P.get)?c=P.get:c=c[E]}else m=Et(c,E),c=c[E];m&&!h&&(Ve[f]=c)}}return c},An={exports:{}},Go=tt,er=Go("%Object.defineProperty%",!0),tr=function(){if(er)try{return er({},"a",{value:1}),!0}catch{return!1}return!1};tr.hasArrayLengthDefineBug=function(){if(!tr())return null;try{return er([],"length",{value:1}).length!==1}catch{return!0}};var En=tr,zo=tt,mt=zo("%Object.getOwnPropertyDescriptor%",!0);if(mt)try{mt([],"length")}catch{mt=null}var br=mt,Ko=En(),vr=tt,ct=Ko&&vr("%Object.defineProperty%",!0);if(ct)try{ct({},"a",{value:1})}catch{ct=!1}var Ho=vr("%SyntaxError%"),ze=vr("%TypeError%"),Rr=br,Wo=function(e,r,o){if(!e||typeof e!="object"&&typeof e!="function")throw new ze("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new ze("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ze("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ze("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ze("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ze("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,h=!!Rr&&Rr(e,r);if(ct)ct(e,r,{configurable:f===null&&h?h.configurable:!f,enumerable:s===null&&h?h.enumerable:!s,value:o,writable:u===null&&h?h.writable:!u});else if(c||!s&&!u&&!f)e[r]=o;else throw new Ho("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},In=tt,Lr=Wo,Jo=En(),Nr=br,Ur=In("%TypeError%"),Yo=In("%Math.floor%"),Xo=function(e,r){if(typeof e!="function")throw new Ur("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Yo(r)!==r)throw new Ur("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],s=!0,u=!0;if("length"in e&&Nr){var f=Nr(e,"length");f&&!f.configurable&&(s=!1),f&&!f.writable&&(u=!1)}return(s||u||!o)&&(Jo?Lr(e,"length",r,!0,!0):Lr(e,"length",r)),e};(function(t){var e=vn,r=tt,o=Xo,s=r("%TypeError%"),u=r("%Function.prototype.apply%"),f=r("%Function.prototype.call%"),c=r("%Reflect.apply%",!0)||e.call(f,u),h=r("%Object.defineProperty%",!0),b=r("%Math.max%");if(h)try{h({},"a",{value:1})}catch{h=null}t.exports=function(E){if(typeof E!="function")throw new s("a function is required");var T=c(e,f,arguments);return o(T,1+b(0,E.length-(arguments.length-1)),!0)};var g=function(){return c(e,u,arguments)};h?h(t.exports,"apply",{value:g}):t.exports.apply=g})(An);var Tn=An.exports,Fn=tt,_n=Tn,Zo=_n(Fn("String.prototype.indexOf")),Cn=function(e,r){var o=Fn(e,!!r);return typeof o=="function"&&Zo(e,".prototype.")>-1?_n(o):o},es=wr(),ts=Cn,rr=ts("Object.prototype.toString"),kt=function(e){return es&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:rr(e)==="[object Arguments]"},On=function(e){return kt(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&rr(e)!=="[object Array]"&&rr(e.callee)==="[object Function]"},rs=function(){return kt(arguments)}();kt.isLegacyArguments=On;var ns=rs?kt:On,is=Object.prototype.toString,os=Function.prototype.toString,ss=/^\s*(?:function)?\*/,xn=wr(),jt=Object.getPrototypeOf,as=function(){if(!xn)return!1;try{return Function("return function*() {}")()}catch{}},Dt,us=function(e){if(typeof e!="function")return!1;if(ss.test(os.call(e)))return!0;if(!xn){var r=is.call(e);return r==="[object GeneratorFunction]"}if(!jt)return!1;if(typeof Dt>"u"){var o=as();Dt=o?jt(o):!1}return jt(e)===Dt},Bn=Function.prototype.toString,We=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,nr,wt;if(typeof We=="function"&&typeof Object.defineProperty=="function")try{nr=Object.defineProperty({},"length",{get:function(){throw wt}}),wt={},We(function(){throw 42},null,nr)}catch(t){t!==wt&&(We=null)}else We=null;var cs=/^\s*class\b/,ir=function(e){try{var r=Bn.call(e);return cs.test(r)}catch{return!1}},Vt=function(e){try{return ir(e)?!1:(Bn.call(e),!0)}catch{return!1}},bt=Object.prototype.toString,ls="[object Object]",fs="[object Function]",ds="[object GeneratorFunction]",hs="[object HTMLAllCollection]",ps="[object HTML document.all class]",ys="[object HTMLCollection]",gs=typeof Symbol=="function"&&!!Symbol.toStringTag,ms=!(0 in[,]),or=function(){return!1};if(typeof document=="object"){var ws=document.all;bt.call(ws)===bt.call(document.all)&&(or=function(e){if((ms||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=bt.call(e);return(r===hs||r===ps||r===ys||r===ls)&&e("")==null}catch{}return!1})}var bs=We?function(e){if(or(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{We(e,null,nr)}catch(r){if(r!==wt)return!1}return!ir(e)&&Vt(e)}:function(e){if(or(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(gs)return Vt(e);if(ir(e))return!1;var r=bt.call(e);return r!==fs&&r!==ds&&!/^\[object HTML/.test(r)?!1:Vt(e)},vs=bs,Ss=Object.prototype.toString,kn=Object.prototype.hasOwnProperty,As=function(e,r,o){for(var s=0,u=e.length;s<u;s++)kn.call(e,s)&&(o==null?r(e[s],s,e):r.call(o,e[s],s,e))},Es=function(e,r,o){for(var s=0,u=e.length;s<u;s++)o==null?r(e.charAt(s),s,e):r.call(o,e.charAt(s),s,e)},Is=function(e,r,o){for(var s in e)kn.call(e,s)&&(o==null?r(e[s],s,e):r.call(o,e[s],s,e))},Ts=function(e,r,o){if(!vs(r))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=o),Ss.call(e)==="[object Array]"?As(e,r,s):typeof e=="string"?Es(e,r,s):Is(e,r,s)},Fs=Ts,Mt=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],_s=typeof globalThis>"u"?Wr:globalThis,Cs=function(){for(var e=[],r=0;r<Mt.length;r++)typeof _s[Mt[r]]=="function"&&(e[e.length]=Mt[r]);return e},Tt=Fs,Os=Cs,$r=Tn,Sr=Cn,vt=br,xs=Sr("Object.prototype.toString"),Pn=wr(),jr=typeof globalThis>"u"?Wr:globalThis,sr=Os(),Ar=Sr("String.prototype.slice"),qt=Object.getPrototypeOf,Bs=Sr("Array.prototype.indexOf",!0)||function(e,r){for(var o=0;o<e.length;o+=1)if(e[o]===r)return o;return-1},Ft={__proto__:null};Pn&&vt&&qt?Tt(sr,function(t){var e=new jr[t];if(Symbol.toStringTag in e){var r=qt(e),o=vt(r,Symbol.toStringTag);if(!o){var s=qt(r);o=vt(s,Symbol.toStringTag)}Ft["$"+t]=$r(o.get)}}):Tt(sr,function(t){var e=new jr[t],r=e.slice||e.set;r&&(Ft["$"+t]=$r(r))});var ks=function(e){var r=!1;return Tt(Ft,function(o,s){if(!r)try{"$"+o(e)===s&&(r=Ar(s,1))}catch{}}),r},Ps=function(e){var r=!1;return Tt(Ft,function(o,s){if(!r)try{o(e),r=Ar(s,1)}catch{}}),r},Rn=function(e){if(!e||typeof e!="object")return!1;if(!Pn){var r=Ar(xs(e),8,-1);return Bs(sr,r)>-1?r:r!=="Object"?!1:Ps(e)}return vt?ks(e):null},Rs=Rn,Ls=function(e){return!!Rs(e)};(function(t){var e=ns,r=us,o=Rn,s=Ls;function u(S){return S.call.bind(S)}var f=typeof BigInt<"u",c=typeof Symbol<"u",h=u(Object.prototype.toString),b=u(Number.prototype.valueOf),g=u(String.prototype.valueOf),m=u(Boolean.prototype.valueOf);if(f)var E=u(BigInt.prototype.valueOf);if(c)var T=u(Symbol.prototype.valueOf);function L(S,pt){if(typeof S!="object")return!1;try{return pt(S),!0}catch{return!1}}t.isArgumentsObject=e,t.isGeneratorFunction=r,t.isTypedArray=s;function P(S){return typeof Promise<"u"&&S instanceof Promise||S!==null&&typeof S=="object"&&typeof S.then=="function"&&typeof S.catch=="function"}t.isPromise=P;function K(S){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(S):s(S)||v(S)}t.isArrayBufferView=K;function I(S){return o(S)==="Uint8Array"}t.isUint8Array=I;function _(S){return o(S)==="Uint8ClampedArray"}t.isUint8ClampedArray=_;function j(S){return o(S)==="Uint16Array"}t.isUint16Array=j;function U(S){return o(S)==="Uint32Array"}t.isUint32Array=U;function F(S){return o(S)==="Int8Array"}t.isInt8Array=F;function x(S){return o(S)==="Int16Array"}t.isInt16Array=x;function k(S){return o(S)==="Int32Array"}t.isInt32Array=k;function G(S){return o(S)==="Float32Array"}t.isFloat32Array=G;function oe(S){return o(S)==="Float64Array"}t.isFloat64Array=oe;function Oe(S){return o(S)==="BigInt64Array"}t.isBigInt64Array=Oe;function Ae(S){return o(S)==="BigUint64Array"}t.isBigUint64Array=Ae;function le(S){return h(S)==="[object Map]"}le.working=typeof Map<"u"&&le(new Map);function nt(S){return typeof Map>"u"?!1:le.working?le(S):S instanceof Map}t.isMap=nt;function fe(S){return h(S)==="[object Set]"}fe.working=typeof Set<"u"&&fe(new Set);function xe(S){return typeof Set>"u"?!1:fe.working?fe(S):S instanceof Set}t.isSet=xe;function Be(S){return h(S)==="[object WeakMap]"}Be.working=typeof WeakMap<"u"&&Be(new WeakMap);function it(S){return typeof WeakMap>"u"?!1:Be.working?Be(S):S instanceof WeakMap}t.isWeakMap=it;function ke(S){return h(S)==="[object WeakSet]"}ke.working=typeof WeakSet<"u"&&ke(new WeakSet);function de(S){return ke(S)}t.isWeakSet=de;function Pe(S){return h(S)==="[object ArrayBuffer]"}Pe.working=typeof ArrayBuffer<"u"&&Pe(new ArrayBuffer);function H(S){return typeof ArrayBuffer>"u"?!1:Pe.working?Pe(S):S instanceof ArrayBuffer}t.isArrayBuffer=H;function p(S){return h(S)==="[object DataView]"}p.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&p(new DataView(new ArrayBuffer(1),0,1));function v(S){return typeof DataView>"u"?!1:p.working?p(S):S instanceof DataView}t.isDataView=v;var A=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function C(S){return h(S)==="[object SharedArrayBuffer]"}function D(S){return typeof A>"u"?!1:(typeof C.working>"u"&&(C.working=C(new A)),C.working?C(S):S instanceof A)}t.isSharedArrayBuffer=D;function V(S){return h(S)==="[object AsyncFunction]"}t.isAsyncFunction=V;function B(S){return h(S)==="[object Map Iterator]"}t.isMapIterator=B;function N(S){return h(S)==="[object Set Iterator]"}t.isSetIterator=N;function M(S){return h(S)==="[object Generator]"}t.isGeneratorObject=M;function re(S){return h(S)==="[object WebAssembly.Module]"}t.isWebAssemblyCompiledModule=re;function ge(S){return L(S,b)}t.isNumberObject=ge;function he(S){return L(S,g)}t.isStringObject=he;function se(S){return L(S,m)}t.isBooleanObject=se;function qe(S){return f&&L(S,E)}t.isBigIntObject=qe;function ht(S){return c&&L(S,T)}t.isSymbolObject=ht;function ot(S){return ge(S)||he(S)||se(S)||qe(S)||ht(S)}t.isBoxedPrimitive=ot;function Pt(S){return typeof Uint8Array<"u"&&(H(S)||D(S))}t.isAnyArrayBuffer=Pt,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(S){Object.defineProperty(t,S,{enumerable:!1,value:function(){throw new Error(S+" is not supported in userland")}})})})(wn);var Ns=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},ar={exports:{}};typeof Object.create=="function"?ar.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ar.exports=function(e,r){if(r){e.super_=r;var o=function(){};o.prototype=r.prototype,e.prototype=new o,e.prototype.constructor=e}};var Us=ar.exports;(function(t){var e=Object.getOwnPropertyDescriptors||function(v){for(var A=Object.keys(v),C={},D=0;D<A.length;D++)C[A[D]]=Object.getOwnPropertyDescriptor(v,A[D]);return C},r=/%[sdj%]/g;t.format=function(p){if(!F(p)){for(var v=[],A=0;A<arguments.length;A++)v.push(f(arguments[A]));return v.join(" ")}for(var A=1,C=arguments,D=C.length,V=String(p).replace(r,function(N){if(N==="%%")return"%";if(A>=D)return N;switch(N){case"%s":return String(C[A++]);case"%d":return Number(C[A++]);case"%j":try{return JSON.stringify(C[A++])}catch{return"[Circular]"}default:return N}}),B=C[A];A<D;B=C[++A])_(B)||!oe(B)?V+=" "+B:V+=" "+f(B);return V},t.deprecate=function(p,v){if(typeof O.process<"u"&&O.process.noDeprecation===!0)return p;if(typeof O.process>"u")return function(){return t.deprecate(p,v).apply(this,arguments)};var A=!1;function C(){if(!A){if(O.process.throwDeprecation)throw new Error(v);O.process.traceDeprecation?console.trace(v):console.error(v),A=!0}return p.apply(this,arguments)}return C};var o={},s=/^$/;if(O.process.env.NODE_DEBUG){var u=O.process.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+u+"$","i")}t.debuglog=function(p){if(p=p.toUpperCase(),!o[p])if(s.test(p)){var v=O.process.pid;o[p]=function(){var A=t.format.apply(t,arguments);console.error("%s %d: %s",p,v,A)}}else o[p]=function(){};return o[p]};function f(p,v){var A={seen:[],stylize:h};return arguments.length>=3&&(A.depth=arguments[2]),arguments.length>=4&&(A.colors=arguments[3]),I(v)?A.showHidden=v:v&&t._extend(A,v),k(A.showHidden)&&(A.showHidden=!1),k(A.depth)&&(A.depth=2),k(A.colors)&&(A.colors=!1),k(A.customInspect)&&(A.customInspect=!0),A.colors&&(A.stylize=c),g(A,p,A.depth)}t.inspect=f,f.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]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function c(p,v){var A=f.styles[v];return A?"\x1B["+f.colors[A][0]+"m"+p+"\x1B["+f.colors[A][1]+"m":p}function h(p,v){return p}function b(p){var v={};return p.forEach(function(A,C){v[A]=!0}),v}function g(p,v,A){if(p.customInspect&&v&&le(v.inspect)&&v.inspect!==t.inspect&&!(v.constructor&&v.constructor.prototype===v)){var C=v.inspect(A,p);return F(C)||(C=g(p,C,A)),C}var D=m(p,v);if(D)return D;var V=Object.keys(v),B=b(V);if(p.showHidden&&(V=Object.getOwnPropertyNames(v)),Ae(v)&&(V.indexOf("message")>=0||V.indexOf("description")>=0))return E(v);if(V.length===0){if(le(v)){var N=v.name?": "+v.name:"";return p.stylize("[Function"+N+"]","special")}if(G(v))return p.stylize(RegExp.prototype.toString.call(v),"regexp");if(Oe(v))return p.stylize(Date.prototype.toString.call(v),"date");if(Ae(v))return E(v)}var M="",re=!1,ge=["{","}"];if(K(v)&&(re=!0,ge=["[","]"]),le(v)){var he=v.name?": "+v.name:"";M=" [Function"+he+"]"}if(G(v)&&(M=" "+RegExp.prototype.toString.call(v)),Oe(v)&&(M=" "+Date.prototype.toUTCString.call(v)),Ae(v)&&(M=" "+E(v)),V.length===0&&(!re||v.length==0))return ge[0]+M+ge[1];if(A<0)return G(v)?p.stylize(RegExp.prototype.toString.call(v),"regexp"):p.stylize("[Object]","special");p.seen.push(v);var se;return re?se=T(p,v,A,B,V):se=V.map(function(qe){return L(p,v,A,B,qe,re)}),p.seen.pop(),P(se,M,ge)}function m(p,v){if(k(v))return p.stylize("undefined","undefined");if(F(v)){var A="'"+JSON.stringify(v).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return p.stylize(A,"string")}if(U(v))return p.stylize(""+v,"number");if(I(v))return p.stylize(""+v,"boolean");if(_(v))return p.stylize("null","null")}function E(p){return"["+Error.prototype.toString.call(p)+"]"}function T(p,v,A,C,D){for(var V=[],B=0,N=v.length;B<N;++B)ke(v,String(B))?V.push(L(p,v,A,C,String(B),!0)):V.push("");return D.forEach(function(M){M.match(/^\d+$/)||V.push(L(p,v,A,C,M,!0))}),V}function L(p,v,A,C,D,V){var B,N,M;if(M=Object.getOwnPropertyDescriptor(v,D)||{value:v[D]},M.get?M.set?N=p.stylize("[Getter/Setter]","special"):N=p.stylize("[Getter]","special"):M.set&&(N=p.stylize("[Setter]","special")),ke(C,D)||(B="["+D+"]"),N||(p.seen.indexOf(M.value)<0?(_(A)?N=g(p,M.value,null):N=g(p,M.value,A-1),N.indexOf(`
|
|
7
7
|
`)>-1&&(V?N=N.split(`
|
|
8
8
|
`).map(function(re){return" "+re}).join(`
|
|
9
9
|
`).slice(2):N=`
|
package/lib/es/index.js
CHANGED
|
@@ -2437,14 +2437,8 @@ class uo extends lr {
|
|
|
2437
2437
|
title: s.data.question.notification.title,
|
|
2438
2438
|
body: s.data.question.notification.body,
|
|
2439
2439
|
image: s.data.question.notification.image,
|
|
2440
|
-
account:
|
|
2441
|
-
|
|
2442
|
-
image: "",
|
|
2443
|
-
name: u?.tweetMeta?.account || "",
|
|
2444
|
-
// ToDo: add later
|
|
2445
|
-
userName: "",
|
|
2446
|
-
verified: !!u?.tweetMeta?.accountVerified
|
|
2447
|
-
}
|
|
2440
|
+
account: u?.tweetMeta?.account || "",
|
|
2441
|
+
accountVerified: !!u?.tweetMeta?.accountVerified
|
|
2448
2442
|
};
|
|
2449
2443
|
this.notifications.add({
|
|
2450
2444
|
type: Le.QUESTION,
|
package/package.json
CHANGED
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"avvio": "^8.2.1",
|
|
27
27
|
"tslib": "^2.6.2",
|
|
28
28
|
"@streamlayer/sdk-web-api": "^0.1.0",
|
|
29
|
-
"@streamlayer/sdk-web-
|
|
29
|
+
"@streamlayer/sdk-web-core": "^0.0.7",
|
|
30
|
+
"@streamlayer/sdk-web-types": "^0.1.0",
|
|
30
31
|
"@streamlayer/sdk-web-logger": "^0.0.1",
|
|
31
|
-
"@streamlayer/sdk-web-core": "^0.0.6",
|
|
32
32
|
"@streamlayer/sdk-web-storage": "^0.0.4",
|
|
33
|
+
"@streamlayer/sdk-web-features": "^0.10.37",
|
|
33
34
|
"@streamlayer/sdk-web-interfaces": "^0.0.1",
|
|
34
35
|
"@streamlayer/sdk-web-notifications": "^0.1.0",
|
|
35
|
-
"@streamlayer/feature-gamification": "^0.
|
|
36
|
-
"@streamlayer/sdk-web-features": "^0.10.36"
|
|
36
|
+
"@streamlayer/feature-gamification": "^0.29.0"
|
|
37
37
|
},
|
|
38
|
-
"version": "0.29.
|
|
38
|
+
"version": "0.29.5",
|
|
39
39
|
"type": "module",
|
|
40
40
|
"main": "./src/index.js",
|
|
41
41
|
"typings": "./src/index.d.ts"
|