@streamlayer/react 0.32.1 → 0.32.2
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/dist/cjs/masters.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
15
15
|
* @license MIT
|
|
16
|
-
*/(function(e){const t=ka,n=Xs,s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=I,e.INSPECT_MAX_BYTES=50;const a=2147483647;e.kMaxLength=a,c.TYPED_ARRAY_SUPPORT=o(),!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 o(){try{const i=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(i,r),i.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 u(i){if(i>a)throw new RangeError('The value "'+i+'" is invalid for option "size"');const r=new Uint8Array(i);return Object.setPrototypeOf(r,c.prototype),r}function c(i,r,l){if(typeof i=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return T(i)}return d(i,r,l)}c.poolSize=8192;function d(i,r,l){if(typeof i=="string")return y(i,r);if(ArrayBuffer.isView(i))return R(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(fe(i,ArrayBuffer)||i&&fe(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(fe(i,SharedArrayBuffer)||i&&fe(i.buffer,SharedArrayBuffer)))return A(i,r,l);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const p=i.valueOf&&i.valueOf();if(p!=null&&p!==i)return c.from(p,r,l);const h=N(i);if(h)return h;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return c.from(i[Symbol.toPrimitive]("string"),r,l);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}c.from=function(i,r,l){return d(i,r,l)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function f(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function g(i,r,l){return f(i),i<=0?u(i):r!==void 0?typeof l=="string"?u(i).fill(r,l):u(i).fill(r):u(i)}c.alloc=function(i,r,l){return g(i,r,l)};function T(i){return f(i),u(i<0?0:_(i)|0)}c.allocUnsafe=function(i){return T(i)},c.allocUnsafeSlow=function(i){return T(i)};function y(i,r){if((typeof r!="string"||r==="")&&(r="utf8"),!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);const l=P(i,r)|0;let p=u(l);const h=p.write(i,r);return h!==l&&(p=p.slice(0,h)),p}function b(i){const r=i.length<0?0:_(i.length)|0,l=u(r);for(let p=0;p<r;p+=1)l[p]=i[p]&255;return l}function R(i){if(fe(i,Uint8Array)){const r=new Uint8Array(i);return A(r.buffer,r.byteOffset,r.byteLength)}return b(i)}function A(i,r,l){if(r<0||i.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<r+(l||0))throw new RangeError('"length" is outside of buffer bounds');let p;return r===void 0&&l===void 0?p=new Uint8Array(i):l===void 0?p=new Uint8Array(i,r):p=new Uint8Array(i,r,l),Object.setPrototypeOf(p,c.prototype),p}function N(i){if(c.isBuffer(i)){const r=_(i.length)|0,l=u(r);return l.length===0||i.copy(l,0,0,r),l}if(i.length!==void 0)return typeof i.length!="number"||At(i.length)?u(0):b(i);if(i.type==="Buffer"&&Array.isArray(i.data))return b(i.data)}function _(i){if(i>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return i|0}function I(i){return+i!=i&&(i=0),c.alloc(+i)}c.isBuffer=function(i){return i!=null&&i._isBuffer===!0&&i!==c.prototype},c.compare=function(i,r){if(fe(i,Uint8Array)&&(i=c.from(i,i.offset,i.byteLength)),fe(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),!c.isBuffer(i)||!c.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(i===r)return 0;let l=i.length,p=r.length;for(let h=0,k=Math.min(l,p);h<k;++h)if(i[h]!==r[h]){l=i[h],p=r[h];break}return l<p?-1:p<l?1:0},c.isEncoding=function(i){switch(String(i).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(i,r){if(!Array.isArray(i))throw new TypeError('"list" argument must be an Array of Buffers');if(i.length===0)return c.alloc(0);let l;if(r===void 0)for(r=0,l=0;l<i.length;++l)r+=i[l].length;const p=c.allocUnsafe(r);let h=0;for(l=0;l<i.length;++l){let k=i[l];if(fe(k,Uint8Array))h+k.length>p.length?(c.isBuffer(k)||(k=c.from(k)),k.copy(p,h)):Uint8Array.prototype.set.call(p,k,h);else if(c.isBuffer(k))k.copy(p,h);else throw new TypeError('"list" argument must be an Array of Buffers');h+=k.length}return p};function P(i,r){if(c.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||fe(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const l=i.length,p=arguments.length>2&&arguments[2]===!0;if(!p&&l===0)return 0;let h=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return l;case"utf8":case"utf-8":return it(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l*2;case"hex":return l>>>1;case"base64":return Rt(i).length;default:if(h)return p?-1:it(i).length;r=(""+r).toLowerCase(),h=!0}}c.byteLength=P;function U(i,r,l){let p=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((l===void 0||l>this.length)&&(l=this.length),l<=0)||(l>>>=0,r>>>=0,l<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return Ce(this,r,l);case"utf8":case"utf-8":return se(this,r,l);case"ascii":return rt(this,r,l);case"latin1":case"binary":return je(this,r,l);case"base64":return de(this,r,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Re(this,r,l);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),p=!0}}c.prototype._isBuffer=!0;function B(i,r,l){const p=i[r];i[r]=i[l],i[l]=p}c.prototype.swap16=function(){const i=this.length;if(i%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<i;r+=2)B(this,r,r+1);return this},c.prototype.swap32=function(){const i=this.length;if(i%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<i;r+=4)B(this,r,r+3),B(this,r+1,r+2);return this},c.prototype.swap64=function(){const i=this.length;if(i%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<i;r+=8)B(this,r,r+7),B(this,r+1,r+6),B(this,r+2,r+5),B(this,r+3,r+4);return this},c.prototype.toString=function(){const i=this.length;return i===0?"":arguments.length===0?se(this,0,i):U.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(i){if(!c.isBuffer(i))throw new TypeError("Argument must be a Buffer");return this===i?!0:c.compare(this,i)===0},c.prototype.inspect=function(){let i="";const r=e.INSPECT_MAX_BYTES;return i=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(i+=" ... "),"<Buffer "+i+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(i,r,l,p,h){if(fe(i,Uint8Array)&&(i=c.from(i,i.offset,i.byteLength)),!c.isBuffer(i))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof i);if(r===void 0&&(r=0),l===void 0&&(l=i?i.length:0),p===void 0&&(p=0),h===void 0&&(h=this.length),r<0||l>i.length||p<0||h>this.length)throw new RangeError("out of range index");if(p>=h&&r>=l)return 0;if(p>=h)return-1;if(r>=l)return 1;if(r>>>=0,l>>>=0,p>>>=0,h>>>=0,this===i)return 0;let k=h-p,E=l-r;const j=Math.min(k,E),J=this.slice(p,h),Q=i.slice(r,l);for(let Y=0;Y<j;++Y)if(J[Y]!==Q[Y]){k=J[Y],E=Q[Y];break}return k<E?-1:E<k?1:0};function V(i,r,l,p,h){if(i.length===0)return-1;if(typeof l=="string"?(p=l,l=0):l>2147483647?l=2147483647:l<-2147483648&&(l=-2147483648),l=+l,At(l)&&(l=h?0:i.length-1),l<0&&(l=i.length+l),l>=i.length){if(h)return-1;l=i.length-1}else if(l<0)if(h)l=0;else return-1;if(typeof r=="string"&&(r=c.from(r,p)),c.isBuffer(r))return r.length===0?-1:D(i,r,l,p,h);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?h?Uint8Array.prototype.indexOf.call(i,r,l):Uint8Array.prototype.lastIndexOf.call(i,r,l):D(i,[r],l,p,h);throw new TypeError("val must be string, number or Buffer")}function D(i,r,l,p,h){let k=1,E=i.length,j=r.length;if(p!==void 0&&(p=String(p).toLowerCase(),p==="ucs2"||p==="ucs-2"||p==="utf16le"||p==="utf-16le")){if(i.length<2||r.length<2)return-1;k=2,E/=2,j/=2,l/=2}function J(Y,K){return k===1?Y[K]:Y.readUInt16BE(K*k)}let Q;if(h){let Y=-1;for(Q=l;Q<E;Q++)if(J(i,Q)===J(r,Y===-1?0:Q-Y)){if(Y===-1&&(Y=Q),Q-Y+1===j)return Y*k}else Y!==-1&&(Q-=Q-Y),Y=-1}else for(l+j>E&&(l=E-j),Q=l;Q>=0;Q--){let Y=!0;for(let K=0;K<j;K++)if(J(i,Q+K)!==J(r,K)){Y=!1;break}if(Y)return Q}return-1}c.prototype.includes=function(i,r,l){return this.indexOf(i,r,l)!==-1},c.prototype.indexOf=function(i,r,l){return V(this,i,r,l,!0)},c.prototype.lastIndexOf=function(i,r,l){return V(this,i,r,l,!1)};function $(i,r,l,p){l=Number(l)||0;const h=i.length-l;p?(p=Number(p),p>h&&(p=h)):p=h;const k=r.length;p>k/2&&(p=k/2);let E;for(E=0;E<p;++E){const j=parseInt(r.substr(E*2,2),16);if(At(j))return E;i[l+E]=j}return E}function ee(i,r,l,p){return ot(it(r,i.length-l),i,l,p)}function ue(i,r,l,p){return ot(kn(r),i,l,p)}function ce(i,r,l,p){return ot(Rt(r),i,l,p)}function ke(i,r,l,p){return ot(x(r,i.length-l),i,l,p)}c.prototype.write=function(i,r,l,p){if(r===void 0)p="utf8",l=this.length,r=0;else if(l===void 0&&typeof r=="string")p=r,l=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(l)?(l=l>>>0,p===void 0&&(p="utf8")):(p=l,l=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const h=this.length-r;if((l===void 0||l>h)&&(l=h),i.length>0&&(l<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");p||(p="utf8");let k=!1;for(;;)switch(p){case"hex":return $(this,i,r,l);case"utf8":case"utf-8":return ee(this,i,r,l);case"ascii":case"latin1":case"binary":return ue(this,i,r,l);case"base64":return ce(this,i,r,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ke(this,i,r,l);default:if(k)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),k=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function de(i,r,l){return r===0&&l===i.length?t.fromByteArray(i):t.fromByteArray(i.slice(r,l))}function se(i,r,l){l=Math.min(i.length,l);const p=[];let h=r;for(;h<l;){const k=i[h];let E=null,j=k>239?4:k>223?3:k>191?2:1;if(h+j<=l){let J,Q,Y,K;switch(j){case 1:k<128&&(E=k);break;case 2:J=i[h+1],(J&192)===128&&(K=(k&31)<<6|J&63,K>127&&(E=K));break;case 3:J=i[h+1],Q=i[h+2],(J&192)===128&&(Q&192)===128&&(K=(k&15)<<12|(J&63)<<6|Q&63,K>2047&&(K<55296||K>57343)&&(E=K));break;case 4:J=i[h+1],Q=i[h+2],Y=i[h+3],(J&192)===128&&(Q&192)===128&&(Y&192)===128&&(K=(k&15)<<18|(J&63)<<12|(Q&63)<<6|Y&63,K>65535&&K<1114112&&(E=K))}}E===null?(E=65533,j=1):E>65535&&(E-=65536,p.push(E>>>10&1023|55296),E=56320|E&1023),p.push(E),h+=j}return De(p)}const pe=4096;function De(i){const r=i.length;if(r<=pe)return String.fromCharCode.apply(String,i);let l="",p=0;for(;p<r;)l+=String.fromCharCode.apply(String,i.slice(p,p+=pe));return l}function rt(i,r,l){let p="";l=Math.min(i.length,l);for(let h=r;h<l;++h)p+=String.fromCharCode(i[h]&127);return p}function je(i,r,l){let p="";l=Math.min(i.length,l);for(let h=r;h<l;++h)p+=String.fromCharCode(i[h]);return p}function Ce(i,r,l){const p=i.length;(!r||r<0)&&(r=0),(!l||l<0||l>p)&&(l=p);let h="";for(let k=r;k<l;++k)h+=_a[i[k]];return h}function Re(i,r,l){const p=i.slice(r,l);let h="";for(let k=0;k<p.length-1;k+=2)h+=String.fromCharCode(p[k]+p[k+1]*256);return h}c.prototype.slice=function(i,r){const l=this.length;i=~~i,r=r===void 0?l:~~r,i<0?(i+=l,i<0&&(i=0)):i>l&&(i=l),r<0?(r+=l,r<0&&(r=0)):r>l&&(r=l),r<i&&(r=i);const p=this.subarray(i,r);return Object.setPrototypeOf(p,c.prototype),p};function q(i,r,l){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>l)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(i,r,l){i=i>>>0,r=r>>>0,l||q(i,r,this.length);let p=this[i],h=1,k=0;for(;++k<r&&(h*=256);)p+=this[i+k]*h;return p},c.prototype.readUintBE=c.prototype.readUIntBE=function(i,r,l){i=i>>>0,r=r>>>0,l||q(i,r,this.length);let p=this[i+--r],h=1;for(;r>0&&(h*=256);)p+=this[i+--r]*h;return p},c.prototype.readUint8=c.prototype.readUInt8=function(i,r){return i=i>>>0,r||q(i,1,this.length),this[i]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(i,r){return i=i>>>0,r||q(i,2,this.length),this[i]|this[i+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(i,r){return i=i>>>0,r||q(i,2,this.length),this[i]<<8|this[i+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(i,r){return i=i>>>0,r||q(i,4,this.length),(this[i]|this[i+1]<<8|this[i+2]<<16)+this[i+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(i,r){return i=i>>>0,r||q(i,4,this.length),this[i]*16777216+(this[i+1]<<16|this[i+2]<<8|this[i+3])},c.prototype.readBigUInt64LE=Ae(function(i){i=i>>>0,be(i,"offset");const r=this[i],l=this[i+7];(r===void 0||l===void 0)&&Se(i,this.length-8);const p=r+this[++i]*2**8+this[++i]*2**16+this[++i]*2**24,h=this[++i]+this[++i]*2**8+this[++i]*2**16+l*2**24;return BigInt(p)+(BigInt(h)<<BigInt(32))}),c.prototype.readBigUInt64BE=Ae(function(i){i=i>>>0,be(i,"offset");const r=this[i],l=this[i+7];(r===void 0||l===void 0)&&Se(i,this.length-8);const p=r*2**24+this[++i]*2**16+this[++i]*2**8+this[++i],h=this[++i]*2**24+this[++i]*2**16+this[++i]*2**8+l;return(BigInt(p)<<BigInt(32))+BigInt(h)}),c.prototype.readIntLE=function(i,r,l){i=i>>>0,r=r>>>0,l||q(i,r,this.length);let p=this[i],h=1,k=0;for(;++k<r&&(h*=256);)p+=this[i+k]*h;return h*=128,p>=h&&(p-=Math.pow(2,8*r)),p},c.prototype.readIntBE=function(i,r,l){i=i>>>0,r=r>>>0,l||q(i,r,this.length);let p=r,h=1,k=this[i+--p];for(;p>0&&(h*=256);)k+=this[i+--p]*h;return h*=128,k>=h&&(k-=Math.pow(2,8*r)),k},c.prototype.readInt8=function(i,r){return i=i>>>0,r||q(i,1,this.length),this[i]&128?(255-this[i]+1)*-1:this[i]},c.prototype.readInt16LE=function(i,r){i=i>>>0,r||q(i,2,this.length);const l=this[i]|this[i+1]<<8;return l&32768?l|4294901760:l},c.prototype.readInt16BE=function(i,r){i=i>>>0,r||q(i,2,this.length);const l=this[i+1]|this[i]<<8;return l&32768?l|4294901760:l},c.prototype.readInt32LE=function(i,r){return i=i>>>0,r||q(i,4,this.length),this[i]|this[i+1]<<8|this[i+2]<<16|this[i+3]<<24},c.prototype.readInt32BE=function(i,r){return i=i>>>0,r||q(i,4,this.length),this[i]<<24|this[i+1]<<16|this[i+2]<<8|this[i+3]},c.prototype.readBigInt64LE=Ae(function(i){i=i>>>0,be(i,"offset");const r=this[i],l=this[i+7];(r===void 0||l===void 0)&&Se(i,this.length-8);const p=this[i+4]+this[i+5]*2**8+this[i+6]*2**16+(l<<24);return(BigInt(p)<<BigInt(32))+BigInt(r+this[++i]*2**8+this[++i]*2**16+this[++i]*2**24)}),c.prototype.readBigInt64BE=Ae(function(i){i=i>>>0,be(i,"offset");const r=this[i],l=this[i+7];(r===void 0||l===void 0)&&Se(i,this.length-8);const p=(r<<24)+this[++i]*2**16+this[++i]*2**8+this[++i];return(BigInt(p)<<BigInt(32))+BigInt(this[++i]*2**24+this[++i]*2**16+this[++i]*2**8+l)}),c.prototype.readFloatLE=function(i,r){return i=i>>>0,r||q(i,4,this.length),n.read(this,i,!0,23,4)},c.prototype.readFloatBE=function(i,r){return i=i>>>0,r||q(i,4,this.length),n.read(this,i,!1,23,4)},c.prototype.readDoubleLE=function(i,r){return i=i>>>0,r||q(i,8,this.length),n.read(this,i,!0,52,8)},c.prototype.readDoubleBE=function(i,r){return i=i>>>0,r||q(i,8,this.length),n.read(this,i,!1,52,8)};function v(i,r,l,p,h,k){if(!c.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>h||r<k)throw new RangeError('"value" argument is out of bounds');if(l+p>i.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(i,r,l,p){if(i=+i,r=r>>>0,l=l>>>0,!p){const E=Math.pow(2,8*l)-1;v(this,i,r,l,E,0)}let h=1,k=0;for(this[r]=i&255;++k<l&&(h*=256);)this[r+k]=i/h&255;return r+l},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(i,r,l,p){if(i=+i,r=r>>>0,l=l>>>0,!p){const E=Math.pow(2,8*l)-1;v(this,i,r,l,E,0)}let h=l-1,k=1;for(this[r+h]=i&255;--h>=0&&(k*=256);)this[r+h]=i/k&255;return r+l},c.prototype.writeUint8=c.prototype.writeUInt8=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,1,255,0),this[r]=i&255,r+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,2,65535,0),this[r]=i&255,this[r+1]=i>>>8,r+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,2,65535,0),this[r]=i>>>8,this[r+1]=i&255,r+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,4,4294967295,0),this[r+3]=i>>>24,this[r+2]=i>>>16,this[r+1]=i>>>8,this[r]=i&255,r+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,4,4294967295,0),this[r]=i>>>24,this[r+1]=i>>>16,this[r+2]=i>>>8,this[r+3]=i&255,r+4};function O(i,r,l,p,h){Ve(r,p,h,i,l,7);let k=Number(r&BigInt(4294967295));i[l++]=k,k=k>>8,i[l++]=k,k=k>>8,i[l++]=k,k=k>>8,i[l++]=k;let E=Number(r>>BigInt(32)&BigInt(4294967295));return i[l++]=E,E=E>>8,i[l++]=E,E=E>>8,i[l++]=E,E=E>>8,i[l++]=E,l}function F(i,r,l,p,h){Ve(r,p,h,i,l,7);let k=Number(r&BigInt(4294967295));i[l+7]=k,k=k>>8,i[l+6]=k,k=k>>8,i[l+5]=k,k=k>>8,i[l+4]=k;let E=Number(r>>BigInt(32)&BigInt(4294967295));return i[l+3]=E,E=E>>8,i[l+2]=E,E=E>>8,i[l+1]=E,E=E>>8,i[l]=E,l+8}c.prototype.writeBigUInt64LE=Ae(function(i,r=0){return O(this,i,r,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Ae(function(i,r=0){return F(this,i,r,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(i,r,l,p){if(i=+i,r=r>>>0,!p){const j=Math.pow(2,8*l-1);v(this,i,r,l,j-1,-j)}let h=0,k=1,E=0;for(this[r]=i&255;++h<l&&(k*=256);)i<0&&E===0&&this[r+h-1]!==0&&(E=1),this[r+h]=(i/k>>0)-E&255;return r+l},c.prototype.writeIntBE=function(i,r,l,p){if(i=+i,r=r>>>0,!p){const j=Math.pow(2,8*l-1);v(this,i,r,l,j-1,-j)}let h=l-1,k=1,E=0;for(this[r+h]=i&255;--h>=0&&(k*=256);)i<0&&E===0&&this[r+h+1]!==0&&(E=1),this[r+h]=(i/k>>0)-E&255;return r+l},c.prototype.writeInt8=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,1,127,-128),i<0&&(i=255+i+1),this[r]=i&255,r+1},c.prototype.writeInt16LE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,2,32767,-32768),this[r]=i&255,this[r+1]=i>>>8,r+2},c.prototype.writeInt16BE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,2,32767,-32768),this[r]=i>>>8,this[r+1]=i&255,r+2},c.prototype.writeInt32LE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,4,2147483647,-2147483648),this[r]=i&255,this[r+1]=i>>>8,this[r+2]=i>>>16,this[r+3]=i>>>24,r+4},c.prototype.writeInt32BE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,4,2147483647,-2147483648),i<0&&(i=4294967295+i+1),this[r]=i>>>24,this[r+1]=i>>>16,this[r+2]=i>>>8,this[r+3]=i&255,r+4},c.prototype.writeBigInt64LE=Ae(function(i,r=0){return O(this,i,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Ae(function(i,r=0){return F(this,i,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(i,r,l,p,h,k){if(l+p>i.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("Index out of range")}function ie(i,r,l,p,h){return r=+r,l=l>>>0,h||H(i,r,l,4),n.write(i,r,l,p,23,4),l+4}c.prototype.writeFloatLE=function(i,r,l){return ie(this,i,r,!0,l)},c.prototype.writeFloatBE=function(i,r,l){return ie(this,i,r,!1,l)};function te(i,r,l,p,h){return r=+r,l=l>>>0,h||H(i,r,l,8),n.write(i,r,l,p,52,8),l+8}c.prototype.writeDoubleLE=function(i,r,l){return te(this,i,r,!0,l)},c.prototype.writeDoubleBE=function(i,r,l){return te(this,i,r,!1,l)},c.prototype.copy=function(i,r,l,p){if(!c.isBuffer(i))throw new TypeError("argument should be a Buffer");if(l||(l=0),!p&&p!==0&&(p=this.length),r>=i.length&&(r=i.length),r||(r=0),p>0&&p<l&&(p=l),p===l||i.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(l<0||l>=this.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("sourceEnd out of bounds");p>this.length&&(p=this.length),i.length-r<p-l&&(p=i.length-r+l);const h=p-l;return this===i&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,l,p):Uint8Array.prototype.set.call(i,this.subarray(l,p),r),h},c.prototype.fill=function(i,r,l,p){if(typeof i=="string"){if(typeof r=="string"?(p=r,r=0,l=this.length):typeof l=="string"&&(p=l,l=this.length),p!==void 0&&typeof p!="string")throw new TypeError("encoding must be a string");if(typeof p=="string"&&!c.isEncoding(p))throw new TypeError("Unknown encoding: "+p);if(i.length===1){const k=i.charCodeAt(0);(p==="utf8"&&k<128||p==="latin1")&&(i=k)}}else typeof i=="number"?i=i&255:typeof i=="boolean"&&(i=Number(i));if(r<0||this.length<r||this.length<l)throw new RangeError("Out of range index");if(l<=r)return this;r=r>>>0,l=l===void 0?this.length:l>>>0,i||(i=0);let h;if(typeof i=="number")for(h=r;h<l;++h)this[h]=i;else{const k=c.isBuffer(i)?i:c.from(i,p),E=k.length;if(E===0)throw new TypeError('The value "'+i+'" is invalid for argument "value"');for(h=0;h<l-r;++h)this[h+r]=k[h%E]}return this};const z={};function X(i,r,l){z[i]=class extends l{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(p){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:p,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}X("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),X("ERR_INVALID_ARG_TYPE",function(i,r){return`The "${i}" argument must be of type number. Received type ${typeof r}`},TypeError),X("ERR_OUT_OF_RANGE",function(i,r,l){let p=`The value of "${i}" is out of range.`,h=l;return Number.isInteger(l)&&Math.abs(l)>2**32?h=ae(String(l)):typeof l=="bigint"&&(h=String(l),(l>BigInt(2)**BigInt(32)||l<-(BigInt(2)**BigInt(32)))&&(h=ae(h)),h+="n"),p+=` It must be ${r}. Received ${h}`,p},RangeError);function ae(i){let r="",l=i.length;const p=i[0]==="-"?1:0;for(;l>=p+4;l-=3)r=`_${i.slice(l-3,l)}${r}`;return`${i.slice(0,l)}${r}`}function xe(i,r,l){be(r,"offset"),(i[r]===void 0||i[r+l]===void 0)&&Se(r,i.length-(l+1))}function Ve(i,r,l,p,h,k){if(i>l||i<r){const E=typeof r=="bigint"?"n":"";let j;throw k>3?r===0||r===BigInt(0)?j=`>= 0${E} and < 2${E} ** ${(k+1)*8}${E}`:j=`>= -(2${E} ** ${(k+1)*8-1}${E}) and < 2 ** ${(k+1)*8-1}${E}`:j=`>= ${r}${E} and <= ${l}${E}`,new z.ERR_OUT_OF_RANGE("value",j,i)}xe(p,h,k)}function be(i,r){if(typeof i!="number")throw new z.ERR_INVALID_ARG_TYPE(r,"number",i)}function Se(i,r,l){throw Math.floor(i)!==i?(be(i,l),new z.ERR_OUT_OF_RANGE(l||"offset","an integer",i)):r<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE(l||"offset",`>= ${l?1:0} and <= ${r}`,i)}const kt=/[^+/0-9A-Za-z-_]/g;function qt(i){if(i=i.split("=")[0],i=i.trim().replace(kt,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function it(i,r){r=r||1/0;let l;const p=i.length;let h=null;const k=[];for(let E=0;E<p;++E){if(l=i.charCodeAt(E),l>55295&&l<57344){if(!h){if(l>56319){(r-=3)>-1&&k.push(239,191,189);continue}else if(E+1===p){(r-=3)>-1&&k.push(239,191,189);continue}h=l;continue}if(l<56320){(r-=3)>-1&&k.push(239,191,189),h=l;continue}l=(h-55296<<10|l-56320)+65536}else h&&(r-=3)>-1&&k.push(239,191,189);if(h=null,l<128){if((r-=1)<0)break;k.push(l)}else if(l<2048){if((r-=2)<0)break;k.push(l>>6|192,l&63|128)}else if(l<65536){if((r-=3)<0)break;k.push(l>>12|224,l>>6&63|128,l&63|128)}else if(l<1114112){if((r-=4)<0)break;k.push(l>>18|240,l>>12&63|128,l>>6&63|128,l&63|128)}else throw new Error("Invalid code point")}return k}function kn(i){const r=[];for(let l=0;l<i.length;++l)r.push(i.charCodeAt(l)&255);return r}function x(i,r){let l,p,h;const k=[];for(let E=0;E<i.length&&!((r-=2)<0);++E)l=i.charCodeAt(E),p=l>>8,h=l%256,k.push(h),k.push(p);return k}function Rt(i){return t.toByteArray(qt(i))}function ot(i,r,l,p){let h;for(h=0;h<p&&!(h+l>=r.length||h>=i.length);++h)r[h+l]=i[h];return h}function fe(i,r){return i instanceof r||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===r.name}function At(i){return i!==i}const _a=function(){const i="0123456789abcdef",r=new Array(256);for(let l=0;l<16;++l){const p=l*16;for(let h=0;h<16;++h)r[p+h]=i[l]+i[h]}return r}();function Ae(i){return typeof BigInt>"u"?wa:i}function wa(){throw new Error("BigInt not supported")}})(_l);var Cl={exports:{}},ye=Cl.exports={},Ze,Je;function ks(){throw new Error("setTimeout has not been defined")}function bs(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Ze=setTimeout:Ze=ks}catch{Ze=ks}try{typeof clearTimeout=="function"?Je=clearTimeout:Je=bs}catch{Je=bs}})();function Rl(e){if(Ze===setTimeout)return setTimeout(e,0);if((Ze===ks||!Ze)&&setTimeout)return Ze=setTimeout,setTimeout(e,0);try{return Ze(e,0)}catch{try{return Ze.call(null,e,0)}catch{return Ze.call(this,e,0)}}}function Ah(e){if(Je===clearTimeout)return clearTimeout(e);if((Je===bs||!Je)&&clearTimeout)return Je=clearTimeout,clearTimeout(e);try{return Je(e)}catch{try{return Je.call(null,e)}catch{return Je.call(this,e)}}}var ht=[],on=!1,Bt,Hn=-1;function Ih(){!on||!Bt||(on=!1,Bt.length?ht=Bt.concat(ht):Hn=-1,ht.length&&Al())}function Al(){if(!on){var e=Rl(Ih);on=!0;for(var t=ht.length;t;){for(Bt=ht,ht=[];++Hn<t;)Bt&&Bt[Hn].run();Hn=-1,t=ht.length}Bt=null,on=!1,Ah(e)}}ye.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];ht.push(new Il(e,t)),ht.length===1&&!on&&Rl(Al)};function Il(e,t){this.fun=e,this.array=t}Il.prototype.run=function(){this.fun.apply(null,this.array)};ye.title="browser";ye.browser=!0;ye.env={};ye.argv=[];ye.version="";ye.versions={};function Tt(){}ye.on=Tt;ye.addListener=Tt;ye.once=Tt;ye.off=Tt;ye.removeListener=Tt;ye.removeAllListeners=Tt;ye.emit=Tt;ye.prependListener=Tt;ye.prependOnceListener=Tt;ye.listeners=function(e){return[]};ye.binding=function(e){throw new Error("process.binding is not supported")};ye.cwd=function(){return"/"};ye.chdir=function(e){throw new Error("process.chdir is not supported")};ye.umask=function(){return 0};var Nh=Cl.exports;(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_l,n=Nh,s=u=>u&&u.__esModule?u:{default:u},a=s(n),o=globalThis||void 0||self;Object.defineProperty(e,"Buffer",{enumerable:!0,get:()=>t.Buffer}),Object.defineProperty(e,"process",{enumerable:!0,get:()=>a.default}),e.global=o})(W);class Lh{}window.slStore=Object.create(null);const Oh=(e,t)=>wd(e,t,{mount:({storeName:n})=>{window.slStore[n]||(window.slStore[n]={mounted:!0,history:[{type:"mount"}]}),window.slStore[n].store=e},unmount:({storeName:n})=>{var s;window.slStore[n].mounted=!1,(s=window.slStore[n])==null||s.history.push({type:"unmount"})},change:({actionName:n,storeName:s,changed:a,newValue:o,oldValue:u,valueMessage:c})=>{var d;(d=window.slStore[s])==null||d.history.push({type:"change",changed:a,newValue:o,oldValue:u,diff:jo({...u},{...o},{cyclesFix:!1}),actionName:n,valueMessage:c})},action:{start:({actionName:n,args:s,storeName:a})=>{var o;(o=window.slStore[a])==null||o.history.push({type:"action:start",actionName:n,args:s,storeName:a})},error:({actionName:n,error:s,storeName:a})=>{var o;(o=window.slStore[a])==null||o.history.push({type:"action:error",actionName:n,error:s})},end:({actionName:n,storeName:s})=>{var a;(a=window.slStore[s])==null||a.history.push({type:"action:end",actionName:n})}}});class ba{constructor(t,n){w(this,"store");w(this,"name");this.store=t,this.name=n,Oh(this.store,this.name)}getStore(){return this.store}}const Mh=e=>{const t=Object.keys(e);return Vo(t.map(n=>e[n].getStore()),(...n)=>Object.fromEntries(t.map((s,a)=>[s,n[a]])))};class Cn extends ba{constructor(){super(...arguments);w(this,"getValues",()=>this.getStore().get());w(this,"getValue",n=>this.getStore().get()[n]);w(this,"setValue",(n,s)=>this.getStore().setKey(n,s));w(this,"subscribe",(...n)=>this.getStore().subscribe(...n));w(this,"unsubscribe",()=>this.getStore().off())}}const Pt=e=>ds(e);var mt;(function(e){e.ORGANIZATION="ORGANIZATION",e.STREAM="STREAM"})(mt||(mt={}));const xh={[me.BETTING]:"betting",[me.GAMES]:"games",[me.PUBLIC_CHAT]:"publicChat",[me.TWITTER]:"twitter"};var Ut;(function(e){e.Ready="ready",e.Suspended="suspended"})(Ut||(Ut={}));class er{constructor({settings:t,...n},s){w(this,"status");w(this,"source");w(this,"config");w(this,"settings");w(this,"listeners",new Set);w(this,"settingsKey");w(this,"enable",()=>{this.status.set(Ut.Ready)});w(this,"disable",()=>{this.status.set(Ut.Suspended)});w(this,"setFeatureConfig",({settings:t,...n})=>{var a;let s;for(s in n)this.config.setValue(s,n[s]);if(((a=t==null?void 0:t.overlaySettings)==null?void 0:a.case)!==void 0&&(t==null?void 0:t.overlaySettings.case)===this.settingsKey){const o=t.overlaySettings.value;if(o!==void 0){let u;for(u in o)console.log(u,o[u]),o[u]!==0&&o[u]!==""&&this.settings.setValue(u,o[u])}}});w(this,"update",(t,n)=>{this.source===mt.STREAM&&n===mt.ORGANIZATION||(this.setFeatureConfig(t),this.source=n)});this.settingsKey=xh[n.type],this.status=_t(Ut.Suspended),this.config=new Cn(Pt(n),`feature:config:${this.settingsKey}`),this.settingsKey!==void 0&&(t==null?void 0:t.overlaySettings.case)===this.settingsKey?this.settings=new Cn(Pt(t.overlaySettings.value),`feature:settings:${this.settingsKey}`):this.settings=new Cn(Pt({}),`feature:settings:${this.settingsKey}`),this.source=s}get featureConfig(){return this.config.getStore()}get featureSettings(){return this.settings.getStore()}registerEventListener(t){this.listeners.add(t)}fireEvent(t){for(const n of this.listeners.values())try{n.onEvent(t)}catch(s){console.error(s)}}}class Ye extends ba{constructor(){super(...arguments);w(this,"getValue",()=>this.getStore().get());w(this,"setValue",n=>this.getStore().set(n));w(this,"subscribe",n=>this.getStore().subscribe(n));w(this,"unsubscribe",()=>this.getStore().off())}getValues(){throw new Error("not implemented")}listen(n){return this.getStore().listen(n)}get(){return this.getStore().get()}}const Ue=e=>_t(e);class Qe extends ba{constructor(n,s,a){super(n,`api:${s}`);w(this,"atomStore");w(this,"getAtomStore",()=>this.atomStore);w(this,"getValue",async()=>{const n=this.getStore();if(n.value===void 0)throw new Error("no store");return await n.value.promise,n.get().data});w(this,"getValues",()=>{throw new Error("not implemented")});w(this,"setValue",n=>this.getStore().set({loading:!1,data:n==null?void 0:n.data}));w(this,"subscribe",n=>this.getStore().subscribe(n));w(this,"unsubscribe",()=>{throw new Error("not implemented")});w(this,"invalidate",()=>{this.store.invalidate()});w(this,"listen",n=>this.getStore().listen(n));w(this,"key",()=>this.getStore().key);w(this,"off",()=>this.getStore().off());this.atomStore=_t(),a&&n.subscribe(o=>{const u=this.atomStore.get(),c=a(o,u);u!==c&&this.atomStore.set(c)})}get(){throw new Error("not implemented")}}async function*Bh(e,t){for await(const n of t){e.response.message=n,e.received_at=Date.now();const s={type:"__GRPC_DEVTOOLS_EXTENSION__",data:e};window.postMessage(s),yield n}}const Ph=()=>e=>async t=>{const n={name:t.url,request:{},response:{}};n.request.header=Object.fromEntries(t.header.entries()),n.sent_at=Date.now();try{const s=await e(t);if(n.received_at=Date.now(),n.stream=s.stream,n.response.header=Object.fromEntries(s.header.entries()),n.response.trailer=Object.fromEntries(s.trailer.entries()),s.stream)return{...s,message:Bh(n,s.message)};{n.request.message=t.message,n.response.message=s.message,n.latency=n.received_at-n.sent_at;const a={type:"__GRPC_DEVTOOLS_EXTENSION__",data:n};window.postMessage(a)}return s}catch(s){n.received_at=Date.now(),n.request.message=t.message,n.response.trailer={"grpc-status":s.code,"grpc-message":s.rawMessage},n.response.message=s.rawMessage,n.latency=n.received_at-n.sent_at;const a={type:"__GRPC_DEVTOOLS_EXTENSION__",data:n};throw window.postMessage(a),s}};window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));var lt;(function(e){e.Init="init",e.Ready="ready",e.Connecting="connecting",e.Connected="connected",e.Disconnected="disconnected",e.Failed="failed",e.Reconnecting="reconnecting"})(lt||(lt={}));class Uh{constructor(t,n,s,a){w(this,"params");w(this,"stream");w(this,"method");w(this,"name");w(this,"headers");w(this,"listeners");w(this,"state");w(this,"store");w(this,"updateState",t=>{this.state.setValue("status",t),this.state.setValue("ts",new Date),this.addStateLog(`status => ${t}`)});w(this,"addStateLog",t=>{const n=this.state.getStore().get().log;this.state.setValue("log",[...n,`${new Date().toLocaleString()}: ${t}`])});w(this,"addListener",(t,n)=>this.listeners.has(t)?(this.addStateLog(`listener '${t}' not added`),!1):(this.listeners.set(t,n),this.addStateLog(`listener '${t}' added`),!0));w(this,"removeListener",t=>{this.listeners.delete(t),this.addStateLog(`listener '${t}' removed`)});w(this,"connect",()=>{this.updateState(lt.Connecting),this.stream&&(this.addStateLog("disconnect prev connection"),this.stream());const t="get"in this.params&&typeof this.params.get=="function"?this.params.get():this.params;this.stream=this.method(t,this.onData,this.onStreamError,{headers:this.headers.getValues()}),this.updateState(lt.Connected)});w(this,"disconnect",()=>{this.stream&&this.stream(),this.listeners.clear(),this.updateState(lt.Disconnected)});w(this,"reconnect",()=>{this.updateState(lt.Reconnecting),this.connect()});w(this,"getStore",()=>{var t;return(t=this.store)==null?void 0:t.getStore()});w(this,"onData",t=>{this.addStateLog(`received data => ${JSON.stringify(t)}`),this.store&&this.store.setValue(t);for(const[,n]of this.listeners)n(t);this.addStateLog(`data routed to ${this.listeners.size} listeners`)});w(this,"onStreamError",t=>{t!==void 0&&(t.code!==oe.Canceled&&t.rawMessage!=="[canceled] BodyStreamBuffer was aborted"?(this.updateState(lt.Failed),this.state.setValue("error",t),this.reconnect()):this.disconnect())});const o={status:lt.Init,ts:new Date,log:[]};this.state=new Cn(Pt(o),`subscription:${a.name}:state`),this.name=a.name,this.headers=t,this.listeners=new Map,this.params=s,this.method=n,a.withStore&&(this.store=new Ye(Ue(null),`subscription:${a.name}:store`)),"subscribe"in s&&typeof s.subscribe=="function"&&s.subscribe(()=>{this.reconnect()}),this.updateState(lt.Ready)}}class Fh{constructor(t){w(this,"toJsonOptions",{emitDefaultValues:!1,enumAsInteger:!0,useProtoFieldName:!1});w(this,"transport");w(this,"nanoquery");w(this,"host");w(this,"interceptors",[]);w(this,"$headers");w(this,"clients");w(this,"callbackClients");w(this,"subscriptions");w(this,"addSubscription",(t,n,s)=>{const a=this.subscriptions.get(n);if(a)return a;const o=new Uh(this.$headers,t,n,s);return this.subscriptions.set(n,o),o});w(this,"removeSubscription",t=>{t.disconnect(),this.subscriptions.delete(t.params)});w(this,"disconnect",()=>{for(const[t,n]of this.subscriptions)n.disconnect(),this.subscriptions.delete(t)});w(this,"registerInterceptor",t=>{this.interceptors.push(t)});w(this,"removeInterceptor",t=>{this.interceptors=this.interceptors.filter(n=>n!==t)});w(this,"getClient",t=>{const n=t.typeName;if(this.clients.has(n))return this.clients.get(n);const s=Xf(t,this.transport);return this.clients.set(n,s),s});w(this,"getCallbackClient",t=>{const n=t.typeName;if(this.callbackClients.has(n))return this.callbackClients.get(n);const s=Yf(t,this.transport);return this.callbackClients.set(n,s),s});w(this,"createPromiseClient",(t,{params:n=[],method:s})=>{const a=this.getClient(t),o=t.methods[s].name,u=[t.typeName,o.charAt(0).toLowerCase()+o.slice(1),...Array.isArray(n)?n:[n]],c=[t.typeName,o.charAt(0).toLowerCase()+o.slice(1)];return{client:a,queryKey:u,queryKeyStr:c.join("")}});w(this,"createCallbackClient",t=>({client:this.getCallbackClient(t)}));w(this,"setSdkKey",t=>{this.$headers.setValue("sdk",t)});w(this,"setAuth",(t,n)=>{this.$headers.setValue("authorization",t),this.$headers.setValue("sl-user-id",n)});w(this,"setHeader",(t,n)=>this.$headers.setValue(t,n));w(this,"getHeader",t=>this.$headers.getValue(t));w(this,"getHeaders",()=>this.$headers.getValues());w(this,"initInterceptors",()=>{if(this.interceptors.length!==0)return;const t=n=>s=>{const a=this.$headers.getValues();for(const o in a)s.header.set(o,a[o]);return n(s)};this.interceptors.push(t),this.interceptors.push(Ph())});var o,u;this.host=t,this.$headers=new Cn(Pt({"sl-device-id":((u=(o=W.process)==null?void 0:o.env)==null?void 0:u.NX_DEVICE_ID)||"sdk-web-dev"}),"transport:headers"),this.initInterceptors(),this.clients=new Map,this.callbackClients=new Map,this.subscriptions=new Map;const[n,s,a]=_3();this.nanoquery={createFetcherStore:n,createMutatorStore:s,utils:a},this.transport=E3({baseUrl:t,interceptors:this.interceptors,useBinaryFormat:!0})}}const Dh=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(j6,{method:"retrieveEventId",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>{var c;if(!u||typeof u!="string")return"";try{return((c=(await n.retrieveEventId({id:u})).data)==null?void 0:c.id)||""}catch{return""}}})},Vh=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(Mn,{method:"getStream",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>{var c;return u?(c=(await n.getStream({id:u})).data)==null?void 0:c.attributes:void 0}})},jh=(e,t)=>{const{queryKey:n,client:s}=t.createPromiseClient(bl,{method:"me",params:[e]});return t.nanoquery.createFetcherStore(n,{fetcher:()=>s.me({})})},Gh=e=>{const{client:t}=e.createPromiseClient(bl,{method:"bypassAuth"});return({userKey:n,schema:s,init:a})=>t.bypassAuth({userKey:n,schema:s,init:a})},qh=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(Mn,{method:"get",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async()=>{var a;return(a=(await n.get({})).data)==null?void 0:a.attributes}})},$h=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(Mn,{method:"getOrganization",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async()=>{const a=await n.getOrganization({});return a.data?{...a.data.attributes,id:a.data.id}:void 0}})},Hh=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(Mn,{method:"getOrganizationAdvertising",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async()=>{var a;return(a=(await n.getOrganizationAdvertising({})).data)==null?void 0:a.attributes}})},zh=(e,t,n)=>{e.transport=new Fh(t.host),e.sdk.host=e.transport.host,e.transport.setSdkKey(t.sdkKey),n()};class tr{constructor(t="main"){w(this,"delimiter",":");w(this,"prefix");w(this,"clear",()=>{for(const t in window.localStorage)t.startsWith(this.prefix)&&window.localStorage.removeItem(t)});w(this,"generateKey",t=>`${this.prefix}${this.delimiter}${t.join(this.delimiter)}`);w(this,"write",(...t)=>{const n=t.pop()||"";window.localStorage.setItem(this.generateKey(t),n)});w(this,"read",(...t)=>{const n=window.localStorage.getItem(this.generateKey(t));return n===null?void 0:n});w(this,"remove",(...t)=>{window.localStorage.removeItem(this.generateKey(t))});this.prefix=`sl-sdk${this.delimiter}${t}`}}var ct;(function(e){e.SCHEMA="schema",e.EXTERNAL_TOKEN="eToken",e.TOKEN="token"})(ct||(ct={}));class tn extends tr{constructor(){super("user");w(this,"setSchema",n=>{this.write(ct.SCHEMA,n)});w(this,"getSchema",()=>this.read(ct.SCHEMA));w(this,"setToken",n=>{this.write(ct.TOKEN,n)});w(this,"getToken",()=>this.read(ct.TOKEN));w(this,"setExternalToken",n=>{this.write(ct.EXTERNAL_TOKEN,n)});w(this,"getExternalToken",()=>this.read(ct.EXTERNAL_TOKEN));w(this,"removeToken",()=>{this.remove(ct.TOKEN)})}}var dt;(function(e){e.DISABLED="disabled",e.INITIALIZATION="initialization",e.READY="ready",e.FAILED="failed",e.SUSPENDED="suspended"})(dt||(dt={}));const Qh=e=>{const t=new tn,n=new Ye(Ue(t.getExternalToken()),"userKey"),s=new Ye(Ue(t.getToken()),"userToken"),a=new Qe(jh(s.getStore(),e),"user",({data:u,error:c,loading:d},f)=>{var g;if(!c)return(g=u==null?void 0:u.data)!=null&&g.id?u.data.id:d===!1?void 0:f}),o=new Qe(qh(s.getStore(),e),"userSettings");return{userKey:n,userToken:s,user:a,userSettings:o}},Yh=e=>{const t=new Ye(Ue(void 0),"providerStreamId"),n=new Qe(Dh(t.getStore(),e),"slStreamId",a=>a==null?void 0:a.data),s=new Qe(Vh(n.getAtomStore(),e),"streamSettings");return n.getAtomStore().listen(a=>{(a===""||a===void 0)&&s.getStore().mutate(void 0)}),{providerStreamId:t,slStreamId:n,streamSettings:s}},Kh=e=>{const t=new Ye(Ue(void 0),"enabled"),n=new Ye(Ue(dt.DISABLED),"status"),s=new Qe($h(t.getStore(),e),"organizationSettings",c=>{var d;return(d=c==null?void 0:c.data)==null?void 0:d.id}),a=new Qe(Hh(s.getAtomStore(),e),"organizationAdvertising"),o=Qh(e),u=Yh(e);return{enabled:t,status:n,providerStreamId:u.providerStreamId,slStreamId:u.slStreamId,streamSettings:u.streamSettings,user:o.user,userKey:o.userKey,userToken:o.userToken,userSettings:o.userSettings,organizationSettings:s,organizationAdvertising:a}};class Wh extends ba{constructor(n){const s=Kh(n),a=Mh(s);super(a,"core");w(this,"stores");w(this,"subscribe",n=>{let s;for(s in this.stores){const a=n[s];s in n&&a!==void 0&&this.stores[s].subscribe(n[s])}});w(this,"unsubscribe",()=>this.getStore().off());this.stores=s}getValue(){throw new Error("Not implemented")}getValues(){return this.stores}setValue(){throw new Error("Not implemented")}}class Zh extends Lh{constructor(n,s){super();w(this,"$coreStore");w(this,"transport");w(this,"bypassLogin");w(this,"me",async()=>{var n;return this.$coreStore.getValues().user.invalidate(),(n=await this.$coreStore.getValues().user.getValue())==null?void 0:n.data});w(this,"login",async(n,s)=>{var c,d;this.$coreStore.getValues().userKey.setValue(s);const a=await this.bypassLogin({schema:n,userKey:s,init:!1}),o=(c=a.meta)==null?void 0:c.jwt,u=(d=a.data)==null?void 0:d.id;if(!o||!u)throw new Error("internal: token missing");return this.$coreStore.getValues().user.getStore().mutate(a),this.saveUser(o,u),o});w(this,"isAuthenticated",()=>this.me());w(this,"logout",()=>{this.$coreStore.getValues().user.setValue(),this.$coreStore.getValues().userKey.setValue(),this.$coreStore.getValues().userToken.setValue(),this.transport.setAuth("",""),new tn().clear()});w(this,"softLogout",()=>{const n=new tn;this.transport.setAuth("",""),n.setToken(""),this.reLogin()});w(this,"reLogin",()=>{const n=new tn,s=n.getToken(),a=n.getExternalToken();if(this.$coreStore.getValues().userKey.setValue(a),s)return this.saveUser(s,""),this.me().then(o=>{if(o!=null&&o.id){const u=o.id;this.saveUser(s,u)}});if(a&&!s){const o=n.getSchema();o&&a&&this.login(o,a).catch(()=>{this.logout()})}});w(this,"saveUser",(n,s)=>{this.transport.setAuth(n,s),this.$coreStore.getValues().userToken.setValue(n),new tn().setToken(n)});w(this,"connect",()=>{this.transport.registerInterceptor(n=>async s=>{try{return await n(s)}catch(a){throw a.code&&(a.code===7||a.code===16)&&this.transport.getHeader("authorization")&&this.softLogout(),a}})});this.$coreStore=n,this.transport=s,this.bypassLogin=Gh(this.transport),this.connect()}}const vn=new tn,Jh=(e,t,n)=>{e.auth=new Zh(e.store,e.transport),e.stores.status.listen(s=>{s===dt.READY&&e.auth.reLogin()}),e.sdk.userId=e.stores.user.getAtomStore,e.sdk.authorizationBypass=async(s,a)=>{if(!(vn.getSchema()===s&&vn.getExternalToken()===a&&e.transport.getHeader("authorization")))try{await e.auth.login(s,a),vn.setSchema(s),vn.setExternalToken(a)}catch{e.sdk.logout()}},e.sdk.logout=()=>{e.auth.logout(),vn.clear()},e.sdk.getUserStore=()=>e.stores.user.getStore(),e.sdk.isUserAuthorized=()=>e.auth.isAuthenticated(),n()},Xh=(e,t,n)=>{e.store=new Wh(e.transport),e.stores=e.store.getValues(),e.sdk.enabled=e.stores.enabled.getStore(),e.sdk.status=e.stores.status.getStore(),e.sdk.sdkStore=Object.fromEntries(Object.entries(e.stores).map(([s,a])=>[s,a.getStore()])),e.sdk.organizationStore=()=>e.stores.organizationSettings.getStore(),e.sdk.streamStore=()=>e.stores.streamSettings.getStore(),e.storeUnsubscribe=()=>{e.store.unsubscribe()},n()},eg=(e,t,n)=>{e.sdk=Object.create(null),e.sdk.initializeApp=async()=>{if(e.stores.enabled.get()==="on")return{enabled:!0};e.storeSubscribe(),e.stores.enabled.setValue("on"),e.stores.status.setValue(dt.INITIALIZATION);try{const s=await e.stores.organizationSettings.getValue();return s?(e.stores.status.setValue(dt.READY),{enabled:!!s}):(e.stores.status.setValue(dt.FAILED),{err:"failed"})}catch(s){return e.stores.enabled.setValue(),e.stores.status.setValue(dt.FAILED),{err:`${s}`}}},e.sdk.disableApp=()=>{e.stores.enabled.get()==="on"&&(e.stores.enabled.setValue(),e.stores.status.setValue(dt.DISABLED),e.sdk.closeFeature(),e.storeUnsubscribe())},e.sdk.createEventSession=s=>{e.stores.providerStreamId.setValue(s)},n()},tg=Ho({level:"trace",enabled:!1,browser:{write:e=>{console.log(e)}}}),Nl=(e,t)=>tg.child({name:e},t),ng=(e,t,n)=>{const{client:s,queryKey:a}=n.createPromiseClient(El,{method:"summary",params:[e,t]});return n.nanoquery.createFetcherStore(a,{fetcher:async(o,u,c,d)=>{var f;return(f=(await s.summary({eventId:c,userId:d})).data)==null?void 0:f.attributes}})},ag=e=>{const{client:t}=e.createPromiseClient(El,{method:"list"});return n=>t.list(n)},sg=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(st,{method:"get",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>{var c;return(c=(await n.get({eventId:u})).data)==null?void 0:c.attributes}})},rg=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(st,{method:"syncQuestion",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>{var c;return u?(c=(await n.syncQuestion({filter:{eventId:u}})).data)==null?void 0:c.attributes:void 0}})},ig=(e,t)=>{const{client:n}=t.createCallbackClient(st),s=_t({eventId:e.get()||"",feedId:""});return e.subscribe((a="")=>{s.set({eventId:a,feedId:""})}),t.addSubscription(n.subscription,s,{name:"feedSubscription"})},og=(e,t)=>{const{client:n}=t.createCallbackClient(st);return t.addSubscription(n.questionSubscription,{questionId:e},{name:"questionSubscription"})},Ll=async(e,t)=>{var s,a;const{client:n}=t.createPromiseClient(st,{method:"questionByUser",params:[e]});return(a=(s=(await n.questionByUser({questionId:e})).data)==null?void 0:s.attributes)==null?void 0:a.question},lg=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(st,{method:"list",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>u?(await n.list({eventId:u,filter:{statuses:[Pe.ACTIVE,Pe.RESOLVED]}})).data:[]})},cg=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(st,{method:"insightHistory",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>{var c;return u?(c=(await n.insightHistory({eventId:u})).data)==null?void 0:c.map(({attributes:d})=>d):void 0}})};var nr={exports:{}};const ug=Object.getPrototypeOf({});function ar(e){function t(_){return _!=="constructor"&&_!=="prototype"&&_!=="__proto__"}function n(_){let I=0;const P=_.length,U=new Array(P);for(I=0;I<P;++I)U[I]=b(_[I]);return U}function s(_){const I={};if(d&&Object.getPrototypeOf(_)!==ug)return d(_);const P=c(_);let U,B,V;for(U=0,B=P.length;U<B;++U)t(V=P[U])&&(I[V]=b(_[V]));return I}function a(_,I){const P=_.length,U=I.length;let B=0;const V=new Array(P+U);for(B=0;B<P;++B)V[B]=b(_[B]);for(B=0;B<U;++B)V[B+P]=b(I[B]);return V}const o=Object.prototype.propertyIsEnumerable;function u(_){const I=Object.keys(_),P=Object.getOwnPropertySymbols(_);for(let U=0,B=P.length;U<B;++U)o.call(_,P[U])&&I.push(P[U]);return I}const c=e&&e.symbols?u:Object.keys,d=typeof(e==null?void 0:e.cloneProtoObject)=="function"?e.cloneProtoObject:void 0;function f(_){return typeof _=="object"&&_!==null&&!(_ instanceof RegExp)&&!(_ instanceof Date)}function g(_){return typeof _!="object"||_===null}const T=typeof W.Buffer<"u"?_=>typeof _!="object"||_===null||_ instanceof RegExp||_ instanceof Date||_ instanceof W.Buffer:_=>typeof _!="object"||_===null||_ instanceof RegExp||_ instanceof Date,y=e&&typeof e.mergeArray=="function"?e.mergeArray({clone:b,deepmerge:A,getKeys:c,isMergeableObject:f}):a;function b(_){return f(_)?Array.isArray(_)?n(_):s(_):_}function R(_,I){const P={},U=c(_),B=c(I);let V,D,$;for(V=0,D=U.length;V<D;++V)t($=U[V])&&B.indexOf($)===-1&&(P[$]=b(_[$]));for(V=0,D=B.length;V<D;++V)t($=B[V])&&($ in _&&(U.indexOf($)!==-1&&(P[$]=A(_[$],I[$])),!0)||(P[$]=b(I[$])));return P}function A(_,I){const P=Array.isArray(I),U=Array.isArray(_);return g(I)?I:T(_)?b(I):P&&U?y(_,I):P!==U?b(I):R(_,I)}function N(){switch(arguments.length){case 0:return{};case 1:return b(arguments[0]);case 2:return A(arguments[0],arguments[1])}let _;for(let I=0,P=arguments.length;I<P;++I)_=A(_,arguments[I]);return _}return e&&e.all?N:A}nr.exports=ar;nr.exports.default=ar;var mg=nr.exports.deepmerge=ar;const dg=e=>(t,n)=>{let s=0;const a=t.length,o=n.length,u=Math.max(a,o),c=new Array(u);for(s=0;s<u;++s)s<o?c[s]=e.deepmerge(t[s],n[s]):c[s]=e.clone(t[s]);return c},pg=mg({mergeArray:dg}),fg=(e,t,n)=>{const s=Vo([t,n],(o,u)=>{if(o&&u.data)return u.data.find(c=>c.id===o)}),a=Pt({data:void 0,loading:void 0,error:void 0});return s.subscribe(async o=>{if(o&&o.type==="question"){a.setKey("loading",!0);const u=await Ll(o.id,e);a.set({data:u,loading:!1});return}a.set({data:void 0,loading:!1})}),{$store:s,$extendedStore:a,updateExtendedQuestion:o=>{const u=a.get().data;if(u)for(const c of(o==null?void 0:o.answers)||[])c.youVoted!==!0&&delete c.youVoted;a.set({data:pg(u,o)})}}},Ol=e=>(e.gamification||(e.gamification=new hg(e)),e.gamification);class hg{constructor(t){w(this,"slStreamId");w(this,"organizationId");w(this,"userId");w(this,"openedQuestionId");w(this,"openedQuestion");w(this,"activeQuestionId");w(this,"feedList");w(this,"moderationId");w(this,"moderation");w(this,"feedSubscription");w(this,"questionSubscription");w(this,"notifications");w(this,"log");w(this,"getCurrentSessionId",t=>{const n=t.eventId||this.slStreamId.get()||"",s=t.userId||this.userId.get()||"",a=t.organizationId||this.organizationId.get()||"",o=t.entity||"",u=t.prefix||"";return[a,n,s,u,o].join(":")});w(this,"disconnect",()=>{var t;(t=this.feedSubscription)==null||t.disconnect()});w(this,"openQuestion",t=>{this.openedQuestionId.set(t),this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:t}))});w(this,"closeQuestion",t=>{this.openedQuestionId.set(void 0),t&&this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:t}))});if(t.gamification)throw new Error("GamificationBackground Singleton error");this.log=Nl("gamification-background"),this.slStreamId=t.stores.slStreamId.getAtomStore(),this.organizationId=t.stores.organizationSettings.getAtomStore(),this.userId=t.stores.user.getAtomStore(),this.moderationId=new Ye(Ue(void 0),"moderationId").getStore(),this.openedQuestionId=new Ye(Ue(void 0),"openedQuestionId").getStore(),this.notifications=t.notifications,this.moderation=new Qe(sg(this.slStreamId,t.transport),"gamification:moderation"),this.feedList=new Qe(lg(this.slStreamId,t.transport),"gamification:feedList"),this.activeQuestionId=new Qe(rg(this.slStreamId,t.transport),"gamification:activeQuestionId"),this.openedQuestion=fg(t.transport,this.openedQuestionId,this.feedList.getStore()),this.openedQuestionId.listen(n=>{this.log.debug({questionId:n},"received question"),n?(this.questionSubscription=og(n,t.transport),this.questionSubscription.addListener("feed-subscription-opened-question",s=>{window.requestAnimationFrame(()=>{var a,o;this.openedQuestion.updateExtendedQuestion((o=(a=s.data)==null?void 0:a.attributes)==null?void 0:o.question)})}),this.questionSubscription.connect()):(this.log.info("cleanup on close question"),this.questionSubscription!==void 0&&(t.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0))}),this.feedSubscription=ig(this.slStreamId,t.transport),this.feedSubscription.addListener("feed-subscription-active-question",n=>{window.requestAnimationFrame(()=>{var a;const s=this.activeQuestionId.getStore();s&&s.mutate((a=n.data)==null?void 0:a.attributes)})})}}class gg{constructor(t){w(this,"notificationsList");w(this,"notifications");w(this,"store");w(this,"timeouts");w(this,"waitingQueue");w(this,"activeQueue");w(this,"options");w(this,"logger");w(this,"addToQueue",t=>{if(this.store.has(t.id)){this.logger.debug({notification:t},"skip existed notification: %o");return}const n=t.close,s=t.action;if(this.store.set(t.id,{...t,close:(...a)=>{n&&n(...a),this.closeNotification(t.id)},action:(...a)=>{s&&s(...a),this.closeNotification(t.id)}}),this.waitingQueue.add(t.id),this.activeQueue.size===this.options.concurrency){const[a]=this.activeQueue;this.closeNotification(a)}else this.tickWaitingQueue()});w(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[t]=this.waitingQueue;if(!t)return;this.activeQueue.add(t),this.waitingQueue.delete(t),this.logger.debug({job:t},"waiting queue tick"),this.tickActiveQueue(t)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});w(this,"tickActiveQueue",t=>{if(!t)return;const n=this.store.get(t);if(!n){this.logger.debug({notificationId:t},"active queue tick skipped, notification not exist");return}const s=setTimeout(()=>{const a=t,o=new Map(this.notifications.getValue());o.set(n.id,n),this.notifications.setValue(o);const u=setTimeout(()=>{this.logger.debug({notificationId:a,delay:n.autoHideDuration||5e3},"notification hiding by autoHideDuration"),this.closeNotification(a)},n.autoHideDuration||5e3);this.timeouts.set(a,u),this.logger.debug({notificationId:a,queue:[...o.values()]},"notification displayed")},n.delay||0);this.timeouts.set(t,s),this.logger.debug({notificationId:t},"active queue tick completed"),this.tickWaitingQueue()});w(this,"closeNotification",t=>{const n=new Map(this.notifications.getValue()),s=n.get(t);if(s){s.hiding=!(this.waitingQueue.size>=this.options.concurrency),this.notifications.setValue(n);const a=setTimeout(()=>{const o=new Map(this.notifications.getValue());o.delete(t),this.notifications.setValue(o);const u=this.timeouts.get(t);u!==void 0&&(clearTimeout(u),this.timeouts.delete(t)),this.logger.debug({notificationId:t},"notification hidden")},this.options.animationDelay||0);this.timeouts.set(t,a)}this.store.delete(t),this.activeQueue.delete(t),this.waitingQueue.delete(t),this.tickWaitingQueue(),this.logger.debug({notificationId:t},"notification hiding")});this.options=t,this.logger=Nl("notifications"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.notifications=new Ye(Ue(new Map),"notifications-queue"),this.notificationsList=this.notifications.getStore()}}var ta;(function(e){e.OPENED="opened"})(ta||(ta={}));class yg extends tr{constructor(){super("notification");w(this,"setOpened",n=>{this.write(ta.OPENED,n,"true")});w(this,"isOpened",n=>this.read(ta.OPENED,n));w(this,"clearNotification",()=>{this.clear()})}}var Et;(function(e){e[e.ONBOARDING=1]="ONBOARDING",e[e.QUESTION=2]="QUESTION",e[e.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(Et||(Et={}));class Tg{constructor(t={}){w(this,"queue");w(this,"storage");w(this,"add",t=>{this.storage.isOpened(t.id)||this.queue.addToQueue(t)});w(this,"close",t=>{this.queue.closeNotification(t),this.markAsViewed(t)});w(this,"getQueueStore",()=>this.queue.notificationsList);w(this,"markAsViewed",t=>{this.storage.setOpened(t)});this.storage=new yg,this.queue=new gg({concurrency:1,animationDelay:1600,...t})}}const kg=(e,t,n)=>{e.notifications=new Tg,e.addNotification=e.notifications.add,e.sdk.getNotificationsStore=()=>e.notifications.getQueueStore(),n()},bg=(e,t)=>{const{client:n}=e.createPromiseClient(st,{method:"submitAnswer"});return n.submitAnswer({data:t})},Sg=(e,t)=>{const{client:n}=e.createPromiseClient(st,{method:"submitInplay"});return n.submitInplay({data:{eventId:+t}})},Eg=(e,t)=>{const{client:n}=e.createPromiseClient(st,{method:"skipQuestion"});return n.skipQuestion({data:{id:t}})};var na;(function(e){e.ONBOARDING="onboarding"})(na||(na={}));class Ml extends tr{constructor(){super("gamification");w(this,"saveOnboardingStatus",({userId:n,eventId:s,organizationId:a},o)=>{this.write(na.ONBOARDING,a,n,s,o)});w(this,"getOnboardingStatus",({userId:n,eventId:s,organizationId:a})=>this.read(na.ONBOARDING,a,n,s))}}const Mi={pageSize:10},vg=(e,t,n)=>{const s=Ue({pageSize:(n==null?void 0:n.pageSize)||Mi.pageSize,page:0}),a=Pt({data:[],loading:void 0,error:void 0}),o=ag(e),u=async d=>{if(d){a.setKey("loading",!0);const f={eventId:d,pagination:{page:0,pageSize:(n==null?void 0:n.pageSize)||Mi.pageSize}},g=await o(f);a.set({data:g.data.map(T=>T.attributes),loading:!1}),s.set(f.pagination)}};t.listen(u);const c=()=>{u(t.get())};return s.listen(async d=>{var T;const f=t.get(),g=((T=a.get().data)==null?void 0:T.length)||0;if(d.page>0&&f&&g>=d.page*d.pageSize){a.setKey("loading",!0);const y=await o({eventId:f,pagination:d}),b=a.get().data||[];a.set({data:[...b,...y.data.map(R=>R.attributes)],loading:!1})}}),{$store:a,fetchMore:()=>{const d=s.get();s.set({...d,page:d.page+1})},invalidate:c}},_g=(e,t)=>{const{client:n,queryKey:s}=e.createPromiseClient(Mn,{method:"generateDeepLink",params:t});return e.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>{var c;return u?(c=(await n.generateDeepLink({data:{eventId:u}})).data)==null?void 0:c.attributes:{}}})},wg=(e,t,n)=>{const s=_g(e,[t]),a=`${window.location.host+window.location.pathname}%23sl_eid=${t.get()}&sl_uid=${n.get()}`;return{$store:s,fetch,desktopLink:a}};var Le;(function(e){e.Unset="unset",e.Required="required",e.Optional="optional",e.Completed="completed",e.Disabled="disabled",e.Unavailable="unavailable"})(Le||(Le={}));const Cg=(e,t,n,s)=>{const a=new Ml,o=Ue(Le.Unset),u=()=>{const{inplayGame:d}=e.featureSettings.get(),f=t.getCurrentSessionId({prefix:"onboarding"});d&&s.add({type:Et.ONBOARDING,id:f,action:e.openFeature,close:()=>{s.markAsViewed(f)},autoHideDuration:1e6,data:{questionType:re.UNSET,onboarding:{...d}}})};o.subscribe(d=>{(d===Le.Optional||Le.Required)&&u(),d===Le.Completed&&t.activeQuestionId.invalidate()});const c=async()=>{var y,b,R,A,N;const d=t.userId.get();if(!d){o.set(Le.Unset);return}a.getOnboardingStatus({userId:d,organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""})===Le.Completed&&o.set(Le.Completed);const f=await t.moderation.getValue();if(o.get()===Le.Completed)return;const g=!!((y=f==null?void 0:f.options)!=null&&y.onboardingEnabled&&((R=(b=e.featureSettings.get().inplayGame)==null?void 0:b.onboarding)!=null&&R.completed)),T=!!((N=(A=e.featureSettings.get().inplayGame)==null?void 0:A.titleCard)!=null&&N.optIn);g?T?o.set(Le.Required):o.set(Le.Optional):T?o.set(Le.Unavailable):o.set(Le.Disabled)};return c(),t.userId.subscribe(d=>{d&&c()}),t.moderation.subscribe(d=>{d.data&&c()}),{$store:o,submitInplay:async()=>{const d=t.slStreamId.get();d&&(await Sg(n,d),o.set(Le.Completed),a.saveOnboardingStatus({organizationId:t.organizationId.get()||"",userId:t.userId.get()||"",eventId:d},Le.Completed))}}},Rg=new Set([re.POLL,re.PREDICTION,re.TRIVIA]);class Ag extends er{constructor(n,s,a){super(n,s);w(this,"userSummary");w(this,"feedList");w(this,"leaderboardId");w(this,"leaderboardList");w(this,"deepLink");w(this,"onboardingStatus");w(this,"openedQuestion");w(this,"currentUserId");w(this,"openedUser");w(this,"closeFeature");w(this,"openFeature");w(this,"notifications");w(this,"transport");w(this,"background");w(this,"storage");w(this,"connect",n=>{this.userSummary.invalidate(),this.leaderboardList.invalidate(),this.feedList.invalidate(),this.background.feedSubscription.addListener("feed-subscription-prediction-close",s=>{window.requestAnimationFrame(async()=>{var d,f;const a=(f=(d=s.data)==null?void 0:d.attributes)==null?void 0:f.question;if(!a)return;const{status:o,type:u,id:c}=a;if(o===Pe.RESOLVED&&u===re.PREDICTION){const g=this.background.getCurrentSessionId({prefix:`notification-id:${c}`}),T=await Ll(c,n),y=T==null?void 0:T.answers.find(({correct:R})=>R),b=T==null?void 0:T.answers.find(({youVoted:R})=>R);if(!b)return;this.notifications.add({type:Et.QUESTION_RESOLVED,action:()=>this.openQuestion(c),close:()=>this.closeQuestion(c),autoHideDuration:35e3,id:g,data:{questionType:re.PREDICTION,question:{title:y!=null&&y.youVoted?`Congratulations! You answered correctly! You won ${y.points} pts!`:`Better luck next time! Correct: ${y==null?void 0:y.text}!`,votedAnswer:{title:b==null?void 0:b.text,points:b==null?void 0:b.points},correctAnswerTitle:y==null?void 0:y.text,correct:y==null?void 0:y.youVoted,predictionResult:o===Pe.RESOLVED}}})}})}),this.background.feedSubscription.addListener("feed-subscription-questions-list",()=>{window.requestAnimationFrame(()=>{var s;(s=this.feedList)==null||s.invalidate()})})});w(this,"disconnect",()=>{this.background.feedSubscription.removeListener("feed-subscription-questions-list")});w(this,"submitAnswer",async(n,s)=>{await bg(this.transport,{questionId:n,answerId:s}),this.feedList.invalidate(),this.userSummary.invalidate()});w(this,"skipQuestion",async n=>{await Eg(this.transport,n),this.feedList.invalidate(),this.userSummary.invalidate()});w(this,"openQuestion",n=>(this.openFeature(),this.background.openQuestion(n)));w(this,"closeQuestion",n=>this.background.closeQuestion(n));w(this,"openUser",n=>{var a;const s=(a=this.leaderboardList.$store.get().data)==null?void 0:a.find(o=>o.userId===n);this.openedUser.set(s)});w(this,"closeUser",()=>{this.openedUser.set(void 0)});this.background=Ol(a),this.storage=new Ml,this.userSummary=new Qe(ng(this.background.slStreamId,this.background.userId,a.transport),"gamification:userSummary"),this.feedList=this.background.feedList,this.currentUserId=this.background.userId,this.openedUser=Ue(void 0),this.leaderboardId=new Ye(Ue(this.settings.getValue("pinnedLeaderboardId")),"pinnedLeaderboardId").getStore(),this.onboardingStatus=Cg(this,this.background,a.transport,a.notifications),this.notifications=a.notifications,this.transport=a.transport,this.closeFeature=a.sdk.closeFeature,this.openFeature=()=>a.sdk.openFeature(me.GAMES),this.openedQuestion=this.background.openedQuestion,this.deepLink=wg(this.transport,this.background.slStreamId,this.background.userId),this.leaderboardList=vg(this.transport,this.background.slStreamId),this.status.subscribe(o=>{o===Ut.Ready?this.connect(a.transport):this.disconnect()}),this.background.activeQuestionId.listen(o=>{var u,c,d,f,g,T,y,b,R,A;if(o&&o.data&&this.onboardingStatus.$store.get()&&((u=o.data.question)==null?void 0:u.id)!==void 0&&o.data.question.notification!==void 0&&((d=(c=o.data.moderation)==null?void 0:c.bypassNotifications)==null?void 0:d.inAppSilence)!==Bs.ON&&o.data.question.status===Pe.ACTIVE){if(Rg.has(o.data.question.type))this.notifications.add({type:Et.QUESTION,action:()=>{var N;return((N=o.data)==null?void 0:N.question)&&this.openQuestion(o.data.question.id)},close:()=>{var N;return((N=o.data)==null?void 0:N.question)&&this.closeQuestion(o.data.question.id)},autoHideDuration:1e3*60,id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),data:{questionType:o.data.question.type,question:{title:o.data.question.notification.title}}});else if(o.data.question.type===re.FACTOID){const N=(f=o.data.question.options)==null?void 0:f.options.value,_={heading:o.data.question.notification.title,body:o.data.question.notification.body,image:o.data.question.notification.image,video:{id:((g=N==null?void 0:N.video)==null?void 0:g.id)||"",url:((T=N==null?void 0:N.video)==null?void 0:T.url)||"",thumbnailUrl:((y=N==null?void 0:N.video)==null?void 0:y.thumbnailUrl)||""},webLink:{label:"",url:""}};this.notifications.add({type:Et.QUESTION,action:()=>{var I;return((I=o.data)==null?void 0:I.question)&&this.openQuestion(o.data.question.id)},close:()=>{var I;return((I=o.data)==null?void 0:I.question)&&this.closeQuestion(o.data.question.id)},autoHideDuration:1e3*120,id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),data:{questionType:o.data.question.type,insight:_}})}else if(o.data.question.type===re.TWEET){const N=(b=o.data.question.options)==null?void 0:b.options.value,_={title:o.data.question.notification.title,body:o.data.question.notification.body,image:o.data.question.notification.image,account:{image:"",name:((R=N==null?void 0:N.tweetMeta)==null?void 0:R.account)||"",userName:"",verified:!!((A=N==null?void 0:N.tweetMeta)!=null&&A.accountVerified)}};this.notifications.add({type:Et.QUESTION,action:()=>{var I;return((I=o.data)==null?void 0:I.question)&&this.openQuestion(o.data.question.id)},close:()=>{var I;return((I=o.data)==null?void 0:I.question)&&this.closeQuestion(o.data.question.id)},autoHideDuration:1e3*120,id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),data:{questionType:o.data.question.type,tweet:_}})}}})}}class Ig extends er{constructor(n,s,a){super(n,s);w(this,"insights");w(this,"closeFeature");w(this,"openFeature");w(this,"openedInsight");w(this,"notifications");w(this,"transport");w(this,"background");w(this,"connect",()=>{this.insights?this.insights.invalidate():this.insights=new Qe(cg(this.background.slStreamId,this.transport),"gamification:insights"),this.background.feedSubscription.addListener("feed-subscription-insights-list",()=>{window.requestAnimationFrame(()=>{var n;(n=this.insights)==null||n.invalidate()})})});w(this,"disconnect",()=>{this.background.feedSubscription.removeListener("feed-subscription-insights-list")});w(this,"openHighlight",n=>(this.openFeature(),this.background.openQuestion(n)));w(this,"closeHighlight",n=>this.background.closeQuestion(n));this.background=Ol(a),this.notifications=a.notifications,this.transport=a.transport,this.closeFeature=a.sdk.closeFeature,this.openFeature=()=>a.sdk.openFeature(me.HIGHLIGHTS),this.status.subscribe(o=>{o===Ut.Ready?this.connect():this.disconnect()}),this.background.activeQuestionId.listen(o=>{var u,c,d,f,g,T,y,b;(c=(u=o==null?void 0:o.data)==null?void 0:u.question)!=null&&c.id&&((f=(d=o==null?void 0:o.data)==null?void 0:d.question)!=null&&f.notification)&&((T=(g=o.data.moderation)==null?void 0:g.bypassNotifications)==null?void 0:T.inAppSilence)!==Bs.ON&&o.data.question.type===re.FACTOID&&o.data.question.status===Pe.ACTIVE&&this.notifications.add({type:Et.QUESTION,action:()=>{var R;return((R=o.data)==null?void 0:R.question)&&this.openHighlight(o.data.question.id)},close:()=>{var R;return((R=o.data)==null?void 0:R.question)&&this.closeHighlight(o.data.question.id)},autoHideDuration:1e3*+(((b=(y=o.data.question)==null?void 0:y.appearance)==null?void 0:b.autoHideInterval)||"5"),id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),data:{questionType:o.data.question.type,question:{title:o.data.question.notification.title}}})}),this.openedInsight=this.background.openedQuestion}}me.GAMES+"",me.HIGHLIGHTS+"";class Ng extends er{constructor(t,n){super(t,n)}}const Lg=(e,t,n)=>e.type===me.GAMES?new Ag(e,t,n):e.type===me.HIGHLIGHTS?new Ig(e,t,n):new Ng(e,t),Og=(e,t,n)=>{e.features=new Map,e.activeFeature=new Ye(Ue(me.UNSET),"activeFeature"),e.sdk.getFeatures=()=>e.features,e.sdk.getFeature=s=>e.features.get(s),e.sdk.getActiveFeature=()=>e.activeFeature.getStore(),e.sdk.openFeature=s=>{e.activeFeature.setValue(s)},e.sdk.closeFeature=()=>{e.activeFeature.setValue(me.UNSET)},e.initFeature=(s,a=mt.ORGANIZATION)=>{const o=Lg(s,a,e);e.features.set(s.type,o)},e.updateFeature=(s,a)=>{var o;(o=e.features.get(s.type))==null||o.update(s,a)},e.destroyFeature=s=>{e.features.delete(s.type)},e.reinitializeFeatures=async()=>{const s=await e.stores.organizationSettings.getValue();e.features.clear();for(const a of(s==null?void 0:s.overlays)||[])e.initFeature(a,mt.ORGANIZATION)},e.stores.providerStreamId.listen(s=>{s||e.reinitializeFeatures()}),e.storeSubscribe=()=>{const s=(o,u)=>{if(u!=null&&u.overlays){o===mt.STREAM&&e.features.clear();for(const c of u.overlays)c.sdkEnable===!0&&(e.features.has(c.type)?e.updateFeature(c,o):e.initFeature(c,o))}},a={organizationSettings:o=>{if(o.data)try{s(mt.ORGANIZATION,o.data)}catch(u){console.log(u)}},streamSettings:o=>{if(o.data)try{s(mt.STREAM,o.data)}catch(u){console.log(u)}}};e.store.subscribe(a)},n()};var sr={exports:{}},rr={exports:{}};function Mg(e){var t=new e,n=t;function s(){var o=t;return o.next?t=o.next:(t=new e,n=t),o.next=null,o}function a(o){n.next=o,n=o}return{get:s,release:a}}var xg=Mg,Bg=xg;function xl(e,t,n){if(typeof e=="function"&&(n=t,t=e,e=null),n<1)throw new Error("fastqueue concurrency must be greater than 1");var s=Bg(Pg),a=null,o=null,u=0,c=null,d={push:A,drain:$e,saturated:$e,pause:g,paused:!1,concurrency:n,running:f,resume:b,idle:R,length:T,getQueue:y,unshift:N,empty:$e,kill:I,killAndDrain:P,error:U};return d;function f(){return u}function g(){d.paused=!0}function T(){for(var B=a,V=0;B;)B=B.next,V++;return V}function y(){for(var B=a,V=[];B;)V.push(B.value),B=B.next;return V}function b(){if(d.paused){d.paused=!1;for(var B=0;B<d.concurrency;B++)u++,_()}}function R(){return u===0&&d.length()===0}function A(B,V){var D=s.get();D.context=e,D.release=_,D.value=B,D.callback=V||$e,D.errorHandler=c,u===d.concurrency||d.paused?o?(o.next=D,o=D):(a=D,o=D,d.saturated()):(u++,t.call(e,D.value,D.worked))}function N(B,V){var D=s.get();D.context=e,D.release=_,D.value=B,D.callback=V||$e,u===d.concurrency||d.paused?a?(D.next=a,a=D):(a=D,o=D,d.saturated()):(u++,t.call(e,D.value,D.worked))}function _(B){B&&s.release(B);var V=a;V?d.paused?u--:(o===a&&(o=null),a=V.next,V.next=null,t.call(e,V.value,V.worked),o===null&&d.empty()):--u===0&&d.drain()}function I(){a=null,o=null,d.drain=$e}function P(){a=null,o=null,d.drain(),d.drain=$e}function U(B){c=B}}function $e(){}function Pg(){this.value=null,this.callback=$e,this.next=null,this.release=$e,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var s=e.callback,a=e.errorHandler,o=e.value;e.value=null,e.callback=$e,e.errorHandler&&a(t,o),s.call(e.context,t,n),e.release(e)}}function Ug(e,t,n){typeof e=="function"&&(n=t,t=e,e=null);function s(g,T){t.call(this,g).then(function(y){T(null,y)},T)}var a=xl(e,s,n),o=a.push,u=a.unshift;return a.push=c,a.unshift=d,a.drained=f,a;function c(g){var T=new Promise(function(y,b){o(g,function(R,A){if(R){b(R);return}y(A)})});return T.catch($e),T}function d(g){var T=new Promise(function(y,b){u(g,function(R,A){if(R){b(R);return}y(A)})});return T.catch($e),T}function f(){if(a.idle())return new Promise(function(y){y()});var g=a.drain,T=new Promise(function(y){a.drain=function(){g(),y()}});return T}}rr.exports=xl;rr.exports.promise=Ug;var Bl=rr.exports,ir={exports:{}},ln=typeof Reflect=="object"?Reflect:null,xi=ln&&typeof ln.apply=="function"?ln.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},zn;ln&&typeof ln.ownKeys=="function"?zn=ln.ownKeys:Object.getOwnPropertySymbols?zn=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:zn=function(e){return Object.getOwnPropertyNames(e)};function Fg(e){console&&console.warn&&console.warn(e)}var Pl=Number.isNaN||function(e){return e!==e};function le(){le.init.call(this)}ir.exports=le;ir.exports.once=Gg;le.EventEmitter=le;le.prototype._events=void 0;le.prototype._eventsCount=0;le.prototype._maxListeners=void 0;var Bi=10;function Sa(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(le,"defaultMaxListeners",{enumerable:!0,get:function(){return Bi},set:function(e){if(typeof e!="number"||e<0||Pl(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Bi=e}});le.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};le.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Pl(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 Ul(e){return e._maxListeners===void 0?le.defaultMaxListeners:e._maxListeners}le.prototype.getMaxListeners=function(){return Ul(this)};le.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var s=e==="error",a=this._events;if(a!==void 0)s=s&&a.error===void 0;else if(!s)return!1;if(s){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var u=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw u.context=o,u}var c=a[e];if(c===void 0)return!1;if(typeof c=="function")xi(c,this,t);else for(var d=c.length,f=Gl(c,d),n=0;n<d;++n)xi(f[n],this,t);return!0};function Fl(e,t,n,s){var a,o,u;if(Sa(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),u=o[t]),u===void 0)u=o[t]=n,++e._eventsCount;else if(typeof u=="function"?u=o[t]=s?[n,u]:[u,n]:s?u.unshift(n):u.push(n),a=Ul(e),a>0&&u.length>a&&!u.warned){u.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=u.length,Fg(c)}return e}le.prototype.addListener=function(e,t){return Fl(this,e,t,!1)};le.prototype.on=le.prototype.addListener;le.prototype.prependListener=function(e,t){return Fl(this,e,t,!0)};function Dg(){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 Dl(e,t,n){var s={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=Dg.bind(s);return a.listener=n,s.wrapFn=a,a}le.prototype.once=function(e,t){return Sa(t),this.on(e,Dl(this,e,t)),this};le.prototype.prependOnceListener=function(e,t){return Sa(t),this.prependListener(e,Dl(this,e,t)),this};le.prototype.removeListener=function(e,t){var n,s,a,o,u;if(Sa(t),s=this._events,s===void 0)return this;if(n=s[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(a=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){u=n[o].listener,a=o;break}if(a<0)return this;a===0?n.shift():Vg(n,a),n.length===1&&(s[e]=n[0]),s.removeListener!==void 0&&this.emit("removeListener",e,u||t)}return this};le.prototype.off=le.prototype.removeListener;le.prototype.removeAllListeners=function(e){var t,n,s;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var a=Object.keys(n),o;for(s=0;s<a.length;++s)o=a[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(s=t.length-1;s>=0;s--)this.removeListener(e,t[s]);return this};function Vl(e,t,n){var s=e._events;if(s===void 0)return[];var a=s[t];return a===void 0?[]:typeof a=="function"?n?[a.listener||a]:[a]:n?jg(a):Gl(a,a.length)}le.prototype.listeners=function(e){return Vl(this,e,!0)};le.prototype.rawListeners=function(e){return Vl(this,e,!1)};le.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):jl.call(e,t)};le.prototype.listenerCount=jl;function jl(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}le.prototype.eventNames=function(){return this._eventsCount>0?zn(this._events):[]};function Gl(e,t){for(var n=new Array(t),s=0;s<t;++s)n[s]=e[s];return n}function Vg(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function jg(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function Gg(e,t){return new Promise(function(n,s){function a(u){e.removeListener(t,o),s(u)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",a),n([].slice.call(arguments))}ql(e,t,o,{once:!0}),t!=="error"&&qg(e,a,{once:!0})})}function qg(e,t,n){typeof e.on=="function"&&ql(e,"error",t,n)}function ql(e,t,n,s){if(typeof e.on=="function")s.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function a(o){s.once&&e.removeEventListener(t,a),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var $l=ir.exports,Ea={},Hl={},zl=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var s=42;e[t]=s;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==s||o.enumerable!==!0)return!1}return!0},$g=zl,or=function(){return $g()&&!!Symbol.toStringTag},Pi=typeof Symbol<"u"&&Symbol,Hg=zl,zg=function(){return typeof Pi!="function"||typeof Symbol!="function"||typeof Pi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Hg()},Ui={foo:{}},Qg=Object,Yg=function(){return{__proto__:Ui}.foo===Ui.foo&&!({__proto__:null}instanceof Qg)},Kg="Function.prototype.bind called on incompatible ",Wg=Object.prototype.toString,Zg=Math.max,Jg="[object Function]",Fi=function(e,t){for(var n=[],s=0;s<e.length;s+=1)n[s]=e[s];for(var a=0;a<t.length;a+=1)n[a+e.length]=t[a];return n},Xg=function(e,t){for(var n=[],s=t||0,a=0;s<e.length;s+=1,a+=1)n[a]=e[s];return n},ey=function(e,t){for(var n="",s=0;s<e.length;s+=1)n+=e[s],s+1<e.length&&(n+=t);return n},ty=function(e){var t=this;if(typeof t!="function"||Wg.apply(t)!==Jg)throw new TypeError(Kg+t);for(var n=Xg(arguments,1),s,a=function(){if(this instanceof s){var f=t.apply(this,Fi(n,arguments));return Object(f)===f?f:this}return t.apply(e,Fi(n,arguments))},o=Zg(0,t.length-n.length),u=[],c=0;c<o;c++)u[c]="$"+c;if(s=Function("binder","return function ("+ey(u,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var d=function(){};d.prototype=t.prototype,s.prototype=new d,d.prototype=null}return s},ny=ty,Ql=Function.prototype.bind||ny,Di={}.hasOwnProperty,qa=Function.prototype.call,ay=qa.bind?qa.bind(Di):function(e,t){return qa.call(Di,e,t)},ne,dn=SyntaxError,Yl=Function,cn=TypeError,$a=function(e){try{return Yl('"use strict"; return ('+e+").constructor;")()}catch{}},Ft=Object.getOwnPropertyDescriptor;if(Ft)try{Ft({},"")}catch{Ft=null}var Ha=function(){throw new cn},sy=Ft?function(){try{return arguments.callee,Ha}catch{try{return Ft(arguments,"callee").get}catch{return Ha}}}():Ha,Zt=zg(),ry=Yg(),Ee=Object.getPrototypeOf||(ry?function(e){return e.__proto__}:null),Xt={},iy=typeof Uint8Array>"u"||!Ee?ne:Ee(Uint8Array),Dt={"%AggregateError%":typeof AggregateError>"u"?ne:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ne:ArrayBuffer,"%ArrayIteratorPrototype%":Zt&&Ee?Ee([][Symbol.iterator]()):ne,"%AsyncFromSyncIteratorPrototype%":ne,"%AsyncFunction%":Xt,"%AsyncGenerator%":Xt,"%AsyncGeneratorFunction%":Xt,"%AsyncIteratorPrototype%":Xt,"%Atomics%":typeof Atomics>"u"?ne:Atomics,"%BigInt%":typeof BigInt>"u"?ne:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ne:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ne:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ne:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ne:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ne:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ne:FinalizationRegistry,"%Function%":Yl,"%GeneratorFunction%":Xt,"%Int8Array%":typeof Int8Array>"u"?ne:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ne:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ne:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Zt&&Ee?Ee(Ee([][Symbol.iterator]())):ne,"%JSON%":typeof JSON=="object"?JSON:ne,"%Map%":typeof Map>"u"?ne:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Zt||!Ee?ne:Ee(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ne:Promise,"%Proxy%":typeof Proxy>"u"?ne:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ne:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ne:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Zt||!Ee?ne:Ee(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ne:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Zt&&Ee?Ee(""[Symbol.iterator]()):ne,"%Symbol%":Zt?Symbol:ne,"%SyntaxError%":dn,"%ThrowTypeError%":sy,"%TypedArray%":iy,"%TypeError%":cn,"%Uint8Array%":typeof Uint8Array>"u"?ne:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ne:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ne:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ne:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ne:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ne:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ne:WeakSet};if(Ee)try{null.error}catch(e){var oy=Ee(Ee(e));Dt["%Error.prototype%"]=oy}var ly=function e(t){var n;if(t==="%AsyncFunction%")n=$a("async function () {}");else if(t==="%GeneratorFunction%")n=$a("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=$a("async function* () {}");else if(t==="%AsyncGenerator%"){var s=e("%AsyncGeneratorFunction%");s&&(n=s.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=e("%AsyncGenerator%");a&&Ee&&(n=Ee(a.prototype))}return Dt[t]=n,n},Vi={"%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"]},xn=Ql,aa=ay,cy=xn.call(Function.call,Array.prototype.concat),uy=xn.call(Function.apply,Array.prototype.splice),ji=xn.call(Function.call,String.prototype.replace),sa=xn.call(Function.call,String.prototype.slice),my=xn.call(Function.call,RegExp.prototype.exec),dy=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,py=/\\(\\)?/g,fy=function(e){var t=sa(e,0,1),n=sa(e,-1);if(t==="%"&&n!=="%")throw new dn("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new dn("invalid intrinsic syntax, expected opening `%`");var s=[];return ji(e,dy,function(a,o,u,c){s[s.length]=u?ji(c,py,"$1"):o||a}),s},hy=function(e,t){var n=e,s;if(aa(Vi,n)&&(s=Vi[n],n="%"+s[0]+"%"),aa(Dt,n)){var a=Dt[n];if(a===Xt&&(a=ly(n)),typeof a>"u"&&!t)throw new cn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:s,name:n,value:a}}throw new dn("intrinsic "+e+" does not exist!")},yn=function(e,t){if(typeof e!="string"||e.length===0)throw new cn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new cn('"allowMissing" argument must be a boolean');if(my(/^%?[^%]*%?$/,e)===null)throw new dn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=fy(e),s=n.length>0?n[0]:"",a=hy("%"+s+"%",t),o=a.name,u=a.value,c=!1,d=a.alias;d&&(s=d[0],uy(n,cy([0,1],d)));for(var f=1,g=!0;f<n.length;f+=1){var T=n[f],y=sa(T,0,1),b=sa(T,-1);if((y==='"'||y==="'"||y==="`"||b==='"'||b==="'"||b==="`")&&y!==b)throw new dn("property names with quotes must have matching quotes");if((T==="constructor"||!g)&&(c=!0),s+="."+T,o="%"+s+"%",aa(Dt,o))u=Dt[o];else if(u!=null){if(!(T in u)){if(!t)throw new cn("base intrinsic for "+e+" exists, but the property is not available.");return}if(Ft&&f+1>=n.length){var R=Ft(u,T);g=!!R,g&&"get"in R&&!("originalValue"in R.get)?u=R.get:u=u[T]}else g=aa(u,T),u=u[T];g&&!c&&(Dt[o]=u)}}return u},Kl={exports:{}},gy=yn,Ss=gy("%Object.defineProperty%",!0),Es=function(){if(Ss)try{return Ss({},"a",{value:1}),!0}catch{return!1}return!1};Es.hasArrayLengthDefineBug=function(){if(!Es())return null;try{return Ss([],"length",{value:1}).length!==1}catch{return!0}};var Wl=Es,yy=yn,Qn=yy("%Object.getOwnPropertyDescriptor%",!0);if(Qn)try{Qn([],"length")}catch{Qn=null}var lr=Qn,Ty=Wl(),cr=yn,Rn=Ty&&cr("%Object.defineProperty%",!0);if(Rn)try{Rn({},"a",{value:1})}catch{Rn=!1}var ky=cr("%SyntaxError%"),Jt=cr("%TypeError%"),Gi=lr,by=function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Jt("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Jt("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Jt("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Jt("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Jt("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Jt("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,c=!!Gi&&Gi(e,t);if(Rn)Rn(e,t,{configurable:o===null&&c?c.configurable:!o,enumerable:s===null&&c?c.enumerable:!s,value:n,writable:a===null&&c?c.writable:!a});else if(u||!s&&!a&&!o)e[t]=n;else throw new ky("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Zl=yn,qi=by,Sy=Wl(),$i=lr,Hi=Zl("%TypeError%"),Ey=Zl("%Math.floor%"),vy=function(e,t){if(typeof e!="function")throw new Hi("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||Ey(t)!==t)throw new Hi("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],s=!0,a=!0;if("length"in e&&$i){var o=$i(e,"length");o&&!o.configurable&&(s=!1),o&&!o.writable&&(a=!1)}return(s||a||!n)&&(Sy?qi(e,"length",t,!0,!0):qi(e,"length",t)),e};(function(e){var t=Ql,n=yn,s=vy,a=n("%TypeError%"),o=n("%Function.prototype.apply%"),u=n("%Function.prototype.call%"),c=n("%Reflect.apply%",!0)||t.call(u,o),d=n("%Object.defineProperty%",!0),f=n("%Math.max%");if(d)try{d({},"a",{value:1})}catch{d=null}e.exports=function(T){if(typeof T!="function")throw new a("a function is required");var y=c(t,u,arguments);return s(y,1+f(0,T.length-(arguments.length-1)),!0)};var g=function(){return c(t,o,arguments)};d?d(e.exports,"apply",{value:g}):e.exports.apply=g})(Kl);var Jl=Kl.exports,Xl=yn,ec=Jl,_y=ec(Xl("String.prototype.indexOf")),tc=function(e,t){var n=Xl(e,!!t);return typeof n=="function"&&_y(e,".prototype.")>-1?ec(n):n},wy=or(),Cy=tc,vs=Cy("Object.prototype.toString"),va=function(e){return wy&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:vs(e)==="[object Arguments]"},nc=function(e){return va(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&vs(e)!=="[object Array]"&&vs(e.callee)==="[object Function]"},Ry=function(){return va(arguments)}();va.isLegacyArguments=nc;var Ay=Ry?va:nc,Iy=Object.prototype.toString,Ny=Function.prototype.toString,Ly=/^\s*(?:function)?\*/,ac=or(),za=Object.getPrototypeOf,Oy=function(){if(!ac)return!1;try{return Function("return function*() {}")()}catch{}},Qa,My=function(e){if(typeof e!="function")return!1;if(Ly.test(Ny.call(e)))return!0;if(!ac){var t=Iy.call(e);return t==="[object GeneratorFunction]"}if(!za)return!1;if(typeof Qa>"u"){var n=Oy();Qa=n?za(n):!1}return za(e)===Qa},sc=Function.prototype.toString,nn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,_s,Yn;if(typeof nn=="function"&&typeof Object.defineProperty=="function")try{_s=Object.defineProperty({},"length",{get:function(){throw Yn}}),Yn={},nn(function(){throw 42},null,_s)}catch(e){e!==Yn&&(nn=null)}else nn=null;var xy=/^\s*class\b/,ws=function(e){try{var t=sc.call(e);return xy.test(t)}catch{return!1}},Ya=function(e){try{return ws(e)?!1:(sc.call(e),!0)}catch{return!1}},Kn=Object.prototype.toString,By="[object Object]",Py="[object Function]",Uy="[object GeneratorFunction]",Fy="[object HTMLAllCollection]",Dy="[object HTML document.all class]",Vy="[object HTMLCollection]",jy=typeof Symbol=="function"&&!!Symbol.toStringTag,Gy=!(0 in[,]),Cs=function(){return!1};if(typeof document=="object"){var qy=document.all;Kn.call(qy)===Kn.call(document.all)&&(Cs=function(e){if((Gy||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=Kn.call(e);return(t===Fy||t===Dy||t===Vy||t===By)&&e("")==null}catch{}return!1})}var $y=nn?function(e){if(Cs(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{nn(e,null,_s)}catch(t){if(t!==Yn)return!1}return!ws(e)&&Ya(e)}:function(e){if(Cs(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(jy)return Ya(e);if(ws(e))return!1;var t=Kn.call(e);return t!==Py&&t!==Uy&&!/^\[object HTML/.test(t)?!1:Ya(e)},Hy=$y,zy=Object.prototype.toString,rc=Object.prototype.hasOwnProperty,Qy=function(e,t,n){for(var s=0,a=e.length;s<a;s++)rc.call(e,s)&&(n==null?t(e[s],s,e):t.call(n,e[s],s,e))},Yy=function(e,t,n){for(var s=0,a=e.length;s<a;s++)n==null?t(e.charAt(s),s,e):t.call(n,e.charAt(s),s,e)},Ky=function(e,t,n){for(var s in e)rc.call(e,s)&&(n==null?t(e[s],s,e):t.call(n,e[s],s,e))},Wy=function(e,t,n){if(!Hy(t))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=n),zy.call(e)==="[object Array]"?Qy(e,t,s):typeof e=="string"?Yy(e,t,s):Ky(e,t,s)},Zy=Wy,Ka=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],Jy=typeof globalThis>"u"?vl:globalThis,Xy=function(){for(var e=[],t=0;t<Ka.length;t++)typeof Jy[Ka[t]]=="function"&&(e[e.length]=Ka[t]);return e},ra=Zy,e4=Xy,zi=Jl,ur=tc,Wn=lr,t4=ur("Object.prototype.toString"),ic=or(),Qi=typeof globalThis>"u"?vl:globalThis,Rs=e4(),mr=ur("String.prototype.slice"),Wa=Object.getPrototypeOf,n4=ur("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},ia={__proto__:null};ic&&Wn&&Wa?ra(Rs,function(e){var t=new Qi[e];if(Symbol.toStringTag in t){var n=Wa(t),s=Wn(n,Symbol.toStringTag);if(!s){var a=Wa(n);s=Wn(a,Symbol.toStringTag)}ia["$"+e]=zi(s.get)}}):ra(Rs,function(e){var t=new Qi[e],n=t.slice||t.set;n&&(ia["$"+e]=zi(n))});var a4=function(e){var t=!1;return ra(ia,function(n,s){if(!t)try{"$"+n(e)===s&&(t=mr(s,1))}catch{}}),t},s4=function(e){var t=!1;return ra(ia,function(n,s){if(!t)try{n(e),t=mr(s,1)}catch{}}),t},oc=function(e){if(!e||typeof e!="object")return!1;if(!ic){var t=mr(t4(e),8,-1);return n4(Rs,t)>-1?t:t!=="Object"?!1:s4(e)}return Wn?a4(e):null},r4=oc,i4=function(e){return!!r4(e)};(function(e){var t=Ay,n=My,s=oc,a=i4;function o(x){return x.call.bind(x)}var u=typeof BigInt<"u",c=typeof Symbol<"u",d=o(Object.prototype.toString),f=o(Number.prototype.valueOf),g=o(String.prototype.valueOf),T=o(Boolean.prototype.valueOf);if(u)var y=o(BigInt.prototype.valueOf);if(c)var b=o(Symbol.prototype.valueOf);function R(x,Rt){if(typeof x!="object")return!1;try{return Rt(x),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=a;function A(x){return typeof Promise<"u"&&x instanceof Promise||x!==null&&typeof x=="object"&&typeof x.then=="function"&&typeof x.catch=="function"}e.isPromise=A;function N(x){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(x):a(x)||O(x)}e.isArrayBufferView=N;function _(x){return s(x)==="Uint8Array"}e.isUint8Array=_;function I(x){return s(x)==="Uint8ClampedArray"}e.isUint8ClampedArray=I;function P(x){return s(x)==="Uint16Array"}e.isUint16Array=P;function U(x){return s(x)==="Uint32Array"}e.isUint32Array=U;function B(x){return s(x)==="Int8Array"}e.isInt8Array=B;function V(x){return s(x)==="Int16Array"}e.isInt16Array=V;function D(x){return s(x)==="Int32Array"}e.isInt32Array=D;function $(x){return s(x)==="Float32Array"}e.isFloat32Array=$;function ee(x){return s(x)==="Float64Array"}e.isFloat64Array=ee;function ue(x){return s(x)==="BigInt64Array"}e.isBigInt64Array=ue;function ce(x){return s(x)==="BigUint64Array"}e.isBigUint64Array=ce;function ke(x){return d(x)==="[object Map]"}ke.working=typeof Map<"u"&&ke(new Map);function de(x){return typeof Map>"u"?!1:ke.working?ke(x):x instanceof Map}e.isMap=de;function se(x){return d(x)==="[object Set]"}se.working=typeof Set<"u"&&se(new Set);function pe(x){return typeof Set>"u"?!1:se.working?se(x):x instanceof Set}e.isSet=pe;function De(x){return d(x)==="[object WeakMap]"}De.working=typeof WeakMap<"u"&&De(new WeakMap);function rt(x){return typeof WeakMap>"u"?!1:De.working?De(x):x instanceof WeakMap}e.isWeakMap=rt;function je(x){return d(x)==="[object WeakSet]"}je.working=typeof WeakSet<"u"&&je(new WeakSet);function Ce(x){return je(x)}e.isWeakSet=Ce;function Re(x){return d(x)==="[object ArrayBuffer]"}Re.working=typeof ArrayBuffer<"u"&&Re(new ArrayBuffer);function q(x){return typeof ArrayBuffer>"u"?!1:Re.working?Re(x):x instanceof ArrayBuffer}e.isArrayBuffer=q;function v(x){return d(x)==="[object DataView]"}v.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&v(new DataView(new ArrayBuffer(1),0,1));function O(x){return typeof DataView>"u"?!1:v.working?v(x):x instanceof DataView}e.isDataView=O;var F=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function H(x){return d(x)==="[object SharedArrayBuffer]"}function ie(x){return typeof F>"u"?!1:(typeof H.working>"u"&&(H.working=H(new F)),H.working?H(x):x instanceof F)}e.isSharedArrayBuffer=ie;function te(x){return d(x)==="[object AsyncFunction]"}e.isAsyncFunction=te;function z(x){return d(x)==="[object Map Iterator]"}e.isMapIterator=z;function X(x){return d(x)==="[object Set Iterator]"}e.isSetIterator=X;function ae(x){return d(x)==="[object Generator]"}e.isGeneratorObject=ae;function xe(x){return d(x)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=xe;function Ve(x){return R(x,f)}e.isNumberObject=Ve;function be(x){return R(x,g)}e.isStringObject=be;function Se(x){return R(x,T)}e.isBooleanObject=Se;function kt(x){return u&&R(x,y)}e.isBigIntObject=kt;function qt(x){return c&&R(x,b)}e.isSymbolObject=qt;function it(x){return Ve(x)||be(x)||Se(x)||kt(x)||qt(x)}e.isBoxedPrimitive=it;function kn(x){return typeof Uint8Array<"u"&&(q(x)||ie(x))}e.isAnyArrayBuffer=kn,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(x){Object.defineProperty(e,x,{enumerable:!1,value:function(){throw new Error(x+" is not supported in userland")}})})})(Hl);var o4=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},As={exports:{}};typeof Object.create=="function"?As.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:As.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var l4=As.exports;(function(e){var t=Object.getOwnPropertyDescriptors||function(v){for(var O=Object.keys(v),F={},H=0;H<O.length;H++)F[O[H]]=Object.getOwnPropertyDescriptor(v,O[H]);return F},n=/%[sdj%]/g;e.format=function(v){if(!B(v)){for(var O=[],F=0;F<arguments.length;F++)O.push(u(arguments[F]));return O.join(" ")}for(var F=1,H=arguments,ie=H.length,te=String(v).replace(n,function(ae){if(ae==="%%")return"%";if(F>=ie)return ae;switch(ae){case"%s":return String(H[F++]);case"%d":return Number(H[F++]);case"%j":try{return JSON.stringify(H[F++])}catch{return"[Circular]"}default:return ae}}),z=H[F];F<ie;z=H[++F])I(z)||!ee(z)?te+=" "+z:te+=" "+u(z);return te},e.deprecate=function(v,O){if(typeof W.process<"u"&&W.process.noDeprecation===!0)return v;if(typeof W.process>"u")return function(){return e.deprecate(v,O).apply(this,arguments)};var F=!1;function H(){if(!F){if(W.process.throwDeprecation)throw new Error(O);W.process.traceDeprecation?console.trace(O):console.error(O),F=!0}return v.apply(this,arguments)}return H};var s={},a=/^$/;if(W.process.env.NODE_DEBUG){var o=W.process.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+o+"$","i")}e.debuglog=function(v){if(v=v.toUpperCase(),!s[v])if(a.test(v)){var O=W.process.pid;s[v]=function(){var F=e.format.apply(e,arguments);console.error("%s %d: %s",v,O,F)}}else s[v]=function(){};return s[v]};function u(v,O){var F={seen:[],stylize:d};return arguments.length>=3&&(F.depth=arguments[2]),arguments.length>=4&&(F.colors=arguments[3]),_(O)?F.showHidden=O:O&&e._extend(F,O),D(F.showHidden)&&(F.showHidden=!1),D(F.depth)&&(F.depth=2),D(F.colors)&&(F.colors=!1),D(F.customInspect)&&(F.customInspect=!0),F.colors&&(F.stylize=c),g(F,v,F.depth)}e.inspect=u,u.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]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function c(v,O){var F=u.styles[O];return F?"\x1B["+u.colors[F][0]+"m"+v+"\x1B["+u.colors[F][1]+"m":v}function d(v,O){return v}function f(v){var O={};return v.forEach(function(F,H){O[F]=!0}),O}function g(v,O,F){if(v.customInspect&&O&&ke(O.inspect)&&O.inspect!==e.inspect&&!(O.constructor&&O.constructor.prototype===O)){var H=O.inspect(F,v);return B(H)||(H=g(v,H,F)),H}var ie=T(v,O);if(ie)return ie;var te=Object.keys(O),z=f(te);if(v.showHidden&&(te=Object.getOwnPropertyNames(O)),ce(O)&&(te.indexOf("message")>=0||te.indexOf("description")>=0))return y(O);if(te.length===0){if(ke(O)){var X=O.name?": "+O.name:"";return v.stylize("[Function"+X+"]","special")}if($(O))return v.stylize(RegExp.prototype.toString.call(O),"regexp");if(ue(O))return v.stylize(Date.prototype.toString.call(O),"date");if(ce(O))return y(O)}var ae="",xe=!1,Ve=["{","}"];if(N(O)&&(xe=!0,Ve=["[","]"]),ke(O)){var be=O.name?": "+O.name:"";ae=" [Function"+be+"]"}if($(O)&&(ae=" "+RegExp.prototype.toString.call(O)),ue(O)&&(ae=" "+Date.prototype.toUTCString.call(O)),ce(O)&&(ae=" "+y(O)),te.length===0&&(!xe||O.length==0))return Ve[0]+ae+Ve[1];if(F<0)return $(O)?v.stylize(RegExp.prototype.toString.call(O),"regexp"):v.stylize("[Object]","special");v.seen.push(O);var Se;return xe?Se=b(v,O,F,z,te):Se=te.map(function(kt){return R(v,O,F,z,kt,xe)}),v.seen.pop(),A(Se,ae,Ve)}function T(v,O){if(D(O))return v.stylize("undefined","undefined");if(B(O)){var F="'"+JSON.stringify(O).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return v.stylize(F,"string")}if(U(O))return v.stylize(""+O,"number");if(_(O))return v.stylize(""+O,"boolean");if(I(O))return v.stylize("null","null")}function y(v){return"["+Error.prototype.toString.call(v)+"]"}function b(v,O,F,H,ie){for(var te=[],z=0,X=O.length;z<X;++z)je(O,String(z))?te.push(R(v,O,F,H,String(z),!0)):te.push("");return ie.forEach(function(ae){ae.match(/^\d+$/)||te.push(R(v,O,F,H,ae,!0))}),te}function R(v,O,F,H,ie,te){var z,X,ae;if(ae=Object.getOwnPropertyDescriptor(O,ie)||{value:O[ie]},ae.get?ae.set?X=v.stylize("[Getter/Setter]","special"):X=v.stylize("[Getter]","special"):ae.set&&(X=v.stylize("[Setter]","special")),je(H,ie)||(z="["+ie+"]"),X||(v.seen.indexOf(ae.value)<0?(I(F)?X=g(v,ae.value,null):X=g(v,ae.value,F-1),X.indexOf(`
|
|
16
|
+
*/(function(e){const t=ka,n=Xs,s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=I,e.INSPECT_MAX_BYTES=50;const a=2147483647;e.kMaxLength=a,c.TYPED_ARRAY_SUPPORT=o(),!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 o(){try{const i=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(i,r),i.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 u(i){if(i>a)throw new RangeError('The value "'+i+'" is invalid for option "size"');const r=new Uint8Array(i);return Object.setPrototypeOf(r,c.prototype),r}function c(i,r,l){if(typeof i=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return T(i)}return d(i,r,l)}c.poolSize=8192;function d(i,r,l){if(typeof i=="string")return y(i,r);if(ArrayBuffer.isView(i))return R(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(fe(i,ArrayBuffer)||i&&fe(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(fe(i,SharedArrayBuffer)||i&&fe(i.buffer,SharedArrayBuffer)))return A(i,r,l);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const p=i.valueOf&&i.valueOf();if(p!=null&&p!==i)return c.from(p,r,l);const h=N(i);if(h)return h;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return c.from(i[Symbol.toPrimitive]("string"),r,l);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}c.from=function(i,r,l){return d(i,r,l)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function f(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function g(i,r,l){return f(i),i<=0?u(i):r!==void 0?typeof l=="string"?u(i).fill(r,l):u(i).fill(r):u(i)}c.alloc=function(i,r,l){return g(i,r,l)};function T(i){return f(i),u(i<0?0:_(i)|0)}c.allocUnsafe=function(i){return T(i)},c.allocUnsafeSlow=function(i){return T(i)};function y(i,r){if((typeof r!="string"||r==="")&&(r="utf8"),!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);const l=P(i,r)|0;let p=u(l);const h=p.write(i,r);return h!==l&&(p=p.slice(0,h)),p}function b(i){const r=i.length<0?0:_(i.length)|0,l=u(r);for(let p=0;p<r;p+=1)l[p]=i[p]&255;return l}function R(i){if(fe(i,Uint8Array)){const r=new Uint8Array(i);return A(r.buffer,r.byteOffset,r.byteLength)}return b(i)}function A(i,r,l){if(r<0||i.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<r+(l||0))throw new RangeError('"length" is outside of buffer bounds');let p;return r===void 0&&l===void 0?p=new Uint8Array(i):l===void 0?p=new Uint8Array(i,r):p=new Uint8Array(i,r,l),Object.setPrototypeOf(p,c.prototype),p}function N(i){if(c.isBuffer(i)){const r=_(i.length)|0,l=u(r);return l.length===0||i.copy(l,0,0,r),l}if(i.length!==void 0)return typeof i.length!="number"||At(i.length)?u(0):b(i);if(i.type==="Buffer"&&Array.isArray(i.data))return b(i.data)}function _(i){if(i>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return i|0}function I(i){return+i!=i&&(i=0),c.alloc(+i)}c.isBuffer=function(i){return i!=null&&i._isBuffer===!0&&i!==c.prototype},c.compare=function(i,r){if(fe(i,Uint8Array)&&(i=c.from(i,i.offset,i.byteLength)),fe(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),!c.isBuffer(i)||!c.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(i===r)return 0;let l=i.length,p=r.length;for(let h=0,k=Math.min(l,p);h<k;++h)if(i[h]!==r[h]){l=i[h],p=r[h];break}return l<p?-1:p<l?1:0},c.isEncoding=function(i){switch(String(i).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(i,r){if(!Array.isArray(i))throw new TypeError('"list" argument must be an Array of Buffers');if(i.length===0)return c.alloc(0);let l;if(r===void 0)for(r=0,l=0;l<i.length;++l)r+=i[l].length;const p=c.allocUnsafe(r);let h=0;for(l=0;l<i.length;++l){let k=i[l];if(fe(k,Uint8Array))h+k.length>p.length?(c.isBuffer(k)||(k=c.from(k)),k.copy(p,h)):Uint8Array.prototype.set.call(p,k,h);else if(c.isBuffer(k))k.copy(p,h);else throw new TypeError('"list" argument must be an Array of Buffers');h+=k.length}return p};function P(i,r){if(c.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||fe(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const l=i.length,p=arguments.length>2&&arguments[2]===!0;if(!p&&l===0)return 0;let h=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return l;case"utf8":case"utf-8":return it(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l*2;case"hex":return l>>>1;case"base64":return Rt(i).length;default:if(h)return p?-1:it(i).length;r=(""+r).toLowerCase(),h=!0}}c.byteLength=P;function U(i,r,l){let p=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((l===void 0||l>this.length)&&(l=this.length),l<=0)||(l>>>=0,r>>>=0,l<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return Ce(this,r,l);case"utf8":case"utf-8":return se(this,r,l);case"ascii":return rt(this,r,l);case"latin1":case"binary":return je(this,r,l);case"base64":return de(this,r,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Re(this,r,l);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),p=!0}}c.prototype._isBuffer=!0;function B(i,r,l){const p=i[r];i[r]=i[l],i[l]=p}c.prototype.swap16=function(){const i=this.length;if(i%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<i;r+=2)B(this,r,r+1);return this},c.prototype.swap32=function(){const i=this.length;if(i%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<i;r+=4)B(this,r,r+3),B(this,r+1,r+2);return this},c.prototype.swap64=function(){const i=this.length;if(i%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<i;r+=8)B(this,r,r+7),B(this,r+1,r+6),B(this,r+2,r+5),B(this,r+3,r+4);return this},c.prototype.toString=function(){const i=this.length;return i===0?"":arguments.length===0?se(this,0,i):U.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(i){if(!c.isBuffer(i))throw new TypeError("Argument must be a Buffer");return this===i?!0:c.compare(this,i)===0},c.prototype.inspect=function(){let i="";const r=e.INSPECT_MAX_BYTES;return i=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(i+=" ... "),"<Buffer "+i+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(i,r,l,p,h){if(fe(i,Uint8Array)&&(i=c.from(i,i.offset,i.byteLength)),!c.isBuffer(i))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof i);if(r===void 0&&(r=0),l===void 0&&(l=i?i.length:0),p===void 0&&(p=0),h===void 0&&(h=this.length),r<0||l>i.length||p<0||h>this.length)throw new RangeError("out of range index");if(p>=h&&r>=l)return 0;if(p>=h)return-1;if(r>=l)return 1;if(r>>>=0,l>>>=0,p>>>=0,h>>>=0,this===i)return 0;let k=h-p,E=l-r;const j=Math.min(k,E),J=this.slice(p,h),Q=i.slice(r,l);for(let Y=0;Y<j;++Y)if(J[Y]!==Q[Y]){k=J[Y],E=Q[Y];break}return k<E?-1:E<k?1:0};function V(i,r,l,p,h){if(i.length===0)return-1;if(typeof l=="string"?(p=l,l=0):l>2147483647?l=2147483647:l<-2147483648&&(l=-2147483648),l=+l,At(l)&&(l=h?0:i.length-1),l<0&&(l=i.length+l),l>=i.length){if(h)return-1;l=i.length-1}else if(l<0)if(h)l=0;else return-1;if(typeof r=="string"&&(r=c.from(r,p)),c.isBuffer(r))return r.length===0?-1:D(i,r,l,p,h);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?h?Uint8Array.prototype.indexOf.call(i,r,l):Uint8Array.prototype.lastIndexOf.call(i,r,l):D(i,[r],l,p,h);throw new TypeError("val must be string, number or Buffer")}function D(i,r,l,p,h){let k=1,E=i.length,j=r.length;if(p!==void 0&&(p=String(p).toLowerCase(),p==="ucs2"||p==="ucs-2"||p==="utf16le"||p==="utf-16le")){if(i.length<2||r.length<2)return-1;k=2,E/=2,j/=2,l/=2}function J(Y,K){return k===1?Y[K]:Y.readUInt16BE(K*k)}let Q;if(h){let Y=-1;for(Q=l;Q<E;Q++)if(J(i,Q)===J(r,Y===-1?0:Q-Y)){if(Y===-1&&(Y=Q),Q-Y+1===j)return Y*k}else Y!==-1&&(Q-=Q-Y),Y=-1}else for(l+j>E&&(l=E-j),Q=l;Q>=0;Q--){let Y=!0;for(let K=0;K<j;K++)if(J(i,Q+K)!==J(r,K)){Y=!1;break}if(Y)return Q}return-1}c.prototype.includes=function(i,r,l){return this.indexOf(i,r,l)!==-1},c.prototype.indexOf=function(i,r,l){return V(this,i,r,l,!0)},c.prototype.lastIndexOf=function(i,r,l){return V(this,i,r,l,!1)};function $(i,r,l,p){l=Number(l)||0;const h=i.length-l;p?(p=Number(p),p>h&&(p=h)):p=h;const k=r.length;p>k/2&&(p=k/2);let E;for(E=0;E<p;++E){const j=parseInt(r.substr(E*2,2),16);if(At(j))return E;i[l+E]=j}return E}function ee(i,r,l,p){return ot(it(r,i.length-l),i,l,p)}function ue(i,r,l,p){return ot(kn(r),i,l,p)}function ce(i,r,l,p){return ot(Rt(r),i,l,p)}function ke(i,r,l,p){return ot(x(r,i.length-l),i,l,p)}c.prototype.write=function(i,r,l,p){if(r===void 0)p="utf8",l=this.length,r=0;else if(l===void 0&&typeof r=="string")p=r,l=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(l)?(l=l>>>0,p===void 0&&(p="utf8")):(p=l,l=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const h=this.length-r;if((l===void 0||l>h)&&(l=h),i.length>0&&(l<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");p||(p="utf8");let k=!1;for(;;)switch(p){case"hex":return $(this,i,r,l);case"utf8":case"utf-8":return ee(this,i,r,l);case"ascii":case"latin1":case"binary":return ue(this,i,r,l);case"base64":return ce(this,i,r,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ke(this,i,r,l);default:if(k)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),k=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function de(i,r,l){return r===0&&l===i.length?t.fromByteArray(i):t.fromByteArray(i.slice(r,l))}function se(i,r,l){l=Math.min(i.length,l);const p=[];let h=r;for(;h<l;){const k=i[h];let E=null,j=k>239?4:k>223?3:k>191?2:1;if(h+j<=l){let J,Q,Y,K;switch(j){case 1:k<128&&(E=k);break;case 2:J=i[h+1],(J&192)===128&&(K=(k&31)<<6|J&63,K>127&&(E=K));break;case 3:J=i[h+1],Q=i[h+2],(J&192)===128&&(Q&192)===128&&(K=(k&15)<<12|(J&63)<<6|Q&63,K>2047&&(K<55296||K>57343)&&(E=K));break;case 4:J=i[h+1],Q=i[h+2],Y=i[h+3],(J&192)===128&&(Q&192)===128&&(Y&192)===128&&(K=(k&15)<<18|(J&63)<<12|(Q&63)<<6|Y&63,K>65535&&K<1114112&&(E=K))}}E===null?(E=65533,j=1):E>65535&&(E-=65536,p.push(E>>>10&1023|55296),E=56320|E&1023),p.push(E),h+=j}return De(p)}const pe=4096;function De(i){const r=i.length;if(r<=pe)return String.fromCharCode.apply(String,i);let l="",p=0;for(;p<r;)l+=String.fromCharCode.apply(String,i.slice(p,p+=pe));return l}function rt(i,r,l){let p="";l=Math.min(i.length,l);for(let h=r;h<l;++h)p+=String.fromCharCode(i[h]&127);return p}function je(i,r,l){let p="";l=Math.min(i.length,l);for(let h=r;h<l;++h)p+=String.fromCharCode(i[h]);return p}function Ce(i,r,l){const p=i.length;(!r||r<0)&&(r=0),(!l||l<0||l>p)&&(l=p);let h="";for(let k=r;k<l;++k)h+=_a[i[k]];return h}function Re(i,r,l){const p=i.slice(r,l);let h="";for(let k=0;k<p.length-1;k+=2)h+=String.fromCharCode(p[k]+p[k+1]*256);return h}c.prototype.slice=function(i,r){const l=this.length;i=~~i,r=r===void 0?l:~~r,i<0?(i+=l,i<0&&(i=0)):i>l&&(i=l),r<0?(r+=l,r<0&&(r=0)):r>l&&(r=l),r<i&&(r=i);const p=this.subarray(i,r);return Object.setPrototypeOf(p,c.prototype),p};function q(i,r,l){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>l)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(i,r,l){i=i>>>0,r=r>>>0,l||q(i,r,this.length);let p=this[i],h=1,k=0;for(;++k<r&&(h*=256);)p+=this[i+k]*h;return p},c.prototype.readUintBE=c.prototype.readUIntBE=function(i,r,l){i=i>>>0,r=r>>>0,l||q(i,r,this.length);let p=this[i+--r],h=1;for(;r>0&&(h*=256);)p+=this[i+--r]*h;return p},c.prototype.readUint8=c.prototype.readUInt8=function(i,r){return i=i>>>0,r||q(i,1,this.length),this[i]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(i,r){return i=i>>>0,r||q(i,2,this.length),this[i]|this[i+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(i,r){return i=i>>>0,r||q(i,2,this.length),this[i]<<8|this[i+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(i,r){return i=i>>>0,r||q(i,4,this.length),(this[i]|this[i+1]<<8|this[i+2]<<16)+this[i+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(i,r){return i=i>>>0,r||q(i,4,this.length),this[i]*16777216+(this[i+1]<<16|this[i+2]<<8|this[i+3])},c.prototype.readBigUInt64LE=Ae(function(i){i=i>>>0,be(i,"offset");const r=this[i],l=this[i+7];(r===void 0||l===void 0)&&Se(i,this.length-8);const p=r+this[++i]*2**8+this[++i]*2**16+this[++i]*2**24,h=this[++i]+this[++i]*2**8+this[++i]*2**16+l*2**24;return BigInt(p)+(BigInt(h)<<BigInt(32))}),c.prototype.readBigUInt64BE=Ae(function(i){i=i>>>0,be(i,"offset");const r=this[i],l=this[i+7];(r===void 0||l===void 0)&&Se(i,this.length-8);const p=r*2**24+this[++i]*2**16+this[++i]*2**8+this[++i],h=this[++i]*2**24+this[++i]*2**16+this[++i]*2**8+l;return(BigInt(p)<<BigInt(32))+BigInt(h)}),c.prototype.readIntLE=function(i,r,l){i=i>>>0,r=r>>>0,l||q(i,r,this.length);let p=this[i],h=1,k=0;for(;++k<r&&(h*=256);)p+=this[i+k]*h;return h*=128,p>=h&&(p-=Math.pow(2,8*r)),p},c.prototype.readIntBE=function(i,r,l){i=i>>>0,r=r>>>0,l||q(i,r,this.length);let p=r,h=1,k=this[i+--p];for(;p>0&&(h*=256);)k+=this[i+--p]*h;return h*=128,k>=h&&(k-=Math.pow(2,8*r)),k},c.prototype.readInt8=function(i,r){return i=i>>>0,r||q(i,1,this.length),this[i]&128?(255-this[i]+1)*-1:this[i]},c.prototype.readInt16LE=function(i,r){i=i>>>0,r||q(i,2,this.length);const l=this[i]|this[i+1]<<8;return l&32768?l|4294901760:l},c.prototype.readInt16BE=function(i,r){i=i>>>0,r||q(i,2,this.length);const l=this[i+1]|this[i]<<8;return l&32768?l|4294901760:l},c.prototype.readInt32LE=function(i,r){return i=i>>>0,r||q(i,4,this.length),this[i]|this[i+1]<<8|this[i+2]<<16|this[i+3]<<24},c.prototype.readInt32BE=function(i,r){return i=i>>>0,r||q(i,4,this.length),this[i]<<24|this[i+1]<<16|this[i+2]<<8|this[i+3]},c.prototype.readBigInt64LE=Ae(function(i){i=i>>>0,be(i,"offset");const r=this[i],l=this[i+7];(r===void 0||l===void 0)&&Se(i,this.length-8);const p=this[i+4]+this[i+5]*2**8+this[i+6]*2**16+(l<<24);return(BigInt(p)<<BigInt(32))+BigInt(r+this[++i]*2**8+this[++i]*2**16+this[++i]*2**24)}),c.prototype.readBigInt64BE=Ae(function(i){i=i>>>0,be(i,"offset");const r=this[i],l=this[i+7];(r===void 0||l===void 0)&&Se(i,this.length-8);const p=(r<<24)+this[++i]*2**16+this[++i]*2**8+this[++i];return(BigInt(p)<<BigInt(32))+BigInt(this[++i]*2**24+this[++i]*2**16+this[++i]*2**8+l)}),c.prototype.readFloatLE=function(i,r){return i=i>>>0,r||q(i,4,this.length),n.read(this,i,!0,23,4)},c.prototype.readFloatBE=function(i,r){return i=i>>>0,r||q(i,4,this.length),n.read(this,i,!1,23,4)},c.prototype.readDoubleLE=function(i,r){return i=i>>>0,r||q(i,8,this.length),n.read(this,i,!0,52,8)},c.prototype.readDoubleBE=function(i,r){return i=i>>>0,r||q(i,8,this.length),n.read(this,i,!1,52,8)};function v(i,r,l,p,h,k){if(!c.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>h||r<k)throw new RangeError('"value" argument is out of bounds');if(l+p>i.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(i,r,l,p){if(i=+i,r=r>>>0,l=l>>>0,!p){const E=Math.pow(2,8*l)-1;v(this,i,r,l,E,0)}let h=1,k=0;for(this[r]=i&255;++k<l&&(h*=256);)this[r+k]=i/h&255;return r+l},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(i,r,l,p){if(i=+i,r=r>>>0,l=l>>>0,!p){const E=Math.pow(2,8*l)-1;v(this,i,r,l,E,0)}let h=l-1,k=1;for(this[r+h]=i&255;--h>=0&&(k*=256);)this[r+h]=i/k&255;return r+l},c.prototype.writeUint8=c.prototype.writeUInt8=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,1,255,0),this[r]=i&255,r+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,2,65535,0),this[r]=i&255,this[r+1]=i>>>8,r+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,2,65535,0),this[r]=i>>>8,this[r+1]=i&255,r+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,4,4294967295,0),this[r+3]=i>>>24,this[r+2]=i>>>16,this[r+1]=i>>>8,this[r]=i&255,r+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,4,4294967295,0),this[r]=i>>>24,this[r+1]=i>>>16,this[r+2]=i>>>8,this[r+3]=i&255,r+4};function O(i,r,l,p,h){Ve(r,p,h,i,l,7);let k=Number(r&BigInt(4294967295));i[l++]=k,k=k>>8,i[l++]=k,k=k>>8,i[l++]=k,k=k>>8,i[l++]=k;let E=Number(r>>BigInt(32)&BigInt(4294967295));return i[l++]=E,E=E>>8,i[l++]=E,E=E>>8,i[l++]=E,E=E>>8,i[l++]=E,l}function F(i,r,l,p,h){Ve(r,p,h,i,l,7);let k=Number(r&BigInt(4294967295));i[l+7]=k,k=k>>8,i[l+6]=k,k=k>>8,i[l+5]=k,k=k>>8,i[l+4]=k;let E=Number(r>>BigInt(32)&BigInt(4294967295));return i[l+3]=E,E=E>>8,i[l+2]=E,E=E>>8,i[l+1]=E,E=E>>8,i[l]=E,l+8}c.prototype.writeBigUInt64LE=Ae(function(i,r=0){return O(this,i,r,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Ae(function(i,r=0){return F(this,i,r,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(i,r,l,p){if(i=+i,r=r>>>0,!p){const j=Math.pow(2,8*l-1);v(this,i,r,l,j-1,-j)}let h=0,k=1,E=0;for(this[r]=i&255;++h<l&&(k*=256);)i<0&&E===0&&this[r+h-1]!==0&&(E=1),this[r+h]=(i/k>>0)-E&255;return r+l},c.prototype.writeIntBE=function(i,r,l,p){if(i=+i,r=r>>>0,!p){const j=Math.pow(2,8*l-1);v(this,i,r,l,j-1,-j)}let h=l-1,k=1,E=0;for(this[r+h]=i&255;--h>=0&&(k*=256);)i<0&&E===0&&this[r+h+1]!==0&&(E=1),this[r+h]=(i/k>>0)-E&255;return r+l},c.prototype.writeInt8=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,1,127,-128),i<0&&(i=255+i+1),this[r]=i&255,r+1},c.prototype.writeInt16LE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,2,32767,-32768),this[r]=i&255,this[r+1]=i>>>8,r+2},c.prototype.writeInt16BE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,2,32767,-32768),this[r]=i>>>8,this[r+1]=i&255,r+2},c.prototype.writeInt32LE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,4,2147483647,-2147483648),this[r]=i&255,this[r+1]=i>>>8,this[r+2]=i>>>16,this[r+3]=i>>>24,r+4},c.prototype.writeInt32BE=function(i,r,l){return i=+i,r=r>>>0,l||v(this,i,r,4,2147483647,-2147483648),i<0&&(i=4294967295+i+1),this[r]=i>>>24,this[r+1]=i>>>16,this[r+2]=i>>>8,this[r+3]=i&255,r+4},c.prototype.writeBigInt64LE=Ae(function(i,r=0){return O(this,i,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Ae(function(i,r=0){return F(this,i,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(i,r,l,p,h,k){if(l+p>i.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("Index out of range")}function ie(i,r,l,p,h){return r=+r,l=l>>>0,h||H(i,r,l,4),n.write(i,r,l,p,23,4),l+4}c.prototype.writeFloatLE=function(i,r,l){return ie(this,i,r,!0,l)},c.prototype.writeFloatBE=function(i,r,l){return ie(this,i,r,!1,l)};function te(i,r,l,p,h){return r=+r,l=l>>>0,h||H(i,r,l,8),n.write(i,r,l,p,52,8),l+8}c.prototype.writeDoubleLE=function(i,r,l){return te(this,i,r,!0,l)},c.prototype.writeDoubleBE=function(i,r,l){return te(this,i,r,!1,l)},c.prototype.copy=function(i,r,l,p){if(!c.isBuffer(i))throw new TypeError("argument should be a Buffer");if(l||(l=0),!p&&p!==0&&(p=this.length),r>=i.length&&(r=i.length),r||(r=0),p>0&&p<l&&(p=l),p===l||i.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(l<0||l>=this.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("sourceEnd out of bounds");p>this.length&&(p=this.length),i.length-r<p-l&&(p=i.length-r+l);const h=p-l;return this===i&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,l,p):Uint8Array.prototype.set.call(i,this.subarray(l,p),r),h},c.prototype.fill=function(i,r,l,p){if(typeof i=="string"){if(typeof r=="string"?(p=r,r=0,l=this.length):typeof l=="string"&&(p=l,l=this.length),p!==void 0&&typeof p!="string")throw new TypeError("encoding must be a string");if(typeof p=="string"&&!c.isEncoding(p))throw new TypeError("Unknown encoding: "+p);if(i.length===1){const k=i.charCodeAt(0);(p==="utf8"&&k<128||p==="latin1")&&(i=k)}}else typeof i=="number"?i=i&255:typeof i=="boolean"&&(i=Number(i));if(r<0||this.length<r||this.length<l)throw new RangeError("Out of range index");if(l<=r)return this;r=r>>>0,l=l===void 0?this.length:l>>>0,i||(i=0);let h;if(typeof i=="number")for(h=r;h<l;++h)this[h]=i;else{const k=c.isBuffer(i)?i:c.from(i,p),E=k.length;if(E===0)throw new TypeError('The value "'+i+'" is invalid for argument "value"');for(h=0;h<l-r;++h)this[h+r]=k[h%E]}return this};const z={};function X(i,r,l){z[i]=class extends l{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(p){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:p,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}X("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),X("ERR_INVALID_ARG_TYPE",function(i,r){return`The "${i}" argument must be of type number. Received type ${typeof r}`},TypeError),X("ERR_OUT_OF_RANGE",function(i,r,l){let p=`The value of "${i}" is out of range.`,h=l;return Number.isInteger(l)&&Math.abs(l)>2**32?h=ae(String(l)):typeof l=="bigint"&&(h=String(l),(l>BigInt(2)**BigInt(32)||l<-(BigInt(2)**BigInt(32)))&&(h=ae(h)),h+="n"),p+=` It must be ${r}. Received ${h}`,p},RangeError);function ae(i){let r="",l=i.length;const p=i[0]==="-"?1:0;for(;l>=p+4;l-=3)r=`_${i.slice(l-3,l)}${r}`;return`${i.slice(0,l)}${r}`}function xe(i,r,l){be(r,"offset"),(i[r]===void 0||i[r+l]===void 0)&&Se(r,i.length-(l+1))}function Ve(i,r,l,p,h,k){if(i>l||i<r){const E=typeof r=="bigint"?"n":"";let j;throw k>3?r===0||r===BigInt(0)?j=`>= 0${E} and < 2${E} ** ${(k+1)*8}${E}`:j=`>= -(2${E} ** ${(k+1)*8-1}${E}) and < 2 ** ${(k+1)*8-1}${E}`:j=`>= ${r}${E} and <= ${l}${E}`,new z.ERR_OUT_OF_RANGE("value",j,i)}xe(p,h,k)}function be(i,r){if(typeof i!="number")throw new z.ERR_INVALID_ARG_TYPE(r,"number",i)}function Se(i,r,l){throw Math.floor(i)!==i?(be(i,l),new z.ERR_OUT_OF_RANGE(l||"offset","an integer",i)):r<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE(l||"offset",`>= ${l?1:0} and <= ${r}`,i)}const kt=/[^+/0-9A-Za-z-_]/g;function qt(i){if(i=i.split("=")[0],i=i.trim().replace(kt,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function it(i,r){r=r||1/0;let l;const p=i.length;let h=null;const k=[];for(let E=0;E<p;++E){if(l=i.charCodeAt(E),l>55295&&l<57344){if(!h){if(l>56319){(r-=3)>-1&&k.push(239,191,189);continue}else if(E+1===p){(r-=3)>-1&&k.push(239,191,189);continue}h=l;continue}if(l<56320){(r-=3)>-1&&k.push(239,191,189),h=l;continue}l=(h-55296<<10|l-56320)+65536}else h&&(r-=3)>-1&&k.push(239,191,189);if(h=null,l<128){if((r-=1)<0)break;k.push(l)}else if(l<2048){if((r-=2)<0)break;k.push(l>>6|192,l&63|128)}else if(l<65536){if((r-=3)<0)break;k.push(l>>12|224,l>>6&63|128,l&63|128)}else if(l<1114112){if((r-=4)<0)break;k.push(l>>18|240,l>>12&63|128,l>>6&63|128,l&63|128)}else throw new Error("Invalid code point")}return k}function kn(i){const r=[];for(let l=0;l<i.length;++l)r.push(i.charCodeAt(l)&255);return r}function x(i,r){let l,p,h;const k=[];for(let E=0;E<i.length&&!((r-=2)<0);++E)l=i.charCodeAt(E),p=l>>8,h=l%256,k.push(h),k.push(p);return k}function Rt(i){return t.toByteArray(qt(i))}function ot(i,r,l,p){let h;for(h=0;h<p&&!(h+l>=r.length||h>=i.length);++h)r[h+l]=i[h];return h}function fe(i,r){return i instanceof r||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===r.name}function At(i){return i!==i}const _a=function(){const i="0123456789abcdef",r=new Array(256);for(let l=0;l<16;++l){const p=l*16;for(let h=0;h<16;++h)r[p+h]=i[l]+i[h]}return r}();function Ae(i){return typeof BigInt>"u"?wa:i}function wa(){throw new Error("BigInt not supported")}})(_l);var Cl={exports:{}},ye=Cl.exports={},Ze,Je;function ks(){throw new Error("setTimeout has not been defined")}function bs(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Ze=setTimeout:Ze=ks}catch{Ze=ks}try{typeof clearTimeout=="function"?Je=clearTimeout:Je=bs}catch{Je=bs}})();function Rl(e){if(Ze===setTimeout)return setTimeout(e,0);if((Ze===ks||!Ze)&&setTimeout)return Ze=setTimeout,setTimeout(e,0);try{return Ze(e,0)}catch{try{return Ze.call(null,e,0)}catch{return Ze.call(this,e,0)}}}function Ah(e){if(Je===clearTimeout)return clearTimeout(e);if((Je===bs||!Je)&&clearTimeout)return Je=clearTimeout,clearTimeout(e);try{return Je(e)}catch{try{return Je.call(null,e)}catch{return Je.call(this,e)}}}var ht=[],on=!1,Bt,Hn=-1;function Ih(){!on||!Bt||(on=!1,Bt.length?ht=Bt.concat(ht):Hn=-1,ht.length&&Al())}function Al(){if(!on){var e=Rl(Ih);on=!0;for(var t=ht.length;t;){for(Bt=ht,ht=[];++Hn<t;)Bt&&Bt[Hn].run();Hn=-1,t=ht.length}Bt=null,on=!1,Ah(e)}}ye.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];ht.push(new Il(e,t)),ht.length===1&&!on&&Rl(Al)};function Il(e,t){this.fun=e,this.array=t}Il.prototype.run=function(){this.fun.apply(null,this.array)};ye.title="browser";ye.browser=!0;ye.env={};ye.argv=[];ye.version="";ye.versions={};function Tt(){}ye.on=Tt;ye.addListener=Tt;ye.once=Tt;ye.off=Tt;ye.removeListener=Tt;ye.removeAllListeners=Tt;ye.emit=Tt;ye.prependListener=Tt;ye.prependOnceListener=Tt;ye.listeners=function(e){return[]};ye.binding=function(e){throw new Error("process.binding is not supported")};ye.cwd=function(){return"/"};ye.chdir=function(e){throw new Error("process.chdir is not supported")};ye.umask=function(){return 0};var Nh=Cl.exports;(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_l,n=Nh,s=u=>u&&u.__esModule?u:{default:u},a=s(n),o=globalThis||void 0||self;Object.defineProperty(e,"Buffer",{enumerable:!0,get:()=>t.Buffer}),Object.defineProperty(e,"process",{enumerable:!0,get:()=>a.default}),e.global=o})(W);class Lh{}window.slStore=Object.create(null);const Oh=(e,t)=>wd(e,t,{mount:({storeName:n})=>{window.slStore[n]||(window.slStore[n]={mounted:!0,history:[{type:"mount"}]}),window.slStore[n].store=e},unmount:({storeName:n})=>{var s;window.slStore[n].mounted=!1,(s=window.slStore[n])==null||s.history.push({type:"unmount"})},change:({actionName:n,storeName:s,changed:a,newValue:o,oldValue:u,valueMessage:c})=>{var d;(d=window.slStore[s])==null||d.history.push({type:"change",changed:a,newValue:o,oldValue:u,diff:jo({...u},{...o},{cyclesFix:!1}),actionName:n,valueMessage:c})},action:{start:({actionName:n,args:s,storeName:a})=>{var o;(o=window.slStore[a])==null||o.history.push({type:"action:start",actionName:n,args:s,storeName:a})},error:({actionName:n,error:s,storeName:a})=>{var o;(o=window.slStore[a])==null||o.history.push({type:"action:error",actionName:n,error:s})},end:({actionName:n,storeName:s})=>{var a;(a=window.slStore[s])==null||a.history.push({type:"action:end",actionName:n})}}});class ba{constructor(t,n){w(this,"store");w(this,"name");this.store=t,this.name=n,Oh(this.store,this.name)}getStore(){return this.store}}const Mh=e=>{const t=Object.keys(e);return Vo(t.map(n=>e[n].getStore()),(...n)=>Object.fromEntries(t.map((s,a)=>[s,n[a]])))};class Cn extends ba{constructor(){super(...arguments);w(this,"getValues",()=>this.getStore().get());w(this,"getValue",n=>this.getStore().get()[n]);w(this,"setValue",(n,s)=>this.getStore().setKey(n,s));w(this,"subscribe",(...n)=>this.getStore().subscribe(...n));w(this,"unsubscribe",()=>this.getStore().off())}}const Pt=e=>ds(e);var mt;(function(e){e.ORGANIZATION="ORGANIZATION",e.STREAM="STREAM"})(mt||(mt={}));const xh={[me.BETTING]:"betting",[me.GAMES]:"games",[me.PUBLIC_CHAT]:"publicChat",[me.TWITTER]:"twitter"};var Ut;(function(e){e.Ready="ready",e.Suspended="suspended"})(Ut||(Ut={}));class er{constructor({settings:t,...n},s){w(this,"status");w(this,"source");w(this,"config");w(this,"settings");w(this,"listeners",new Set);w(this,"settingsKey");w(this,"enable",()=>{this.status.set(Ut.Ready)});w(this,"disable",()=>{this.status.set(Ut.Suspended)});w(this,"setFeatureConfig",({settings:t,...n})=>{var a;let s;for(s in n)this.config.setValue(s,n[s]);if(((a=t==null?void 0:t.overlaySettings)==null?void 0:a.case)!==void 0&&(t==null?void 0:t.overlaySettings.case)===this.settingsKey){const o=t.overlaySettings.value;if(o!==void 0){let u;for(u in o)console.log(u,o[u]),o[u]!==0&&o[u]!==""&&this.settings.setValue(u,o[u])}}});w(this,"update",(t,n)=>{this.source===mt.STREAM&&n===mt.ORGANIZATION||(this.setFeatureConfig(t),this.source=n)});this.settingsKey=xh[n.type],this.status=_t(Ut.Suspended),this.config=new Cn(Pt(n),`feature:config:${this.settingsKey}`),this.settingsKey!==void 0&&(t==null?void 0:t.overlaySettings.case)===this.settingsKey?this.settings=new Cn(Pt(t.overlaySettings.value),`feature:settings:${this.settingsKey}`):this.settings=new Cn(Pt({}),`feature:settings:${this.settingsKey}`),this.source=s}get featureConfig(){return this.config.getStore()}get featureSettings(){return this.settings.getStore()}registerEventListener(t){this.listeners.add(t)}fireEvent(t){for(const n of this.listeners.values())try{n.onEvent(t)}catch(s){console.error(s)}}}class Ye extends ba{constructor(){super(...arguments);w(this,"getValue",()=>this.getStore().get());w(this,"setValue",n=>this.getStore().set(n));w(this,"subscribe",n=>this.getStore().subscribe(n));w(this,"unsubscribe",()=>this.getStore().off())}getValues(){throw new Error("not implemented")}listen(n){return this.getStore().listen(n)}get(){return this.getStore().get()}}const Ue=e=>_t(e);class Qe extends ba{constructor(n,s,a){super(n,`api:${s}`);w(this,"atomStore");w(this,"getAtomStore",()=>this.atomStore);w(this,"getValue",async()=>{const n=this.getStore();if(n.value===void 0)throw new Error("no store");return await n.value.promise,n.get().data});w(this,"getValues",()=>{throw new Error("not implemented")});w(this,"setValue",n=>this.getStore().set({loading:!1,data:n==null?void 0:n.data}));w(this,"subscribe",n=>this.getStore().subscribe(n));w(this,"unsubscribe",()=>{throw new Error("not implemented")});w(this,"invalidate",()=>{this.store.invalidate()});w(this,"listen",n=>this.getStore().listen(n));w(this,"key",()=>this.getStore().key);w(this,"off",()=>this.getStore().off());this.atomStore=_t(),a&&n.subscribe(o=>{const u=this.atomStore.get(),c=a(o,u);u!==c&&this.atomStore.set(c)})}get(){throw new Error("not implemented")}}async function*Bh(e,t){for await(const n of t){e.response.message=n,e.received_at=Date.now();const s={type:"__GRPC_DEVTOOLS_EXTENSION__",data:e};window.postMessage(s),yield n}}const Ph=()=>e=>async t=>{const n={name:t.url,request:{},response:{}};n.request.header=Object.fromEntries(t.header.entries()),n.sent_at=Date.now();try{const s=await e(t);if(n.received_at=Date.now(),n.stream=s.stream,n.response.header=Object.fromEntries(s.header.entries()),n.response.trailer=Object.fromEntries(s.trailer.entries()),s.stream)return{...s,message:Bh(n,s.message)};{n.request.message=t.message,n.response.message=s.message,n.latency=n.received_at-n.sent_at;const a={type:"__GRPC_DEVTOOLS_EXTENSION__",data:n};window.postMessage(a)}return s}catch(s){n.received_at=Date.now(),n.request.message=t.message,n.response.trailer={"grpc-status":s.code,"grpc-message":s.rawMessage},n.response.message=s.rawMessage,n.latency=n.received_at-n.sent_at;const a={type:"__GRPC_DEVTOOLS_EXTENSION__",data:n};throw window.postMessage(a),s}};window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));var lt;(function(e){e.Init="init",e.Ready="ready",e.Connecting="connecting",e.Connected="connected",e.Disconnected="disconnected",e.Failed="failed",e.Reconnecting="reconnecting"})(lt||(lt={}));class Uh{constructor(t,n,s,a){w(this,"params");w(this,"stream");w(this,"method");w(this,"name");w(this,"headers");w(this,"listeners");w(this,"state");w(this,"store");w(this,"updateState",t=>{this.state.setValue("status",t),this.state.setValue("ts",new Date),this.addStateLog(`status => ${t}`)});w(this,"addStateLog",t=>{const n=this.state.getStore().get().log;this.state.setValue("log",[...n,`${new Date().toLocaleString()}: ${t}`])});w(this,"addListener",(t,n)=>this.listeners.has(t)?(this.addStateLog(`listener '${t}' not added`),!1):(this.listeners.set(t,n),this.addStateLog(`listener '${t}' added`),!0));w(this,"removeListener",t=>{this.listeners.delete(t),this.addStateLog(`listener '${t}' removed`)});w(this,"connect",()=>{this.updateState(lt.Connecting),this.stream&&(this.addStateLog("disconnect prev connection"),this.stream());const t="get"in this.params&&typeof this.params.get=="function"?this.params.get():this.params;this.stream=this.method(t,this.onData,this.onStreamError,{headers:this.headers.getValues()}),this.updateState(lt.Connected)});w(this,"disconnect",()=>{this.stream&&this.stream(),this.listeners.clear(),this.updateState(lt.Disconnected)});w(this,"reconnect",()=>{this.updateState(lt.Reconnecting),this.connect()});w(this,"getStore",()=>{var t;return(t=this.store)==null?void 0:t.getStore()});w(this,"onData",t=>{this.addStateLog(`received data => ${JSON.stringify(t)}`),this.store&&this.store.setValue(t);for(const[,n]of this.listeners)n(t);this.addStateLog(`data routed to ${this.listeners.size} listeners`)});w(this,"onStreamError",t=>{t!==void 0&&(t.code!==oe.Canceled&&t.rawMessage!=="[canceled] BodyStreamBuffer was aborted"?(this.updateState(lt.Failed),this.state.setValue("error",t),this.reconnect()):this.disconnect())});const o={status:lt.Init,ts:new Date,log:[]};this.state=new Cn(Pt(o),`subscription:${a.name}:state`),this.name=a.name,this.headers=t,this.listeners=new Map,this.params=s,this.method=n,a.withStore&&(this.store=new Ye(Ue(null),`subscription:${a.name}:store`)),"subscribe"in s&&typeof s.subscribe=="function"&&s.subscribe(()=>{this.reconnect()}),this.updateState(lt.Ready)}}class Fh{constructor(t){w(this,"toJsonOptions",{emitDefaultValues:!1,enumAsInteger:!0,useProtoFieldName:!1});w(this,"transport");w(this,"nanoquery");w(this,"host");w(this,"interceptors",[]);w(this,"$headers");w(this,"clients");w(this,"callbackClients");w(this,"subscriptions");w(this,"addSubscription",(t,n,s)=>{const a=this.subscriptions.get(n);if(a)return a;const o=new Uh(this.$headers,t,n,s);return this.subscriptions.set(n,o),o});w(this,"removeSubscription",t=>{t.disconnect(),this.subscriptions.delete(t.params)});w(this,"disconnect",()=>{for(const[t,n]of this.subscriptions)n.disconnect(),this.subscriptions.delete(t)});w(this,"registerInterceptor",t=>{this.interceptors.push(t)});w(this,"removeInterceptor",t=>{this.interceptors=this.interceptors.filter(n=>n!==t)});w(this,"getClient",t=>{const n=t.typeName;if(this.clients.has(n))return this.clients.get(n);const s=Xf(t,this.transport);return this.clients.set(n,s),s});w(this,"getCallbackClient",t=>{const n=t.typeName;if(this.callbackClients.has(n))return this.callbackClients.get(n);const s=Yf(t,this.transport);return this.callbackClients.set(n,s),s});w(this,"createPromiseClient",(t,{params:n=[],method:s})=>{const a=this.getClient(t),o=t.methods[s].name,u=[t.typeName,o.charAt(0).toLowerCase()+o.slice(1),...Array.isArray(n)?n:[n]],c=[t.typeName,o.charAt(0).toLowerCase()+o.slice(1)];return{client:a,queryKey:u,queryKeyStr:c.join("")}});w(this,"createCallbackClient",t=>({client:this.getCallbackClient(t)}));w(this,"setSdkKey",t=>{this.$headers.setValue("sdk",t)});w(this,"setAuth",(t,n)=>{this.$headers.setValue("authorization",t),this.$headers.setValue("sl-user-id",n)});w(this,"setHeader",(t,n)=>this.$headers.setValue(t,n));w(this,"getHeader",t=>this.$headers.getValue(t));w(this,"getHeaders",()=>this.$headers.getValues());w(this,"initInterceptors",()=>{if(this.interceptors.length!==0)return;const t=n=>s=>{const a=this.$headers.getValues();for(const o in a)s.header.set(o,a[o]);return n(s)};this.interceptors.push(t),this.interceptors.push(Ph())});var o,u;this.host=t,this.$headers=new Cn(Pt({"sl-device-id":((u=(o=W.process)==null?void 0:o.env)==null?void 0:u.NX_DEVICE_ID)||"sdk-web-dev"}),"transport:headers"),this.initInterceptors(),this.clients=new Map,this.callbackClients=new Map,this.subscriptions=new Map;const[n,s,a]=_3();this.nanoquery={createFetcherStore:n,createMutatorStore:s,utils:a},this.transport=E3({baseUrl:t,interceptors:this.interceptors,useBinaryFormat:!0})}}const Dh=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(j6,{method:"retrieveEventId",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>{var c;if(!u||typeof u!="string")return"";try{return((c=(await n.retrieveEventId({id:u})).data)==null?void 0:c.id)||""}catch{return""}}})},Vh=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(Mn,{method:"getStream",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>{var c;return u?(c=(await n.getStream({id:u})).data)==null?void 0:c.attributes:void 0}})},jh=(e,t)=>{const{queryKey:n,client:s}=t.createPromiseClient(bl,{method:"me",params:[e]});return t.nanoquery.createFetcherStore(n,{fetcher:()=>s.me({})})},Gh=e=>{const{client:t}=e.createPromiseClient(bl,{method:"bypassAuth"});return({userKey:n,schema:s,init:a})=>t.bypassAuth({userKey:n,schema:s,init:a})},qh=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(Mn,{method:"get",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async()=>{var a;return(a=(await n.get({})).data)==null?void 0:a.attributes}})},$h=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(Mn,{method:"getOrganization",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async()=>{const a=await n.getOrganization({});return a.data?{...a.data.attributes,id:a.data.id}:void 0}})},Hh=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(Mn,{method:"getOrganizationAdvertising",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async()=>{var a;return(a=(await n.getOrganizationAdvertising({})).data)==null?void 0:a.attributes}})},zh=(e,t,n)=>{e.transport=new Fh(t.host),e.sdk.host=e.transport.host,e.transport.setSdkKey(t.sdkKey),n()};class tr{constructor(t="main"){w(this,"delimiter",":");w(this,"prefix");w(this,"clear",()=>{for(const t in window.localStorage)t.startsWith(this.prefix)&&window.localStorage.removeItem(t)});w(this,"generateKey",t=>`${this.prefix}${this.delimiter}${t.join(this.delimiter)}`);w(this,"write",(...t)=>{const n=t.pop()||"";window.localStorage.setItem(this.generateKey(t),n)});w(this,"read",(...t)=>{const n=window.localStorage.getItem(this.generateKey(t));return n===null?void 0:n});w(this,"remove",(...t)=>{window.localStorage.removeItem(this.generateKey(t))});this.prefix=`sl-sdk${this.delimiter}${t}`}}var ct;(function(e){e.SCHEMA="schema",e.EXTERNAL_TOKEN="eToken",e.TOKEN="token"})(ct||(ct={}));class tn extends tr{constructor(){super("user");w(this,"setSchema",n=>{this.write(ct.SCHEMA,n)});w(this,"getSchema",()=>this.read(ct.SCHEMA));w(this,"setToken",n=>{this.write(ct.TOKEN,n)});w(this,"getToken",()=>this.read(ct.TOKEN));w(this,"setExternalToken",n=>{this.write(ct.EXTERNAL_TOKEN,n)});w(this,"getExternalToken",()=>this.read(ct.EXTERNAL_TOKEN));w(this,"removeToken",()=>{this.remove(ct.TOKEN)})}}var dt;(function(e){e.DISABLED="disabled",e.INITIALIZATION="initialization",e.READY="ready",e.FAILED="failed",e.SUSPENDED="suspended"})(dt||(dt={}));const Qh=e=>{const t=new tn,n=new Ye(Ue(t.getExternalToken()),"userKey"),s=new Ye(Ue(t.getToken()),"userToken"),a=new Qe(jh(s.getStore(),e),"user",({data:u,error:c,loading:d},f)=>{var g;if(!c)return(g=u==null?void 0:u.data)!=null&&g.id?u.data.id:d===!1?void 0:f}),o=new Qe(qh(s.getStore(),e),"userSettings");return{userKey:n,userToken:s,user:a,userSettings:o}},Yh=e=>{const t=new Ye(Ue(void 0),"providerStreamId"),n=new Qe(Dh(t.getStore(),e),"slStreamId",a=>a==null?void 0:a.data),s=new Qe(Vh(n.getAtomStore(),e),"streamSettings");return n.getAtomStore().listen(a=>{(a===""||a===void 0)&&s.getStore().mutate(void 0)}),{providerStreamId:t,slStreamId:n,streamSettings:s}},Kh=e=>{const t=new Ye(Ue(void 0),"enabled"),n=new Ye(Ue(dt.DISABLED),"status"),s=new Qe($h(t.getStore(),e),"organizationSettings",c=>{var d;return(d=c==null?void 0:c.data)==null?void 0:d.id}),a=new Qe(Hh(s.getAtomStore(),e),"organizationAdvertising"),o=Qh(e),u=Yh(e);return{enabled:t,status:n,providerStreamId:u.providerStreamId,slStreamId:u.slStreamId,streamSettings:u.streamSettings,user:o.user,userKey:o.userKey,userToken:o.userToken,userSettings:o.userSettings,organizationSettings:s,organizationAdvertising:a}};class Wh extends ba{constructor(n){const s=Kh(n),a=Mh(s);super(a,"core");w(this,"stores");w(this,"subscribe",n=>{let s;for(s in this.stores){const a=n[s];s in n&&a!==void 0&&this.stores[s].subscribe(n[s])}});w(this,"unsubscribe",()=>this.getStore().off());this.stores=s}getValue(){throw new Error("Not implemented")}getValues(){return this.stores}setValue(){throw new Error("Not implemented")}}class Zh extends Lh{constructor(n,s){super();w(this,"$coreStore");w(this,"transport");w(this,"bypassLogin");w(this,"me",async()=>{var n;return this.$coreStore.getValues().user.invalidate(),(n=await this.$coreStore.getValues().user.getValue())==null?void 0:n.data});w(this,"login",async(n,s)=>{var c,d;this.$coreStore.getValues().userKey.setValue(s);const a=await this.bypassLogin({schema:n,userKey:s,init:!1}),o=(c=a.meta)==null?void 0:c.jwt,u=(d=a.data)==null?void 0:d.id;if(!o||!u)throw new Error("internal: token missing");return this.$coreStore.getValues().user.getStore().mutate(a),this.saveUser(o,u),o});w(this,"isAuthenticated",()=>this.me());w(this,"logout",()=>{this.$coreStore.getValues().user.setValue(),this.$coreStore.getValues().userKey.setValue(),this.$coreStore.getValues().userToken.setValue(),this.transport.setAuth("",""),new tn().clear()});w(this,"softLogout",()=>{const n=new tn;this.transport.setAuth("",""),n.setToken(""),this.reLogin()});w(this,"reLogin",()=>{const n=new tn,s=n.getToken(),a=n.getExternalToken();if(this.$coreStore.getValues().userKey.setValue(a),s)return this.saveUser(s,""),this.me().then(o=>{if(o!=null&&o.id){const u=o.id;this.saveUser(s,u)}});if(a&&!s){const o=n.getSchema();o&&a&&this.login(o,a).catch(()=>{this.logout()})}});w(this,"saveUser",(n,s)=>{this.transport.setAuth(n,s),this.$coreStore.getValues().userToken.setValue(n),new tn().setToken(n)});w(this,"connect",()=>{this.transport.registerInterceptor(n=>async s=>{try{return await n(s)}catch(a){throw a.code&&(a.code===7||a.code===16)&&this.transport.getHeader("authorization")&&this.softLogout(),a}})});this.$coreStore=n,this.transport=s,this.bypassLogin=Gh(this.transport),this.connect()}}const vn=new tn,Jh=(e,t,n)=>{e.auth=new Zh(e.store,e.transport),e.stores.status.listen(s=>{s===dt.READY&&e.auth.reLogin()}),e.sdk.userId=e.stores.user.getAtomStore,e.sdk.authorizationBypass=async(s,a)=>{if(!(vn.getSchema()===s&&vn.getExternalToken()===a&&e.transport.getHeader("authorization")))try{await e.auth.login(s,a),vn.setSchema(s),vn.setExternalToken(a)}catch{e.sdk.logout()}},e.sdk.logout=()=>{e.auth.logout(),vn.clear()},e.sdk.getUserStore=()=>e.stores.user.getStore(),e.sdk.isUserAuthorized=()=>e.auth.isAuthenticated(),n()},Xh=(e,t,n)=>{e.store=new Wh(e.transport),e.stores=e.store.getValues(),e.sdk.enabled=e.stores.enabled.getStore(),e.sdk.status=e.stores.status.getStore(),e.sdk.sdkStore=Object.fromEntries(Object.entries(e.stores).map(([s,a])=>[s,a.getStore()])),e.sdk.organizationStore=()=>e.stores.organizationSettings.getStore(),e.sdk.streamStore=()=>e.stores.streamSettings.getStore(),e.storeUnsubscribe=()=>{e.store.unsubscribe()},n()},eg=(e,t,n)=>{e.sdk=Object.create(null),e.sdk.initializeApp=async()=>{if(e.stores.enabled.get()==="on")return{enabled:!0};e.storeSubscribe(),e.stores.enabled.setValue("on"),e.stores.status.setValue(dt.INITIALIZATION);try{const s=await e.stores.organizationSettings.getValue();return s?(e.stores.status.setValue(dt.READY),{enabled:!!s}):(e.stores.status.setValue(dt.FAILED),{err:"failed"})}catch(s){return e.stores.enabled.setValue(),e.stores.status.setValue(dt.FAILED),{err:`${s}`}}},e.sdk.disableApp=()=>{e.stores.enabled.get()==="on"&&(e.stores.enabled.setValue(),e.stores.status.setValue(dt.DISABLED),e.sdk.closeFeature(),e.storeUnsubscribe())},e.sdk.createEventSession=s=>{e.stores.providerStreamId.setValue(s)},n()},tg=Ho({level:"trace",enabled:!1,browser:{write:e=>{console.log(e)}}}),Nl=(e,t)=>tg.child({name:e},t),ng=(e,t,n)=>{const{client:s,queryKey:a}=n.createPromiseClient(El,{method:"summary",params:[e,t]});return n.nanoquery.createFetcherStore(a,{fetcher:async(o,u,c,d)=>{var f;return(f=(await s.summary({eventId:c,userId:d})).data)==null?void 0:f.attributes}})},ag=e=>{const{client:t}=e.createPromiseClient(El,{method:"list"});return n=>t.list(n)},sg=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(st,{method:"get",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>{var c;return(c=(await n.get({eventId:u})).data)==null?void 0:c.attributes}})},rg=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(st,{method:"syncQuestion",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>{var c;return u?(c=(await n.syncQuestion({filter:{eventId:u}})).data)==null?void 0:c.attributes:void 0}})},ig=(e,t)=>{const{client:n}=t.createCallbackClient(st),s=_t({eventId:e.get()||"",feedId:""});return e.subscribe((a="")=>{s.set({eventId:a,feedId:""})}),t.addSubscription(n.subscription,s,{name:"feedSubscription"})},og=(e,t)=>{const{client:n}=t.createCallbackClient(st);return t.addSubscription(n.questionSubscription,{questionId:e},{name:"questionSubscription"})},Ll=async(e,t)=>{var s,a;const{client:n}=t.createPromiseClient(st,{method:"questionByUser",params:[e]});return(a=(s=(await n.questionByUser({questionId:e})).data)==null?void 0:s.attributes)==null?void 0:a.question},lg=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(st,{method:"list",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>u?(await n.list({eventId:u,filter:{statuses:[Pe.ACTIVE,Pe.RESOLVED]}})).data:[]})},cg=(e,t)=>{const{client:n,queryKey:s}=t.createPromiseClient(st,{method:"insightHistory",params:[e]});return t.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>{var c;return u?(c=(await n.insightHistory({eventId:u})).data)==null?void 0:c.map(({attributes:d})=>d):void 0}})};var nr={exports:{}};const ug=Object.getPrototypeOf({});function ar(e){function t(_){return _!=="constructor"&&_!=="prototype"&&_!=="__proto__"}function n(_){let I=0;const P=_.length,U=new Array(P);for(I=0;I<P;++I)U[I]=b(_[I]);return U}function s(_){const I={};if(d&&Object.getPrototypeOf(_)!==ug)return d(_);const P=c(_);let U,B,V;for(U=0,B=P.length;U<B;++U)t(V=P[U])&&(I[V]=b(_[V]));return I}function a(_,I){const P=_.length,U=I.length;let B=0;const V=new Array(P+U);for(B=0;B<P;++B)V[B]=b(_[B]);for(B=0;B<U;++B)V[B+P]=b(I[B]);return V}const o=Object.prototype.propertyIsEnumerable;function u(_){const I=Object.keys(_),P=Object.getOwnPropertySymbols(_);for(let U=0,B=P.length;U<B;++U)o.call(_,P[U])&&I.push(P[U]);return I}const c=e&&e.symbols?u:Object.keys,d=typeof(e==null?void 0:e.cloneProtoObject)=="function"?e.cloneProtoObject:void 0;function f(_){return typeof _=="object"&&_!==null&&!(_ instanceof RegExp)&&!(_ instanceof Date)}function g(_){return typeof _!="object"||_===null}const T=typeof W.Buffer<"u"?_=>typeof _!="object"||_===null||_ instanceof RegExp||_ instanceof Date||_ instanceof W.Buffer:_=>typeof _!="object"||_===null||_ instanceof RegExp||_ instanceof Date,y=e&&typeof e.mergeArray=="function"?e.mergeArray({clone:b,deepmerge:A,getKeys:c,isMergeableObject:f}):a;function b(_){return f(_)?Array.isArray(_)?n(_):s(_):_}function R(_,I){const P={},U=c(_),B=c(I);let V,D,$;for(V=0,D=U.length;V<D;++V)t($=U[V])&&B.indexOf($)===-1&&(P[$]=b(_[$]));for(V=0,D=B.length;V<D;++V)t($=B[V])&&($ in _&&(U.indexOf($)!==-1&&(P[$]=A(_[$],I[$])),!0)||(P[$]=b(I[$])));return P}function A(_,I){const P=Array.isArray(I),U=Array.isArray(_);return g(I)?I:T(_)?b(I):P&&U?y(_,I):P!==U?b(I):R(_,I)}function N(){switch(arguments.length){case 0:return{};case 1:return b(arguments[0]);case 2:return A(arguments[0],arguments[1])}let _;for(let I=0,P=arguments.length;I<P;++I)_=A(_,arguments[I]);return _}return e&&e.all?N:A}nr.exports=ar;nr.exports.default=ar;var mg=nr.exports.deepmerge=ar;const dg=e=>(t,n)=>{let s=0;const a=t.length,o=n.length,u=Math.max(a,o),c=new Array(u);for(s=0;s<u;++s)s<o?c[s]=e.deepmerge(t[s],n[s]):c[s]=e.clone(t[s]);return c},pg=mg({mergeArray:dg}),fg=(e,t,n)=>{const s=Vo([t,n],(o,u)=>{if(o&&u.data)return u.data.find(c=>c.id===o)}),a=Pt({data:void 0,loading:void 0,error:void 0});return s.subscribe(async o=>{if(o&&o.type==="question"){a.setKey("loading",!0);const u=await Ll(o.id,e);a.set({data:u,loading:!1});return}a.set({data:void 0,loading:!1})}),{$store:s,$extendedStore:a,updateExtendedQuestion:o=>{const u=a.get().data;if(u)for(const c of(o==null?void 0:o.answers)||[])c.youVoted!==!0&&delete c.youVoted;a.set({data:pg(u,o)})}}},Ol=e=>(e.gamification||(e.gamification=new hg(e)),e.gamification);class hg{constructor(t){w(this,"slStreamId");w(this,"organizationId");w(this,"userId");w(this,"openedQuestionId");w(this,"openedQuestion");w(this,"activeQuestionId");w(this,"feedList");w(this,"moderationId");w(this,"moderation");w(this,"feedSubscription");w(this,"questionSubscription");w(this,"notifications");w(this,"log");w(this,"getCurrentSessionId",t=>{const n=t.eventId||this.slStreamId.get()||"",s=t.userId||this.userId.get()||"",a=t.organizationId||this.organizationId.get()||"",o=t.entity||"",u=t.prefix||"";return[a,n,s,u,o].join(":")});w(this,"disconnect",()=>{var t;(t=this.feedSubscription)==null||t.disconnect()});w(this,"openQuestion",t=>{this.openedQuestionId.set(t),this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:t}))});w(this,"closeQuestion",t=>{this.openedQuestionId.set(void 0),t&&this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:t}))});if(t.gamification)throw new Error("GamificationBackground Singleton error");this.log=Nl("gamification-background"),this.slStreamId=t.stores.slStreamId.getAtomStore(),this.organizationId=t.stores.organizationSettings.getAtomStore(),this.userId=t.stores.user.getAtomStore(),this.moderationId=new Ye(Ue(void 0),"moderationId").getStore(),this.openedQuestionId=new Ye(Ue(void 0),"openedQuestionId").getStore(),this.notifications=t.notifications,this.moderation=new Qe(sg(this.slStreamId,t.transport),"gamification:moderation"),this.feedList=new Qe(lg(this.slStreamId,t.transport),"gamification:feedList"),this.activeQuestionId=new Qe(rg(this.slStreamId,t.transport),"gamification:activeQuestionId"),this.openedQuestion=fg(t.transport,this.openedQuestionId,this.feedList.getStore()),this.openedQuestionId.listen(n=>{this.log.debug({questionId:n},"received question"),n?(this.questionSubscription=og(n,t.transport),this.questionSubscription.addListener("feed-subscription-opened-question",s=>{window.requestAnimationFrame(()=>{var a,o;this.openedQuestion.updateExtendedQuestion((o=(a=s.data)==null?void 0:a.attributes)==null?void 0:o.question)})}),this.questionSubscription.connect()):(this.log.info("cleanup on close question"),this.questionSubscription!==void 0&&(t.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0))}),this.feedSubscription=ig(this.slStreamId,t.transport),this.feedSubscription.addListener("feed-subscription-active-question",n=>{window.requestAnimationFrame(()=>{var a;const s=this.activeQuestionId.getStore();s&&s.mutate((a=n.data)==null?void 0:a.attributes)})})}}class gg{constructor(t){w(this,"notificationsList");w(this,"notifications");w(this,"store");w(this,"timeouts");w(this,"waitingQueue");w(this,"activeQueue");w(this,"options");w(this,"logger");w(this,"addToQueue",t=>{if(this.store.has(t.id)){this.logger.debug({notification:t},"skip existed notification: %o");return}const n=t.close,s=t.action;if(this.store.set(t.id,{...t,close:(...a)=>{n&&n(...a),this.closeNotification(t.id)},action:(...a)=>{s&&s(...a),this.closeNotification(t.id)}}),this.waitingQueue.add(t.id),this.activeQueue.size===this.options.concurrency){const[a]=this.activeQueue;this.closeNotification(a)}else this.tickWaitingQueue()});w(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[t]=this.waitingQueue;if(!t)return;this.activeQueue.add(t),this.waitingQueue.delete(t),this.logger.debug({job:t},"waiting queue tick"),this.tickActiveQueue(t)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});w(this,"tickActiveQueue",t=>{if(!t)return;const n=this.store.get(t);if(!n){this.logger.debug({notificationId:t},"active queue tick skipped, notification not exist");return}const s=setTimeout(()=>{const a=t,o=new Map(this.notifications.getValue());o.set(n.id,n),this.notifications.setValue(o);const u=setTimeout(()=>{this.logger.debug({notificationId:a,delay:n.autoHideDuration||5e3},"notification hiding by autoHideDuration"),this.closeNotification(a)},n.autoHideDuration||5e3);this.timeouts.set(a,u),this.logger.debug({notificationId:a,queue:[...o.values()]},"notification displayed")},n.delay||0);this.timeouts.set(t,s),this.logger.debug({notificationId:t},"active queue tick completed"),this.tickWaitingQueue()});w(this,"closeNotification",t=>{const n=new Map(this.notifications.getValue()),s=n.get(t);if(s){s.hiding=!(this.waitingQueue.size>=this.options.concurrency),this.notifications.setValue(n);const a=setTimeout(()=>{const o=new Map(this.notifications.getValue());o.delete(t),this.notifications.setValue(o);const u=this.timeouts.get(t);u!==void 0&&(clearTimeout(u),this.timeouts.delete(t)),this.logger.debug({notificationId:t},"notification hidden")},this.options.animationDelay||0);this.timeouts.set(t,a)}this.store.delete(t),this.activeQueue.delete(t),this.waitingQueue.delete(t),this.tickWaitingQueue(),this.logger.debug({notificationId:t},"notification hiding")});this.options=t,this.logger=Nl("notifications"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.notifications=new Ye(Ue(new Map),"notifications-queue"),this.notificationsList=this.notifications.getStore()}}var ta;(function(e){e.OPENED="opened"})(ta||(ta={}));class yg extends tr{constructor(){super("notification");w(this,"setOpened",n=>{this.write(ta.OPENED,n,"true")});w(this,"isOpened",n=>this.read(ta.OPENED,n));w(this,"clearNotification",()=>{this.clear()})}}var Et;(function(e){e[e.ONBOARDING=1]="ONBOARDING",e[e.QUESTION=2]="QUESTION",e[e.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(Et||(Et={}));class Tg{constructor(t={}){w(this,"queue");w(this,"storage");w(this,"add",t=>{this.storage.isOpened(t.id)||this.queue.addToQueue(t)});w(this,"close",t=>{this.queue.closeNotification(t),this.markAsViewed(t)});w(this,"getQueueStore",()=>this.queue.notificationsList);w(this,"markAsViewed",t=>{this.storage.setOpened(t)});this.storage=new yg,this.queue=new gg({concurrency:1,animationDelay:1600,...t})}}const kg=(e,t,n)=>{e.notifications=new Tg,e.addNotification=e.notifications.add,e.sdk.getNotificationsStore=()=>e.notifications.getQueueStore(),n()},bg=(e,t)=>{const{client:n}=e.createPromiseClient(st,{method:"submitAnswer"});return n.submitAnswer({data:t})},Sg=(e,t)=>{const{client:n}=e.createPromiseClient(st,{method:"submitInplay"});return n.submitInplay({data:{eventId:+t}})},Eg=(e,t)=>{const{client:n}=e.createPromiseClient(st,{method:"skipQuestion"});return n.skipQuestion({data:{id:t}})};var na;(function(e){e.ONBOARDING="onboarding"})(na||(na={}));class Ml extends tr{constructor(){super("gamification");w(this,"saveOnboardingStatus",({userId:n,eventId:s,organizationId:a},o)=>{this.write(na.ONBOARDING,a,n,s,o)});w(this,"getOnboardingStatus",({userId:n,eventId:s,organizationId:a})=>this.read(na.ONBOARDING,a,n,s))}}const Mi={pageSize:10},vg=(e,t,n)=>{const s=Ue({pageSize:(n==null?void 0:n.pageSize)||Mi.pageSize,page:0}),a=Pt({data:[],loading:void 0,error:void 0}),o=ag(e),u=async d=>{if(d){a.setKey("loading",!0);const f={eventId:d,pagination:{page:0,pageSize:(n==null?void 0:n.pageSize)||Mi.pageSize}},g=await o(f);a.set({data:g.data.map(T=>T.attributes),loading:!1}),s.set(f.pagination)}};t.listen(u);const c=()=>{u(t.get())};return s.listen(async d=>{var T;const f=t.get(),g=((T=a.get().data)==null?void 0:T.length)||0;if(d.page>0&&f&&g>=d.page*d.pageSize){a.setKey("loading",!0);const y=await o({eventId:f,pagination:d}),b=a.get().data||[];a.set({data:[...b,...y.data.map(R=>R.attributes)],loading:!1})}}),{$store:a,fetchMore:()=>{const d=s.get();s.set({...d,page:d.page+1})},invalidate:c}},_g=(e,t)=>{const{client:n,queryKey:s}=e.createPromiseClient(Mn,{method:"generateDeepLink",params:t});return e.nanoquery.createFetcherStore(s,{fetcher:async(a,o,u)=>{var c;return u?(c=(await n.generateDeepLink({data:{eventId:u}})).data)==null?void 0:c.attributes:{}}})},wg=(e,t,n)=>{const s=_g(e,[t]),a=`${window.location.host+window.location.pathname}%23sl_eid=${t.get()}&sl_uid=${n.get()}`;return{$store:s,fetch,desktopLink:a}};var Le;(function(e){e.Unset="unset",e.Required="required",e.Optional="optional",e.Completed="completed",e.Disabled="disabled",e.Unavailable="unavailable"})(Le||(Le={}));const Cg=(e,t,n,s)=>{const a=new Ml,o=Ue(Le.Unset),u=()=>{const{inplayGame:d}=e.featureSettings.get(),f=t.getCurrentSessionId({prefix:"onboarding"});d&&s.add({type:Et.ONBOARDING,id:f,action:e.openFeature,close:()=>{s.markAsViewed(f)},autoHideDuration:1e6,data:{questionType:re.UNSET,onboarding:{...d}}})};o.subscribe(d=>{(d===Le.Optional||Le.Required)&&u(),d===Le.Completed&&t.activeQuestionId.invalidate()});const c=async()=>{var y,b,R,A,N;const d=t.userId.get();if(!d){o.set(Le.Unset);return}a.getOnboardingStatus({userId:d,organizationId:t.organizationId.get()||"",eventId:t.slStreamId.get()||""})===Le.Completed&&o.set(Le.Completed);const f=await t.moderation.getValue();if(o.get()===Le.Completed)return;const g=!!((y=f==null?void 0:f.options)!=null&&y.onboardingEnabled&&((R=(b=e.featureSettings.get().inplayGame)==null?void 0:b.onboarding)!=null&&R.completed)),T=!!((N=(A=e.featureSettings.get().inplayGame)==null?void 0:A.titleCard)!=null&&N.optIn);g?T?o.set(Le.Required):o.set(Le.Optional):T?o.set(Le.Unavailable):o.set(Le.Disabled)};return c(),t.userId.subscribe(d=>{d&&c()}),t.moderation.subscribe(d=>{d.data&&c()}),{$store:o,submitInplay:async()=>{const d=t.slStreamId.get();d&&(await Sg(n,d),o.set(Le.Completed),a.saveOnboardingStatus({organizationId:t.organizationId.get()||"",userId:t.userId.get()||"",eventId:d},Le.Completed))}}},Rg=new Set([re.POLL,re.PREDICTION,re.TRIVIA]);class Ag extends er{constructor(n,s,a){super(n,s);w(this,"userSummary");w(this,"feedList");w(this,"leaderboardId");w(this,"leaderboardList");w(this,"deepLink");w(this,"onboardingStatus");w(this,"openedQuestion");w(this,"currentUserId");w(this,"openedUser");w(this,"closeFeature");w(this,"openFeature");w(this,"notifications");w(this,"transport");w(this,"background");w(this,"storage");w(this,"connect",n=>{this.userSummary.invalidate(),this.leaderboardList.invalidate(),this.feedList.invalidate(),this.background.feedSubscription.addListener("feed-subscription-prediction-close",s=>{window.requestAnimationFrame(async()=>{var d,f;const a=(f=(d=s.data)==null?void 0:d.attributes)==null?void 0:f.question;if(!a)return;const{status:o,type:u,id:c}=a;if(o===Pe.RESOLVED&&u===re.PREDICTION){const g=this.background.getCurrentSessionId({prefix:`notification-id:${c}`}),T=await Ll(c,n),y=T==null?void 0:T.answers.find(({correct:R})=>R),b=T==null?void 0:T.answers.find(({youVoted:R})=>R);if(!b)return;this.notifications.add({type:Et.QUESTION_RESOLVED,action:()=>this.openQuestion(c),close:()=>this.closeQuestion(c),autoHideDuration:35e3,id:g,data:{questionType:re.PREDICTION,question:{title:y!=null&&y.youVoted?`Congratulations! You answered correctly! You won ${y.points} pts!`:`Better luck next time! Correct: ${y==null?void 0:y.text}!`,votedAnswer:{title:b==null?void 0:b.text,points:b==null?void 0:b.points},correctAnswerTitle:y==null?void 0:y.text,correct:y==null?void 0:y.youVoted,predictionResult:o===Pe.RESOLVED}}}),this.userSummary.invalidate()}})}),this.background.feedSubscription.addListener("feed-subscription-questions-list",()=>{window.requestAnimationFrame(()=>{var s;(s=this.feedList)==null||s.invalidate()})})});w(this,"disconnect",()=>{this.background.feedSubscription.removeListener("feed-subscription-questions-list")});w(this,"submitAnswer",async(n,s)=>{await bg(this.transport,{questionId:n,answerId:s}),this.feedList.invalidate(),this.userSummary.invalidate()});w(this,"skipQuestion",async n=>{await Eg(this.transport,n),this.feedList.invalidate(),this.userSummary.invalidate()});w(this,"openQuestion",n=>(this.openFeature(),this.background.openQuestion(n)));w(this,"closeQuestion",n=>this.background.closeQuestion(n));w(this,"openUser",n=>{var a;const s=(a=this.leaderboardList.$store.get().data)==null?void 0:a.find(o=>o.userId===n);this.openedUser.set(s)});w(this,"closeUser",()=>{this.openedUser.set(void 0)});this.background=Ol(a),this.storage=new Ml,this.userSummary=new Qe(ng(this.background.slStreamId,this.background.userId,a.transport),"gamification:userSummary"),this.feedList=this.background.feedList,this.currentUserId=this.background.userId,this.openedUser=Ue(void 0),this.leaderboardId=new Ye(Ue(this.settings.getValue("pinnedLeaderboardId")),"pinnedLeaderboardId").getStore(),this.onboardingStatus=Cg(this,this.background,a.transport,a.notifications),this.notifications=a.notifications,this.transport=a.transport,this.closeFeature=a.sdk.closeFeature,this.openFeature=()=>a.sdk.openFeature(me.GAMES),this.openedQuestion=this.background.openedQuestion,this.deepLink=wg(this.transport,this.background.slStreamId,this.background.userId),this.leaderboardList=vg(this.transport,this.background.slStreamId),this.status.subscribe(o=>{o===Ut.Ready?this.connect(a.transport):this.disconnect()}),this.background.activeQuestionId.listen(o=>{var u,c,d,f,g,T,y,b,R,A;if(o&&o.data&&this.onboardingStatus.$store.get()&&((u=o.data.question)==null?void 0:u.id)!==void 0&&o.data.question.notification!==void 0&&((d=(c=o.data.moderation)==null?void 0:c.bypassNotifications)==null?void 0:d.inAppSilence)!==Bs.ON&&o.data.question.status===Pe.ACTIVE){if(Rg.has(o.data.question.type))this.notifications.add({type:Et.QUESTION,action:()=>{var N;return((N=o.data)==null?void 0:N.question)&&this.openQuestion(o.data.question.id)},close:()=>{var N;return((N=o.data)==null?void 0:N.question)&&this.closeQuestion(o.data.question.id)},autoHideDuration:1e3*60,id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),data:{questionType:o.data.question.type,question:{title:o.data.question.notification.title}}});else if(o.data.question.type===re.FACTOID){const N=(f=o.data.question.options)==null?void 0:f.options.value,_={heading:o.data.question.notification.title,body:o.data.question.notification.body,image:o.data.question.notification.image,video:{id:((g=N==null?void 0:N.video)==null?void 0:g.id)||"",url:((T=N==null?void 0:N.video)==null?void 0:T.url)||"",thumbnailUrl:((y=N==null?void 0:N.video)==null?void 0:y.thumbnailUrl)||""},webLink:{label:"",url:""}};this.notifications.add({type:Et.QUESTION,action:()=>{var I;return((I=o.data)==null?void 0:I.question)&&this.openQuestion(o.data.question.id)},close:()=>{var I;return((I=o.data)==null?void 0:I.question)&&this.closeQuestion(o.data.question.id)},autoHideDuration:1e3*120,id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),data:{questionType:o.data.question.type,insight:_}})}else if(o.data.question.type===re.TWEET){const N=(b=o.data.question.options)==null?void 0:b.options.value,_={title:o.data.question.notification.title,body:o.data.question.notification.body,image:o.data.question.notification.image,account:{image:"",name:((R=N==null?void 0:N.tweetMeta)==null?void 0:R.account)||"",userName:"",verified:!!((A=N==null?void 0:N.tweetMeta)!=null&&A.accountVerified)}};this.notifications.add({type:Et.QUESTION,action:()=>{var I;return((I=o.data)==null?void 0:I.question)&&this.openQuestion(o.data.question.id)},close:()=>{var I;return((I=o.data)==null?void 0:I.question)&&this.closeQuestion(o.data.question.id)},autoHideDuration:1e3*120,id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),data:{questionType:o.data.question.type,tweet:_}})}}})}}class Ig extends er{constructor(n,s,a){super(n,s);w(this,"insights");w(this,"closeFeature");w(this,"openFeature");w(this,"openedInsight");w(this,"notifications");w(this,"transport");w(this,"background");w(this,"connect",()=>{this.insights?this.insights.invalidate():this.insights=new Qe(cg(this.background.slStreamId,this.transport),"gamification:insights"),this.background.feedSubscription.addListener("feed-subscription-insights-list",()=>{window.requestAnimationFrame(()=>{var n;(n=this.insights)==null||n.invalidate()})})});w(this,"disconnect",()=>{this.background.feedSubscription.removeListener("feed-subscription-insights-list")});w(this,"openHighlight",n=>(this.openFeature(),this.background.openQuestion(n)));w(this,"closeHighlight",n=>this.background.closeQuestion(n));this.background=Ol(a),this.notifications=a.notifications,this.transport=a.transport,this.closeFeature=a.sdk.closeFeature,this.openFeature=()=>a.sdk.openFeature(me.HIGHLIGHTS),this.status.subscribe(o=>{o===Ut.Ready?this.connect():this.disconnect()}),this.background.activeQuestionId.listen(o=>{var u,c,d,f,g,T,y,b;(c=(u=o==null?void 0:o.data)==null?void 0:u.question)!=null&&c.id&&((f=(d=o==null?void 0:o.data)==null?void 0:d.question)!=null&&f.notification)&&((T=(g=o.data.moderation)==null?void 0:g.bypassNotifications)==null?void 0:T.inAppSilence)!==Bs.ON&&o.data.question.type===re.FACTOID&&o.data.question.status===Pe.ACTIVE&&this.notifications.add({type:Et.QUESTION,action:()=>{var R;return((R=o.data)==null?void 0:R.question)&&this.openHighlight(o.data.question.id)},close:()=>{var R;return((R=o.data)==null?void 0:R.question)&&this.closeHighlight(o.data.question.id)},autoHideDuration:1e3*+(((b=(y=o.data.question)==null?void 0:y.appearance)==null?void 0:b.autoHideInterval)||"5"),id:this.background.getCurrentSessionId({prefix:"notification",entity:o.data.question.id}),data:{questionType:o.data.question.type,question:{title:o.data.question.notification.title}}})}),this.openedInsight=this.background.openedQuestion}}me.GAMES+"",me.HIGHLIGHTS+"";class Ng extends er{constructor(t,n){super(t,n)}}const Lg=(e,t,n)=>e.type===me.GAMES?new Ag(e,t,n):e.type===me.HIGHLIGHTS?new Ig(e,t,n):new Ng(e,t),Og=(e,t,n)=>{e.features=new Map,e.activeFeature=new Ye(Ue(me.UNSET),"activeFeature"),e.sdk.getFeatures=()=>e.features,e.sdk.getFeature=s=>e.features.get(s),e.sdk.getActiveFeature=()=>e.activeFeature.getStore(),e.sdk.openFeature=s=>{e.activeFeature.setValue(s)},e.sdk.closeFeature=()=>{e.activeFeature.setValue(me.UNSET)},e.initFeature=(s,a=mt.ORGANIZATION)=>{const o=Lg(s,a,e);e.features.set(s.type,o)},e.updateFeature=(s,a)=>{var o;(o=e.features.get(s.type))==null||o.update(s,a)},e.destroyFeature=s=>{e.features.delete(s.type)},e.reinitializeFeatures=async()=>{const s=await e.stores.organizationSettings.getValue();e.features.clear();for(const a of(s==null?void 0:s.overlays)||[])e.initFeature(a,mt.ORGANIZATION)},e.stores.providerStreamId.listen(s=>{s||e.reinitializeFeatures()}),e.storeSubscribe=()=>{const s=(o,u)=>{if(u!=null&&u.overlays){o===mt.STREAM&&e.features.clear();for(const c of u.overlays)c.sdkEnable===!0&&(e.features.has(c.type)?e.updateFeature(c,o):e.initFeature(c,o))}},a={organizationSettings:o=>{if(o.data)try{s(mt.ORGANIZATION,o.data)}catch(u){console.log(u)}},streamSettings:o=>{if(o.data)try{s(mt.STREAM,o.data)}catch(u){console.log(u)}}};e.store.subscribe(a)},n()};var sr={exports:{}},rr={exports:{}};function Mg(e){var t=new e,n=t;function s(){var o=t;return o.next?t=o.next:(t=new e,n=t),o.next=null,o}function a(o){n.next=o,n=o}return{get:s,release:a}}var xg=Mg,Bg=xg;function xl(e,t,n){if(typeof e=="function"&&(n=t,t=e,e=null),n<1)throw new Error("fastqueue concurrency must be greater than 1");var s=Bg(Pg),a=null,o=null,u=0,c=null,d={push:A,drain:$e,saturated:$e,pause:g,paused:!1,concurrency:n,running:f,resume:b,idle:R,length:T,getQueue:y,unshift:N,empty:$e,kill:I,killAndDrain:P,error:U};return d;function f(){return u}function g(){d.paused=!0}function T(){for(var B=a,V=0;B;)B=B.next,V++;return V}function y(){for(var B=a,V=[];B;)V.push(B.value),B=B.next;return V}function b(){if(d.paused){d.paused=!1;for(var B=0;B<d.concurrency;B++)u++,_()}}function R(){return u===0&&d.length()===0}function A(B,V){var D=s.get();D.context=e,D.release=_,D.value=B,D.callback=V||$e,D.errorHandler=c,u===d.concurrency||d.paused?o?(o.next=D,o=D):(a=D,o=D,d.saturated()):(u++,t.call(e,D.value,D.worked))}function N(B,V){var D=s.get();D.context=e,D.release=_,D.value=B,D.callback=V||$e,u===d.concurrency||d.paused?a?(D.next=a,a=D):(a=D,o=D,d.saturated()):(u++,t.call(e,D.value,D.worked))}function _(B){B&&s.release(B);var V=a;V?d.paused?u--:(o===a&&(o=null),a=V.next,V.next=null,t.call(e,V.value,V.worked),o===null&&d.empty()):--u===0&&d.drain()}function I(){a=null,o=null,d.drain=$e}function P(){a=null,o=null,d.drain(),d.drain=$e}function U(B){c=B}}function $e(){}function Pg(){this.value=null,this.callback=$e,this.next=null,this.release=$e,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var s=e.callback,a=e.errorHandler,o=e.value;e.value=null,e.callback=$e,e.errorHandler&&a(t,o),s.call(e.context,t,n),e.release(e)}}function Ug(e,t,n){typeof e=="function"&&(n=t,t=e,e=null);function s(g,T){t.call(this,g).then(function(y){T(null,y)},T)}var a=xl(e,s,n),o=a.push,u=a.unshift;return a.push=c,a.unshift=d,a.drained=f,a;function c(g){var T=new Promise(function(y,b){o(g,function(R,A){if(R){b(R);return}y(A)})});return T.catch($e),T}function d(g){var T=new Promise(function(y,b){u(g,function(R,A){if(R){b(R);return}y(A)})});return T.catch($e),T}function f(){if(a.idle())return new Promise(function(y){y()});var g=a.drain,T=new Promise(function(y){a.drain=function(){g(),y()}});return T}}rr.exports=xl;rr.exports.promise=Ug;var Bl=rr.exports,ir={exports:{}},ln=typeof Reflect=="object"?Reflect:null,xi=ln&&typeof ln.apply=="function"?ln.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},zn;ln&&typeof ln.ownKeys=="function"?zn=ln.ownKeys:Object.getOwnPropertySymbols?zn=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:zn=function(e){return Object.getOwnPropertyNames(e)};function Fg(e){console&&console.warn&&console.warn(e)}var Pl=Number.isNaN||function(e){return e!==e};function le(){le.init.call(this)}ir.exports=le;ir.exports.once=Gg;le.EventEmitter=le;le.prototype._events=void 0;le.prototype._eventsCount=0;le.prototype._maxListeners=void 0;var Bi=10;function Sa(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(le,"defaultMaxListeners",{enumerable:!0,get:function(){return Bi},set:function(e){if(typeof e!="number"||e<0||Pl(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Bi=e}});le.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};le.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Pl(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 Ul(e){return e._maxListeners===void 0?le.defaultMaxListeners:e._maxListeners}le.prototype.getMaxListeners=function(){return Ul(this)};le.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var s=e==="error",a=this._events;if(a!==void 0)s=s&&a.error===void 0;else if(!s)return!1;if(s){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var u=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw u.context=o,u}var c=a[e];if(c===void 0)return!1;if(typeof c=="function")xi(c,this,t);else for(var d=c.length,f=Gl(c,d),n=0;n<d;++n)xi(f[n],this,t);return!0};function Fl(e,t,n,s){var a,o,u;if(Sa(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),u=o[t]),u===void 0)u=o[t]=n,++e._eventsCount;else if(typeof u=="function"?u=o[t]=s?[n,u]:[u,n]:s?u.unshift(n):u.push(n),a=Ul(e),a>0&&u.length>a&&!u.warned){u.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=u.length,Fg(c)}return e}le.prototype.addListener=function(e,t){return Fl(this,e,t,!1)};le.prototype.on=le.prototype.addListener;le.prototype.prependListener=function(e,t){return Fl(this,e,t,!0)};function Dg(){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 Dl(e,t,n){var s={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=Dg.bind(s);return a.listener=n,s.wrapFn=a,a}le.prototype.once=function(e,t){return Sa(t),this.on(e,Dl(this,e,t)),this};le.prototype.prependOnceListener=function(e,t){return Sa(t),this.prependListener(e,Dl(this,e,t)),this};le.prototype.removeListener=function(e,t){var n,s,a,o,u;if(Sa(t),s=this._events,s===void 0)return this;if(n=s[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(a=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){u=n[o].listener,a=o;break}if(a<0)return this;a===0?n.shift():Vg(n,a),n.length===1&&(s[e]=n[0]),s.removeListener!==void 0&&this.emit("removeListener",e,u||t)}return this};le.prototype.off=le.prototype.removeListener;le.prototype.removeAllListeners=function(e){var t,n,s;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var a=Object.keys(n),o;for(s=0;s<a.length;++s)o=a[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(s=t.length-1;s>=0;s--)this.removeListener(e,t[s]);return this};function Vl(e,t,n){var s=e._events;if(s===void 0)return[];var a=s[t];return a===void 0?[]:typeof a=="function"?n?[a.listener||a]:[a]:n?jg(a):Gl(a,a.length)}le.prototype.listeners=function(e){return Vl(this,e,!0)};le.prototype.rawListeners=function(e){return Vl(this,e,!1)};le.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):jl.call(e,t)};le.prototype.listenerCount=jl;function jl(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}le.prototype.eventNames=function(){return this._eventsCount>0?zn(this._events):[]};function Gl(e,t){for(var n=new Array(t),s=0;s<t;++s)n[s]=e[s];return n}function Vg(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function jg(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function Gg(e,t){return new Promise(function(n,s){function a(u){e.removeListener(t,o),s(u)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",a),n([].slice.call(arguments))}ql(e,t,o,{once:!0}),t!=="error"&&qg(e,a,{once:!0})})}function qg(e,t,n){typeof e.on=="function"&&ql(e,"error",t,n)}function ql(e,t,n,s){if(typeof e.on=="function")s.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function a(o){s.once&&e.removeEventListener(t,a),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var $l=ir.exports,Ea={},Hl={},zl=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var s=42;e[t]=s;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==s||o.enumerable!==!0)return!1}return!0},$g=zl,or=function(){return $g()&&!!Symbol.toStringTag},Pi=typeof Symbol<"u"&&Symbol,Hg=zl,zg=function(){return typeof Pi!="function"||typeof Symbol!="function"||typeof Pi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Hg()},Ui={foo:{}},Qg=Object,Yg=function(){return{__proto__:Ui}.foo===Ui.foo&&!({__proto__:null}instanceof Qg)},Kg="Function.prototype.bind called on incompatible ",Wg=Object.prototype.toString,Zg=Math.max,Jg="[object Function]",Fi=function(e,t){for(var n=[],s=0;s<e.length;s+=1)n[s]=e[s];for(var a=0;a<t.length;a+=1)n[a+e.length]=t[a];return n},Xg=function(e,t){for(var n=[],s=t||0,a=0;s<e.length;s+=1,a+=1)n[a]=e[s];return n},ey=function(e,t){for(var n="",s=0;s<e.length;s+=1)n+=e[s],s+1<e.length&&(n+=t);return n},ty=function(e){var t=this;if(typeof t!="function"||Wg.apply(t)!==Jg)throw new TypeError(Kg+t);for(var n=Xg(arguments,1),s,a=function(){if(this instanceof s){var f=t.apply(this,Fi(n,arguments));return Object(f)===f?f:this}return t.apply(e,Fi(n,arguments))},o=Zg(0,t.length-n.length),u=[],c=0;c<o;c++)u[c]="$"+c;if(s=Function("binder","return function ("+ey(u,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var d=function(){};d.prototype=t.prototype,s.prototype=new d,d.prototype=null}return s},ny=ty,Ql=Function.prototype.bind||ny,Di={}.hasOwnProperty,qa=Function.prototype.call,ay=qa.bind?qa.bind(Di):function(e,t){return qa.call(Di,e,t)},ne,dn=SyntaxError,Yl=Function,cn=TypeError,$a=function(e){try{return Yl('"use strict"; return ('+e+").constructor;")()}catch{}},Ft=Object.getOwnPropertyDescriptor;if(Ft)try{Ft({},"")}catch{Ft=null}var Ha=function(){throw new cn},sy=Ft?function(){try{return arguments.callee,Ha}catch{try{return Ft(arguments,"callee").get}catch{return Ha}}}():Ha,Zt=zg(),ry=Yg(),Ee=Object.getPrototypeOf||(ry?function(e){return e.__proto__}:null),Xt={},iy=typeof Uint8Array>"u"||!Ee?ne:Ee(Uint8Array),Dt={"%AggregateError%":typeof AggregateError>"u"?ne:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ne:ArrayBuffer,"%ArrayIteratorPrototype%":Zt&&Ee?Ee([][Symbol.iterator]()):ne,"%AsyncFromSyncIteratorPrototype%":ne,"%AsyncFunction%":Xt,"%AsyncGenerator%":Xt,"%AsyncGeneratorFunction%":Xt,"%AsyncIteratorPrototype%":Xt,"%Atomics%":typeof Atomics>"u"?ne:Atomics,"%BigInt%":typeof BigInt>"u"?ne:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ne:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ne:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ne:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ne:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ne:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ne:FinalizationRegistry,"%Function%":Yl,"%GeneratorFunction%":Xt,"%Int8Array%":typeof Int8Array>"u"?ne:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ne:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ne:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Zt&&Ee?Ee(Ee([][Symbol.iterator]())):ne,"%JSON%":typeof JSON=="object"?JSON:ne,"%Map%":typeof Map>"u"?ne:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Zt||!Ee?ne:Ee(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ne:Promise,"%Proxy%":typeof Proxy>"u"?ne:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ne:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ne:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Zt||!Ee?ne:Ee(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ne:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Zt&&Ee?Ee(""[Symbol.iterator]()):ne,"%Symbol%":Zt?Symbol:ne,"%SyntaxError%":dn,"%ThrowTypeError%":sy,"%TypedArray%":iy,"%TypeError%":cn,"%Uint8Array%":typeof Uint8Array>"u"?ne:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ne:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ne:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ne:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ne:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ne:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ne:WeakSet};if(Ee)try{null.error}catch(e){var oy=Ee(Ee(e));Dt["%Error.prototype%"]=oy}var ly=function e(t){var n;if(t==="%AsyncFunction%")n=$a("async function () {}");else if(t==="%GeneratorFunction%")n=$a("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=$a("async function* () {}");else if(t==="%AsyncGenerator%"){var s=e("%AsyncGeneratorFunction%");s&&(n=s.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=e("%AsyncGenerator%");a&&Ee&&(n=Ee(a.prototype))}return Dt[t]=n,n},Vi={"%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"]},xn=Ql,aa=ay,cy=xn.call(Function.call,Array.prototype.concat),uy=xn.call(Function.apply,Array.prototype.splice),ji=xn.call(Function.call,String.prototype.replace),sa=xn.call(Function.call,String.prototype.slice),my=xn.call(Function.call,RegExp.prototype.exec),dy=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,py=/\\(\\)?/g,fy=function(e){var t=sa(e,0,1),n=sa(e,-1);if(t==="%"&&n!=="%")throw new dn("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new dn("invalid intrinsic syntax, expected opening `%`");var s=[];return ji(e,dy,function(a,o,u,c){s[s.length]=u?ji(c,py,"$1"):o||a}),s},hy=function(e,t){var n=e,s;if(aa(Vi,n)&&(s=Vi[n],n="%"+s[0]+"%"),aa(Dt,n)){var a=Dt[n];if(a===Xt&&(a=ly(n)),typeof a>"u"&&!t)throw new cn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:s,name:n,value:a}}throw new dn("intrinsic "+e+" does not exist!")},yn=function(e,t){if(typeof e!="string"||e.length===0)throw new cn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new cn('"allowMissing" argument must be a boolean');if(my(/^%?[^%]*%?$/,e)===null)throw new dn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=fy(e),s=n.length>0?n[0]:"",a=hy("%"+s+"%",t),o=a.name,u=a.value,c=!1,d=a.alias;d&&(s=d[0],uy(n,cy([0,1],d)));for(var f=1,g=!0;f<n.length;f+=1){var T=n[f],y=sa(T,0,1),b=sa(T,-1);if((y==='"'||y==="'"||y==="`"||b==='"'||b==="'"||b==="`")&&y!==b)throw new dn("property names with quotes must have matching quotes");if((T==="constructor"||!g)&&(c=!0),s+="."+T,o="%"+s+"%",aa(Dt,o))u=Dt[o];else if(u!=null){if(!(T in u)){if(!t)throw new cn("base intrinsic for "+e+" exists, but the property is not available.");return}if(Ft&&f+1>=n.length){var R=Ft(u,T);g=!!R,g&&"get"in R&&!("originalValue"in R.get)?u=R.get:u=u[T]}else g=aa(u,T),u=u[T];g&&!c&&(Dt[o]=u)}}return u},Kl={exports:{}},gy=yn,Ss=gy("%Object.defineProperty%",!0),Es=function(){if(Ss)try{return Ss({},"a",{value:1}),!0}catch{return!1}return!1};Es.hasArrayLengthDefineBug=function(){if(!Es())return null;try{return Ss([],"length",{value:1}).length!==1}catch{return!0}};var Wl=Es,yy=yn,Qn=yy("%Object.getOwnPropertyDescriptor%",!0);if(Qn)try{Qn([],"length")}catch{Qn=null}var lr=Qn,Ty=Wl(),cr=yn,Rn=Ty&&cr("%Object.defineProperty%",!0);if(Rn)try{Rn({},"a",{value:1})}catch{Rn=!1}var ky=cr("%SyntaxError%"),Jt=cr("%TypeError%"),Gi=lr,by=function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Jt("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Jt("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Jt("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Jt("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Jt("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Jt("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,c=!!Gi&&Gi(e,t);if(Rn)Rn(e,t,{configurable:o===null&&c?c.configurable:!o,enumerable:s===null&&c?c.enumerable:!s,value:n,writable:a===null&&c?c.writable:!a});else if(u||!s&&!a&&!o)e[t]=n;else throw new ky("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Zl=yn,qi=by,Sy=Wl(),$i=lr,Hi=Zl("%TypeError%"),Ey=Zl("%Math.floor%"),vy=function(e,t){if(typeof e!="function")throw new Hi("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||Ey(t)!==t)throw new Hi("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],s=!0,a=!0;if("length"in e&&$i){var o=$i(e,"length");o&&!o.configurable&&(s=!1),o&&!o.writable&&(a=!1)}return(s||a||!n)&&(Sy?qi(e,"length",t,!0,!0):qi(e,"length",t)),e};(function(e){var t=Ql,n=yn,s=vy,a=n("%TypeError%"),o=n("%Function.prototype.apply%"),u=n("%Function.prototype.call%"),c=n("%Reflect.apply%",!0)||t.call(u,o),d=n("%Object.defineProperty%",!0),f=n("%Math.max%");if(d)try{d({},"a",{value:1})}catch{d=null}e.exports=function(T){if(typeof T!="function")throw new a("a function is required");var y=c(t,u,arguments);return s(y,1+f(0,T.length-(arguments.length-1)),!0)};var g=function(){return c(t,o,arguments)};d?d(e.exports,"apply",{value:g}):e.exports.apply=g})(Kl);var Jl=Kl.exports,Xl=yn,ec=Jl,_y=ec(Xl("String.prototype.indexOf")),tc=function(e,t){var n=Xl(e,!!t);return typeof n=="function"&&_y(e,".prototype.")>-1?ec(n):n},wy=or(),Cy=tc,vs=Cy("Object.prototype.toString"),va=function(e){return wy&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:vs(e)==="[object Arguments]"},nc=function(e){return va(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&vs(e)!=="[object Array]"&&vs(e.callee)==="[object Function]"},Ry=function(){return va(arguments)}();va.isLegacyArguments=nc;var Ay=Ry?va:nc,Iy=Object.prototype.toString,Ny=Function.prototype.toString,Ly=/^\s*(?:function)?\*/,ac=or(),za=Object.getPrototypeOf,Oy=function(){if(!ac)return!1;try{return Function("return function*() {}")()}catch{}},Qa,My=function(e){if(typeof e!="function")return!1;if(Ly.test(Ny.call(e)))return!0;if(!ac){var t=Iy.call(e);return t==="[object GeneratorFunction]"}if(!za)return!1;if(typeof Qa>"u"){var n=Oy();Qa=n?za(n):!1}return za(e)===Qa},sc=Function.prototype.toString,nn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,_s,Yn;if(typeof nn=="function"&&typeof Object.defineProperty=="function")try{_s=Object.defineProperty({},"length",{get:function(){throw Yn}}),Yn={},nn(function(){throw 42},null,_s)}catch(e){e!==Yn&&(nn=null)}else nn=null;var xy=/^\s*class\b/,ws=function(e){try{var t=sc.call(e);return xy.test(t)}catch{return!1}},Ya=function(e){try{return ws(e)?!1:(sc.call(e),!0)}catch{return!1}},Kn=Object.prototype.toString,By="[object Object]",Py="[object Function]",Uy="[object GeneratorFunction]",Fy="[object HTMLAllCollection]",Dy="[object HTML document.all class]",Vy="[object HTMLCollection]",jy=typeof Symbol=="function"&&!!Symbol.toStringTag,Gy=!(0 in[,]),Cs=function(){return!1};if(typeof document=="object"){var qy=document.all;Kn.call(qy)===Kn.call(document.all)&&(Cs=function(e){if((Gy||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=Kn.call(e);return(t===Fy||t===Dy||t===Vy||t===By)&&e("")==null}catch{}return!1})}var $y=nn?function(e){if(Cs(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{nn(e,null,_s)}catch(t){if(t!==Yn)return!1}return!ws(e)&&Ya(e)}:function(e){if(Cs(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(jy)return Ya(e);if(ws(e))return!1;var t=Kn.call(e);return t!==Py&&t!==Uy&&!/^\[object HTML/.test(t)?!1:Ya(e)},Hy=$y,zy=Object.prototype.toString,rc=Object.prototype.hasOwnProperty,Qy=function(e,t,n){for(var s=0,a=e.length;s<a;s++)rc.call(e,s)&&(n==null?t(e[s],s,e):t.call(n,e[s],s,e))},Yy=function(e,t,n){for(var s=0,a=e.length;s<a;s++)n==null?t(e.charAt(s),s,e):t.call(n,e.charAt(s),s,e)},Ky=function(e,t,n){for(var s in e)rc.call(e,s)&&(n==null?t(e[s],s,e):t.call(n,e[s],s,e))},Wy=function(e,t,n){if(!Hy(t))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=n),zy.call(e)==="[object Array]"?Qy(e,t,s):typeof e=="string"?Yy(e,t,s):Ky(e,t,s)},Zy=Wy,Ka=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],Jy=typeof globalThis>"u"?vl:globalThis,Xy=function(){for(var e=[],t=0;t<Ka.length;t++)typeof Jy[Ka[t]]=="function"&&(e[e.length]=Ka[t]);return e},ra=Zy,e4=Xy,zi=Jl,ur=tc,Wn=lr,t4=ur("Object.prototype.toString"),ic=or(),Qi=typeof globalThis>"u"?vl:globalThis,Rs=e4(),mr=ur("String.prototype.slice"),Wa=Object.getPrototypeOf,n4=ur("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},ia={__proto__:null};ic&&Wn&&Wa?ra(Rs,function(e){var t=new Qi[e];if(Symbol.toStringTag in t){var n=Wa(t),s=Wn(n,Symbol.toStringTag);if(!s){var a=Wa(n);s=Wn(a,Symbol.toStringTag)}ia["$"+e]=zi(s.get)}}):ra(Rs,function(e){var t=new Qi[e],n=t.slice||t.set;n&&(ia["$"+e]=zi(n))});var a4=function(e){var t=!1;return ra(ia,function(n,s){if(!t)try{"$"+n(e)===s&&(t=mr(s,1))}catch{}}),t},s4=function(e){var t=!1;return ra(ia,function(n,s){if(!t)try{n(e),t=mr(s,1)}catch{}}),t},oc=function(e){if(!e||typeof e!="object")return!1;if(!ic){var t=mr(t4(e),8,-1);return n4(Rs,t)>-1?t:t!=="Object"?!1:s4(e)}return Wn?a4(e):null},r4=oc,i4=function(e){return!!r4(e)};(function(e){var t=Ay,n=My,s=oc,a=i4;function o(x){return x.call.bind(x)}var u=typeof BigInt<"u",c=typeof Symbol<"u",d=o(Object.prototype.toString),f=o(Number.prototype.valueOf),g=o(String.prototype.valueOf),T=o(Boolean.prototype.valueOf);if(u)var y=o(BigInt.prototype.valueOf);if(c)var b=o(Symbol.prototype.valueOf);function R(x,Rt){if(typeof x!="object")return!1;try{return Rt(x),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=a;function A(x){return typeof Promise<"u"&&x instanceof Promise||x!==null&&typeof x=="object"&&typeof x.then=="function"&&typeof x.catch=="function"}e.isPromise=A;function N(x){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(x):a(x)||O(x)}e.isArrayBufferView=N;function _(x){return s(x)==="Uint8Array"}e.isUint8Array=_;function I(x){return s(x)==="Uint8ClampedArray"}e.isUint8ClampedArray=I;function P(x){return s(x)==="Uint16Array"}e.isUint16Array=P;function U(x){return s(x)==="Uint32Array"}e.isUint32Array=U;function B(x){return s(x)==="Int8Array"}e.isInt8Array=B;function V(x){return s(x)==="Int16Array"}e.isInt16Array=V;function D(x){return s(x)==="Int32Array"}e.isInt32Array=D;function $(x){return s(x)==="Float32Array"}e.isFloat32Array=$;function ee(x){return s(x)==="Float64Array"}e.isFloat64Array=ee;function ue(x){return s(x)==="BigInt64Array"}e.isBigInt64Array=ue;function ce(x){return s(x)==="BigUint64Array"}e.isBigUint64Array=ce;function ke(x){return d(x)==="[object Map]"}ke.working=typeof Map<"u"&&ke(new Map);function de(x){return typeof Map>"u"?!1:ke.working?ke(x):x instanceof Map}e.isMap=de;function se(x){return d(x)==="[object Set]"}se.working=typeof Set<"u"&&se(new Set);function pe(x){return typeof Set>"u"?!1:se.working?se(x):x instanceof Set}e.isSet=pe;function De(x){return d(x)==="[object WeakMap]"}De.working=typeof WeakMap<"u"&&De(new WeakMap);function rt(x){return typeof WeakMap>"u"?!1:De.working?De(x):x instanceof WeakMap}e.isWeakMap=rt;function je(x){return d(x)==="[object WeakSet]"}je.working=typeof WeakSet<"u"&&je(new WeakSet);function Ce(x){return je(x)}e.isWeakSet=Ce;function Re(x){return d(x)==="[object ArrayBuffer]"}Re.working=typeof ArrayBuffer<"u"&&Re(new ArrayBuffer);function q(x){return typeof ArrayBuffer>"u"?!1:Re.working?Re(x):x instanceof ArrayBuffer}e.isArrayBuffer=q;function v(x){return d(x)==="[object DataView]"}v.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&v(new DataView(new ArrayBuffer(1),0,1));function O(x){return typeof DataView>"u"?!1:v.working?v(x):x instanceof DataView}e.isDataView=O;var F=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function H(x){return d(x)==="[object SharedArrayBuffer]"}function ie(x){return typeof F>"u"?!1:(typeof H.working>"u"&&(H.working=H(new F)),H.working?H(x):x instanceof F)}e.isSharedArrayBuffer=ie;function te(x){return d(x)==="[object AsyncFunction]"}e.isAsyncFunction=te;function z(x){return d(x)==="[object Map Iterator]"}e.isMapIterator=z;function X(x){return d(x)==="[object Set Iterator]"}e.isSetIterator=X;function ae(x){return d(x)==="[object Generator]"}e.isGeneratorObject=ae;function xe(x){return d(x)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=xe;function Ve(x){return R(x,f)}e.isNumberObject=Ve;function be(x){return R(x,g)}e.isStringObject=be;function Se(x){return R(x,T)}e.isBooleanObject=Se;function kt(x){return u&&R(x,y)}e.isBigIntObject=kt;function qt(x){return c&&R(x,b)}e.isSymbolObject=qt;function it(x){return Ve(x)||be(x)||Se(x)||kt(x)||qt(x)}e.isBoxedPrimitive=it;function kn(x){return typeof Uint8Array<"u"&&(q(x)||ie(x))}e.isAnyArrayBuffer=kn,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(x){Object.defineProperty(e,x,{enumerable:!1,value:function(){throw new Error(x+" is not supported in userland")}})})})(Hl);var o4=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},As={exports:{}};typeof Object.create=="function"?As.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:As.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var l4=As.exports;(function(e){var t=Object.getOwnPropertyDescriptors||function(v){for(var O=Object.keys(v),F={},H=0;H<O.length;H++)F[O[H]]=Object.getOwnPropertyDescriptor(v,O[H]);return F},n=/%[sdj%]/g;e.format=function(v){if(!B(v)){for(var O=[],F=0;F<arguments.length;F++)O.push(u(arguments[F]));return O.join(" ")}for(var F=1,H=arguments,ie=H.length,te=String(v).replace(n,function(ae){if(ae==="%%")return"%";if(F>=ie)return ae;switch(ae){case"%s":return String(H[F++]);case"%d":return Number(H[F++]);case"%j":try{return JSON.stringify(H[F++])}catch{return"[Circular]"}default:return ae}}),z=H[F];F<ie;z=H[++F])I(z)||!ee(z)?te+=" "+z:te+=" "+u(z);return te},e.deprecate=function(v,O){if(typeof W.process<"u"&&W.process.noDeprecation===!0)return v;if(typeof W.process>"u")return function(){return e.deprecate(v,O).apply(this,arguments)};var F=!1;function H(){if(!F){if(W.process.throwDeprecation)throw new Error(O);W.process.traceDeprecation?console.trace(O):console.error(O),F=!0}return v.apply(this,arguments)}return H};var s={},a=/^$/;if(W.process.env.NODE_DEBUG){var o=W.process.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+o+"$","i")}e.debuglog=function(v){if(v=v.toUpperCase(),!s[v])if(a.test(v)){var O=W.process.pid;s[v]=function(){var F=e.format.apply(e,arguments);console.error("%s %d: %s",v,O,F)}}else s[v]=function(){};return s[v]};function u(v,O){var F={seen:[],stylize:d};return arguments.length>=3&&(F.depth=arguments[2]),arguments.length>=4&&(F.colors=arguments[3]),_(O)?F.showHidden=O:O&&e._extend(F,O),D(F.showHidden)&&(F.showHidden=!1),D(F.depth)&&(F.depth=2),D(F.colors)&&(F.colors=!1),D(F.customInspect)&&(F.customInspect=!0),F.colors&&(F.stylize=c),g(F,v,F.depth)}e.inspect=u,u.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]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function c(v,O){var F=u.styles[O];return F?"\x1B["+u.colors[F][0]+"m"+v+"\x1B["+u.colors[F][1]+"m":v}function d(v,O){return v}function f(v){var O={};return v.forEach(function(F,H){O[F]=!0}),O}function g(v,O,F){if(v.customInspect&&O&&ke(O.inspect)&&O.inspect!==e.inspect&&!(O.constructor&&O.constructor.prototype===O)){var H=O.inspect(F,v);return B(H)||(H=g(v,H,F)),H}var ie=T(v,O);if(ie)return ie;var te=Object.keys(O),z=f(te);if(v.showHidden&&(te=Object.getOwnPropertyNames(O)),ce(O)&&(te.indexOf("message")>=0||te.indexOf("description")>=0))return y(O);if(te.length===0){if(ke(O)){var X=O.name?": "+O.name:"";return v.stylize("[Function"+X+"]","special")}if($(O))return v.stylize(RegExp.prototype.toString.call(O),"regexp");if(ue(O))return v.stylize(Date.prototype.toString.call(O),"date");if(ce(O))return y(O)}var ae="",xe=!1,Ve=["{","}"];if(N(O)&&(xe=!0,Ve=["[","]"]),ke(O)){var be=O.name?": "+O.name:"";ae=" [Function"+be+"]"}if($(O)&&(ae=" "+RegExp.prototype.toString.call(O)),ue(O)&&(ae=" "+Date.prototype.toUTCString.call(O)),ce(O)&&(ae=" "+y(O)),te.length===0&&(!xe||O.length==0))return Ve[0]+ae+Ve[1];if(F<0)return $(O)?v.stylize(RegExp.prototype.toString.call(O),"regexp"):v.stylize("[Object]","special");v.seen.push(O);var Se;return xe?Se=b(v,O,F,z,te):Se=te.map(function(kt){return R(v,O,F,z,kt,xe)}),v.seen.pop(),A(Se,ae,Ve)}function T(v,O){if(D(O))return v.stylize("undefined","undefined");if(B(O)){var F="'"+JSON.stringify(O).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return v.stylize(F,"string")}if(U(O))return v.stylize(""+O,"number");if(_(O))return v.stylize(""+O,"boolean");if(I(O))return v.stylize("null","null")}function y(v){return"["+Error.prototype.toString.call(v)+"]"}function b(v,O,F,H,ie){for(var te=[],z=0,X=O.length;z<X;++z)je(O,String(z))?te.push(R(v,O,F,H,String(z),!0)):te.push("");return ie.forEach(function(ae){ae.match(/^\d+$/)||te.push(R(v,O,F,H,ae,!0))}),te}function R(v,O,F,H,ie,te){var z,X,ae;if(ae=Object.getOwnPropertyDescriptor(O,ie)||{value:O[ie]},ae.get?ae.set?X=v.stylize("[Getter/Setter]","special"):X=v.stylize("[Getter]","special"):ae.set&&(X=v.stylize("[Setter]","special")),je(H,ie)||(z="["+ie+"]"),X||(v.seen.indexOf(ae.value)<0?(I(F)?X=g(v,ae.value,null):X=g(v,ae.value,F-1),X.indexOf(`
|
|
17
17
|
`)>-1&&(te?X=X.split(`
|
|
18
18
|
`).map(function(xe){return" "+xe}).join(`
|
|
19
19
|
`).slice(2):X=`
|
package/lib/dist/es/masters.js
CHANGED
|
@@ -17794,7 +17794,7 @@ class Dg extends as {
|
|
|
17794
17794
|
predictionResult: o === Ve.RESOLVED
|
|
17795
17795
|
}
|
|
17796
17796
|
}
|
|
17797
|
-
});
|
|
17797
|
+
}), this.userSummary.invalidate();
|
|
17798
17798
|
}
|
|
17799
17799
|
});
|
|
17800
17800
|
}), this.background.feedSubscription.addListener("feed-subscription-questions-list", () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "StreamLayer, Inc (https://streamlayer.io)",
|
|
6
6
|
"maintainers": [
|
|
@@ -54,16 +54,16 @@
|
|
|
54
54
|
}
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@streamlayer/feature-gamification": "^0.27.
|
|
58
|
-
"@streamlayer/sdk-web": "^0.29.
|
|
57
|
+
"@streamlayer/feature-gamification": "^0.27.1",
|
|
58
|
+
"@streamlayer/sdk-web": "^0.29.2",
|
|
59
59
|
"@streamlayer/sdk-web-api": "^0.1.0",
|
|
60
60
|
"@streamlayer/sdk-web-core": "^0.0.5",
|
|
61
|
-
"@streamlayer/sdk-web-features": "^0.10.
|
|
61
|
+
"@streamlayer/sdk-web-features": "^0.10.34",
|
|
62
62
|
"@streamlayer/sdk-web-interfaces": "^0.0.1",
|
|
63
63
|
"@streamlayer/sdk-web-logger": "^0.0.1",
|
|
64
64
|
"@streamlayer/sdk-web-notifications": "^0.13.4",
|
|
65
|
-
"@streamlayer/sdk-web-
|
|
66
|
-
"@streamlayer/sdk-web-
|
|
65
|
+
"@streamlayer/sdk-web-types": "^0.0.1",
|
|
66
|
+
"@streamlayer/sdk-web-storage": "^0.0.4"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@bufbuild/protobuf": "^1.4.2",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"size-limit": "^11.0.0",
|
|
116
116
|
"url-loader": "^4.1.1",
|
|
117
117
|
"vite-plugin-dts": "^3.6.3",
|
|
118
|
-
"@streamlayer/react-ui": "^0.74.
|
|
118
|
+
"@streamlayer/react-ui": "^0.74.1"
|
|
119
119
|
},
|
|
120
120
|
"scripts": {
|
|
121
121
|
"size-limit": "size-limit"
|