@streamlayer/react 1.12.0 → 1.12.1
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.
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
`),c=`
|
|
15
15
|
`+n+(o.length?s("│"):" ")+" ";return n+r.join(c)+`
|
|
16
16
|
`+o.map(function(l,m){var u=m===o.length-1,d=l.nodes&&l.nodes.length,f=n+(u?" ":s("│"))+" ";return n+s(u?"└":"├")+s("─")+s(d?"┬":"─")+" "+e(l,f,a).slice(n.length+2)}).join("")};const US=CS,Or=Symbol("avvio.TimeTree.untrackNode"),wa=Symbol("avvio.TimeTree.trackNode"),vr=Symbol("avvio.TimeTree.getParent"),Ar=Symbol("avvio.TimeTree.getNode"),wr=Symbol("avvio.TimeTree.addNode");let FS=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[wa](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[Or](e){this.tableId.delete(e.id);const t=this.tableLabel.get(e.label);if(t.id){this.tableLabel.delete(e.label);return}t.pop(),t.length===0&&this.tableLabel.delete(e.label)}[vr](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[Ar](e){return this.tableId.get(e)}[wr](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[wa](this.root),this.root.id;const a=this[vr](e),s=`${t}-${Math.random()}`,o={id:s,parent:e,start:n,label:t,nodes:[]};return a.nodes.push(o),this[wa](o),s}start(e,t,n=Date.now()){return this[wr](e,t,n)}stop(e,t=Date.now()){const n=this[Ar](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[Or](n))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const e=n=>(n.label=`${n.label} ${n.diff} ms`,n.nodes.length>0&&(n.nodes=n.nodes.map(a=>e(a))),n),t=e(this.toJSON());return US(t)}};var BS=FS,xs={exports:{}},is={exports:{}},Ra,Rr;function GS(){if(Rr)return Ra;Rr=1;var e=1e3,t=e*60,n=t*60,a=n*24,s=a*7,o=a*365.25;Ra=function(u,d){d=d||{};var f=typeof u;if(f==="string"&&u.length>0)return r(u);if(f==="number"&&isFinite(u))return d.long?l(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function r(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var f=parseFloat(d[1]),T=(d[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*s;case"days":case"day":case"d":return f*a;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function c(u){var d=Math.abs(u);return d>=a?Math.round(u/a)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var d=Math.abs(u);return d>=a?m(u,d,a,"day"):d>=n?m(u,d,n,"hour"):d>=t?m(u,d,t,"minute"):d>=e?m(u,d,e,"second"):u+" ms"}function m(u,d,f,T){var y=d>=f*1.5;return Math.round(u/f)+" "+T+(y?"s":"")}return Ra}function VS(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=s,n.enabled=r,n.humanize=GS(),n.destroy=m,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let f=0;f<u.length;f++)d=(d<<5)-d+u.charCodeAt(f),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,f=null,T,y;function g(...b){if(!g.enabled)return;const h=g,v=Number(new Date),R=v-(d||v);h.diff=R,h.prev=d,h.curr=v,d=v,b[0]=n.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let w=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(O,P)=>{if(O==="%%")return"%";w++;const N=n.formatters[P];if(typeof N=="function"){const F=b[w];O=N.call(h,F),b.splice(w,1),w--}return O}),n.formatArgs.call(h,b),(h.log||n.log).apply(h,b)}return g.namespace=u,g.useColors=n.useColors(),g.color=n.selectColor(u),g.extend=a,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(T!==n.namespaces&&(T=n.namespaces,y=n.enabled(u)),y),set:b=>{f=b}}),typeof n.init=="function"&&n.init(g),g}function a(u,d){const f=n(this.namespace+(typeof d>"u"?":":d)+u);return f.log=this.log,f}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const f=(typeof u=="string"?u:"").split(/[\s,]+/),T=f.length;for(d=0;d<T;d++)f[d]&&(u=f[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function o(){const u=[...n.names.map(c),...n.skips.map(c).map(d=>"-"+d)].join(",");return n.enable(""),u}function r(u){if(u[u.length-1]==="*")return!0;let d,f;for(d=0,f=n.skips.length;d<f;d++)if(n.skips[d].test(u))return!1;for(d=0,f=n.names.length;d<f;d++)if(n.names[d].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var qS=VS;(function(e,t){t.formatArgs=a,t.save=s,t.load=o,t.useColors=n,t.storage=r(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;l.splice(1,0,m,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(u++,f==="%c"&&(d=u))}),l.splice(d,0,m)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof B<"u"&&"env"in B&&(l=B.env.DEBUG),l}function r(){try{return localStorage}catch{}}e.exports=qS(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(is,is.exports);var Vc=is.exports;const xS=pc,HS=Ec.EventEmitter,QS=ta.inherits,pe=Vc("avvio"),{AVV_ERR_READY_TIMEOUT:YS}=Gc,La=Symbol.for("plugin-meta");function jS(e,t){return e[La]&&e[La].name?e[La].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
|
|
17
|
-
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function $S(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=jS(t,n),this.isAfter=a,this.q=xS(e,KS,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}QS(qt,HS);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){pe("skipping loading of plugin as parent errored and it is not an after",s),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return pe("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,pe("exec",s);let o;const r=l=>{if(a){pe("loading complete",s);return}this._error=l,pe(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(pe("setting up timeout",s,this.timeout),o=setTimeout(function(){pe("timed out",s),o=null;const l=new YS(s);l.fn=n,r(l)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,r);c&&typeof c.then=="function"&&(pe("exec: resolving promise",s),c.then(()=>B.nextTick(r),l=>B.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(pe("rejecting promise",this.name,n),this._promise.reject(n)):(pe("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=$S(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){pe("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){pe("finish",this.name,e);const n=()=>{this.loaded||(pe("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const a=()=>{if(pe("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{pe("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else pe("delayed",this.name),this.q.drain=()=>{pe("drain",this.name),this.q.drain=WS,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function KS(e,t){const n=this;B.nextTick(Hs.bind(n),e,t)}function Hs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Hs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function WS(){}xs.exports=qt;xs.exports.loadPlugin=Hs;var zS=xs.exports;const Lr=pc,JS=Ec.EventEmitter,XS=ta.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Pa,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:ZS,AVV_ERR_ROOT_PLG_BOOTED:eE,AVV_ERR_READY_TIMEOUT:tE}=Gc,nE=BS,cs=zS,Bt=Vc("avvio"),Hn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function aE(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new Pa(s);if(e[o])throw new Pa(o);if(e[r])throw new Pa(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:qc.bind(n)}),e[Hn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Da(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Da(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(cE(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Da(m,this)),this):n.close()}}function me(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof me)){const a=new me(e,t,n);return e&&aE(e,t,a),a}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new nE,this._readyQ=Lr(this,xc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Pr},this._closeQ=Lr(this,iE,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Pr},this._doStart=null,this._root=new cs(this,sE.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),cs.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function sE(e,t,n){this._doStart=n,t.autostart&&this.start()}XS(me,JS);me.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};me.prototype.override=function(e,t,n){return e};function oE(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new ZS(typeof e);return e}me.prototype[Hn]=!0;me.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};me.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(me.prototype,"then",{get:qc});me.prototype._addPlugin=function(e,t,n){if(e=oE(e),t=t||{},this.booted)throw new eE;const a=this._current[0],s=new cs(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};me.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){xc.call(this,e,s)}return this};me.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};me.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};me.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),B.nextTick(c)}})};me.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};me.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Pr(){}function qc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function xc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else rE.call(this,e,a,n,t)}function rE(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new tE(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function iE(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>B.nextTick(t),o=>B.nextTick(t,o))):B.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function cE(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e(this,s)}}function Da(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s,a)},s):B.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===2?e(a,s):e(a,this,s):B.nextTick(s)}}Ls.exports=me;Ls.exports.express=function(e){return me(e,{expose:{use:"load"}})};var lE=Ls.exports;const mE=Bh(lE);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function uE(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=mE(Object.create({}),{autostart:!1});return r.use(Th,{friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),r.use(ih,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(uh,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(ph,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Ok,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(Lk),r.use(mh),r.use(vh),r.use(Jk),r.use(Fh),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const dE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m})=>{const[u,d]=Ys.useState(null);return Ys.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),d(y=>(y!==null&&typeof y.disableApp=="function"&&y.disableApp(),null)),()=>{f=!0};const T=uE(e,n,a,{version:"1.12.0",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m});if(t)for(const y of t)T.use(y);return T.ready().then(y=>{f||(d(y.sdk),typeof window<"u")}).catch(y=>console.log(y)),()=>{f=!0,T.close(function(y){if(y)throw y})}},[e,n]),u};exports.AutoPlayVideo=Yn;exports.CloseTimerAuto=ui;exports.CtaIconMode=ii;exports.InvitationFrom=Mn;exports.NotificationEnabled=Ln;exports.NotificationPromotionImagePosition=oi;exports.NotificationPromotionMode=si;exports.NotificationSponsorLogoMode=ri;exports.PickHistoryStatus=It;exports.PromotionButtonType=li;exports.PromotionLogoMode=mi;exports.PromotionType=ae;exports.QuestionImages=ot;exports.QuestionStatus=ee;exports.QuestionType=M;exports.SdkOverlayType=$;exports.createContextKey=Ya;exports.global=ja;exports.pino_1=Gr;exports.useStreamLayerApp=dE;
|
|
17
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function $S(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=jS(t,n),this.isAfter=a,this.q=xS(e,KS,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}QS(qt,HS);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){pe("skipping loading of plugin as parent errored and it is not an after",s),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return pe("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,pe("exec",s);let o;const r=l=>{if(a){pe("loading complete",s);return}this._error=l,pe(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(pe("setting up timeout",s,this.timeout),o=setTimeout(function(){pe("timed out",s),o=null;const l=new YS(s);l.fn=n,r(l)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,r);c&&typeof c.then=="function"&&(pe("exec: resolving promise",s),c.then(()=>B.nextTick(r),l=>B.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(pe("rejecting promise",this.name,n),this._promise.reject(n)):(pe("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=$S(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){pe("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){pe("finish",this.name,e);const n=()=>{this.loaded||(pe("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const a=()=>{if(pe("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{pe("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else pe("delayed",this.name),this.q.drain=()=>{pe("drain",this.name),this.q.drain=WS,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function KS(e,t){const n=this;B.nextTick(Hs.bind(n),e,t)}function Hs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Hs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function WS(){}xs.exports=qt;xs.exports.loadPlugin=Hs;var zS=xs.exports;const Lr=pc,JS=Ec.EventEmitter,XS=ta.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Pa,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:ZS,AVV_ERR_ROOT_PLG_BOOTED:eE,AVV_ERR_READY_TIMEOUT:tE}=Gc,nE=BS,cs=zS,Bt=Vc("avvio"),Hn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function aE(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new Pa(s);if(e[o])throw new Pa(o);if(e[r])throw new Pa(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:qc.bind(n)}),e[Hn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Da(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Da(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(cE(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Da(m,this)),this):n.close()}}function me(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof me)){const a=new me(e,t,n);return e&&aE(e,t,a),a}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new nE,this._readyQ=Lr(this,xc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Pr},this._closeQ=Lr(this,iE,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Pr},this._doStart=null,this._root=new cs(this,sE.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),cs.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function sE(e,t,n){this._doStart=n,t.autostart&&this.start()}XS(me,JS);me.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};me.prototype.override=function(e,t,n){return e};function oE(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new ZS(typeof e);return e}me.prototype[Hn]=!0;me.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};me.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(me.prototype,"then",{get:qc});me.prototype._addPlugin=function(e,t,n){if(e=oE(e),t=t||{},this.booted)throw new eE;const a=this._current[0],s=new cs(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};me.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){xc.call(this,e,s)}return this};me.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};me.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};me.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),B.nextTick(c)}})};me.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};me.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Pr(){}function qc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function xc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else rE.call(this,e,a,n,t)}function rE(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new tE(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function iE(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>B.nextTick(t),o=>B.nextTick(t,o))):B.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function cE(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e(this,s)}}function Da(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s,a)},s):B.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===2?e(a,s):e(a,this,s):B.nextTick(s)}}Ls.exports=me;Ls.exports.express=function(e){return me(e,{expose:{use:"load"}})};var lE=Ls.exports;const mE=Bh(lE);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function uE(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=mE(Object.create({}),{autostart:!1});return r.use(Th,{friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),r.use(ih,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(uh,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(ph,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Ok,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(Lk),r.use(mh),r.use(vh),r.use(Jk),r.use(Fh),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const dE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m})=>{const[u,d]=Ys.useState(null);return Ys.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),d(y=>(y!==null&&typeof y.disableApp=="function"&&y.disableApp(),null)),()=>{f=!0};const T=uE(e,n,a,{version:"1.12.1",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m});if(t)for(const y of t)T.use(y);return T.ready().then(y=>{f||(d(y.sdk),typeof window<"u")}).catch(y=>console.log(y)),()=>{f=!0,T.close(function(y){if(y)throw y})}},[e,n]),u};exports.AutoPlayVideo=Yn;exports.CloseTimerAuto=ui;exports.CtaIconMode=ii;exports.InvitationFrom=Mn;exports.NotificationEnabled=Ln;exports.NotificationPromotionImagePosition=oi;exports.NotificationPromotionMode=si;exports.NotificationSponsorLogoMode=ri;exports.PickHistoryStatus=It;exports.PromotionButtonType=li;exports.PromotionLogoMode=mi;exports.PromotionType=ae;exports.QuestionImages=ot;exports.QuestionStatus=ee;exports.QuestionType=M;exports.SdkOverlayType=$;exports.createContextKey=Ya;exports.global=ja;exports.pino_1=Gr;exports.useStreamLayerApp=dE;
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
`),c=`
|
|
15
15
|
`+n+(o.length?s("│"):" ")+" ";return n+r.join(c)+`
|
|
16
16
|
`+o.map(function(l,m){var u=m===o.length-1,d=l.nodes&&l.nodes.length,f=n+(u?" ":s("│"))+" ";return n+s(u?"└":"├")+s("─")+s(d?"┬":"─")+" "+e(l,f,a).slice(n.length+2)}).join("")};const US=CS,Or=Symbol("avvio.TimeTree.untrackNode"),wa=Symbol("avvio.TimeTree.trackNode"),vr=Symbol("avvio.TimeTree.getParent"),Ar=Symbol("avvio.TimeTree.getNode"),wr=Symbol("avvio.TimeTree.addNode");let FS=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[wa](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[Or](e){this.tableId.delete(e.id);const t=this.tableLabel.get(e.label);if(t.id){this.tableLabel.delete(e.label);return}t.pop(),t.length===0&&this.tableLabel.delete(e.label)}[vr](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[Ar](e){return this.tableId.get(e)}[wr](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[wa](this.root),this.root.id;const a=this[vr](e),s=`${t}-${Math.random()}`,o={id:s,parent:e,start:n,label:t,nodes:[]};return a.nodes.push(o),this[wa](o),s}start(e,t,n=Date.now()){return this[wr](e,t,n)}stop(e,t=Date.now()){const n=this[Ar](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[Or](n))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const e=n=>(n.label=`${n.label} ${n.diff} ms`,n.nodes.length>0&&(n.nodes=n.nodes.map(a=>e(a))),n),t=e(this.toJSON());return US(t)}};var BS=FS,xs={exports:{}},is={exports:{}},Ra,Rr;function GS(){if(Rr)return Ra;Rr=1;var e=1e3,t=e*60,n=t*60,a=n*24,s=a*7,o=a*365.25;Ra=function(u,d){d=d||{};var f=typeof u;if(f==="string"&&u.length>0)return r(u);if(f==="number"&&isFinite(u))return d.long?l(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function r(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var f=parseFloat(d[1]),T=(d[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*s;case"days":case"day":case"d":return f*a;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function c(u){var d=Math.abs(u);return d>=a?Math.round(u/a)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var d=Math.abs(u);return d>=a?m(u,d,a,"day"):d>=n?m(u,d,n,"hour"):d>=t?m(u,d,t,"minute"):d>=e?m(u,d,e,"second"):u+" ms"}function m(u,d,f,T){var y=d>=f*1.5;return Math.round(u/f)+" "+T+(y?"s":"")}return Ra}function VS(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=s,n.enabled=r,n.humanize=GS(),n.destroy=m,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let f=0;f<u.length;f++)d=(d<<5)-d+u.charCodeAt(f),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,f=null,T,y;function g(...b){if(!g.enabled)return;const h=g,v=Number(new Date),R=v-(d||v);h.diff=R,h.prev=d,h.curr=v,d=v,b[0]=n.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let w=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(O,P)=>{if(O==="%%")return"%";w++;const N=n.formatters[P];if(typeof N=="function"){const F=b[w];O=N.call(h,F),b.splice(w,1),w--}return O}),n.formatArgs.call(h,b),(h.log||n.log).apply(h,b)}return g.namespace=u,g.useColors=n.useColors(),g.color=n.selectColor(u),g.extend=a,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(T!==n.namespaces&&(T=n.namespaces,y=n.enabled(u)),y),set:b=>{f=b}}),typeof n.init=="function"&&n.init(g),g}function a(u,d){const f=n(this.namespace+(typeof d>"u"?":":d)+u);return f.log=this.log,f}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const f=(typeof u=="string"?u:"").split(/[\s,]+/),T=f.length;for(d=0;d<T;d++)f[d]&&(u=f[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function o(){const u=[...n.names.map(c),...n.skips.map(c).map(d=>"-"+d)].join(",");return n.enable(""),u}function r(u){if(u[u.length-1]==="*")return!0;let d,f;for(d=0,f=n.skips.length;d<f;d++)if(n.skips[d].test(u))return!1;for(d=0,f=n.names.length;d<f;d++)if(n.names[d].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var qS=VS;(function(e,t){t.formatArgs=a,t.save=s,t.load=o,t.useColors=n,t.storage=r(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;l.splice(1,0,m,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(u++,f==="%c"&&(d=u))}),l.splice(d,0,m)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof B<"u"&&"env"in B&&(l=B.env.DEBUG),l}function r(){try{return localStorage}catch{}}e.exports=qS(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(is,is.exports);var Vc=is.exports;const xS=pc,HS=Ec.EventEmitter,QS=ta.inherits,pe=Vc("avvio"),{AVV_ERR_READY_TIMEOUT:YS}=Gc,La=Symbol.for("plugin-meta");function jS(e,t){return e[La]&&e[La].name?e[La].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
|
|
17
|
-
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function $S(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=jS(t,n),this.isAfter=a,this.q=xS(e,KS,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}QS(qt,HS);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){pe("skipping loading of plugin as parent errored and it is not an after",s),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return pe("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,pe("exec",s);let o;const r=l=>{if(a){pe("loading complete",s);return}this._error=l,pe(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(pe("setting up timeout",s,this.timeout),o=setTimeout(function(){pe("timed out",s),o=null;const l=new YS(s);l.fn=n,r(l)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,r);c&&typeof c.then=="function"&&(pe("exec: resolving promise",s),c.then(()=>B.nextTick(r),l=>B.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(pe("rejecting promise",this.name,n),this._promise.reject(n)):(pe("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=$S(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){pe("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){pe("finish",this.name,e);const n=()=>{this.loaded||(pe("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const a=()=>{if(pe("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{pe("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else pe("delayed",this.name),this.q.drain=()=>{pe("drain",this.name),this.q.drain=WS,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function KS(e,t){const n=this;B.nextTick(Hs.bind(n),e,t)}function Hs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Hs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function WS(){}xs.exports=qt;xs.exports.loadPlugin=Hs;var zS=xs.exports;const Lr=pc,JS=Ec.EventEmitter,XS=ta.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Pa,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:ZS,AVV_ERR_ROOT_PLG_BOOTED:eE,AVV_ERR_READY_TIMEOUT:tE}=Gc,nE=BS,cs=zS,Bt=Vc("avvio"),Hn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function aE(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new Pa(s);if(e[o])throw new Pa(o);if(e[r])throw new Pa(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:qc.bind(n)}),e[Hn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Da(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Da(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(cE(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Da(m,this)),this):n.close()}}function me(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof me)){const a=new me(e,t,n);return e&&aE(e,t,a),a}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new nE,this._readyQ=Lr(this,xc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Pr},this._closeQ=Lr(this,iE,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Pr},this._doStart=null,this._root=new cs(this,sE.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),cs.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function sE(e,t,n){this._doStart=n,t.autostart&&this.start()}XS(me,JS);me.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};me.prototype.override=function(e,t,n){return e};function oE(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new ZS(typeof e);return e}me.prototype[Hn]=!0;me.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};me.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(me.prototype,"then",{get:qc});me.prototype._addPlugin=function(e,t,n){if(e=oE(e),t=t||{},this.booted)throw new eE;const a=this._current[0],s=new cs(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};me.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){xc.call(this,e,s)}return this};me.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};me.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};me.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),B.nextTick(c)}})};me.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};me.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Pr(){}function qc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function xc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else rE.call(this,e,a,n,t)}function rE(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new tE(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function iE(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>B.nextTick(t),o=>B.nextTick(t,o))):B.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function cE(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e(this,s)}}function Da(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s,a)},s):B.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===2?e(a,s):e(a,this,s):B.nextTick(s)}}Ls.exports=me;Ls.exports.express=function(e){return me(e,{expose:{use:"load"}})};var lE=Ls.exports;const mE=Bh(lE);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function uE(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=mE(Object.create({}),{autostart:!1});return r.use(Th,{friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),r.use(ih,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(uh,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(ph,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Ok,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(Lk),r.use(mh),r.use(vh),r.use(Jk),r.use(Fh),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const dE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m})=>{const[u,d]=Ys.useState(null);return Ys.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),d(y=>(y!==null&&typeof y.disableApp=="function"&&y.disableApp(),null)),()=>{f=!0};const T=uE(e,n,a,{version:"1.12.0",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m});if(t)for(const y of t)T.use(y);return T.ready().then(y=>{f||(d(y.sdk),typeof window<"u")}).catch(y=>console.log(y)),()=>{f=!0,T.close(function(y){if(y)throw y})}},[e,n]),u};exports.AutoPlayVideo=Yn;exports.CloseTimerAuto=ui;exports.CtaIconMode=ii;exports.InvitationFrom=Mn;exports.NotificationEnabled=Ln;exports.NotificationPromotionImagePosition=oi;exports.NotificationPromotionMode=si;exports.NotificationSponsorLogoMode=ri;exports.PickHistoryStatus=It;exports.PromotionButtonType=li;exports.PromotionLogoMode=mi;exports.PromotionType=ae;exports.QuestionImages=ot;exports.QuestionStatus=ee;exports.QuestionType=M;exports.SdkOverlayType=$;exports.createContextKey=Ya;exports.global=ja;exports.pino_1=Gr;exports.useStreamLayerApp=dE;
|
|
17
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function $S(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=jS(t,n),this.isAfter=a,this.q=xS(e,KS,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}QS(qt,HS);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){pe("skipping loading of plugin as parent errored and it is not an after",s),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return pe("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,pe("exec",s);let o;const r=l=>{if(a){pe("loading complete",s);return}this._error=l,pe(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(pe("setting up timeout",s,this.timeout),o=setTimeout(function(){pe("timed out",s),o=null;const l=new YS(s);l.fn=n,r(l)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,r);c&&typeof c.then=="function"&&(pe("exec: resolving promise",s),c.then(()=>B.nextTick(r),l=>B.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(pe("rejecting promise",this.name,n),this._promise.reject(n)):(pe("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=$S(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){pe("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){pe("finish",this.name,e);const n=()=>{this.loaded||(pe("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const a=()=>{if(pe("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{pe("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else pe("delayed",this.name),this.q.drain=()=>{pe("drain",this.name),this.q.drain=WS,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function KS(e,t){const n=this;B.nextTick(Hs.bind(n),e,t)}function Hs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Hs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function WS(){}xs.exports=qt;xs.exports.loadPlugin=Hs;var zS=xs.exports;const Lr=pc,JS=Ec.EventEmitter,XS=ta.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Pa,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:ZS,AVV_ERR_ROOT_PLG_BOOTED:eE,AVV_ERR_READY_TIMEOUT:tE}=Gc,nE=BS,cs=zS,Bt=Vc("avvio"),Hn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function aE(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new Pa(s);if(e[o])throw new Pa(o);if(e[r])throw new Pa(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:qc.bind(n)}),e[Hn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Da(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Da(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(cE(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Da(m,this)),this):n.close()}}function me(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof me)){const a=new me(e,t,n);return e&&aE(e,t,a),a}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new nE,this._readyQ=Lr(this,xc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Pr},this._closeQ=Lr(this,iE,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Pr},this._doStart=null,this._root=new cs(this,sE.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),cs.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function sE(e,t,n){this._doStart=n,t.autostart&&this.start()}XS(me,JS);me.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};me.prototype.override=function(e,t,n){return e};function oE(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new ZS(typeof e);return e}me.prototype[Hn]=!0;me.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};me.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(me.prototype,"then",{get:qc});me.prototype._addPlugin=function(e,t,n){if(e=oE(e),t=t||{},this.booted)throw new eE;const a=this._current[0],s=new cs(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};me.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){xc.call(this,e,s)}return this};me.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};me.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};me.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),B.nextTick(c)}})};me.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};me.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Pr(){}function qc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function xc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else rE.call(this,e,a,n,t)}function rE(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new tE(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function iE(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>B.nextTick(t),o=>B.nextTick(t,o))):B.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function cE(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e(this,s)}}function Da(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s,a)},s):B.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===2?e(a,s):e(a,this,s):B.nextTick(s)}}Ls.exports=me;Ls.exports.express=function(e){return me(e,{expose:{use:"load"}})};var lE=Ls.exports;const mE=Bh(lE);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function uE(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=mE(Object.create({}),{autostart:!1});return r.use(Th,{friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),r.use(ih,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(uh,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(ph,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Ok,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(Lk),r.use(mh),r.use(vh),r.use(Jk),r.use(Fh),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const dE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m})=>{const[u,d]=Ys.useState(null);return Ys.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),d(y=>(y!==null&&typeof y.disableApp=="function"&&y.disableApp(),null)),()=>{f=!0};const T=uE(e,n,a,{version:"1.12.1",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m});if(t)for(const y of t)T.use(y);return T.ready().then(y=>{f||(d(y.sdk),typeof window<"u")}).catch(y=>console.log(y)),()=>{f=!0,T.close(function(y){if(y)throw y})}},[e,n]),u};exports.AutoPlayVideo=Yn;exports.CloseTimerAuto=ui;exports.CtaIconMode=ii;exports.InvitationFrom=Mn;exports.NotificationEnabled=Ln;exports.NotificationPromotionImagePosition=oi;exports.NotificationPromotionMode=si;exports.NotificationSponsorLogoMode=ri;exports.PickHistoryStatus=It;exports.PromotionButtonType=li;exports.PromotionLogoMode=mi;exports.PromotionType=ae;exports.QuestionImages=ot;exports.QuestionStatus=ee;exports.QuestionType=M;exports.SdkOverlayType=$;exports.createContextKey=Ya;exports.global=ja;exports.pino_1=Gr;exports.useStreamLayerApp=dE;
|
|
@@ -18267,7 +18267,7 @@ const fE = ({
|
|
|
18267
18267
|
f = !0;
|
|
18268
18268
|
};
|
|
18269
18269
|
const T = pE(e, n, a, {
|
|
18270
|
-
version: "1.12.
|
|
18270
|
+
version: "1.12.1",
|
|
18271
18271
|
onDeepLinkHandled: s,
|
|
18272
18272
|
videoPlayerController: o,
|
|
18273
18273
|
onContentActivate: r,
|
package/lib/dist/cjs/masters.js
CHANGED
|
@@ -220,4 +220,4 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
220
220
|
`),g=`
|
|
221
221
|
`+r+(p.length?s("│"):" ")+" ";return r+f.join(g)+`
|
|
222
222
|
`+p.map(function(v,b){var E=b===p.length-1,I=v.nodes&&v.nodes.length,O=r+(E?" ":s("│"))+" ";return r+s(E?"└":"├")+s("─")+s(I?"┬":"─")+" "+t(v,O,u).slice(r.length+2)}).join("")};const hse=mse,NC=Symbol("avvio.TimeTree.untrackNode"),W9=Symbol("avvio.TimeTree.trackNode"),LC=Symbol("avvio.TimeTree.getParent"),RC=Symbol("avvio.TimeTree.getNode"),xC=Symbol("avvio.TimeTree.addNode");let gse=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[W9](t){this.tableId.set(t.id,t),this.tableLabel.has(t.label)?this.tableLabel.get(t.label).push(t):this.tableLabel.set(t.label,[t])}[NC](t){this.tableId.delete(t.id);const n=this.tableLabel.get(t.label);if(n.id){this.tableLabel.delete(t.label);return}n.pop(),n.length===0&&this.tableLabel.delete(t.label)}[LC](t){if(t===null)return this.root;const n=this.tableLabel.get(t);return n.id?n:n[n.length-1]}[RC](t){return this.tableId.get(t)}[xC](t,n,r){if(t===null)return this.root={id:"root",label:n,start:r,nodes:[]},this[W9](this.root),this.root.id;const u=this[LC](t),s=`${n}-${Math.random()}`,p={id:s,parent:t,start:r,label:n,nodes:[]};return u.nodes.push(p),this[W9](p),s}start(t,n,r=Date.now()){return this[xC](t,n,r)}stop(t,n=Date.now()){const r=this[RC](t);r&&(r.stop=n,r.diff=r.stop-r.start||0,this[NC](r))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const t=r=>(r.label=`${r.label} ${r.diff} ms`,r.nodes.length>0&&(r.nodes=r.nodes.map(u=>t(u))),r),n=t(this.toJSON());return hse(n)}};var yse=gse,zy={exports:{}},z7={exports:{}},Q9,AC;function vse(){if(AC)return Q9;AC=1;var t=1e3,n=t*60,r=n*60,u=r*24,s=u*7,p=u*365.25;Q9=function(E,I){I=I||{};var O=typeof E;if(O==="string"&&E.length>0)return f(E);if(O==="number"&&isFinite(E))return I.long?v(E):g(E);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(E))};function f(E){if(E=String(E),!(E.length>100)){var I=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(E);if(I){var O=parseFloat(I[1]),L=(I[2]||"ms").toLowerCase();switch(L){case"years":case"year":case"yrs":case"yr":case"y":return O*p;case"weeks":case"week":case"w":return O*s;case"days":case"day":case"d":return O*u;case"hours":case"hour":case"hrs":case"hr":case"h":return O*r;case"minutes":case"minute":case"mins":case"min":case"m":return O*n;case"seconds":case"second":case"secs":case"sec":case"s":return O*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return O;default:return}}}}function g(E){var I=Math.abs(E);return I>=u?Math.round(E/u)+"d":I>=r?Math.round(E/r)+"h":I>=n?Math.round(E/n)+"m":I>=t?Math.round(E/t)+"s":E+"ms"}function v(E){var I=Math.abs(E);return I>=u?b(E,I,u,"day"):I>=r?b(E,I,r,"hour"):I>=n?b(E,I,n,"minute"):I>=t?b(E,I,t,"second"):E+" ms"}function b(E,I,O,L){var x=I>=O*1.5;return Math.round(E/O)+" "+L+(x?"s":"")}return Q9}function Tse(t){r.debug=r,r.default=r,r.coerce=v,r.disable=p,r.enable=s,r.enabled=f,r.humanize=vse(),r.destroy=b,Object.keys(t).forEach(E=>{r[E]=t[E]}),r.names=[],r.skips=[],r.formatters={};function n(E){let I=0;for(let O=0;O<E.length;O++)I=(I<<5)-I+E.charCodeAt(O),I|=0;return r.colors[Math.abs(I)%r.colors.length]}r.selectColor=n;function r(E){let I,O=null,L,x;function M(...F){if(!M.enabled)return;const U=M,B=Number(new Date),z=B-(I||B);U.diff=z,U.prev=I,U.curr=B,I=B,F[0]=r.coerce(F[0]),typeof F[0]!="string"&&F.unshift("%O");let Y=0;F[0]=F[0].replace(/%([a-zA-Z%])/g,(Z,ee)=>{if(Z==="%%")return"%";Y++;const J=r.formatters[ee];if(typeof J=="function"){const Ie=F[Y];Z=J.call(U,Ie),F.splice(Y,1),Y--}return Z}),r.formatArgs.call(U,F),(U.log||r.log).apply(U,F)}return M.namespace=E,M.useColors=r.useColors(),M.color=r.selectColor(E),M.extend=u,M.destroy=r.destroy,Object.defineProperty(M,"enabled",{enumerable:!0,configurable:!1,get:()=>O!==null?O:(L!==r.namespaces&&(L=r.namespaces,x=r.enabled(E)),x),set:F=>{O=F}}),typeof r.init=="function"&&r.init(M),M}function u(E,I){const O=r(this.namespace+(typeof I>"u"?":":I)+E);return O.log=this.log,O}function s(E){r.save(E),r.namespaces=E,r.names=[],r.skips=[];let I;const O=(typeof E=="string"?E:"").split(/[\s,]+/),L=O.length;for(I=0;I<L;I++)O[I]&&(E=O[I].replace(/\*/g,".*?"),E[0]==="-"?r.skips.push(new RegExp("^"+E.slice(1)+"$")):r.names.push(new RegExp("^"+E+"$")))}function p(){const E=[...r.names.map(g),...r.skips.map(g).map(I=>"-"+I)].join(",");return r.enable(""),E}function f(E){if(E[E.length-1]==="*")return!0;let I,O;for(I=0,O=r.skips.length;I<O;I++)if(r.skips[I].test(E))return!1;for(I=0,O=r.names.length;I<O;I++)if(r.names[I].test(E))return!0;return!1}function g(E){return E.toString().substring(2,E.toString().length-2).replace(/\.\*\?$/,"*")}function v(E){return E instanceof Error?E.stack||E.message:E}function b(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var bse=Tse;(function(t,n){n.formatArgs=u,n.save=s,n.load=p,n.useColors=r,n.storage=f(),n.destroy=(()=>{let v=!1;return()=>{v||(v=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function u(v){if(v[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+v[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const b="color: "+this.color;v.splice(1,0,b,"color: inherit");let E=0,I=0;v[0].replace(/%[a-zA-Z%]/g,O=>{O!=="%%"&&(E++,O==="%c"&&(I=E))}),v.splice(I,0,b)}n.log=console.debug||console.log||(()=>{});function s(v){try{v?n.storage.setItem("debug",v):n.storage.removeItem("debug")}catch{}}function p(){let v;try{v=n.storage.getItem("debug")}catch{}return!v&&typeof It<"u"&&"env"in It&&(v=It.env.DEBUG),v}function f(){try{return localStorage}catch{}}t.exports=bse(n);const{formatters:g}=t.exports;g.j=function(v){try{return JSON.stringify(v)}catch(b){return"[UnexpectedJSONParseError]: "+b.message}}})(z7,z7.exports);var vO=z7.exports;const kse=qI,Sse=eO.EventEmitter,wse=T4.inherits,Ga=vO("avvio"),{AVV_ERR_READY_TIMEOUT:Cse}=yO,Y9=Symbol.for("plugin-meta");function Ese(t,n){return t[Y9]&&t[Y9].name?t[Y9].name:typeof n<"u"&&typeof n!="function"&&n.name?n.name:t.name?t.name:t.toString().split(`
|
|
223
|
-
`).slice(0,2).map(r=>r.trim()).join(" -- ")}function _se(){const t={};return t.promise=new Promise((n,r)=>{t.resolve=n,t.reject=r}),t}function Wf(t,n,r,u,s){this.started=!1,this.func=n,this.opts=r,this.onFinish=null,this.parent=t,this.timeout=s===void 0?t._timeout:s,this.name=Ese(n,r),this.isAfter=u,this.q=kse(t,Ise,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}wse(Wf,Sse);Wf.prototype.exec=function(t,n){const r=this.func;let u=!1;const s=this.name;if(this.parent._error&&!this.isAfter){Ga("skipping loading of plugin as parent errored and it is not an after",s),It.nextTick(n);return}if(this.isAfter)this.server=t;else try{this.server=this.parent.override(t,r,this.opts)}catch(v){return Ga("override errored",s),n(v)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ga("exec",s);let p;const f=v=>{if(u){Ga("loading complete",s);return}this._error=v,Ga(v?"exec errored":"exec completed",s),u=!0,p&&clearTimeout(p),n(v)};this.timeout>0&&(Ga("setting up timeout",s,this.timeout),p=setTimeout(function(){Ga("timed out",s),p=null;const v=new Cse(s);v.fn=r,f(v)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const g=r(this.server,this.opts,f);g&&typeof g.then=="function"&&(Ga("exec: resolving promise",s),g.then(()=>It.nextTick(f),v=>It.nextTick(f,v)))};Wf.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const t=()=>{this.server.after((r,u)=>{this._error=r,this.q.pause(),r?(Ga("rejecting promise",this.name,r),this._promise.reject(r)):(Ga("resolving promise",this.name),this._promise.resolve()),this._promise=null,It.nextTick(u,r)}),this.q.resume()};let n;return this._promise?n=Promise.resolve():(this._promise=_se(),n=this._promise.promise,this.server?t():this.on("start",t)),n};Wf.prototype.enqueue=function(t,n){Ga("enqueue",this.name,t.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(t,n)};Wf.prototype.finish=function(t,n){Ga("finish",this.name,t);const r=()=>{this.loaded||(Ga("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,n(t))};if(t){this._promise&&(this._promise.reject(t),this._promise=null),r();return}const u=()=>{if(Ga("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{Ga("wrap"),queueMicrotask(u)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else r();else Ga("delayed",this.name),this.q.drain=()=>{Ga("drain",this.name),this.q.drain=Ose,queueMicrotask(u)}};queueMicrotask(u),this.q.resume()};function Ise(t,n){const r=this;It.nextTick(qy.bind(r),t,n)}function qy(t,n){if(typeof t.func.then=="function"){t.func.then(u=>{typeof u.default=="function"&&(u=u.default),t.func=u,qy.call(this,t,n)},n);return}const r=this._current[0];this._current.unshift(t),t.exec(r&&r.server||this._server,u=>{t.finish(u,s=>{this._current.shift(),n(s)})})}function Ose(){}zy.exports=Wf;zy.exports.loadPlugin=qy;var Nse=zy.exports;const PC=qI,Lse=eO.EventEmitter,Rse=T4.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:K9,AVV_ERR_CALLBACK_NOT_FN:Cp,AVV_ERR_PLUGIN_NOT_VALID:xse,AVV_ERR_ROOT_PLG_BOOTED:Ase,AVV_ERR_READY_TIMEOUT:Pse}=yO,Mse=yse,q7=Nse,Bf=vO("avvio"),J6=Symbol("kAvvio"),Z9=Symbol("kThenifyDoNotWrap");function Dse(t,n,r){const u=n.expose||{},s=u.use||"use",p=u.after||"after",f=u.ready||"ready",g=u.onClose||"onClose",v=u.close||"close";if(t[s])throw new K9(s);if(t[p])throw new K9(p);if(t[f])throw new K9(f);t[s]=function(b,E){return r.use(b,E),this},Object.defineProperty(t,"then",{get:TO.bind(r)}),t[J6]=!0,t[p]=function(b){return typeof b!="function"?r._loadRegistered():(r.after(X9(b,this)),this)},t[f]=function(b){if(b&&typeof b!="function")throw new Cp(f,typeof b);return r.ready(b?X9(b,this):void 0)},t[g]=function(b){if(typeof b!="function")throw new Cp(g,typeof b);return r.onClose(Bse(b,this)),this},t[v]=function(b){if(b&&typeof b!="function")throw new Cp(v,typeof b);return b?(r.close(X9(b,this)),this):r.close()}}function Ra(t,n,r){if(typeof t=="function"&&arguments.length===1&&(r=t,n={},t=null),typeof n=="function"&&(r=n,n={}),n=n||{},!(this instanceof Ra)){const u=new Ra(t,n,r);return t&&Dse(t,n,u),u}n.autostart!==!1&&(n.autostart=!0),t=t||this,this._timeout=Number(n.timeout)||0,this._server=t,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),r&&this.once("start",r),this.started=!1,this.booted=!1,this.pluginTree=new Mse,this._readyQ=PC(this,bO,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=MC},this._closeQ=PC(this,Vse,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=MC},this._doStart=null,this._root=new q7(this,Use.bind(this),n,!1,0),this._root.once("start",(u,s,p)=>{const f=this.pluginTree.start(null,s,p);this._root.once("loaded",(g,v,b)=>{this.pluginTree.stop(f,b)})}),q7.loadPlugin.call(this,this._root,u=>{Bf("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){u=u||this._error||s}if(u){if(this._error=u,this._readyQ.length()===0)throw u}else this.booted=!0;this._readyQ.resume()})}function Use(t,n,r){this._doStart=r,n.autostart&&this.start()}Rse(Ra,Lse);Ra.prototype.start=function(){return this.started=!0,It.nextTick(this._doStart),this};Ra.prototype.override=function(t,n,r){return t};function Fse(t){if(t&&typeof t=="object"&&typeof t.default=="function"&&(t=t.default),!(t&&(typeof t=="function"||typeof t.then=="function")))throw new xse(typeof t);return t}Ra.prototype[J6]=!0;Ra.prototype.use=function(t,n){return this._lastUsed=this._addPlugin(t,n,!1),this};Ra.prototype._loadRegistered=function(){const t=this._current[0];return!this.started&&!this.booted&&It.nextTick(()=>this._root.q.resume()),t?t.loadedSoFar():Promise.resolve()};Object.defineProperty(Ra.prototype,"then",{get:TO});Ra.prototype._addPlugin=function(t,n,r){if(t=Fse(t),n=n||{},this.booted)throw new Ase;const u=this._current[0],s=new q7(this,t,n,r);if(s.once("start",(p,f,g)=>{const v=this.pluginTree.start(u.name,f,g);s.once("loaded",(b,E,I)=>{this.pluginTree.stop(v,I)})}),u.loaded)throw new Error(s.name,u.name);return u.enqueue(s,p=>{p&&(this._error=p)}),s};Ra.prototype.after=function(t){if(!t)return this._loadRegistered();this._addPlugin(n.bind(this),{},!0);function n(r,u,s){bO.call(this,t,s)}return this};Ra.prototype.onClose=function(t){if(typeof t!="function")throw new Error("not a function");t[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(t,n.bind(this));function n(r){r&&(this._error=r)}return this};Ra.prototype.close=function(t){let n;if(t){if(typeof t!="function")throw new Cp("close",typeof t)}else n=new Promise(function(r,u){t=function(s){if(s)return u(s);r()}});return this.ready(()=>{this._error=null,this._closeQ.push(t),It.nextTick(this._closeQ.resume.bind(this._closeQ))}),n};Ra.prototype.ready=function(t){if(t){if(typeof t!="function")throw new Cp("ready",typeof t);this._readyQ.push(t),queueMicrotask(this.start.bind(this));return}return new Promise((n,r)=>{this._readyQ.push(s),this.start();const u=this._current[0].server;function s(p,f,g){p?r(p):n(u),It.nextTick(g)}})};Ra.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ra.prototype.toJSON=function(){return this.pluginTree.toJSON()};function MC(){}function TO(){if(this.booted){Bf("thenify returning null because we are already booted");return}if(this[Z9]){this[Z9]=!1;return}return Bf("thenify"),(t,n)=>this._loadRegistered().then(()=>(this[Z9]=!0,t(this._server)),n)}function bO(t,n){const r=this._server,u=this._error;let s;if(this._error=null,t.length===0)this._error=u,s=t(),s&&!s[J6]&&typeof s.then=="function"?s.then(()=>It.nextTick(n),p=>It.nextTick(n,p)):It.nextTick(n);else if(t.length===1)s=t(u),s&&!s[J6]&&typeof s.then=="function"?s.then(()=>It.nextTick(n),p=>It.nextTick(n,p)):It.nextTick(n);else if(this._timeout===0){const p=f=>{this._error=f,n(this._error)};t.length===2?t(u,p):t(u,r,p)}else jse.call(this,t,u,r,n)}function jse(t,n,r,u){const s=t.name;Bf("setting up ready timeout",s,this._timeout);let p=setTimeout(()=>{Bf("timed out",s),p=null;const g=new Pse(s);g.fn=t,this._error=g,u(g)},this._timeout);t.length===2?t(n,f.bind(this)):t(n,r,f.bind(this));function f(g){p&&(clearTimeout(p),this._error=g,u(this._error))}}function Vse(t,n){const r=this._server,u=t[this._isOnCloseHandlerKey];if(t.length===0||t.length===1){let s;u?s=t(r):s=t(this._error),s&&typeof s.then=="function"?(Bf("resolving close/onClose promise"),s.then(()=>It.nextTick(n),p=>It.nextTick(n,p))):It.nextTick(n)}else t.length===2?t(u?r:this._error,n):u?t(r,n):t(this._error,r,n)}function Bse(t,n){return r.bind(n);function r(u,s){let p;t.length===0?(p=t(),p&&p.then?p.then(function(){It.nextTick(s)},s):It.nextTick(s)):t.length===1?(p=t(this),p&&p.then?p.then(function(){It.nextTick(s)},s):It.nextTick(s)):t(this,s)}}function X9(t,n){return r.bind(n);function r(u,s){let p;t?t.length===0?(p=t(),p&&p.then?p.then(function(){It.nextTick(s,u)},s):It.nextTick(s,u)):t.length===1?(p=t(u),p&&p.then?p.then(function(){It.nextTick(s)},s):It.nextTick(s)):t.length===2?t(u,s):t(u,this,s):It.nextTick(s)}}Ay.exports=Ra;Ay.exports.express=function(t){return Ra(t,{expose:{use:"load"}})};var $se=Ay.exports;const Hse=yoe($se);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const t=["webkit","moz","ms","o"];for(const n of t)window.requestAnimationFrame=window.requestAnimationFrame||window[`${n}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${n}CancelAnimationFrame`]||window[`${n}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let n=0;const r=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(u){const s=r?window.performance.now():new Date().getTime(),p=Math.max(0,16-(s-n)),f=window.setTimeout(function(){u(s+p)},p);return n=s+p,f},window.cancelAnimationFrame=clearTimeout}})();function zse(t,n=!0,r=!0,u={friendsTab:"enabled"}){const s=n?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",p=n?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",f=Hse(Object.create({}),{autostart:!1});return f.use(Wre,{friendsTab:u.friendsTab,theme:u.theme,themeMode:u.themeMode}),f.use(Vre,{onDeepLinkHandled:u==null?void 0:u.onDeepLinkHandled}),f.use(zre,{videoPlayerController:u==null?void 0:u.videoPlayerController}),f.use(Gre,{onContentActivate:u==null?void 0:u.onContentActivate,withAd:u==null?void 0:u.withAd,withAdNotification:u==null?void 0:u.withAdNotification}),f.use(ore,{sdkKey:t,host:s,analyticsHost:p,version:u==null?void 0:u.version}),f.use(cre),f.use(Hre),f.use(ioe),f.use(Lre),f.use(goe),f.after((g,v,b)=>{if(g)throw g;v.ready(),b()}),r&&f.after(async(g,v,b)=>{if(g)throw g;await v.sdk.initializeApp(),b()}),f.onClose(()=>{console.log("close")}),f}const qse=({sdkKey:t,plugins:n,production:r,autoEnable:u,onDeepLinkHandled:s,videoPlayerController:p,onContentActivate:f,withAdNotification:g,withAd:v,friendsTab:b})=>{const[E,I]=q.useState(null);return q.useEffect(()=>{let O=!1;if(!t)return console.error("streamlayer sdk key should be provided"),I(x=>(x!==null&&typeof x.disableApp=="function"&&x.disableApp(),null)),()=>{O=!0};const L=zse(t,r,u,{version:"1.12.0",onDeepLinkHandled:s,videoPlayerController:p,onContentActivate:f,withAdNotification:g,withAd:v,friendsTab:b});if(n)for(const x of n)L.use(x);return L.ready().then(x=>{O||(I(x.sdk),typeof window<"u")}).catch(x=>console.log(x)),()=>{O=!0,L.close(function(x){if(x)throw x})}},[t,r]),E},Gse=({event:t})=>{const n=Dp(),r=Qse();return q.useEffect(()=>(n&&(t&&(n.createEventSession(t),r&&(r.current=t)),!t&&(r!=null&&r.current)&&(n.createEventSession(""),r.current="")),()=>{n&&n.disableApp()}),[t,r,n]),null};var kO=(t=>(t[t.UNSET=0]="UNSET",t[t.CONNECTED=1]="CONNECTED",t[t.READY=2]="READY",t))(kO||{});const Wse={status:0,sdk:null},C4=q.createContext(Wse),SO=({sdkKey:t,theme:n,themeMode:r,plugins:u,children:s,event:p,production:f=!0,autoEnable:g=!0,withAdNotification:v,withAd:b=!0,friendsTab:E="enabled",onDeepLinkHandled:I,videoPlayerController:O,onContentActivate:L})=>{const x=qse({sdkKey:t,plugins:u,production:f,autoEnable:g,onDeepLinkHandled:I,videoPlayerController:O,onContentActivate:L,withAdNotification:v,withAd:b,friendsTab:E}),M=q.useRef(""),F=q.useMemo(()=>x?{sdk:x,status:2,event:M}:{status:1,sdk:null,event:M},[x]);return q.useEffect(()=>{x&&(x.options.setKey("friendsTab",E),x.options.setKey("theme",n),x.options.setKey("themeMode",r))},[x,E,n,r]),q.useEffect(()=>()=>{I&&(x==null||x.removeDeepLinkHandler(I)),O&&(x==null||x.removeVideoPlayerController(O))},[x]),q.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!t,onDeepLinkHandled:!!I,videoPlayerController:!!O})},[t,I,O]),S.jsxs(C4.Provider,{value:F,children:[p!==void 0&&S.jsx(Gse,{event:p}),s]})},Dp=()=>{const{sdk:t}=q.useContext(C4);return t},Qse=()=>{const{event:t}=q.useContext(C4);return t},Yse=()=>{const t=Dp();return t?S.jsx(j_,{sdk:t}):null},Kse=({close:t,onEvent:n})=>{const r=Dp();return r?S.jsx(F_,{sdk:r,onEvent:n,close:t}):null},Zse=({sdkKey:t,plugins:n,children:r,onDeepLinkHandled:u,videoPlayerController:s,production:p=!0})=>S.jsx(SO,{sdkKey:t,plugins:n,production:p,autoEnable:!1,onDeepLinkHandled:u,videoPlayerController:s,children:r}),Xse=({children:t,overlays:n})=>{const{sdk:r,status:u}=q.useContext(C4);return u===kO.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),t({})):r?S.jsx("div",{className:"StreamLayerSDK",children:S.jsx(_y,{style:{height:"100%"},children:S.jsx(gX,{sdk:r,overlays:n,children:t})})}):t({})};class Jse extends q.Component{constructor(n){super(n),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n,r){console.error(n,r.componentStack)}render(){return this.state.hasError?this.props.children({}):S.jsx(Xse,{...this.props})}}const ele=({token:t,schema:n})=>{const r=Dp();return q.useEffect(()=>{t&&n&&r&&r.authorizationBypass(n,t),r&&(r.withAuth=!0)},[t,n,r]),null},wO=({event:t,sdkKey:n,token:r,deviceId:u,production:s=!1,theme:p,themeMode:f="light",children:g})=>{const[v,b]=q.useState(!1);return q.useEffect(()=>{r&&(new sI().setToken(r),b(!0))},[r]),q.useEffect(()=>{u&&localStorage.setItem("sl-device-id",u)},[u]),v?S.jsx(SO,{sdkKey:n,event:t,production:s,theme:p,themeMode:f,autoEnable:!0,children:S.jsx("div",{className:"StreamLayerSDK",children:S.jsx(_y,{children:g})})}):null},tle=({onEvent:t,close:n,...r})=>S.jsx(wO,{...r,children:S.jsx(Kse,{close:n,onEvent:t})}),nle=({production:t})=>{const[n,r]=q.useState();return q.useEffect(()=>{const{hostname:u,search:s}=window.location,p=new URLSearchParams(s);r({sdkKey:p.get("_slrk")||"",event:p.get("_slre")||"",token:p.get("_slrt")||"",deviceId:p.get("_slrd")||"",theme:p.get("theme")||"",themeMode:p.get("themeMode")==="dark"?"dark":"light",production:t??!(u.includes("next.")||u==="localhost")})},[t]),n?S.jsx(wO,{...n,children:S.jsx(Yse,{})}):null},ale=()=>{const t=Dp();return t?S.jsx("div",{className:"StreamLayerSDK",children:S.jsx(_y,{children:S.jsx(_X,{sdk:t})})}):null};exports.A=Wa;exports.BetPack=tle;exports.BetPackStandalone=nle;exports.C=X_;exports.C$1=i$;exports.M=Cy;exports.MastersStreamLayerProvider=Zse;exports.MastersStreamLayerSDKReact=Jse;exports.O=vy;exports.S=nI;exports.S$1=l$;exports.StreamLayerLogin=ele;exports.StreamLayerSDKPoints=ale;exports.T=wy;exports.b=Z_;exports.cx_default=ki;exports.d=u$;exports.k=rI;exports.l=r$;exports.m=kp;exports.m$1=a$;exports.n=fy;exports.p=OX;exports.styled_default=A;exports.useStore=jt;exports.useTransition=VC;exports.z=IY;
|
|
223
|
+
`).slice(0,2).map(r=>r.trim()).join(" -- ")}function _se(){const t={};return t.promise=new Promise((n,r)=>{t.resolve=n,t.reject=r}),t}function Wf(t,n,r,u,s){this.started=!1,this.func=n,this.opts=r,this.onFinish=null,this.parent=t,this.timeout=s===void 0?t._timeout:s,this.name=Ese(n,r),this.isAfter=u,this.q=kse(t,Ise,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}wse(Wf,Sse);Wf.prototype.exec=function(t,n){const r=this.func;let u=!1;const s=this.name;if(this.parent._error&&!this.isAfter){Ga("skipping loading of plugin as parent errored and it is not an after",s),It.nextTick(n);return}if(this.isAfter)this.server=t;else try{this.server=this.parent.override(t,r,this.opts)}catch(v){return Ga("override errored",s),n(v)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ga("exec",s);let p;const f=v=>{if(u){Ga("loading complete",s);return}this._error=v,Ga(v?"exec errored":"exec completed",s),u=!0,p&&clearTimeout(p),n(v)};this.timeout>0&&(Ga("setting up timeout",s,this.timeout),p=setTimeout(function(){Ga("timed out",s),p=null;const v=new Cse(s);v.fn=r,f(v)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const g=r(this.server,this.opts,f);g&&typeof g.then=="function"&&(Ga("exec: resolving promise",s),g.then(()=>It.nextTick(f),v=>It.nextTick(f,v)))};Wf.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const t=()=>{this.server.after((r,u)=>{this._error=r,this.q.pause(),r?(Ga("rejecting promise",this.name,r),this._promise.reject(r)):(Ga("resolving promise",this.name),this._promise.resolve()),this._promise=null,It.nextTick(u,r)}),this.q.resume()};let n;return this._promise?n=Promise.resolve():(this._promise=_se(),n=this._promise.promise,this.server?t():this.on("start",t)),n};Wf.prototype.enqueue=function(t,n){Ga("enqueue",this.name,t.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(t,n)};Wf.prototype.finish=function(t,n){Ga("finish",this.name,t);const r=()=>{this.loaded||(Ga("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,n(t))};if(t){this._promise&&(this._promise.reject(t),this._promise=null),r();return}const u=()=>{if(Ga("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{Ga("wrap"),queueMicrotask(u)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else r();else Ga("delayed",this.name),this.q.drain=()=>{Ga("drain",this.name),this.q.drain=Ose,queueMicrotask(u)}};queueMicrotask(u),this.q.resume()};function Ise(t,n){const r=this;It.nextTick(qy.bind(r),t,n)}function qy(t,n){if(typeof t.func.then=="function"){t.func.then(u=>{typeof u.default=="function"&&(u=u.default),t.func=u,qy.call(this,t,n)},n);return}const r=this._current[0];this._current.unshift(t),t.exec(r&&r.server||this._server,u=>{t.finish(u,s=>{this._current.shift(),n(s)})})}function Ose(){}zy.exports=Wf;zy.exports.loadPlugin=qy;var Nse=zy.exports;const PC=qI,Lse=eO.EventEmitter,Rse=T4.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:K9,AVV_ERR_CALLBACK_NOT_FN:Cp,AVV_ERR_PLUGIN_NOT_VALID:xse,AVV_ERR_ROOT_PLG_BOOTED:Ase,AVV_ERR_READY_TIMEOUT:Pse}=yO,Mse=yse,q7=Nse,Bf=vO("avvio"),J6=Symbol("kAvvio"),Z9=Symbol("kThenifyDoNotWrap");function Dse(t,n,r){const u=n.expose||{},s=u.use||"use",p=u.after||"after",f=u.ready||"ready",g=u.onClose||"onClose",v=u.close||"close";if(t[s])throw new K9(s);if(t[p])throw new K9(p);if(t[f])throw new K9(f);t[s]=function(b,E){return r.use(b,E),this},Object.defineProperty(t,"then",{get:TO.bind(r)}),t[J6]=!0,t[p]=function(b){return typeof b!="function"?r._loadRegistered():(r.after(X9(b,this)),this)},t[f]=function(b){if(b&&typeof b!="function")throw new Cp(f,typeof b);return r.ready(b?X9(b,this):void 0)},t[g]=function(b){if(typeof b!="function")throw new Cp(g,typeof b);return r.onClose(Bse(b,this)),this},t[v]=function(b){if(b&&typeof b!="function")throw new Cp(v,typeof b);return b?(r.close(X9(b,this)),this):r.close()}}function Ra(t,n,r){if(typeof t=="function"&&arguments.length===1&&(r=t,n={},t=null),typeof n=="function"&&(r=n,n={}),n=n||{},!(this instanceof Ra)){const u=new Ra(t,n,r);return t&&Dse(t,n,u),u}n.autostart!==!1&&(n.autostart=!0),t=t||this,this._timeout=Number(n.timeout)||0,this._server=t,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),r&&this.once("start",r),this.started=!1,this.booted=!1,this.pluginTree=new Mse,this._readyQ=PC(this,bO,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=MC},this._closeQ=PC(this,Vse,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=MC},this._doStart=null,this._root=new q7(this,Use.bind(this),n,!1,0),this._root.once("start",(u,s,p)=>{const f=this.pluginTree.start(null,s,p);this._root.once("loaded",(g,v,b)=>{this.pluginTree.stop(f,b)})}),q7.loadPlugin.call(this,this._root,u=>{Bf("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){u=u||this._error||s}if(u){if(this._error=u,this._readyQ.length()===0)throw u}else this.booted=!0;this._readyQ.resume()})}function Use(t,n,r){this._doStart=r,n.autostart&&this.start()}Rse(Ra,Lse);Ra.prototype.start=function(){return this.started=!0,It.nextTick(this._doStart),this};Ra.prototype.override=function(t,n,r){return t};function Fse(t){if(t&&typeof t=="object"&&typeof t.default=="function"&&(t=t.default),!(t&&(typeof t=="function"||typeof t.then=="function")))throw new xse(typeof t);return t}Ra.prototype[J6]=!0;Ra.prototype.use=function(t,n){return this._lastUsed=this._addPlugin(t,n,!1),this};Ra.prototype._loadRegistered=function(){const t=this._current[0];return!this.started&&!this.booted&&It.nextTick(()=>this._root.q.resume()),t?t.loadedSoFar():Promise.resolve()};Object.defineProperty(Ra.prototype,"then",{get:TO});Ra.prototype._addPlugin=function(t,n,r){if(t=Fse(t),n=n||{},this.booted)throw new Ase;const u=this._current[0],s=new q7(this,t,n,r);if(s.once("start",(p,f,g)=>{const v=this.pluginTree.start(u.name,f,g);s.once("loaded",(b,E,I)=>{this.pluginTree.stop(v,I)})}),u.loaded)throw new Error(s.name,u.name);return u.enqueue(s,p=>{p&&(this._error=p)}),s};Ra.prototype.after=function(t){if(!t)return this._loadRegistered();this._addPlugin(n.bind(this),{},!0);function n(r,u,s){bO.call(this,t,s)}return this};Ra.prototype.onClose=function(t){if(typeof t!="function")throw new Error("not a function");t[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(t,n.bind(this));function n(r){r&&(this._error=r)}return this};Ra.prototype.close=function(t){let n;if(t){if(typeof t!="function")throw new Cp("close",typeof t)}else n=new Promise(function(r,u){t=function(s){if(s)return u(s);r()}});return this.ready(()=>{this._error=null,this._closeQ.push(t),It.nextTick(this._closeQ.resume.bind(this._closeQ))}),n};Ra.prototype.ready=function(t){if(t){if(typeof t!="function")throw new Cp("ready",typeof t);this._readyQ.push(t),queueMicrotask(this.start.bind(this));return}return new Promise((n,r)=>{this._readyQ.push(s),this.start();const u=this._current[0].server;function s(p,f,g){p?r(p):n(u),It.nextTick(g)}})};Ra.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ra.prototype.toJSON=function(){return this.pluginTree.toJSON()};function MC(){}function TO(){if(this.booted){Bf("thenify returning null because we are already booted");return}if(this[Z9]){this[Z9]=!1;return}return Bf("thenify"),(t,n)=>this._loadRegistered().then(()=>(this[Z9]=!0,t(this._server)),n)}function bO(t,n){const r=this._server,u=this._error;let s;if(this._error=null,t.length===0)this._error=u,s=t(),s&&!s[J6]&&typeof s.then=="function"?s.then(()=>It.nextTick(n),p=>It.nextTick(n,p)):It.nextTick(n);else if(t.length===1)s=t(u),s&&!s[J6]&&typeof s.then=="function"?s.then(()=>It.nextTick(n),p=>It.nextTick(n,p)):It.nextTick(n);else if(this._timeout===0){const p=f=>{this._error=f,n(this._error)};t.length===2?t(u,p):t(u,r,p)}else jse.call(this,t,u,r,n)}function jse(t,n,r,u){const s=t.name;Bf("setting up ready timeout",s,this._timeout);let p=setTimeout(()=>{Bf("timed out",s),p=null;const g=new Pse(s);g.fn=t,this._error=g,u(g)},this._timeout);t.length===2?t(n,f.bind(this)):t(n,r,f.bind(this));function f(g){p&&(clearTimeout(p),this._error=g,u(this._error))}}function Vse(t,n){const r=this._server,u=t[this._isOnCloseHandlerKey];if(t.length===0||t.length===1){let s;u?s=t(r):s=t(this._error),s&&typeof s.then=="function"?(Bf("resolving close/onClose promise"),s.then(()=>It.nextTick(n),p=>It.nextTick(n,p))):It.nextTick(n)}else t.length===2?t(u?r:this._error,n):u?t(r,n):t(this._error,r,n)}function Bse(t,n){return r.bind(n);function r(u,s){let p;t.length===0?(p=t(),p&&p.then?p.then(function(){It.nextTick(s)},s):It.nextTick(s)):t.length===1?(p=t(this),p&&p.then?p.then(function(){It.nextTick(s)},s):It.nextTick(s)):t(this,s)}}function X9(t,n){return r.bind(n);function r(u,s){let p;t?t.length===0?(p=t(),p&&p.then?p.then(function(){It.nextTick(s,u)},s):It.nextTick(s,u)):t.length===1?(p=t(u),p&&p.then?p.then(function(){It.nextTick(s)},s):It.nextTick(s)):t.length===2?t(u,s):t(u,this,s):It.nextTick(s)}}Ay.exports=Ra;Ay.exports.express=function(t){return Ra(t,{expose:{use:"load"}})};var $se=Ay.exports;const Hse=yoe($se);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const t=["webkit","moz","ms","o"];for(const n of t)window.requestAnimationFrame=window.requestAnimationFrame||window[`${n}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${n}CancelAnimationFrame`]||window[`${n}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let n=0;const r=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(u){const s=r?window.performance.now():new Date().getTime(),p=Math.max(0,16-(s-n)),f=window.setTimeout(function(){u(s+p)},p);return n=s+p,f},window.cancelAnimationFrame=clearTimeout}})();function zse(t,n=!0,r=!0,u={friendsTab:"enabled"}){const s=n?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",p=n?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",f=Hse(Object.create({}),{autostart:!1});return f.use(Wre,{friendsTab:u.friendsTab,theme:u.theme,themeMode:u.themeMode}),f.use(Vre,{onDeepLinkHandled:u==null?void 0:u.onDeepLinkHandled}),f.use(zre,{videoPlayerController:u==null?void 0:u.videoPlayerController}),f.use(Gre,{onContentActivate:u==null?void 0:u.onContentActivate,withAd:u==null?void 0:u.withAd,withAdNotification:u==null?void 0:u.withAdNotification}),f.use(ore,{sdkKey:t,host:s,analyticsHost:p,version:u==null?void 0:u.version}),f.use(cre),f.use(Hre),f.use(ioe),f.use(Lre),f.use(goe),f.after((g,v,b)=>{if(g)throw g;v.ready(),b()}),r&&f.after(async(g,v,b)=>{if(g)throw g;await v.sdk.initializeApp(),b()}),f.onClose(()=>{console.log("close")}),f}const qse=({sdkKey:t,plugins:n,production:r,autoEnable:u,onDeepLinkHandled:s,videoPlayerController:p,onContentActivate:f,withAdNotification:g,withAd:v,friendsTab:b})=>{const[E,I]=q.useState(null);return q.useEffect(()=>{let O=!1;if(!t)return console.error("streamlayer sdk key should be provided"),I(x=>(x!==null&&typeof x.disableApp=="function"&&x.disableApp(),null)),()=>{O=!0};const L=zse(t,r,u,{version:"1.12.1",onDeepLinkHandled:s,videoPlayerController:p,onContentActivate:f,withAdNotification:g,withAd:v,friendsTab:b});if(n)for(const x of n)L.use(x);return L.ready().then(x=>{O||(I(x.sdk),typeof window<"u")}).catch(x=>console.log(x)),()=>{O=!0,L.close(function(x){if(x)throw x})}},[t,r]),E},Gse=({event:t})=>{const n=Dp(),r=Qse();return q.useEffect(()=>(n&&(t&&(n.createEventSession(t),r&&(r.current=t)),!t&&(r!=null&&r.current)&&(n.createEventSession(""),r.current="")),()=>{n&&n.disableApp()}),[t,r,n]),null};var kO=(t=>(t[t.UNSET=0]="UNSET",t[t.CONNECTED=1]="CONNECTED",t[t.READY=2]="READY",t))(kO||{});const Wse={status:0,sdk:null},C4=q.createContext(Wse),SO=({sdkKey:t,theme:n,themeMode:r,plugins:u,children:s,event:p,production:f=!0,autoEnable:g=!0,withAdNotification:v,withAd:b=!0,friendsTab:E="enabled",onDeepLinkHandled:I,videoPlayerController:O,onContentActivate:L})=>{const x=qse({sdkKey:t,plugins:u,production:f,autoEnable:g,onDeepLinkHandled:I,videoPlayerController:O,onContentActivate:L,withAdNotification:v,withAd:b,friendsTab:E}),M=q.useRef(""),F=q.useMemo(()=>x?{sdk:x,status:2,event:M}:{status:1,sdk:null,event:M},[x]);return q.useEffect(()=>{x&&(x.options.setKey("friendsTab",E),x.options.setKey("theme",n),x.options.setKey("themeMode",r))},[x,E,n,r]),q.useEffect(()=>()=>{I&&(x==null||x.removeDeepLinkHandler(I)),O&&(x==null||x.removeVideoPlayerController(O))},[x]),q.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!t,onDeepLinkHandled:!!I,videoPlayerController:!!O})},[t,I,O]),S.jsxs(C4.Provider,{value:F,children:[p!==void 0&&S.jsx(Gse,{event:p}),s]})},Dp=()=>{const{sdk:t}=q.useContext(C4);return t},Qse=()=>{const{event:t}=q.useContext(C4);return t},Yse=()=>{const t=Dp();return t?S.jsx(j_,{sdk:t}):null},Kse=({close:t,onEvent:n})=>{const r=Dp();return r?S.jsx(F_,{sdk:r,onEvent:n,close:t}):null},Zse=({sdkKey:t,plugins:n,children:r,onDeepLinkHandled:u,videoPlayerController:s,production:p=!0})=>S.jsx(SO,{sdkKey:t,plugins:n,production:p,autoEnable:!1,onDeepLinkHandled:u,videoPlayerController:s,children:r}),Xse=({children:t,overlays:n})=>{const{sdk:r,status:u}=q.useContext(C4);return u===kO.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),t({})):r?S.jsx("div",{className:"StreamLayerSDK",children:S.jsx(_y,{style:{height:"100%"},children:S.jsx(gX,{sdk:r,overlays:n,children:t})})}):t({})};class Jse extends q.Component{constructor(n){super(n),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n,r){console.error(n,r.componentStack)}render(){return this.state.hasError?this.props.children({}):S.jsx(Xse,{...this.props})}}const ele=({token:t,schema:n})=>{const r=Dp();return q.useEffect(()=>{t&&n&&r&&r.authorizationBypass(n,t),r&&(r.withAuth=!0)},[t,n,r]),null},wO=({event:t,sdkKey:n,token:r,deviceId:u,production:s=!1,theme:p,themeMode:f="light",children:g})=>{const[v,b]=q.useState(!1);return q.useEffect(()=>{r&&(new sI().setToken(r),b(!0))},[r]),q.useEffect(()=>{u&&localStorage.setItem("sl-device-id",u)},[u]),v?S.jsx(SO,{sdkKey:n,event:t,production:s,theme:p,themeMode:f,autoEnable:!0,children:S.jsx("div",{className:"StreamLayerSDK",children:S.jsx(_y,{children:g})})}):null},tle=({onEvent:t,close:n,...r})=>S.jsx(wO,{...r,children:S.jsx(Kse,{close:n,onEvent:t})}),nle=({production:t})=>{const[n,r]=q.useState();return q.useEffect(()=>{const{hostname:u,search:s}=window.location,p=new URLSearchParams(s);r({sdkKey:p.get("_slrk")||"",event:p.get("_slre")||"",token:p.get("_slrt")||"",deviceId:p.get("_slrd")||"",theme:p.get("theme")||"",themeMode:p.get("themeMode")==="dark"?"dark":"light",production:t??!(u.includes("next.")||u==="localhost")})},[t]),n?S.jsx(wO,{...n,children:S.jsx(Yse,{})}):null},ale=()=>{const t=Dp();return t?S.jsx("div",{className:"StreamLayerSDK",children:S.jsx(_y,{children:S.jsx(_X,{sdk:t})})}):null};exports.A=Wa;exports.BetPack=tle;exports.BetPackStandalone=nle;exports.C=X_;exports.C$1=i$;exports.M=Cy;exports.MastersStreamLayerProvider=Zse;exports.MastersStreamLayerSDKReact=Jse;exports.O=vy;exports.S=nI;exports.S$1=l$;exports.StreamLayerLogin=ele;exports.StreamLayerSDKPoints=ale;exports.T=wy;exports.b=Z_;exports.cx_default=ki;exports.d=u$;exports.k=rI;exports.l=r$;exports.m=kp;exports.m$1=a$;exports.n=fy;exports.p=OX;exports.styled_default=A;exports.useStore=jt;exports.useTransition=VC;exports.z=IY;
|
package/lib/dist/es/masters.js
CHANGED
|
@@ -45711,7 +45711,7 @@ const tle = ({
|
|
|
45711
45711
|
O = !0;
|
|
45712
45712
|
};
|
|
45713
45713
|
const L = ele(t, r, u, {
|
|
45714
|
-
version: "1.12.
|
|
45714
|
+
version: "1.12.1",
|
|
45715
45715
|
onDeepLinkHandled: s,
|
|
45716
45716
|
videoPlayerController: p,
|
|
45717
45717
|
onContentActivate: f,
|
|
@@ -18267,7 +18267,7 @@ const fE = ({
|
|
|
18267
18267
|
f = !0;
|
|
18268
18268
|
};
|
|
18269
18269
|
const T = pE(e, n, a, {
|
|
18270
|
-
version: "1.12.
|
|
18270
|
+
version: "1.12.1",
|
|
18271
18271
|
onDeepLinkHandled: s,
|
|
18272
18272
|
videoPlayerController: o,
|
|
18273
18273
|
onContentActivate: r,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "StreamLayer, Inc (https://streamlayer.io)",
|
|
6
6
|
"maintainers": [
|
|
@@ -123,18 +123,18 @@
|
|
|
123
123
|
}
|
|
124
124
|
],
|
|
125
125
|
"dependencies": {
|
|
126
|
-
"@streamlayer/feature-gamification": "^1.14.
|
|
127
|
-
"@streamlayer/sdk-web": "^1.8.
|
|
128
|
-
"@streamlayer/sdk-web-analytics": "^1.6.
|
|
129
|
-
"@streamlayer/sdk-web-api": "^1.7.
|
|
130
|
-
"@streamlayer/sdk-web-core": "^1.10.
|
|
131
|
-
"@streamlayer/sdk-web-features": "^1.0.
|
|
132
|
-
"@streamlayer/sdk-web-interfaces": "^1.4.
|
|
133
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
134
|
-
"@streamlayer/sdk-web-notifications": "^1.3.
|
|
135
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
136
|
-
"@streamlayer/react-polyfills": "^0.1.
|
|
137
|
-
"@streamlayer/sdk-web-types": "^1.10.
|
|
126
|
+
"@streamlayer/feature-gamification": "^1.14.1",
|
|
127
|
+
"@streamlayer/sdk-web": "^1.8.1",
|
|
128
|
+
"@streamlayer/sdk-web-analytics": "^1.6.1",
|
|
129
|
+
"@streamlayer/sdk-web-api": "^1.7.1",
|
|
130
|
+
"@streamlayer/sdk-web-core": "^1.10.1",
|
|
131
|
+
"@streamlayer/sdk-web-features": "^1.0.44",
|
|
132
|
+
"@streamlayer/sdk-web-interfaces": "^1.4.10",
|
|
133
|
+
"@streamlayer/sdk-web-logger": "^1.0.44",
|
|
134
|
+
"@streamlayer/sdk-web-notifications": "^1.3.6",
|
|
135
|
+
"@streamlayer/sdk-web-storage": "^1.0.44",
|
|
136
|
+
"@streamlayer/react-polyfills": "^0.1.4",
|
|
137
|
+
"@streamlayer/sdk-web-types": "^1.10.1"
|
|
138
138
|
},
|
|
139
139
|
"peerDependencies": {
|
|
140
140
|
"@bufbuild/protobuf": "^1.10.0",
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
"size-limit": "^11.1.6",
|
|
191
191
|
"url-loader": "^4.1.1",
|
|
192
192
|
"vite-plugin-dts": "^4.2.3",
|
|
193
|
-
"@streamlayer/react-ui": "^1.18.
|
|
193
|
+
"@streamlayer/react-ui": "^1.18.1"
|
|
194
194
|
},
|
|
195
195
|
"scripts": {
|
|
196
196
|
"size-limit": "size-limit"
|