@streamlayer/react 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
`),c=`
|
|
15
15
|
`+n+(o.length?s("│"):" ")+" ";return n+r.join(c)+`
|
|
16
16
|
`+o.map(function(l,m){var u=m===o.length-1,d=l.nodes&&l.nodes.length,y=n+(u?" ":s("│"))+" ";return n+s(u?"└":"├")+s("─")+s(d?"┬":"─")+" "+e(l,y,a).slice(n.length+2)}).join("")};const y_=T_,hr=Symbol("avvio.TimeTree.untrackNode"),Ia=Symbol("avvio.TimeTree.trackNode"),Sr=Symbol("avvio.TimeTree.getParent"),_r=Symbol("avvio.TimeTree.getNode"),Er=Symbol("avvio.TimeTree.addNode");let g_=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Ia](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])}[hr](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)}[Sr](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[_r](e){return this.tableId.get(e)}[Er](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Ia](this.root),this.root.id;const a=this[Sr](e),s=`${t}-${Math.random()}`,o={id:s,parent:e,start:n,label:t,nodes:[]};return a.nodes.push(o),this[Ia](o),s}start(e,t,n=Date.now()){return this[Er](e,t,n)}stop(e,t=Date.now()){const n=this[_r](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[hr](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 y_(t)}};var f_=g_,Us={exports:{}},ns={exports:{}},Na,br;function k_(){if(br)return Na;br=1;var e=1e3,t=e*60,n=t*60,a=n*24,s=a*7,o=a*365.25;Na=function(u,d){d=d||{};var y=typeof u;if(y==="string"&&u.length>0)return r(u);if(y==="number"&&isFinite(u))return d.long?l(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function r(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var y=parseFloat(d[1]),T=(d[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return y*o;case"weeks":case"week":case"w":return y*s;case"days":case"day":case"d":return y*a;case"hours":case"hour":case"hrs":case"hr":case"h":return y*n;case"minutes":case"minute":case"mins":case"min":case"m":return y*t;case"seconds":case"second":case"secs":case"sec":case"s":return y*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function c(u){var d=Math.abs(u);return d>=a?Math.round(u/a)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var d=Math.abs(u);return d>=a?m(u,d,a,"day"):d>=n?m(u,d,n,"hour"):d>=t?m(u,d,t,"minute"):d>=e?m(u,d,e,"second"):u+" ms"}function m(u,d,y,T){var f=d>=y*1.5;return Math.round(u/y)+" "+T+(f?"s":"")}return Na}function h_(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=s,n.enabled=r,n.humanize=k_(),n.destroy=m,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let y=0;y<u.length;y++)d=(d<<5)-d+u.charCodeAt(y),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,y=null,T,f;function _(...O){if(!_.enabled)return;const b=_,E=Number(new Date),R=E-(d||E);b.diff=R,b.prev=d,b.curr=E,d=E,O[0]=n.coerce(O[0]),typeof O[0]!="string"&&O.unshift("%O");let v=0;O[0]=O[0].replace(/%([a-zA-Z%])/g,(A,L)=>{if(A==="%%")return"%";v++;const N=n.formatters[L];if(typeof N=="function"){const D=O[v];A=N.call(b,D),O.splice(v,1),v--}return A}),n.formatArgs.call(b,O),(b.log||n.log).apply(b,O)}return _.namespace=u,_.useColors=n.useColors(),_.color=n.selectColor(u),_.extend=a,_.destroy=n.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(T!==n.namespaces&&(T=n.namespaces,f=n.enabled(u)),f),set:O=>{y=O}}),typeof n.init=="function"&&n.init(_),_}function a(u,d){const y=n(this.namespace+(typeof d>"u"?":":d)+u);return y.log=this.log,y}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const y=(typeof u=="string"?u:"").split(/[\s,]+/),T=y.length;for(d=0;d<T;d++)y[d]&&(u=y[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function o(){const u=[...n.names.map(c),...n.skips.map(c).map(d=>"-"+d)].join(",");return n.enable(""),u}function r(u){if(u[u.length-1]==="*")return!0;let d,y;for(d=0,y=n.skips.length;d<y;d++)if(n.skips[d].test(u))return!1;for(d=0,y=n.names.length;d<y;d++)if(n.names[d].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var S_=h_;(function(e,t){t.formatArgs=a,t.save=s,t.load=o,t.useColors=n,t.storage=r(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;l.splice(1,0,m,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,y=>{y!=="%%"&&(u++,y==="%c"&&(d=u))}),l.splice(d,0,m)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof P<"u"&&"env"in P&&(l=P.env.DEBUG),l}function r(){try{return localStorage}catch{}}e.exports=S_(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(ns,ns.exports);var Rc=ns.exports;const __=ac,E_=dc.EventEmitter,b_=zn.inherits,le=Rc("avvio"),{AVV_ERR_READY_TIMEOUT:I_}=wc,Oa=Symbol.for("plugin-meta");function N_(e,t){return e[Oa]&&e[Oa].name?e[Oa].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 O_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function Vt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=N_(t,n),this.isAfter=a,this.q=__(e,v_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}b_(Vt,E_);Vt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){le("skipping loading of plugin as parent errored and it is not an after",s),P.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return le("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,le("exec",s);let o;const r=l=>{if(a){le("loading complete",s);return}this._error=l,le(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(le("setting up timeout",s,this.timeout),o=setTimeout(function(){le("timed out",s),o=null;const l=new I_(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"&&(le("exec: resolving promise",s),c.then(()=>P.nextTick(r),l=>P.nextTick(r,l)))};Vt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(le("rejecting promise",this.name,n),this._promise.reject(n)):(le("resolving promise",this.name),this._promise.resolve()),this._promise=null,P.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=O_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};Vt.prototype.enqueue=function(e,t){le("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};Vt.prototype.finish=function(e,t){le("finish",this.name,e);const n=()=>{this.loaded||(le("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(le("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{le("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else le("delayed",this.name),this.q.drain=()=>{le("drain",this.name),this.q.drain=A_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function v_(e,t){const n=this;P.nextTick(Fs.bind(n),e,t)}function Fs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Fs.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 A_(){}Us.exports=Vt;Us.exports.loadPlugin=Fs;var w_=Us.exports;const Ir=ac,R_=dc.EventEmitter,L_=zn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:va,AVV_ERR_CALLBACK_NOT_FN:Wt,AVV_ERR_PLUGIN_NOT_VALID:M_,AVV_ERR_ROOT_PLG_BOOTED:P_,AVV_ERR_READY_TIMEOUT:C_}=wc,D_=f_,as=w_,Ft=Rc("avvio"),Vn=Symbol("kAvvio"),Aa=Symbol("kThenifyDoNotWrap");function U_(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 va(s);if(e[o])throw new va(o);if(e[r])throw new va(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:Lc.bind(n)}),e[Vn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(wa(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new Wt(r,typeof m);return n.ready(m?wa(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new Wt(c,typeof m);return n.onClose(x_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new Wt(l,typeof m);return m?(n.close(wa(m,this)),this):n.close()}}function re(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 re)){const a=new re(e,t,n);return e&&U_(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 D_,this._readyQ=Ir(this,Mc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Nr},this._closeQ=Ir(this,V_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Nr},this._doStart=null,this._root=new as(this,F_.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)})}),as.loadPlugin.call(this,this._root,a=>{Ft("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function F_(e,t,n){this._doStart=n,t.autostart&&this.start()}L_(re,R_);re.prototype.start=function(){return this.started=!0,P.nextTick(this._doStart),this};re.prototype.override=function(e,t,n){return e};function G_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new M_(typeof e);return e}re.prototype[Vn]=!0;re.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};re.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&P.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(re.prototype,"then",{get:Lc});re.prototype._addPlugin=function(e,t,n){if(e=G_(e),t=t||{},this.booted)throw new P_;const a=this._current[0],s=new as(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};re.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Mc.call(this,e,s)}return this};re.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};re.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Wt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),P.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};re.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Wt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),P.nextTick(c)}})};re.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};re.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Nr(){}function Lc(){if(this.booted){Ft("thenify returning null because we are already booted");return}if(this[Aa]){this[Aa]=!1;return}return Ft("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Aa]=!0,e(this._server)),t)}function Mc(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[Vn]&&typeof s.then=="function"?s.then(()=>P.nextTick(t),o=>P.nextTick(t,o)):P.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Vn]&&typeof s.then=="function"?s.then(()=>P.nextTick(t),o=>P.nextTick(t,o)):P.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 B_.call(this,e,a,n,t)}function B_(e,t,n,a){const s=e.name;Ft("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Ft("timed out",s),o=null;const c=new C_(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 V_(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Ft("resolving close/onClose promise"),s.then(()=>P.nextTick(t),o=>P.nextTick(t,o))):P.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function x_(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){P.nextTick(s)},s):P.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){P.nextTick(s)},s):P.nextTick(s)):e(this,s)}}function wa(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){P.nextTick(s,a)},s):P.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){P.nextTick(s)},s):P.nextTick(s)):e.length===2?e(a,s):e(a,this,s):P.nextTick(s)}}Ns.exports=re;Ns.exports.express=function(e){return re(e,{expose:{use:"load"}})};var q_=Ns.exports;const H_=fh(q_);(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 Q_(e,t=!0,n=!0,a){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=H_(Object.create({}),{autostart:!1});return r.use($k),r.use(Vk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(Qk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(jk,{onContentActivate:a==null?void 0:a.onContentActivate}),r.use(ik,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(dk),r.use(Hk),r.use(rh),r.use(Rk),r.use(gh),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 Y_=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r})=>{const[c,l]=Bs.useState(null);return Bs.useEffect(()=>{let m=!1;if(!e)return console.error("streamlayer sdk key should be provided"),l(d=>(d!==null&&typeof d.disableApp=="function"&&d.disableApp(),null)),()=>{m=!0};const u=Q_(e,n,a,{version:"1.5.1",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r});if(t)for(const d of t)u.use(d);return u.ready().then(d=>{m||(l(d.sdk),typeof window<"u")}).catch(d=>console.log(d)),()=>{m=!0,u.close(function(d){if(d)throw d})}},[e,n]),c};exports.CtaIconMode=Zr;exports.InvitationFrom=Ln;exports.NotificationEnabled=ms;exports.NotificationPromotionImagePosition=Jr;exports.NotificationSponsorLogoMode=Xr;exports.PickHistoryStatus=It;exports.PromotionButtonType=ti;exports.PromotionLogoMode=ni;exports.PromotionType=Fe;exports.QuestionImages=ot;exports.QuestionStatus=se;exports.QuestionType=C;exports.SdkOverlayType=H;exports.createContextKey=Va;exports.global=xa;exports.pino_1=Mr;exports.useStreamLayerApp=Y_;
|
|
17
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function O_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function Vt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=N_(t,n),this.isAfter=a,this.q=__(e,v_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}b_(Vt,E_);Vt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){le("skipping loading of plugin as parent errored and it is not an after",s),P.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return le("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,le("exec",s);let o;const r=l=>{if(a){le("loading complete",s);return}this._error=l,le(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(le("setting up timeout",s,this.timeout),o=setTimeout(function(){le("timed out",s),o=null;const l=new I_(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"&&(le("exec: resolving promise",s),c.then(()=>P.nextTick(r),l=>P.nextTick(r,l)))};Vt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(le("rejecting promise",this.name,n),this._promise.reject(n)):(le("resolving promise",this.name),this._promise.resolve()),this._promise=null,P.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=O_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};Vt.prototype.enqueue=function(e,t){le("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};Vt.prototype.finish=function(e,t){le("finish",this.name,e);const n=()=>{this.loaded||(le("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(le("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{le("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else le("delayed",this.name),this.q.drain=()=>{le("drain",this.name),this.q.drain=A_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function v_(e,t){const n=this;P.nextTick(Fs.bind(n),e,t)}function Fs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Fs.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 A_(){}Us.exports=Vt;Us.exports.loadPlugin=Fs;var w_=Us.exports;const Ir=ac,R_=dc.EventEmitter,L_=zn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:va,AVV_ERR_CALLBACK_NOT_FN:Wt,AVV_ERR_PLUGIN_NOT_VALID:M_,AVV_ERR_ROOT_PLG_BOOTED:P_,AVV_ERR_READY_TIMEOUT:C_}=wc,D_=f_,as=w_,Ft=Rc("avvio"),Vn=Symbol("kAvvio"),Aa=Symbol("kThenifyDoNotWrap");function U_(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 va(s);if(e[o])throw new va(o);if(e[r])throw new va(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:Lc.bind(n)}),e[Vn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(wa(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new Wt(r,typeof m);return n.ready(m?wa(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new Wt(c,typeof m);return n.onClose(x_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new Wt(l,typeof m);return m?(n.close(wa(m,this)),this):n.close()}}function re(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 re)){const a=new re(e,t,n);return e&&U_(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 D_,this._readyQ=Ir(this,Mc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Nr},this._closeQ=Ir(this,V_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Nr},this._doStart=null,this._root=new as(this,F_.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)})}),as.loadPlugin.call(this,this._root,a=>{Ft("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function F_(e,t,n){this._doStart=n,t.autostart&&this.start()}L_(re,R_);re.prototype.start=function(){return this.started=!0,P.nextTick(this._doStart),this};re.prototype.override=function(e,t,n){return e};function G_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new M_(typeof e);return e}re.prototype[Vn]=!0;re.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};re.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&P.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(re.prototype,"then",{get:Lc});re.prototype._addPlugin=function(e,t,n){if(e=G_(e),t=t||{},this.booted)throw new P_;const a=this._current[0],s=new as(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};re.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Mc.call(this,e,s)}return this};re.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};re.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Wt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),P.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};re.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Wt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),P.nextTick(c)}})};re.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};re.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Nr(){}function Lc(){if(this.booted){Ft("thenify returning null because we are already booted");return}if(this[Aa]){this[Aa]=!1;return}return Ft("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Aa]=!0,e(this._server)),t)}function Mc(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[Vn]&&typeof s.then=="function"?s.then(()=>P.nextTick(t),o=>P.nextTick(t,o)):P.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Vn]&&typeof s.then=="function"?s.then(()=>P.nextTick(t),o=>P.nextTick(t,o)):P.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 B_.call(this,e,a,n,t)}function B_(e,t,n,a){const s=e.name;Ft("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Ft("timed out",s),o=null;const c=new C_(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 V_(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Ft("resolving close/onClose promise"),s.then(()=>P.nextTick(t),o=>P.nextTick(t,o))):P.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function x_(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){P.nextTick(s)},s):P.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){P.nextTick(s)},s):P.nextTick(s)):e(this,s)}}function wa(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){P.nextTick(s,a)},s):P.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){P.nextTick(s)},s):P.nextTick(s)):e.length===2?e(a,s):e(a,this,s):P.nextTick(s)}}Ns.exports=re;Ns.exports.express=function(e){return re(e,{expose:{use:"load"}})};var q_=Ns.exports;const H_=fh(q_);(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 Q_(e,t=!0,n=!0,a){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=H_(Object.create({}),{autostart:!1});return r.use($k),r.use(Vk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(Qk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(jk,{onContentActivate:a==null?void 0:a.onContentActivate}),r.use(ik,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(dk),r.use(Hk),r.use(rh),r.use(Rk),r.use(gh),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 Y_=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r})=>{const[c,l]=Bs.useState(null);return Bs.useEffect(()=>{let m=!1;if(!e)return console.error("streamlayer sdk key should be provided"),l(d=>(d!==null&&typeof d.disableApp=="function"&&d.disableApp(),null)),()=>{m=!0};const u=Q_(e,n,a,{version:"1.5.2",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r});if(t)for(const d of t)u.use(d);return u.ready().then(d=>{m||(l(d.sdk),typeof window<"u")}).catch(d=>console.log(d)),()=>{m=!0,u.close(function(d){if(d)throw d})}},[e,n]),c};exports.CtaIconMode=Zr;exports.InvitationFrom=Ln;exports.NotificationEnabled=ms;exports.NotificationPromotionImagePosition=Jr;exports.NotificationSponsorLogoMode=Xr;exports.PickHistoryStatus=It;exports.PromotionButtonType=ti;exports.PromotionLogoMode=ni;exports.PromotionType=Fe;exports.QuestionImages=ot;exports.QuestionStatus=se;exports.QuestionType=C;exports.SdkOverlayType=H;exports.createContextKey=Va;exports.global=xa;exports.pino_1=Mr;exports.useStreamLayerApp=Y_;
|
package/lib/dist/cjs/masters.js
CHANGED
|
@@ -209,4 +209,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
209
209
|
`),y=`
|
|
210
210
|
`+o+(p.length?c("│"):" ")+" ";return o+m.join(y)+`
|
|
211
211
|
`+p.map(function(b,C){var _=C===p.length-1,I=b.nodes&&b.nodes.length,R=o+(_?" ":c("│"))+" ";return o+c(_?"└":"├")+c("─")+c(I?"┬":"─")+" "+n(b,R,l).slice(o.length+2)}).join("")};const Iee=_ee,$S=Symbol("avvio.TimeTree.untrackNode"),Z5=Symbol("avvio.TimeTree.trackNode"),zS=Symbol("avvio.TimeTree.getParent"),HS=Symbol("avvio.TimeTree.getNode"),GS=Symbol("avvio.TimeTree.addNode");let Nee=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Z5](n){this.tableId.set(n.id,n),this.tableLabel.has(n.label)?this.tableLabel.get(n.label).push(n):this.tableLabel.set(n.label,[n])}[$S](n){this.tableId.delete(n.id);const r=this.tableLabel.get(n.label);if(r.id){this.tableLabel.delete(n.label);return}r.pop(),r.length===0&&this.tableLabel.delete(n.label)}[zS](n){if(n===null)return this.root;const r=this.tableLabel.get(n);return r.id?r:r[r.length-1]}[HS](n){return this.tableId.get(n)}[GS](n,r,o){if(n===null)return this.root={id:"root",label:r,start:o,nodes:[]},this[Z5](this.root),this.root.id;const l=this[zS](n),c=`${r}-${Math.random()}`,p={id:c,parent:n,start:o,label:r,nodes:[]};return l.nodes.push(p),this[Z5](p),c}start(n,r,o=Date.now()){return this[GS](n,r,o)}stop(n,r=Date.now()){const o=this[HS](n);o&&(o.stop=r,o.diff=o.stop-o.start||0,this[$S](o))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const n=o=>(o.label=`${o.label} ${o.diff} ms`,o.nodes.length>0&&(o.nodes=o.nodes.map(l=>n(l))),o),r=n(this.toJSON());return Iee(r)}};var Ree=Nee,_y={exports:{}},U9={exports:{}},X5,qS;function Lee(){if(qS)return X5;qS=1;var n=1e3,r=n*60,o=r*60,l=o*24,c=l*7,p=l*365.25;X5=function(_,I){I=I||{};var R=typeof _;if(R==="string"&&_.length>0)return m(_);if(R==="number"&&isFinite(_))return I.long?b(_):y(_);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(_))};function m(_){if(_=String(_),!(_.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(_);if(I){var R=parseFloat(I[1]),O=(I[2]||"ms").toLowerCase();switch(O){case"years":case"year":case"yrs":case"yr":case"y":return R*p;case"weeks":case"week":case"w":return R*c;case"days":case"day":case"d":return R*l;case"hours":case"hour":case"hrs":case"hr":case"h":return R*o;case"minutes":case"minute":case"mins":case"min":case"m":return R*r;case"seconds":case"second":case"secs":case"sec":case"s":return R*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return R;default:return}}}}function y(_){var I=Math.abs(_);return I>=l?Math.round(_/l)+"d":I>=o?Math.round(_/o)+"h":I>=r?Math.round(_/r)+"m":I>=n?Math.round(_/n)+"s":_+"ms"}function b(_){var I=Math.abs(_);return I>=l?C(_,I,l,"day"):I>=o?C(_,I,o,"hour"):I>=r?C(_,I,r,"minute"):I>=n?C(_,I,n,"second"):_+" ms"}function C(_,I,R,O){var D=I>=R*1.5;return Math.round(_/R)+" "+O+(D?"s":"")}return X5}function Oee(n){o.debug=o,o.default=o,o.coerce=b,o.disable=p,o.enable=c,o.enabled=m,o.humanize=Lee(),o.destroy=C,Object.keys(n).forEach(_=>{o[_]=n[_]}),o.names=[],o.skips=[],o.formatters={};function r(_){let I=0;for(let R=0;R<_.length;R++)I=(I<<5)-I+_.charCodeAt(R),I|=0;return o.colors[Math.abs(I)%o.colors.length]}o.selectColor=r;function o(_){let I,R=null,O,D;function F(...V){if(!F.enabled)return;const G=F,Q=Number(new Date),J=Q-(I||Q);G.diff=J,G.prev=I,G.curr=Q,I=Q,V[0]=o.coerce(V[0]),typeof V[0]!="string"&&V.unshift("%O");let ne=0;V[0]=V[0].replace(/%([a-zA-Z%])/g,(te,ce)=>{if(te==="%%")return"%";ne++;const oe=o.formatters[ce];if(typeof oe=="function"){const Ne=V[ne];te=oe.call(G,Ne),V.splice(ne,1),ne--}return te}),o.formatArgs.call(G,V),(G.log||o.log).apply(G,V)}return F.namespace=_,F.useColors=o.useColors(),F.color=o.selectColor(_),F.extend=l,F.destroy=o.destroy,Object.defineProperty(F,"enabled",{enumerable:!0,configurable:!1,get:()=>R!==null?R:(O!==o.namespaces&&(O=o.namespaces,D=o.enabled(_)),D),set:V=>{R=V}}),typeof o.init=="function"&&o.init(F),F}function l(_,I){const R=o(this.namespace+(typeof I>"u"?":":I)+_);return R.log=this.log,R}function c(_){o.save(_),o.namespaces=_,o.names=[],o.skips=[];let I;const R=(typeof _=="string"?_:"").split(/[\s,]+/),O=R.length;for(I=0;I<O;I++)R[I]&&(_=R[I].replace(/\*/g,".*?"),_[0]==="-"?o.skips.push(new RegExp("^"+_.slice(1)+"$")):o.names.push(new RegExp("^"+_+"$")))}function p(){const _=[...o.names.map(y),...o.skips.map(y).map(I=>"-"+I)].join(",");return o.enable(""),_}function m(_){if(_[_.length-1]==="*")return!0;let I,R;for(I=0,R=o.skips.length;I<R;I++)if(o.skips[I].test(_))return!1;for(I=0,R=o.names.length;I<R;I++)if(o.names[I].test(_))return!0;return!1}function y(_){return _.toString().substring(2,_.toString().length-2).replace(/\.\*\?$/,"*")}function b(_){return _ instanceof Error?_.stack||_.message:_}function C(){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 o.enable(o.load()),o}var xee=Oee;(function(n,r){r.formatArgs=l,r.save=c,r.load=p,r.useColors=o,r.storage=m(),r.destroy=(()=>{let b=!1;return()=>{b||(b=!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`."))}})(),r.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 o(){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 l(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const C="color: "+this.color;b.splice(1,0,C,"color: inherit");let _=0,I=0;b[0].replace(/%[a-zA-Z%]/g,R=>{R!=="%%"&&(_++,R==="%c"&&(I=_))}),b.splice(I,0,C)}r.log=console.debug||console.log||(()=>{});function c(b){try{b?r.storage.setItem("debug",b):r.storage.removeItem("debug")}catch{}}function p(){let b;try{b=r.storage.getItem("debug")}catch{}return!b&&typeof St<"u"&&"env"in St&&(b=St.env.DEBUG),b}function m(){try{return localStorage}catch{}}n.exports=xee(r);const{formatters:y}=n.exports;y.j=function(b){try{return JSON.stringify(b)}catch(C){return"[UnexpectedJSONParseError]: "+C.message}}})(U9,U9.exports);var BE=U9.exports;const Aee=pE,Pee=wE.EventEmitter,Mee=A6.inherits,Ma=BE("avvio"),{AVV_ERR_READY_TIMEOUT:Dee}=jE,J5=Symbol.for("plugin-meta");function Uee(n,r){return n[J5]&&n[J5].name?n[J5].name:typeof r<"u"&&typeof r!="function"&&r.name?r.name:n.name?n.name:n.toString().split(`
|
|
212
|
-
`).slice(0,2).map(o=>o.trim()).join(" -- ")}function Fee(){const n={};return n.promise=new Promise((r,o)=>{n.resolve=r,n.reject=o}),n}function _0(n,r,o,l,c){this.started=!1,this.func=r,this.opts=o,this.onFinish=null,this.parent=n,this.timeout=c===void 0?n._timeout:c,this.name=Uee(r,o),this.isAfter=l,this.q=Aee(n,Vee,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Mee(_0,Pee);_0.prototype.exec=function(n,r){const o=this.func;let l=!1;const c=this.name;if(this.parent._error&&!this.isAfter){Ma("skipping loading of plugin as parent errored and it is not an after",c),St.nextTick(r);return}if(this.isAfter)this.server=n;else try{this.server=this.parent.override(n,o,this.opts)}catch(b){return Ma("override errored",c),r(b)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ma("exec",c);let p;const m=b=>{if(l){Ma("loading complete",c);return}this._error=b,Ma(b?"exec errored":"exec completed",c),l=!0,p&&clearTimeout(p),r(b)};this.timeout>0&&(Ma("setting up timeout",c,this.timeout),p=setTimeout(function(){Ma("timed out",c),p=null;const b=new Dee(c);b.fn=o,m(b)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const y=o(this.server,this.opts,m);y&&typeof y.then=="function"&&(Ma("exec: resolving promise",c),y.then(()=>St.nextTick(m),b=>St.nextTick(m,b)))};_0.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const n=()=>{this.server.after((o,l)=>{this._error=o,this.q.pause(),o?(Ma("rejecting promise",this.name,o),this._promise.reject(o)):(Ma("resolving promise",this.name),this._promise.resolve()),this._promise=null,St.nextTick(l,o)}),this.q.resume()};let r;return this._promise?r=Promise.resolve():(this._promise=Fee(),r=this._promise.promise,this.server?n():this.on("start",n)),r};_0.prototype.enqueue=function(n,r){Ma("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,r)};_0.prototype.finish=function(n,r){Ma("finish",this.name,n);const o=()=>{this.loaded||(Ma("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,r(n))};if(n){this._promise&&(this._promise.reject(n),this._promise=null),o();return}const l=()=>{if(Ma("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const c=()=>{Ma("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(c,c),this._promise=null}else o();else Ma("delayed",this.name),this.q.drain=()=>{Ma("drain",this.name),this.q.drain=jee,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function Vee(n,r){const o=this;St.nextTick(Iy.bind(o),n,r)}function Iy(n,r){if(typeof n.func.then=="function"){n.func.then(l=>{typeof l.default=="function"&&(l=l.default),n.func=l,Iy.call(this,n,r)},r);return}const o=this._current[0];this._current.unshift(n),n.exec(o&&o.server||this._server,l=>{n.finish(l,c=>{this._current.shift(),r(c)})})}function jee(){}_y.exports=_0;_y.exports.loadPlugin=Iy;var Bee=_y.exports;const WS=pE,$ee=wE.EventEmitter,zee=A6.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:e9,AVV_ERR_CALLBACK_NOT_FN:s2,AVV_ERR_PLUGIN_NOT_VALID:Hee,AVV_ERR_ROOT_PLG_BOOTED:Gee,AVV_ERR_READY_TIMEOUT:qee}=jE,Wee=Ree,F9=Bee,b0=BE("avvio"),b6=Symbol("kAvvio"),t9=Symbol("kThenifyDoNotWrap");function Qee(n,r,o){const l=r.expose||{},c=l.use||"use",p=l.after||"after",m=l.ready||"ready",y=l.onClose||"onClose",b=l.close||"close";if(n[c])throw new e9(c);if(n[p])throw new e9(p);if(n[m])throw new e9(m);n[c]=function(C,_){return o.use(C,_),this},Object.defineProperty(n,"then",{get:$E.bind(o)}),n[b6]=!0,n[p]=function(C){return typeof C!="function"?o._loadRegistered():(o.after(n9(C,this)),this)},n[m]=function(C){if(C&&typeof C!="function")throw new s2(m,typeof C);return o.ready(C?n9(C,this):void 0)},n[y]=function(C){if(typeof C!="function")throw new s2(y,typeof C);return o.onClose(Jee(C,this)),this},n[b]=function(C){if(C&&typeof C!="function")throw new s2(b,typeof C);return C?(o.close(n9(C,this)),this):o.close()}}function ba(n,r,o){if(typeof n=="function"&&arguments.length===1&&(o=n,r={},n=null),typeof r=="function"&&(o=r,r={}),r=r||{},!(this instanceof ba)){const l=new ba(n,r,o);return n&&Qee(n,r,l),l}r.autostart!==!1&&(r.autostart=!0),n=n||this,this._timeout=Number(r.timeout)||0,this._server=n,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),o&&this.once("start",o),this.started=!1,this.booted=!1,this.pluginTree=new Wee,this._readyQ=WS(this,zE,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=QS},this._closeQ=WS(this,Xee,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=QS},this._doStart=null,this._root=new F9(this,Yee.bind(this),r,!1,0),this._root.once("start",(l,c,p)=>{const m=this.pluginTree.start(null,c,p);this._root.once("loaded",(y,b,C)=>{this.pluginTree.stop(m,C)})}),F9.loadPlugin.call(this,this._root,l=>{b0("root plugin ready");try{this.emit("preReady"),this._root=null}catch(c){l=l||this._error||c}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function Yee(n,r,o){this._doStart=o,r.autostart&&this.start()}zee(ba,$ee);ba.prototype.start=function(){return this.started=!0,St.nextTick(this._doStart),this};ba.prototype.override=function(n,r,o){return n};function Kee(n){if(n&&typeof n=="object"&&typeof n.default=="function"&&(n=n.default),!(n&&(typeof n=="function"||typeof n.then=="function")))throw new Hee(typeof n);return n}ba.prototype[b6]=!0;ba.prototype.use=function(n,r){return this._lastUsed=this._addPlugin(n,r,!1),this};ba.prototype._loadRegistered=function(){const n=this._current[0];return!this.started&&!this.booted&&St.nextTick(()=>this._root.q.resume()),n?n.loadedSoFar():Promise.resolve()};Object.defineProperty(ba.prototype,"then",{get:$E});ba.prototype._addPlugin=function(n,r,o){if(n=Kee(n),r=r||{},this.booted)throw new Gee;const l=this._current[0],c=new F9(this,n,r,o);if(c.once("start",(p,m,y)=>{const b=this.pluginTree.start(l.name,m,y);c.once("loaded",(C,_,I)=>{this.pluginTree.stop(b,I)})}),l.loaded)throw new Error(c.name,l.name);return l.enqueue(c,p=>{p&&(this._error=p)}),c};ba.prototype.after=function(n){if(!n)return this._loadRegistered();this._addPlugin(r.bind(this),{},!0);function r(o,l,c){zE.call(this,n,c)}return this};ba.prototype.onClose=function(n){if(typeof n!="function")throw new Error("not a function");n[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(n,r.bind(this));function r(o){o&&(this._error=o)}return this};ba.prototype.close=function(n){let r;if(n){if(typeof n!="function")throw new s2("close",typeof n)}else r=new Promise(function(o,l){n=function(c){if(c)return l(c);o()}});return this.ready(()=>{this._error=null,this._closeQ.push(n),St.nextTick(this._closeQ.resume.bind(this._closeQ))}),r};ba.prototype.ready=function(n){if(n){if(typeof n!="function")throw new s2("ready",typeof n);this._readyQ.push(n),queueMicrotask(this.start.bind(this));return}return new Promise((r,o)=>{this._readyQ.push(c),this.start();const l=this._current[0].server;function c(p,m,y){p?o(p):r(l),St.nextTick(y)}})};ba.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ba.prototype.toJSON=function(){return this.pluginTree.toJSON()};function QS(){}function $E(){if(this.booted){b0("thenify returning null because we are already booted");return}if(this[t9]){this[t9]=!1;return}return b0("thenify"),(n,r)=>this._loadRegistered().then(()=>(this[t9]=!0,n(this._server)),r)}function zE(n,r){const o=this._server,l=this._error;let c;if(this._error=null,n.length===0)this._error=l,c=n(),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(r),p=>St.nextTick(r,p)):St.nextTick(r);else if(n.length===1)c=n(l),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(r),p=>St.nextTick(r,p)):St.nextTick(r);else if(this._timeout===0){const p=m=>{this._error=m,r(this._error)};n.length===2?n(l,p):n(l,o,p)}else Zee.call(this,n,l,o,r)}function Zee(n,r,o,l){const c=n.name;b0("setting up ready timeout",c,this._timeout);let p=setTimeout(()=>{b0("timed out",c),p=null;const y=new qee(c);y.fn=n,this._error=y,l(y)},this._timeout);n.length===2?n(r,m.bind(this)):n(r,o,m.bind(this));function m(y){p&&(clearTimeout(p),this._error=y,l(this._error))}}function Xee(n,r){const o=this._server,l=n[this._isOnCloseHandlerKey];if(n.length===0||n.length===1){let c;l?c=n(o):c=n(this._error),c&&typeof c.then=="function"?(b0("resolving close/onClose promise"),c.then(()=>St.nextTick(r),p=>St.nextTick(r,p))):St.nextTick(r)}else n.length===2?n(l?o:this._error,r):l?n(o,r):n(this._error,o,r)}function Jee(n,r){return o.bind(r);function o(l,c){let p;n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===1?(p=n(this),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n(this,c)}}function n9(n,r){return o.bind(r);function o(l,c){let p;n?n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c,l)},c):St.nextTick(c,l)):n.length===1?(p=n(l),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===2?n(l,c):n(l,this,c):St.nextTick(c)}}hy.exports=ba;hy.exports.express=function(n){return ba(n,{expose:{use:"load"}})};var ete=hy.exports;const tte=RX(ete);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const n=["webkit","moz","ms","o"];for(const r of n)window.requestAnimationFrame=window.requestAnimationFrame||window[`${r}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${r}CancelAnimationFrame`]||window[`${r}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let r=0;const o=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const c=o?window.performance.now():new Date().getTime(),p=Math.max(0,16-(c-r)),m=window.setTimeout(function(){l(c+p)},p);return r=c+p,m},window.cancelAnimationFrame=clearTimeout}})();function nte(n,r=!0,o=!0,l){const c=r?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",p=r?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",m=tte(Object.create({}),{autostart:!1});return m.use(oX),m.use(XZ,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),m.use(nX,{videoPlayerController:l==null?void 0:l.videoPlayerController}),m.use(rX,{onContentActivate:l==null?void 0:l.onContentActivate}),m.use(TZ,{sdkKey:n,host:c,analyticsHost:p,version:l==null?void 0:l.version}),m.use(CZ),m.use(tX),m.use(vX),m.use($Z),m.use(NX),m.after((y,b,C)=>{if(y)throw y;b.ready(),C()}),o&&m.after(async(y,b,C)=>{if(y)throw y;await b.sdk.initializeApp(),C()}),m.onClose(()=>{console.log("close")}),m}const ate=({sdkKey:n,plugins:r,production:o,autoEnable:l,onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:m})=>{const[y,b]=W.useState(null);return W.useEffect(()=>{let C=!1;if(!n)return console.error("streamlayer sdk key should be provided"),b(I=>(I!==null&&typeof I.disableApp=="function"&&I.disableApp(),null)),()=>{C=!0};const _=nte(n,o,l,{version:"1.5.1",onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:m});if(r)for(const I of r)_.use(I);return _.ready().then(I=>{C||(b(I.sdk),typeof window<"u")}).catch(I=>console.log(I)),()=>{C=!0,_.close(function(I){if(I)throw I})}},[n,o]),y},rte=({event:n})=>{const r=Ny(),o=ste();return W.useEffect(()=>(r&&(n&&(r.createEventSession(n),o&&(o.current=n)),!n&&(o!=null&&o.current)&&(r.createEventSession(""),o.current="")),()=>{r&&r.disableApp()}),[n,o,r]),null};var HE=(n=>(n[n.UNSET=0]="UNSET",n[n.CONNECTED=1]="CONNECTED",n[n.READY=2]="READY",n))(HE||{});const F6=W.createContext({status:0,sdk:null}),ote=({sdkKey:n,plugins:r,children:o,event:l,production:c=!0,autoEnable:p=!0,onDeepLinkHandled:m,videoPlayerController:y,onContentActivate:b})=>{const C=ate({sdkKey:n,plugins:r,production:c,autoEnable:p,onDeepLinkHandled:m,videoPlayerController:y,onContentActivate:b}),_=W.useRef(""),I=W.useMemo(()=>C?{sdk:C,status:2,eventRef:_}:{status:1,sdk:null,eventRef:_},[C]);return W.useEffect(()=>()=>{m&&(C==null||C.removeDeepLinkHandler(m)),y&&(C==null||C.removeVideoPlayerController(y))},[C]),W.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!n,onDeepLinkHandled:!!m,videoPlayerController:!!y})},[n,m,y]),w.jsxs(F6.Provider,{value:I,children:[l!==void 0&&w.jsx(rte,{event:l}),o]})},Ny=()=>{const{sdk:n}=W.useContext(F6);return n},ste=()=>{const{event:n}=W.useContext(F6);return n},ite=({sdkKey:n,plugins:r,children:o,onDeepLinkHandled:l,videoPlayerController:c,production:p=!0})=>w.jsx(ote,{sdkKey:n,plugins:r,production:p,autoEnable:!1,onDeepLinkHandled:l,videoPlayerController:c,children:o}),lte=({children:n,overlays:r})=>{const{sdk:o,status:l}=W.useContext(F6);return l===HE.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),n({})):o?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(OC,{style:{height:"100%"},children:w.jsx(qG,{sdk:o,overlays:r,children:n})})}):n({})};class ute extends W.Component{constructor(r){super(r),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,o){console.error(r,o.componentStack)}render(){return this.state.hasError?this.props.children({}):w.jsx(lte,{...this.props})}}const cte=({token:n,schema:r})=>{const o=Ny();return W.useEffect(()=>{n&&r&&o&&o.authorizationBypass(r,n)},[n,r,o]),null},dte=()=>{const n=Ny();return n?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(OC,{children:w.jsx(nq,{sdk:n})})}):null};exports.C=wC;exports.C$1=ew;exports.C$2=C6;exports.M=ly;exports.MastersStreamLayerProvider=ite;exports.MastersStreamLayerSDKReact=ute;exports.O=ty;exports.S=IC;exports.StreamLayerLogin=cte;exports.StreamLayerSDKPoints=dte;exports.T=iy;exports.a=j9;exports.b=SC;exports.k=NC;exports.l=XS;exports.m=a2;exports.m$1=tw;exports.n=m2;exports.p=rq;exports.p$1=JS;exports.styled_default=P;exports.useStore=Ut;exports.z=H$;
|
|
212
|
+
`).slice(0,2).map(o=>o.trim()).join(" -- ")}function Fee(){const n={};return n.promise=new Promise((r,o)=>{n.resolve=r,n.reject=o}),n}function _0(n,r,o,l,c){this.started=!1,this.func=r,this.opts=o,this.onFinish=null,this.parent=n,this.timeout=c===void 0?n._timeout:c,this.name=Uee(r,o),this.isAfter=l,this.q=Aee(n,Vee,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Mee(_0,Pee);_0.prototype.exec=function(n,r){const o=this.func;let l=!1;const c=this.name;if(this.parent._error&&!this.isAfter){Ma("skipping loading of plugin as parent errored and it is not an after",c),St.nextTick(r);return}if(this.isAfter)this.server=n;else try{this.server=this.parent.override(n,o,this.opts)}catch(b){return Ma("override errored",c),r(b)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ma("exec",c);let p;const m=b=>{if(l){Ma("loading complete",c);return}this._error=b,Ma(b?"exec errored":"exec completed",c),l=!0,p&&clearTimeout(p),r(b)};this.timeout>0&&(Ma("setting up timeout",c,this.timeout),p=setTimeout(function(){Ma("timed out",c),p=null;const b=new Dee(c);b.fn=o,m(b)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const y=o(this.server,this.opts,m);y&&typeof y.then=="function"&&(Ma("exec: resolving promise",c),y.then(()=>St.nextTick(m),b=>St.nextTick(m,b)))};_0.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const n=()=>{this.server.after((o,l)=>{this._error=o,this.q.pause(),o?(Ma("rejecting promise",this.name,o),this._promise.reject(o)):(Ma("resolving promise",this.name),this._promise.resolve()),this._promise=null,St.nextTick(l,o)}),this.q.resume()};let r;return this._promise?r=Promise.resolve():(this._promise=Fee(),r=this._promise.promise,this.server?n():this.on("start",n)),r};_0.prototype.enqueue=function(n,r){Ma("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,r)};_0.prototype.finish=function(n,r){Ma("finish",this.name,n);const o=()=>{this.loaded||(Ma("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,r(n))};if(n){this._promise&&(this._promise.reject(n),this._promise=null),o();return}const l=()=>{if(Ma("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const c=()=>{Ma("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(c,c),this._promise=null}else o();else Ma("delayed",this.name),this.q.drain=()=>{Ma("drain",this.name),this.q.drain=jee,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function Vee(n,r){const o=this;St.nextTick(Iy.bind(o),n,r)}function Iy(n,r){if(typeof n.func.then=="function"){n.func.then(l=>{typeof l.default=="function"&&(l=l.default),n.func=l,Iy.call(this,n,r)},r);return}const o=this._current[0];this._current.unshift(n),n.exec(o&&o.server||this._server,l=>{n.finish(l,c=>{this._current.shift(),r(c)})})}function jee(){}_y.exports=_0;_y.exports.loadPlugin=Iy;var Bee=_y.exports;const WS=pE,$ee=wE.EventEmitter,zee=A6.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:e9,AVV_ERR_CALLBACK_NOT_FN:s2,AVV_ERR_PLUGIN_NOT_VALID:Hee,AVV_ERR_ROOT_PLG_BOOTED:Gee,AVV_ERR_READY_TIMEOUT:qee}=jE,Wee=Ree,F9=Bee,b0=BE("avvio"),b6=Symbol("kAvvio"),t9=Symbol("kThenifyDoNotWrap");function Qee(n,r,o){const l=r.expose||{},c=l.use||"use",p=l.after||"after",m=l.ready||"ready",y=l.onClose||"onClose",b=l.close||"close";if(n[c])throw new e9(c);if(n[p])throw new e9(p);if(n[m])throw new e9(m);n[c]=function(C,_){return o.use(C,_),this},Object.defineProperty(n,"then",{get:$E.bind(o)}),n[b6]=!0,n[p]=function(C){return typeof C!="function"?o._loadRegistered():(o.after(n9(C,this)),this)},n[m]=function(C){if(C&&typeof C!="function")throw new s2(m,typeof C);return o.ready(C?n9(C,this):void 0)},n[y]=function(C){if(typeof C!="function")throw new s2(y,typeof C);return o.onClose(Jee(C,this)),this},n[b]=function(C){if(C&&typeof C!="function")throw new s2(b,typeof C);return C?(o.close(n9(C,this)),this):o.close()}}function ba(n,r,o){if(typeof n=="function"&&arguments.length===1&&(o=n,r={},n=null),typeof r=="function"&&(o=r,r={}),r=r||{},!(this instanceof ba)){const l=new ba(n,r,o);return n&&Qee(n,r,l),l}r.autostart!==!1&&(r.autostart=!0),n=n||this,this._timeout=Number(r.timeout)||0,this._server=n,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),o&&this.once("start",o),this.started=!1,this.booted=!1,this.pluginTree=new Wee,this._readyQ=WS(this,zE,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=QS},this._closeQ=WS(this,Xee,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=QS},this._doStart=null,this._root=new F9(this,Yee.bind(this),r,!1,0),this._root.once("start",(l,c,p)=>{const m=this.pluginTree.start(null,c,p);this._root.once("loaded",(y,b,C)=>{this.pluginTree.stop(m,C)})}),F9.loadPlugin.call(this,this._root,l=>{b0("root plugin ready");try{this.emit("preReady"),this._root=null}catch(c){l=l||this._error||c}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function Yee(n,r,o){this._doStart=o,r.autostart&&this.start()}zee(ba,$ee);ba.prototype.start=function(){return this.started=!0,St.nextTick(this._doStart),this};ba.prototype.override=function(n,r,o){return n};function Kee(n){if(n&&typeof n=="object"&&typeof n.default=="function"&&(n=n.default),!(n&&(typeof n=="function"||typeof n.then=="function")))throw new Hee(typeof n);return n}ba.prototype[b6]=!0;ba.prototype.use=function(n,r){return this._lastUsed=this._addPlugin(n,r,!1),this};ba.prototype._loadRegistered=function(){const n=this._current[0];return!this.started&&!this.booted&&St.nextTick(()=>this._root.q.resume()),n?n.loadedSoFar():Promise.resolve()};Object.defineProperty(ba.prototype,"then",{get:$E});ba.prototype._addPlugin=function(n,r,o){if(n=Kee(n),r=r||{},this.booted)throw new Gee;const l=this._current[0],c=new F9(this,n,r,o);if(c.once("start",(p,m,y)=>{const b=this.pluginTree.start(l.name,m,y);c.once("loaded",(C,_,I)=>{this.pluginTree.stop(b,I)})}),l.loaded)throw new Error(c.name,l.name);return l.enqueue(c,p=>{p&&(this._error=p)}),c};ba.prototype.after=function(n){if(!n)return this._loadRegistered();this._addPlugin(r.bind(this),{},!0);function r(o,l,c){zE.call(this,n,c)}return this};ba.prototype.onClose=function(n){if(typeof n!="function")throw new Error("not a function");n[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(n,r.bind(this));function r(o){o&&(this._error=o)}return this};ba.prototype.close=function(n){let r;if(n){if(typeof n!="function")throw new s2("close",typeof n)}else r=new Promise(function(o,l){n=function(c){if(c)return l(c);o()}});return this.ready(()=>{this._error=null,this._closeQ.push(n),St.nextTick(this._closeQ.resume.bind(this._closeQ))}),r};ba.prototype.ready=function(n){if(n){if(typeof n!="function")throw new s2("ready",typeof n);this._readyQ.push(n),queueMicrotask(this.start.bind(this));return}return new Promise((r,o)=>{this._readyQ.push(c),this.start();const l=this._current[0].server;function c(p,m,y){p?o(p):r(l),St.nextTick(y)}})};ba.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ba.prototype.toJSON=function(){return this.pluginTree.toJSON()};function QS(){}function $E(){if(this.booted){b0("thenify returning null because we are already booted");return}if(this[t9]){this[t9]=!1;return}return b0("thenify"),(n,r)=>this._loadRegistered().then(()=>(this[t9]=!0,n(this._server)),r)}function zE(n,r){const o=this._server,l=this._error;let c;if(this._error=null,n.length===0)this._error=l,c=n(),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(r),p=>St.nextTick(r,p)):St.nextTick(r);else if(n.length===1)c=n(l),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(r),p=>St.nextTick(r,p)):St.nextTick(r);else if(this._timeout===0){const p=m=>{this._error=m,r(this._error)};n.length===2?n(l,p):n(l,o,p)}else Zee.call(this,n,l,o,r)}function Zee(n,r,o,l){const c=n.name;b0("setting up ready timeout",c,this._timeout);let p=setTimeout(()=>{b0("timed out",c),p=null;const y=new qee(c);y.fn=n,this._error=y,l(y)},this._timeout);n.length===2?n(r,m.bind(this)):n(r,o,m.bind(this));function m(y){p&&(clearTimeout(p),this._error=y,l(this._error))}}function Xee(n,r){const o=this._server,l=n[this._isOnCloseHandlerKey];if(n.length===0||n.length===1){let c;l?c=n(o):c=n(this._error),c&&typeof c.then=="function"?(b0("resolving close/onClose promise"),c.then(()=>St.nextTick(r),p=>St.nextTick(r,p))):St.nextTick(r)}else n.length===2?n(l?o:this._error,r):l?n(o,r):n(this._error,o,r)}function Jee(n,r){return o.bind(r);function o(l,c){let p;n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===1?(p=n(this),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n(this,c)}}function n9(n,r){return o.bind(r);function o(l,c){let p;n?n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c,l)},c):St.nextTick(c,l)):n.length===1?(p=n(l),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===2?n(l,c):n(l,this,c):St.nextTick(c)}}hy.exports=ba;hy.exports.express=function(n){return ba(n,{expose:{use:"load"}})};var ete=hy.exports;const tte=RX(ete);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const n=["webkit","moz","ms","o"];for(const r of n)window.requestAnimationFrame=window.requestAnimationFrame||window[`${r}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${r}CancelAnimationFrame`]||window[`${r}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let r=0;const o=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const c=o?window.performance.now():new Date().getTime(),p=Math.max(0,16-(c-r)),m=window.setTimeout(function(){l(c+p)},p);return r=c+p,m},window.cancelAnimationFrame=clearTimeout}})();function nte(n,r=!0,o=!0,l){const c=r?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",p=r?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",m=tte(Object.create({}),{autostart:!1});return m.use(oX),m.use(XZ,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),m.use(nX,{videoPlayerController:l==null?void 0:l.videoPlayerController}),m.use(rX,{onContentActivate:l==null?void 0:l.onContentActivate}),m.use(TZ,{sdkKey:n,host:c,analyticsHost:p,version:l==null?void 0:l.version}),m.use(CZ),m.use(tX),m.use(vX),m.use($Z),m.use(NX),m.after((y,b,C)=>{if(y)throw y;b.ready(),C()}),o&&m.after(async(y,b,C)=>{if(y)throw y;await b.sdk.initializeApp(),C()}),m.onClose(()=>{console.log("close")}),m}const ate=({sdkKey:n,plugins:r,production:o,autoEnable:l,onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:m})=>{const[y,b]=W.useState(null);return W.useEffect(()=>{let C=!1;if(!n)return console.error("streamlayer sdk key should be provided"),b(I=>(I!==null&&typeof I.disableApp=="function"&&I.disableApp(),null)),()=>{C=!0};const _=nte(n,o,l,{version:"1.5.2",onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:m});if(r)for(const I of r)_.use(I);return _.ready().then(I=>{C||(b(I.sdk),typeof window<"u")}).catch(I=>console.log(I)),()=>{C=!0,_.close(function(I){if(I)throw I})}},[n,o]),y},rte=({event:n})=>{const r=Ny(),o=ste();return W.useEffect(()=>(r&&(n&&(r.createEventSession(n),o&&(o.current=n)),!n&&(o!=null&&o.current)&&(r.createEventSession(""),o.current="")),()=>{r&&r.disableApp()}),[n,o,r]),null};var HE=(n=>(n[n.UNSET=0]="UNSET",n[n.CONNECTED=1]="CONNECTED",n[n.READY=2]="READY",n))(HE||{});const F6=W.createContext({status:0,sdk:null}),ote=({sdkKey:n,plugins:r,children:o,event:l,production:c=!0,autoEnable:p=!0,onDeepLinkHandled:m,videoPlayerController:y,onContentActivate:b})=>{const C=ate({sdkKey:n,plugins:r,production:c,autoEnable:p,onDeepLinkHandled:m,videoPlayerController:y,onContentActivate:b}),_=W.useRef(""),I=W.useMemo(()=>C?{sdk:C,status:2,eventRef:_}:{status:1,sdk:null,eventRef:_},[C]);return W.useEffect(()=>()=>{m&&(C==null||C.removeDeepLinkHandler(m)),y&&(C==null||C.removeVideoPlayerController(y))},[C]),W.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!n,onDeepLinkHandled:!!m,videoPlayerController:!!y})},[n,m,y]),w.jsxs(F6.Provider,{value:I,children:[l!==void 0&&w.jsx(rte,{event:l}),o]})},Ny=()=>{const{sdk:n}=W.useContext(F6);return n},ste=()=>{const{event:n}=W.useContext(F6);return n},ite=({sdkKey:n,plugins:r,children:o,onDeepLinkHandled:l,videoPlayerController:c,production:p=!0})=>w.jsx(ote,{sdkKey:n,plugins:r,production:p,autoEnable:!1,onDeepLinkHandled:l,videoPlayerController:c,children:o}),lte=({children:n,overlays:r})=>{const{sdk:o,status:l}=W.useContext(F6);return l===HE.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),n({})):o?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(OC,{style:{height:"100%"},children:w.jsx(qG,{sdk:o,overlays:r,children:n})})}):n({})};class ute extends W.Component{constructor(r){super(r),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,o){console.error(r,o.componentStack)}render(){return this.state.hasError?this.props.children({}):w.jsx(lte,{...this.props})}}const cte=({token:n,schema:r})=>{const o=Ny();return W.useEffect(()=>{n&&r&&o&&o.authorizationBypass(r,n)},[n,r,o]),null},dte=()=>{const n=Ny();return n?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(OC,{children:w.jsx(nq,{sdk:n})})}):null};exports.C=wC;exports.C$1=ew;exports.C$2=C6;exports.M=ly;exports.MastersStreamLayerProvider=ite;exports.MastersStreamLayerSDKReact=ute;exports.O=ty;exports.S=IC;exports.StreamLayerLogin=cte;exports.StreamLayerSDKPoints=dte;exports.T=iy;exports.a=j9;exports.b=SC;exports.k=NC;exports.l=XS;exports.m=a2;exports.m$1=tw;exports.n=m2;exports.p=rq;exports.p$1=JS;exports.styled_default=P;exports.useStore=Ut;exports.z=H$;
|
package/lib/dist/es/masters.js
CHANGED
|
@@ -41914,7 +41914,7 @@ const vte = ({
|
|
|
41914
41914
|
w = !0;
|
|
41915
41915
|
};
|
|
41916
41916
|
const E = yte(n, o, l, {
|
|
41917
|
-
version: "1.5.
|
|
41917
|
+
version: "1.5.2",
|
|
41918
41918
|
onDeepLinkHandled: c,
|
|
41919
41919
|
videoPlayerController: p,
|
|
41920
41920
|
onContentActivate: f
|