@streamlayer/react 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/advertisement.d.ts +2 -0
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/auth.js +1 -1
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +1 -188
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +188 -0
- package/lib/cjs/useStreamLayerApp2.js +1 -1
- package/lib/dist/cjs/masters.js +1 -1
- package/lib/dist/es/masters.js +1 -1
- package/lib/es/advertisement.js +142 -137
- package/lib/es/auth.js +1 -1
- package/lib/es/gamification-feature.js +1 -1
- package/lib/es/index.js +8 -5
- package/lib/es/index2.js +902 -23171
- package/lib/es/masters.js +1 -1
- package/lib/es/masters2.js +1 -1
- package/lib/es/points.js +2 -2
- package/lib/es/provider.js +23227 -0
- package/lib/es/useStreamLayerApp2.js +4 -4
- package/lib/index.d.ts +1 -0
- package/package.json +19 -19
- package/lib/cjs/app.js +0 -1
- package/lib/es/app.js +0 -958
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
`),c=`
|
|
15
15
|
`+n+(r.length?s("│"):" ")+" ";return n+o.join(c)+`
|
|
16
16
|
`+r.map(function(l,m){var u=m===r.length-1,p=l.nodes&&l.nodes.length,y=n+(u?" ":s("│"))+" ";return n+s(u?"└":"├")+s("─")+s(p?"┬":"─")+" "+e(l,y,a).slice(n.length+2)}).join("")};const p_=d_,ko=Symbol("avvio.TimeTree.untrackNode"),Ia=Symbol("avvio.TimeTree.trackNode"),ho=Symbol("avvio.TimeTree.getParent"),So=Symbol("avvio.TimeTree.getNode"),_o=Symbol("avvio.TimeTree.addNode");let T_=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])}[ko](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)}[ho](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[So](e){return this.tableId.get(e)}[_o](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[ho](e),s=`${t}-${Math.random()}`,r={id:s,parent:e,start:n,label:t,nodes:[]};return a.nodes.push(r),this[Ia](r),s}start(e,t,n=Date.now()){return this[_o](e,t,n)}stop(e,t=Date.now()){const n=this[So](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[ko](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 p_(t)}};var y_=T_,Ds={exports:{}},ns={exports:{}},Na,Eo;function g_(){if(Eo)return Na;Eo=1;var e=1e3,t=e*60,n=t*60,a=n*24,s=a*7,r=a*365.25;Na=function(u,p){p=p||{};var y=typeof u;if(y==="string"&&u.length>0)return o(u);if(y==="number"&&isFinite(u))return p.long?l(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var p=/^(-?(?:\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(p){var y=parseFloat(p[1]),T=(p[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return y*r;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 p=Math.abs(u);return p>=a?Math.round(u/a)+"d":p>=n?Math.round(u/n)+"h":p>=t?Math.round(u/t)+"m":p>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var p=Math.abs(u);return p>=a?m(u,p,a,"day"):p>=n?m(u,p,n,"hour"):p>=t?m(u,p,t,"minute"):p>=e?m(u,p,e,"second"):u+" ms"}function m(u,p,y,T){var f=p>=y*1.5;return Math.round(u/y)+" "+T+(f?"s":"")}return Na}function f_(e){n.debug=n,n.default=n,n.coerce=l,n.disable=r,n.enable=s,n.enabled=o,n.humanize=g_(),n.destroy=m,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let p=0;for(let y=0;y<u.length;y++)p=(p<<5)-p+u.charCodeAt(y),p|=0;return n.colors[Math.abs(p)%n.colors.length]}n.selectColor=t;function n(u){let p,y=null,T,f;function _(...I){if(!_.enabled)return;const b=_,E=Number(new Date),w=E-(p||E);b.diff=w,b.prev=p,b.curr=E,p=E,I[0]=n.coerce(I[0]),typeof I[0]!="string"&&I.unshift("%O");let O=0;I[0]=I[0].replace(/%([a-zA-Z%])/g,(A,L)=>{if(A==="%%")return"%";O++;const N=n.formatters[L];if(typeof N=="function"){const C=I[O];A=N.call(b,C),I.splice(O,1),O--}return A}),n.formatArgs.call(b,I),(b.log||n.log).apply(b,I)}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:I=>{y=I}}),typeof n.init=="function"&&n.init(_),_}function a(u,p){const y=n(this.namespace+(typeof p>"u"?":":p)+u);return y.log=this.log,y}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let p;const y=(typeof u=="string"?u:"").split(/[\s,]+/),T=y.length;for(p=0;p<T;p++)y[p]&&(u=y[p].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function r(){const u=[...n.names.map(c),...n.skips.map(c).map(p=>"-"+p)].join(",");return n.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let p,y;for(p=0,y=n.skips.length;p<y;p++)if(n.skips[p].test(u))return!1;for(p=0,y=n.names.length;p<y;p++)if(n.names[p].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 k_=f_;(function(e,t){t.formatArgs=a,t.save=s,t.load=r,t.useColors=n,t.storage=o(),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,p=0;l[0].replace(/%[a-zA-Z%]/g,y=>{y!=="%%"&&(u++,y==="%c"&&(p=u))}),l.splice(p,0,m)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function r(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof P<"u"&&"env"in P&&(l=P.env.DEBUG),l}function o(){try{return localStorage}catch{}}e.exports=k_(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 bc=ns.exports;const h_=zi,S_=rc.EventEmitter,__=zn.inherits,me=bc("avvio"),{AVV_ERR_READY_TIMEOUT:E_}=Ec,va=Symbol.for("plugin-meta");function b_(e,t){return e[va]&&e[va].name?e[va].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 I_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function xt(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=b_(t,n),this.isAfter=a,this.q=h_(e,N_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}__(xt,S_);xt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){me("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 me("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,me("exec",s);let r;const o=l=>{if(a){me("loading complete",s);return}this._error=l,me(l?"exec errored":"exec completed",s),a=!0,r&&clearTimeout(r),t(l)};this.timeout>0&&(me("setting up timeout",s,this.timeout),r=setTimeout(function(){me("timed out",s),r=null;const l=new E_(s);l.fn=n,o(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,o);c&&typeof c.then=="function"&&(me("exec: resolving promise",s),c.then(()=>P.nextTick(o),l=>P.nextTick(o,l)))};xt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(me("rejecting promise",this.name,n),this._promise.reject(n)):(me("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=I_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};xt.prototype.enqueue=function(e,t){me("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};xt.prototype.finish=function(e,t){me("finish",this.name,e);const n=()=>{this.loaded||(me("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(me("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{me("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else me("delayed",this.name),this.q.drain=()=>{me("drain",this.name),this.q.drain=v_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function N_(e,t){const n=this;P.nextTick(Us.bind(n),e,t)}function Us(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Us.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 v_(){}Ds.exports=xt;Ds.exports.loadPlugin=Us;var O_=Ds.exports;const bo=zi,A_=rc.EventEmitter,w_=zn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Oa,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:R_,AVV_ERR_ROOT_PLG_BOOTED:L_,AVV_ERR_READY_TIMEOUT:M_}=Ec,P_=y_,as=O_,Ft=bc("avvio"),Vn=Symbol("kAvvio"),Aa=Symbol("kThenifyDoNotWrap");function C_(e,t,n){const a=t.expose||{},s=a.use||"use",r=a.after||"after",o=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new Oa(s);if(e[r])throw new Oa(r);if(e[o])throw new Oa(o);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:Ic.bind(n)}),e[Vn]=!0,e[r]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(wa(m,this)),this)},e[o]=function(m){if(m&&typeof m!="function")throw new zt(o,typeof m);return n.ready(m?wa(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(B_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(wa(m,this)),this):n.close()}}function ie(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 ie)){const a=new ie(e,t,n);return e&&C_(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 P_,this._readyQ=bo(this,Nc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Io},this._closeQ=bo(this,G_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Io},this._doStart=null,this._root=new as(this,D_.bind(this),t,!1,0),this._root.once("start",(a,s,r)=>{const o=this.pluginTree.start(null,s,r);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(o,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 D_(e,t,n){this._doStart=n,t.autostart&&this.start()}w_(ie,A_);ie.prototype.start=function(){return this.started=!0,P.nextTick(this._doStart),this};ie.prototype.override=function(e,t,n){return e};function U_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new R_(typeof e);return e}ie.prototype[Vn]=!0;ie.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};ie.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(ie.prototype,"then",{get:Ic});ie.prototype._addPlugin=function(e,t,n){if(e=U_(e),t=t||{},this.booted)throw new L_;const a=this._current[0],s=new as(this,e,t,n);if(s.once("start",(r,o,c)=>{const l=this.pluginTree.start(a.name,o,c);s.once("loaded",(m,u,p)=>{this.pluginTree.stop(l,p)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,r=>{r&&(this._error=r)}),s};ie.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Nc.call(this,e,s)}return this};ie.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};ie.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),P.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};ie.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(r,o,c){r?n(r):t(a),P.nextTick(c)}})};ie.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ie.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Io(){}function Ic(){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 Nc(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),r=>P.nextTick(t,r)):P.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Vn]&&typeof s.then=="function"?s.then(()=>P.nextTick(t),r=>P.nextTick(t,r)):P.nextTick(t);else if(this._timeout===0){const r=o=>{this._error=o,t(this._error)};e.length===2?e(a,r):e(a,n,r)}else F_.call(this,e,a,n,t)}function F_(e,t,n,a){const s=e.name;Ft("setting up ready timeout",s,this._timeout);let r=setTimeout(()=>{Ft("timed out",s),r=null;const c=new M_(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,o.bind(this)):e(t,n,o.bind(this));function o(c){r&&(clearTimeout(r),this._error=c,a(this._error))}}function G_(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),r=>P.nextTick(t,r))):P.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function B_(e,t){return n.bind(t);function n(a,s){let r;e.length===0?(r=e(),r&&r.then?r.then(function(){P.nextTick(s)},s):P.nextTick(s)):e.length===1?(r=e(this),r&&r.then?r.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 r;e?e.length===0?(r=e(),r&&r.then?r.then(function(){P.nextTick(s,a)},s):P.nextTick(s,a)):e.length===1?(r=e(a),r&&r.then?r.then(function(){P.nextTick(s)},s):P.nextTick(s)):e.length===2?e(a,s):e(a,this,s):P.nextTick(s)}}Is.exports=ie;Is.exports.express=function(e){return ie(e,{expose:{use:"load"}})};var V_=Is.exports;const x_=yh(V_);(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(),r=Math.max(0,16-(s-t)),o=window.setTimeout(function(){a(s+r)},r);return t=s+r,o},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",r=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",o=x_(Object.create({}),{autostart:!1});return o.use(Yk),o.use(Bk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),o.use(Hk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),o.use(Qk,{onContentActivate:a==null?void 0:a.onContentActivate}),o.use(rk,{sdkKey:e,host:s,analyticsHost:r,version:a==null?void 0:a.version}),o.use(mk),o.use(qk),o.use(sh),o.use(wk),o.use(Th),o.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&o.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),o.onClose(()=>{console.log("close")}),o}const H_=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:r,onContentActivate:o})=>{const[c,l]=Gs.useState(null);return Gs.useEffect(()=>{let m=!1;if(!e)return console.error("streamlayer sdk key should be provided"),l(p=>(p!==null&&typeof p.disableApp=="function"&&p.disableApp(),null)),()=>{m=!0};const u=q_(e,n,a,{version:"1.2.0",onDeepLinkHandled:s,videoPlayerController:r,onContentActivate:o});if(t)for(const p of t)u.use(p);return u.ready().then(p=>{m||(l(p.sdk),typeof window<"u")}).catch(p=>console.log(p)),()=>{m=!0,u.close(function(p){if(p)throw p})}},[e,n]),c};exports.InvitationFrom=Ln;exports.PickHistoryStatus=It;exports.PromotionLogoMode=Jo;exports.PromotionType=Ge;exports.QuestionImages=rt;exports.QuestionStatus=te;exports.QuestionType=F;exports.SdkOverlayType=H;exports.createContextKey=Va;exports.global=xa;exports.pino_1=Lo;exports.useStreamLayerApp=H_;
|
|
17
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function I_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function xt(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=b_(t,n),this.isAfter=a,this.q=h_(e,N_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}__(xt,S_);xt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){me("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 me("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,me("exec",s);let r;const o=l=>{if(a){me("loading complete",s);return}this._error=l,me(l?"exec errored":"exec completed",s),a=!0,r&&clearTimeout(r),t(l)};this.timeout>0&&(me("setting up timeout",s,this.timeout),r=setTimeout(function(){me("timed out",s),r=null;const l=new E_(s);l.fn=n,o(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,o);c&&typeof c.then=="function"&&(me("exec: resolving promise",s),c.then(()=>P.nextTick(o),l=>P.nextTick(o,l)))};xt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(me("rejecting promise",this.name,n),this._promise.reject(n)):(me("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=I_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};xt.prototype.enqueue=function(e,t){me("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};xt.prototype.finish=function(e,t){me("finish",this.name,e);const n=()=>{this.loaded||(me("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(me("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{me("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else me("delayed",this.name),this.q.drain=()=>{me("drain",this.name),this.q.drain=v_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function N_(e,t){const n=this;P.nextTick(Us.bind(n),e,t)}function Us(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Us.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 v_(){}Ds.exports=xt;Ds.exports.loadPlugin=Us;var O_=Ds.exports;const bo=zi,A_=rc.EventEmitter,w_=zn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Oa,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:R_,AVV_ERR_ROOT_PLG_BOOTED:L_,AVV_ERR_READY_TIMEOUT:M_}=Ec,P_=y_,as=O_,Ft=bc("avvio"),Vn=Symbol("kAvvio"),Aa=Symbol("kThenifyDoNotWrap");function C_(e,t,n){const a=t.expose||{},s=a.use||"use",r=a.after||"after",o=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new Oa(s);if(e[r])throw new Oa(r);if(e[o])throw new Oa(o);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:Ic.bind(n)}),e[Vn]=!0,e[r]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(wa(m,this)),this)},e[o]=function(m){if(m&&typeof m!="function")throw new zt(o,typeof m);return n.ready(m?wa(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(B_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(wa(m,this)),this):n.close()}}function ie(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 ie)){const a=new ie(e,t,n);return e&&C_(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 P_,this._readyQ=bo(this,Nc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Io},this._closeQ=bo(this,G_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Io},this._doStart=null,this._root=new as(this,D_.bind(this),t,!1,0),this._root.once("start",(a,s,r)=>{const o=this.pluginTree.start(null,s,r);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(o,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 D_(e,t,n){this._doStart=n,t.autostart&&this.start()}w_(ie,A_);ie.prototype.start=function(){return this.started=!0,P.nextTick(this._doStart),this};ie.prototype.override=function(e,t,n){return e};function U_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new R_(typeof e);return e}ie.prototype[Vn]=!0;ie.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};ie.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(ie.prototype,"then",{get:Ic});ie.prototype._addPlugin=function(e,t,n){if(e=U_(e),t=t||{},this.booted)throw new L_;const a=this._current[0],s=new as(this,e,t,n);if(s.once("start",(r,o,c)=>{const l=this.pluginTree.start(a.name,o,c);s.once("loaded",(m,u,p)=>{this.pluginTree.stop(l,p)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,r=>{r&&(this._error=r)}),s};ie.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Nc.call(this,e,s)}return this};ie.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};ie.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),P.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};ie.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(r,o,c){r?n(r):t(a),P.nextTick(c)}})};ie.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ie.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Io(){}function Ic(){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 Nc(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),r=>P.nextTick(t,r)):P.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Vn]&&typeof s.then=="function"?s.then(()=>P.nextTick(t),r=>P.nextTick(t,r)):P.nextTick(t);else if(this._timeout===0){const r=o=>{this._error=o,t(this._error)};e.length===2?e(a,r):e(a,n,r)}else F_.call(this,e,a,n,t)}function F_(e,t,n,a){const s=e.name;Ft("setting up ready timeout",s,this._timeout);let r=setTimeout(()=>{Ft("timed out",s),r=null;const c=new M_(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,o.bind(this)):e(t,n,o.bind(this));function o(c){r&&(clearTimeout(r),this._error=c,a(this._error))}}function G_(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),r=>P.nextTick(t,r))):P.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function B_(e,t){return n.bind(t);function n(a,s){let r;e.length===0?(r=e(),r&&r.then?r.then(function(){P.nextTick(s)},s):P.nextTick(s)):e.length===1?(r=e(this),r&&r.then?r.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 r;e?e.length===0?(r=e(),r&&r.then?r.then(function(){P.nextTick(s,a)},s):P.nextTick(s,a)):e.length===1?(r=e(a),r&&r.then?r.then(function(){P.nextTick(s)},s):P.nextTick(s)):e.length===2?e(a,s):e(a,this,s):P.nextTick(s)}}Is.exports=ie;Is.exports.express=function(e){return ie(e,{expose:{use:"load"}})};var V_=Is.exports;const x_=yh(V_);(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(),r=Math.max(0,16-(s-t)),o=window.setTimeout(function(){a(s+r)},r);return t=s+r,o},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",r=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",o=x_(Object.create({}),{autostart:!1});return o.use(Yk),o.use(Bk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),o.use(Hk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),o.use(Qk,{onContentActivate:a==null?void 0:a.onContentActivate}),o.use(rk,{sdkKey:e,host:s,analyticsHost:r,version:a==null?void 0:a.version}),o.use(mk),o.use(qk),o.use(sh),o.use(wk),o.use(Th),o.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&o.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),o.onClose(()=>{console.log("close")}),o}const H_=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:r,onContentActivate:o})=>{const[c,l]=Gs.useState(null);return Gs.useEffect(()=>{let m=!1;if(!e)return console.error("streamlayer sdk key should be provided"),l(p=>(p!==null&&typeof p.disableApp=="function"&&p.disableApp(),null)),()=>{m=!0};const u=q_(e,n,a,{version:"1.3.0",onDeepLinkHandled:s,videoPlayerController:r,onContentActivate:o});if(t)for(const p of t)u.use(p);return u.ready().then(p=>{m||(l(p.sdk),typeof window<"u")}).catch(p=>console.log(p)),()=>{m=!0,u.close(function(p){if(p)throw p})}},[e,n]),c};exports.InvitationFrom=Ln;exports.PickHistoryStatus=It;exports.PromotionLogoMode=Jo;exports.PromotionType=Ge;exports.QuestionImages=rt;exports.QuestionStatus=te;exports.QuestionType=F;exports.SdkOverlayType=H;exports.createContextKey=Va;exports.global=xa;exports.pino_1=Lo;exports.useStreamLayerApp=H_;
|
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+f.join(y)+`
|
|
211
211
|
`+p.map(function(b,C){var _=C===p.length-1,N=b.nodes&&b.nodes.length,R=o+(_?" ":c("│"))+" ";return o+c(_?"└":"├")+c("─")+c(N?"┬":"─")+" "+n(b,R,l).slice(o.length+2)}).join("")};const wee=See,BS=Symbol("avvio.TimeTree.untrackNode"),K5=Symbol("avvio.TimeTree.trackNode"),$S=Symbol("avvio.TimeTree.getParent"),zS=Symbol("avvio.TimeTree.getNode"),HS=Symbol("avvio.TimeTree.addNode");let Cee=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[K5](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])}[BS](n){this.tableId.delete(n.id);const a=this.tableLabel.get(n.label);if(a.id){this.tableLabel.delete(n.label);return}a.pop(),a.length===0&&this.tableLabel.delete(n.label)}[$S](n){if(n===null)return this.root;const a=this.tableLabel.get(n);return a.id?a:a[a.length-1]}[zS](n){return this.tableId.get(n)}[HS](n,a,o){if(n===null)return this.root={id:"root",label:a,start:o,nodes:[]},this[K5](this.root),this.root.id;const l=this[$S](n),c=`${a}-${Math.random()}`,p={id:c,parent:n,start:o,label:a,nodes:[]};return l.nodes.push(p),this[K5](p),c}start(n,a,o=Date.now()){return this[HS](n,a,o)}stop(n,a=Date.now()){const o=this[zS](n);o&&(o.stop=a,o.diff=o.stop-o.start||0,this[BS](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),a=n(this.toJSON());return wee(a)}};var Eee=Cee,Ey={exports:{}},D9={exports:{}},Z5,GS;function _ee(){if(GS)return Z5;GS=1;var n=1e3,a=n*60,o=a*60,l=o*24,c=l*7,p=l*365.25;Z5=function(_,N){N=N||{};var R=typeof _;if(R==="string"&&_.length>0)return f(_);if(R==="number"&&isFinite(_))return N.long?b(_):y(_);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(_))};function f(_){if(_=String(_),!(_.length>100)){var N=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(_);if(N){var R=parseFloat(N[1]),O=(N[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*a;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 N=Math.abs(_);return N>=l?Math.round(_/l)+"d":N>=o?Math.round(_/o)+"h":N>=a?Math.round(_/a)+"m":N>=n?Math.round(_/n)+"s":_+"ms"}function b(_){var N=Math.abs(_);return N>=l?C(_,N,l,"day"):N>=o?C(_,N,o,"hour"):N>=a?C(_,N,a,"minute"):N>=n?C(_,N,n,"second"):_+" ms"}function C(_,N,R,O){var D=N>=R*1.5;return Math.round(_/R)+" "+O+(D?"s":"")}return Z5}function Iee(n){o.debug=o,o.default=o,o.coerce=b,o.disable=p,o.enable=c,o.enabled=f,o.humanize=_ee(),o.destroy=C,Object.keys(n).forEach(_=>{o[_]=n[_]}),o.names=[],o.skips=[],o.formatters={};function a(_){let N=0;for(let R=0;R<_.length;R++)N=(N<<5)-N+_.charCodeAt(R),N|=0;return o.colors[Math.abs(N)%o.colors.length]}o.selectColor=a;function o(_){let N,R=null,O,D;function F(...V){if(!F.enabled)return;const z=F,W=Number(new Date),K=W-(N||W);z.diff=K,z.prev=N,z.curr=W,N=W,V[0]=o.coerce(V[0]),typeof V[0]!="string"&&V.unshift("%O");let te=0;V[0]=V[0].replace(/%([a-zA-Z%])/g,(J,ue)=>{if(J==="%%")return"%";te++;const ae=o.formatters[ue];if(typeof ae=="function"){const Ne=V[te];J=ae.call(z,Ne),V.splice(te,1),te--}return J}),o.formatArgs.call(z,V),(z.log||o.log).apply(z,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(_,N){const R=o(this.namespace+(typeof N>"u"?":":N)+_);return R.log=this.log,R}function c(_){o.save(_),o.namespaces=_,o.names=[],o.skips=[];let N;const R=(typeof _=="string"?_:"").split(/[\s,]+/),O=R.length;for(N=0;N<O;N++)R[N]&&(_=R[N].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(N=>"-"+N)].join(",");return o.enable(""),_}function f(_){if(_[_.length-1]==="*")return!0;let N,R;for(N=0,R=o.skips.length;N<R;N++)if(o.skips[N].test(_))return!1;for(N=0,R=o.names.length;N<R;N++)if(o.names[N].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 Nee=Iee;(function(n,a){a.formatArgs=l,a.save=c,a.load=p,a.useColors=o,a.storage=f(),a.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`."))}})(),a.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,N=0;b[0].replace(/%[a-zA-Z%]/g,R=>{R!=="%%"&&(_++,R==="%c"&&(N=_))}),b.splice(N,0,C)}a.log=console.debug||console.log||(()=>{});function c(b){try{b?a.storage.setItem("debug",b):a.storage.removeItem("debug")}catch{}}function p(){let b;try{b=a.storage.getItem("debug")}catch{}return!b&&typeof St<"u"&&"env"in St&&(b=St.env.DEBUG),b}function f(){try{return localStorage}catch{}}n.exports=Nee(a);const{formatters:y}=n.exports;y.j=function(b){try{return JSON.stringify(b)}catch(C){return"[UnexpectedJSONParseError]: "+C.message}}})(D9,D9.exports);var UE=D9.exports;const Ree=cE,Lee=TE.EventEmitter,Oee=A6.inherits,Da=UE("avvio"),{AVV_ERR_READY_TIMEOUT:xee}=DE,X5=Symbol.for("plugin-meta");function Aee(n,a){return n[X5]&&n[X5].name?n[X5].name:typeof a<"u"&&typeof a!="function"&&a.name?a.name:n.name?n.name:n.toString().split(`
|
|
212
|
-
`).slice(0,2).map(o=>o.trim()).join(" -- ")}function Pee(){const n={};return n.promise=new Promise((a,o)=>{n.resolve=a,n.reject=o}),n}function _m(n,a,o,l,c){this.started=!1,this.func=a,this.opts=o,this.onFinish=null,this.parent=n,this.timeout=c===void 0?n._timeout:c,this.name=Aee(a,o),this.isAfter=l,this.q=Ree(n,Mee,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Oee(_m,Lee);_m.prototype.exec=function(n,a){const o=this.func;let l=!1;const c=this.name;if(this.parent._error&&!this.isAfter){Da("skipping loading of plugin as parent errored and it is not an after",c),St.nextTick(a);return}if(this.isAfter)this.server=n;else try{this.server=this.parent.override(n,o,this.opts)}catch(b){return Da("override errored",c),a(b)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Da("exec",c);let p;const f=b=>{if(l){Da("loading complete",c);return}this._error=b,Da(b?"exec errored":"exec completed",c),l=!0,p&&clearTimeout(p),a(b)};this.timeout>0&&(Da("setting up timeout",c,this.timeout),p=setTimeout(function(){Da("timed out",c),p=null;const b=new xee(c);b.fn=o,f(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,f);y&&typeof y.then=="function"&&(Da("exec: resolving promise",c),y.then(()=>St.nextTick(f),b=>St.nextTick(f,b)))};_m.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const n=()=>{this.server.after((o,l)=>{this._error=o,this.q.pause(),o?(Da("rejecting promise",this.name,o),this._promise.reject(o)):(Da("resolving promise",this.name),this._promise.resolve()),this._promise=null,St.nextTick(l,o)}),this.q.resume()};let a;return this._promise?a=Promise.resolve():(this._promise=Pee(),a=this._promise.promise,this.server?n():this.on("start",n)),a};_m.prototype.enqueue=function(n,a){Da("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,a)};_m.prototype.finish=function(n,a){Da("finish",this.name,n);const o=()=>{this.loaded||(Da("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,a(n))};if(n){this._promise&&(this._promise.reject(n),this._promise=null),o();return}const l=()=>{if(Da("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const c=()=>{Da("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(c,c),this._promise=null}else o();else Da("delayed",this.name),this.q.drain=()=>{Da("drain",this.name),this.q.drain=Dee,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function Mee(n,a){const o=this;St.nextTick(_y.bind(o),n,a)}function _y(n,a){if(typeof n.func.then=="function"){n.func.then(l=>{typeof l.default=="function"&&(l=l.default),n.func=l,_y.call(this,n,a)},a);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(),a(c)})})}function Dee(){}Ey.exports=_m;Ey.exports.loadPlugin=_y;var Uee=Ey.exports;const qS=cE,Fee=TE.EventEmitter,Vee=A6.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:J5,AVV_ERR_CALLBACK_NOT_FN:i2,AVV_ERR_PLUGIN_NOT_VALID:jee,AVV_ERR_ROOT_PLG_BOOTED:Bee,AVV_ERR_READY_TIMEOUT:$ee}=DE,zee=Eee,U9=Uee,Tm=UE("avvio"),b6=Symbol("kAvvio"),e9=Symbol("kThenifyDoNotWrap");function Hee(n,a,o){const l=a.expose||{},c=l.use||"use",p=l.after||"after",f=l.ready||"ready",y=l.onClose||"onClose",b=l.close||"close";if(n[c])throw new J5(c);if(n[p])throw new J5(p);if(n[f])throw new J5(f);n[c]=function(C,_){return o.use(C,_),this},Object.defineProperty(n,"then",{get:FE.bind(o)}),n[b6]=!0,n[p]=function(C){return typeof C!="function"?o._loadRegistered():(o.after(t9(C,this)),this)},n[f]=function(C){if(C&&typeof C!="function")throw new i2(f,typeof C);return o.ready(C?t9(C,this):void 0)},n[y]=function(C){if(typeof C!="function")throw new i2(y,typeof C);return o.onClose(Yee(C,this)),this},n[b]=function(C){if(C&&typeof C!="function")throw new i2(b,typeof C);return C?(o.close(t9(C,this)),this):o.close()}}function ka(n,a,o){if(typeof n=="function"&&arguments.length===1&&(o=n,a={},n=null),typeof a=="function"&&(o=a,a={}),a=a||{},!(this instanceof ka)){const l=new ka(n,a,o);return n&&Hee(n,a,l),l}a.autostart!==!1&&(a.autostart=!0),n=n||this,this._timeout=Number(a.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 zee,this._readyQ=qS(this,VE,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=WS},this._closeQ=qS(this,Qee,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=WS},this._doStart=null,this._root=new U9(this,Gee.bind(this),a,!1,0),this._root.once("start",(l,c,p)=>{const f=this.pluginTree.start(null,c,p);this._root.once("loaded",(y,b,C)=>{this.pluginTree.stop(f,C)})}),U9.loadPlugin.call(this,this._root,l=>{Tm("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 Gee(n,a,o){this._doStart=o,a.autostart&&this.start()}Vee(ka,Fee);ka.prototype.start=function(){return this.started=!0,St.nextTick(this._doStart),this};ka.prototype.override=function(n,a,o){return n};function qee(n){if(n&&typeof n=="object"&&typeof n.default=="function"&&(n=n.default),!(n&&(typeof n=="function"||typeof n.then=="function")))throw new jee(typeof n);return n}ka.prototype[b6]=!0;ka.prototype.use=function(n,a){return this._lastUsed=this._addPlugin(n,a,!1),this};ka.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(ka.prototype,"then",{get:FE});ka.prototype._addPlugin=function(n,a,o){if(n=qee(n),a=a||{},this.booted)throw new Bee;const l=this._current[0],c=new U9(this,n,a,o);if(c.once("start",(p,f,y)=>{const b=this.pluginTree.start(l.name,f,y);c.once("loaded",(C,_,N)=>{this.pluginTree.stop(b,N)})}),l.loaded)throw new Error(c.name,l.name);return l.enqueue(c,p=>{p&&(this._error=p)}),c};ka.prototype.after=function(n){if(!n)return this._loadRegistered();this._addPlugin(a.bind(this),{},!0);function a(o,l,c){VE.call(this,n,c)}return this};ka.prototype.onClose=function(n){if(typeof n!="function")throw new Error("not a function");n[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(n,a.bind(this));function a(o){o&&(this._error=o)}return this};ka.prototype.close=function(n){let a;if(n){if(typeof n!="function")throw new i2("close",typeof n)}else a=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))}),a};ka.prototype.ready=function(n){if(n){if(typeof n!="function")throw new i2("ready",typeof n);this._readyQ.push(n),queueMicrotask(this.start.bind(this));return}return new Promise((a,o)=>{this._readyQ.push(c),this.start();const l=this._current[0].server;function c(p,f,y){p?o(p):a(l),St.nextTick(y)}})};ka.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ka.prototype.toJSON=function(){return this.pluginTree.toJSON()};function WS(){}function FE(){if(this.booted){Tm("thenify returning null because we are already booted");return}if(this[e9]){this[e9]=!1;return}return Tm("thenify"),(n,a)=>this._loadRegistered().then(()=>(this[e9]=!0,n(this._server)),a)}function VE(n,a){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(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(n.length===1)c=n(l),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(this._timeout===0){const p=f=>{this._error=f,a(this._error)};n.length===2?n(l,p):n(l,o,p)}else Wee.call(this,n,l,o,a)}function Wee(n,a,o,l){const c=n.name;Tm("setting up ready timeout",c,this._timeout);let p=setTimeout(()=>{Tm("timed out",c),p=null;const y=new $ee(c);y.fn=n,this._error=y,l(y)},this._timeout);n.length===2?n(a,f.bind(this)):n(a,o,f.bind(this));function f(y){p&&(clearTimeout(p),this._error=y,l(this._error))}}function Qee(n,a){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"?(Tm("resolving close/onClose promise"),c.then(()=>St.nextTick(a),p=>St.nextTick(a,p))):St.nextTick(a)}else n.length===2?n(l?o:this._error,a):l?n(o,a):n(this._error,o,a)}function Yee(n,a){return o.bind(a);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 t9(n,a){return o.bind(a);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)}}py.exports=ka;py.exports.express=function(n){return ka(n,{expose:{use:"load"}})};var Kee=py.exports;const Zee=EX(Kee);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const n=["webkit","moz","ms","o"];for(const a of n)window.requestAnimationFrame=window.requestAnimationFrame||window[`${a}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${a}CancelAnimationFrame`]||window[`${a}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let a=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-a)),f=window.setTimeout(function(){l(c+p)},p);return a=c+p,f},window.cancelAnimationFrame=clearTimeout}})();function Xee(n,a=!0,o=!0,l){const c=a?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",p=a?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",f=Zee(Object.create({}),{autostart:!1});return f.use(tX),f.use(YZ,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),f.use(JZ,{videoPlayerController:l==null?void 0:l.videoPlayerController}),f.use(eX,{onContentActivate:l==null?void 0:l.onContentActivate}),f.use(hZ,{sdkKey:n,host:c,analyticsHost:p,version:l==null?void 0:l.version}),f.use(bZ),f.use(XZ),f.use(pX),f.use(VZ),f.use(CX),f.after((y,b,C)=>{if(y)throw y;b.ready(),C()}),o&&f.after(async(y,b,C)=>{if(y)throw y;await b.sdk.initializeApp(),C()}),f.onClose(()=>{console.log("close")}),f}const Jee=({sdkKey:n,plugins:a,production:o,autoEnable:l,onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f})=>{const[y,b]=Q.useState(null);return Q.useEffect(()=>{let C=!1;if(!n)return console.error("streamlayer sdk key should be provided"),b(N=>(N!==null&&typeof N.disableApp=="function"&&N.disableApp(),null)),()=>{C=!0};const _=Xee(n,o,l,{version:"1.2.0",onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f});if(a)for(const N of a)_.use(N);return _.ready().then(N=>{C||(b(N.sdk),typeof window<"u")}).catch(N=>console.log(N)),()=>{C=!0,_.close(function(N){if(N)throw N})}},[n,o]),y};var jE=(n=>(n[n.UNSET=0]="UNSET",n[n.CONNECTED=1]="CONNECTED",n[n.READY=2]="READY",n))(jE||{});const Iy=Q.createContext({status:0,sdk:null}),ete=({sdkKey:n,plugins:a,children:o,production:l=!0,autoEnable:c=!0,onDeepLinkHandled:p,videoPlayerController:f,onContentActivate:y})=>{const b=Jee({sdkKey:n,plugins:a,production:l,autoEnable:c,onDeepLinkHandled:p,videoPlayerController:f,onContentActivate:y}),C=Q.useMemo(()=>b?{sdk:b,status:2}:{status:1,sdk:null},[b]);return Q.useEffect(()=>()=>{p&&(b==null||b.removeDeepLinkHandler(p)),f&&(b==null||b.removeVideoPlayerController(f))},[b]),Q.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!n,onDeepLinkHandled:!!p,videoPlayerController:!!f})},[n,p,f]),w.jsx(Iy.Provider,{value:C,children:o})},BE=()=>{const{sdk:n}=Q.useContext(Iy);return n},tte=({sdkKey:n,plugins:a,children:o,onDeepLinkHandled:l,videoPlayerController:c,production:p=!0})=>w.jsx(ete,{sdkKey:n,plugins:a,production:p,autoEnable:!1,onDeepLinkHandled:l,videoPlayerController:c,children:o}),nte=({children:n,overlays:a})=>{const{sdk:o,status:l}=Q.useContext(Iy);return l===jE.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),n({})):o?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(RC,{style:{height:"100%"},children:w.jsx($G,{sdk:o,overlays:a,children:n})})}):n({})};class ate extends Q.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a,o){console.error(a,o.componentStack)}render(){return this.state.hasError?this.props.children({}):w.jsx(nte,{...this.props})}}const rte=({token:n,schema:a})=>{const o=BE();return Q.useEffect(()=>{n&&a&&o&&o.authorizationBypass(a,n)},[n,a,o]),null},ote=()=>{const n=BE();return n?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(RC,{children:w.jsx(XG,{sdk:n})})}):null};exports.C=kC;exports.C$1=XS;exports.C$2=C6;exports.M=iy;exports.MastersStreamLayerProvider=tte;exports.MastersStreamLayerSDKReact=ate;exports.O=ey;exports.S=EC;exports.StreamLayerLogin=rte;exports.StreamLayerSDKPoints=ote;exports.T=sy;exports.a=F9;exports.b=bC;exports.k=_C;exports.l=KS;exports.m=r2;exports.m$1=JS;exports.n=f2;exports.p=eq;exports.p$1=ZS;exports.styled_default=P;exports.useStore=Ut;exports.z=j$;
|
|
212
|
+
`).slice(0,2).map(o=>o.trim()).join(" -- ")}function Pee(){const n={};return n.promise=new Promise((a,o)=>{n.resolve=a,n.reject=o}),n}function _m(n,a,o,l,c){this.started=!1,this.func=a,this.opts=o,this.onFinish=null,this.parent=n,this.timeout=c===void 0?n._timeout:c,this.name=Aee(a,o),this.isAfter=l,this.q=Ree(n,Mee,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Oee(_m,Lee);_m.prototype.exec=function(n,a){const o=this.func;let l=!1;const c=this.name;if(this.parent._error&&!this.isAfter){Da("skipping loading of plugin as parent errored and it is not an after",c),St.nextTick(a);return}if(this.isAfter)this.server=n;else try{this.server=this.parent.override(n,o,this.opts)}catch(b){return Da("override errored",c),a(b)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Da("exec",c);let p;const f=b=>{if(l){Da("loading complete",c);return}this._error=b,Da(b?"exec errored":"exec completed",c),l=!0,p&&clearTimeout(p),a(b)};this.timeout>0&&(Da("setting up timeout",c,this.timeout),p=setTimeout(function(){Da("timed out",c),p=null;const b=new xee(c);b.fn=o,f(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,f);y&&typeof y.then=="function"&&(Da("exec: resolving promise",c),y.then(()=>St.nextTick(f),b=>St.nextTick(f,b)))};_m.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const n=()=>{this.server.after((o,l)=>{this._error=o,this.q.pause(),o?(Da("rejecting promise",this.name,o),this._promise.reject(o)):(Da("resolving promise",this.name),this._promise.resolve()),this._promise=null,St.nextTick(l,o)}),this.q.resume()};let a;return this._promise?a=Promise.resolve():(this._promise=Pee(),a=this._promise.promise,this.server?n():this.on("start",n)),a};_m.prototype.enqueue=function(n,a){Da("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,a)};_m.prototype.finish=function(n,a){Da("finish",this.name,n);const o=()=>{this.loaded||(Da("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,a(n))};if(n){this._promise&&(this._promise.reject(n),this._promise=null),o();return}const l=()=>{if(Da("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const c=()=>{Da("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(c,c),this._promise=null}else o();else Da("delayed",this.name),this.q.drain=()=>{Da("drain",this.name),this.q.drain=Dee,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function Mee(n,a){const o=this;St.nextTick(_y.bind(o),n,a)}function _y(n,a){if(typeof n.func.then=="function"){n.func.then(l=>{typeof l.default=="function"&&(l=l.default),n.func=l,_y.call(this,n,a)},a);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(),a(c)})})}function Dee(){}Ey.exports=_m;Ey.exports.loadPlugin=_y;var Uee=Ey.exports;const qS=cE,Fee=TE.EventEmitter,Vee=A6.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:J5,AVV_ERR_CALLBACK_NOT_FN:i2,AVV_ERR_PLUGIN_NOT_VALID:jee,AVV_ERR_ROOT_PLG_BOOTED:Bee,AVV_ERR_READY_TIMEOUT:$ee}=DE,zee=Eee,U9=Uee,Tm=UE("avvio"),b6=Symbol("kAvvio"),e9=Symbol("kThenifyDoNotWrap");function Hee(n,a,o){const l=a.expose||{},c=l.use||"use",p=l.after||"after",f=l.ready||"ready",y=l.onClose||"onClose",b=l.close||"close";if(n[c])throw new J5(c);if(n[p])throw new J5(p);if(n[f])throw new J5(f);n[c]=function(C,_){return o.use(C,_),this},Object.defineProperty(n,"then",{get:FE.bind(o)}),n[b6]=!0,n[p]=function(C){return typeof C!="function"?o._loadRegistered():(o.after(t9(C,this)),this)},n[f]=function(C){if(C&&typeof C!="function")throw new i2(f,typeof C);return o.ready(C?t9(C,this):void 0)},n[y]=function(C){if(typeof C!="function")throw new i2(y,typeof C);return o.onClose(Yee(C,this)),this},n[b]=function(C){if(C&&typeof C!="function")throw new i2(b,typeof C);return C?(o.close(t9(C,this)),this):o.close()}}function ka(n,a,o){if(typeof n=="function"&&arguments.length===1&&(o=n,a={},n=null),typeof a=="function"&&(o=a,a={}),a=a||{},!(this instanceof ka)){const l=new ka(n,a,o);return n&&Hee(n,a,l),l}a.autostart!==!1&&(a.autostart=!0),n=n||this,this._timeout=Number(a.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 zee,this._readyQ=qS(this,VE,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=WS},this._closeQ=qS(this,Qee,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=WS},this._doStart=null,this._root=new U9(this,Gee.bind(this),a,!1,0),this._root.once("start",(l,c,p)=>{const f=this.pluginTree.start(null,c,p);this._root.once("loaded",(y,b,C)=>{this.pluginTree.stop(f,C)})}),U9.loadPlugin.call(this,this._root,l=>{Tm("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 Gee(n,a,o){this._doStart=o,a.autostart&&this.start()}Vee(ka,Fee);ka.prototype.start=function(){return this.started=!0,St.nextTick(this._doStart),this};ka.prototype.override=function(n,a,o){return n};function qee(n){if(n&&typeof n=="object"&&typeof n.default=="function"&&(n=n.default),!(n&&(typeof n=="function"||typeof n.then=="function")))throw new jee(typeof n);return n}ka.prototype[b6]=!0;ka.prototype.use=function(n,a){return this._lastUsed=this._addPlugin(n,a,!1),this};ka.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(ka.prototype,"then",{get:FE});ka.prototype._addPlugin=function(n,a,o){if(n=qee(n),a=a||{},this.booted)throw new Bee;const l=this._current[0],c=new U9(this,n,a,o);if(c.once("start",(p,f,y)=>{const b=this.pluginTree.start(l.name,f,y);c.once("loaded",(C,_,N)=>{this.pluginTree.stop(b,N)})}),l.loaded)throw new Error(c.name,l.name);return l.enqueue(c,p=>{p&&(this._error=p)}),c};ka.prototype.after=function(n){if(!n)return this._loadRegistered();this._addPlugin(a.bind(this),{},!0);function a(o,l,c){VE.call(this,n,c)}return this};ka.prototype.onClose=function(n){if(typeof n!="function")throw new Error("not a function");n[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(n,a.bind(this));function a(o){o&&(this._error=o)}return this};ka.prototype.close=function(n){let a;if(n){if(typeof n!="function")throw new i2("close",typeof n)}else a=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))}),a};ka.prototype.ready=function(n){if(n){if(typeof n!="function")throw new i2("ready",typeof n);this._readyQ.push(n),queueMicrotask(this.start.bind(this));return}return new Promise((a,o)=>{this._readyQ.push(c),this.start();const l=this._current[0].server;function c(p,f,y){p?o(p):a(l),St.nextTick(y)}})};ka.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ka.prototype.toJSON=function(){return this.pluginTree.toJSON()};function WS(){}function FE(){if(this.booted){Tm("thenify returning null because we are already booted");return}if(this[e9]){this[e9]=!1;return}return Tm("thenify"),(n,a)=>this._loadRegistered().then(()=>(this[e9]=!0,n(this._server)),a)}function VE(n,a){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(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(n.length===1)c=n(l),c&&!c[b6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(this._timeout===0){const p=f=>{this._error=f,a(this._error)};n.length===2?n(l,p):n(l,o,p)}else Wee.call(this,n,l,o,a)}function Wee(n,a,o,l){const c=n.name;Tm("setting up ready timeout",c,this._timeout);let p=setTimeout(()=>{Tm("timed out",c),p=null;const y=new $ee(c);y.fn=n,this._error=y,l(y)},this._timeout);n.length===2?n(a,f.bind(this)):n(a,o,f.bind(this));function f(y){p&&(clearTimeout(p),this._error=y,l(this._error))}}function Qee(n,a){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"?(Tm("resolving close/onClose promise"),c.then(()=>St.nextTick(a),p=>St.nextTick(a,p))):St.nextTick(a)}else n.length===2?n(l?o:this._error,a):l?n(o,a):n(this._error,o,a)}function Yee(n,a){return o.bind(a);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 t9(n,a){return o.bind(a);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)}}py.exports=ka;py.exports.express=function(n){return ka(n,{expose:{use:"load"}})};var Kee=py.exports;const Zee=EX(Kee);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const n=["webkit","moz","ms","o"];for(const a of n)window.requestAnimationFrame=window.requestAnimationFrame||window[`${a}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${a}CancelAnimationFrame`]||window[`${a}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let a=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-a)),f=window.setTimeout(function(){l(c+p)},p);return a=c+p,f},window.cancelAnimationFrame=clearTimeout}})();function Xee(n,a=!0,o=!0,l){const c=a?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",p=a?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",f=Zee(Object.create({}),{autostart:!1});return f.use(tX),f.use(YZ,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),f.use(JZ,{videoPlayerController:l==null?void 0:l.videoPlayerController}),f.use(eX,{onContentActivate:l==null?void 0:l.onContentActivate}),f.use(hZ,{sdkKey:n,host:c,analyticsHost:p,version:l==null?void 0:l.version}),f.use(bZ),f.use(XZ),f.use(pX),f.use(VZ),f.use(CX),f.after((y,b,C)=>{if(y)throw y;b.ready(),C()}),o&&f.after(async(y,b,C)=>{if(y)throw y;await b.sdk.initializeApp(),C()}),f.onClose(()=>{console.log("close")}),f}const Jee=({sdkKey:n,plugins:a,production:o,autoEnable:l,onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f})=>{const[y,b]=Q.useState(null);return Q.useEffect(()=>{let C=!1;if(!n)return console.error("streamlayer sdk key should be provided"),b(N=>(N!==null&&typeof N.disableApp=="function"&&N.disableApp(),null)),()=>{C=!0};const _=Xee(n,o,l,{version:"1.3.0",onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f});if(a)for(const N of a)_.use(N);return _.ready().then(N=>{C||(b(N.sdk),typeof window<"u")}).catch(N=>console.log(N)),()=>{C=!0,_.close(function(N){if(N)throw N})}},[n,o]),y};var jE=(n=>(n[n.UNSET=0]="UNSET",n[n.CONNECTED=1]="CONNECTED",n[n.READY=2]="READY",n))(jE||{});const Iy=Q.createContext({status:0,sdk:null}),ete=({sdkKey:n,plugins:a,children:o,production:l=!0,autoEnable:c=!0,onDeepLinkHandled:p,videoPlayerController:f,onContentActivate:y})=>{const b=Jee({sdkKey:n,plugins:a,production:l,autoEnable:c,onDeepLinkHandled:p,videoPlayerController:f,onContentActivate:y}),C=Q.useMemo(()=>b?{sdk:b,status:2}:{status:1,sdk:null},[b]);return Q.useEffect(()=>()=>{p&&(b==null||b.removeDeepLinkHandler(p)),f&&(b==null||b.removeVideoPlayerController(f))},[b]),Q.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!n,onDeepLinkHandled:!!p,videoPlayerController:!!f})},[n,p,f]),w.jsx(Iy.Provider,{value:C,children:o})},BE=()=>{const{sdk:n}=Q.useContext(Iy);return n},tte=({sdkKey:n,plugins:a,children:o,onDeepLinkHandled:l,videoPlayerController:c,production:p=!0})=>w.jsx(ete,{sdkKey:n,plugins:a,production:p,autoEnable:!1,onDeepLinkHandled:l,videoPlayerController:c,children:o}),nte=({children:n,overlays:a})=>{const{sdk:o,status:l}=Q.useContext(Iy);return l===jE.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),n({})):o?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(RC,{style:{height:"100%"},children:w.jsx($G,{sdk:o,overlays:a,children:n})})}):n({})};class ate extends Q.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a,o){console.error(a,o.componentStack)}render(){return this.state.hasError?this.props.children({}):w.jsx(nte,{...this.props})}}const rte=({token:n,schema:a})=>{const o=BE();return Q.useEffect(()=>{n&&a&&o&&o.authorizationBypass(a,n)},[n,a,o]),null},ote=()=>{const n=BE();return n?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(RC,{children:w.jsx(XG,{sdk:n})})}):null};exports.C=kC;exports.C$1=XS;exports.C$2=C6;exports.M=iy;exports.MastersStreamLayerProvider=tte;exports.MastersStreamLayerSDKReact=ate;exports.O=ey;exports.S=EC;exports.StreamLayerLogin=rte;exports.StreamLayerSDKPoints=ote;exports.T=sy;exports.a=F9;exports.b=bC;exports.k=_C;exports.l=KS;exports.m=r2;exports.m$1=JS;exports.n=f2;exports.p=eq;exports.p$1=ZS;exports.styled_default=P;exports.useStore=Ut;exports.z=j$;
|
package/lib/dist/es/masters.js
CHANGED
|
@@ -41947,7 +41947,7 @@ const pte = ({
|
|
|
41947
41947
|
w = !0;
|
|
41948
41948
|
};
|
|
41949
41949
|
const E = fte(n, o, l, {
|
|
41950
|
-
version: "1.
|
|
41950
|
+
version: "1.3.0",
|
|
41951
41951
|
onDeepLinkHandled: c,
|
|
41952
41952
|
videoPlayerController: p,
|
|
41953
41953
|
onContentActivate: f
|