@streamlayer/react 1.21.0 → 1.21.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.
Files changed (41) hide show
  1. package/lib/cjs/advertisement.js +1 -1
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/cjs/insight.js +1 -1
  4. package/lib/cjs/notification.js +1 -1
  5. package/lib/cjs/pause-ad.js +1 -1
  6. package/lib/cjs/points.js +1 -1
  7. package/lib/cjs/provider.js +14 -14
  8. package/lib/cjs/useStreamLayerApp2.js +1 -1
  9. package/lib/classic/cjs/advertisement.js +1 -1
  10. package/lib/classic/cjs/index.js +1 -1
  11. package/lib/classic/cjs/insight.js +1 -1
  12. package/lib/classic/cjs/notification.js +1 -1
  13. package/lib/classic/cjs/pause-ad.js +1 -1
  14. package/lib/classic/cjs/points.js +1 -1
  15. package/lib/classic/cjs/provider.js +9 -9
  16. package/lib/classic/cjs/useStreamLayerApp2.js +1 -1
  17. package/lib/classic/es/advertisement.js +2 -3
  18. package/lib/classic/es/index.js +9 -10
  19. package/lib/classic/es/insight.js +6 -7
  20. package/lib/classic/es/notification.js +2 -3
  21. package/lib/classic/es/pause-ad.js +117 -124
  22. package/lib/classic/es/points.js +2 -3
  23. package/lib/classic/es/provider.js +2066 -2062
  24. package/lib/classic/es/useStreamLayerApp2.js +1 -1
  25. package/lib/dist/cjs/gamification-feature2.js +1 -1
  26. package/lib/dist/cjs/index.js +1 -1
  27. package/lib/dist/cjs/masters.js +22 -22
  28. package/lib/dist/es/gamification-feature2.js +71 -72
  29. package/lib/dist/es/index.js +6 -7
  30. package/lib/dist/es/masters.js +3089 -3074
  31. package/lib/dist/style.css +1 -1
  32. package/lib/es/advertisement.js +2 -3
  33. package/lib/es/index.js +9 -10
  34. package/lib/es/insight.js +6 -7
  35. package/lib/es/notification.js +2 -3
  36. package/lib/es/pause-ad.js +113 -120
  37. package/lib/es/points.js +2 -3
  38. package/lib/es/provider.js +2035 -2020
  39. package/lib/es/useStreamLayerApp2.js +1 -1
  40. package/lib/style.css +1 -1
  41. package/package.json +14 -15
@@ -13,4 +13,4 @@
13
13
  `),a=`
14
14
  `+n+(i.length?o("│"):" ")+" ";return n+c.join(a)+`
15
15
  `+i.map(function(s,r){var u=r===i.length-1,V=s.nodes&&s.nodes.length,R=n+(u?" ":o("│"))+" ";return n+o(u?"└":"├")+o("─")+o(V?"┬":"─")+" "+e(s,R,l).slice(n.length+2)}).join("")};const Vb=ub,mi=Symbol("avvio.TimeTree.untrackNode"),Pn=Symbol("avvio.TimeTree.trackNode"),gi=Symbol("avvio.TimeTree.getParent"),hi=Symbol("avvio.TimeTree.getNode"),Wi=Symbol("avvio.TimeTree.addNode");let bb=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Pn](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])}[mi](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)}[gi](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[hi](e){return this.tableId.get(e)}[Wi](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Pn](this.root),this.root.id;const l=this[gi](e),o=`${t}-${Math.random()}`,i={id:o,parent:e,start:n,label:t,nodes:[]};return l.nodes.push(i),this[Pn](i),o}start(e,t,n=Date.now()){return this[Wi](e,t,n)}stop(e,t=Date.now()){const n=this[hi](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[mi](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(l=>e(l))),n),t=e(this.toJSON());return Vb(t)}};var Rb=bb,$l={exports:{}},Xl={exports:{}},_n,Zi;function Ab(){if(Zi)return _n;Zi=1;var e=1e3,t=e*60,n=t*60,l=n*24,o=l*7,i=l*365.25;_n=function(u,V){V=V||{};var R=typeof u;if(R==="string"&&u.length>0)return c(u);if(R==="number"&&isFinite(u))return V.long?s(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function c(u){if(u=String(u),!(u.length>100)){var V=/^(-?(?:\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(V){var R=parseFloat(V[1]),g=(V[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return R*i;case"weeks":case"week":case"w":return R*o;case"days":case"day":case"d":return R*l;case"hours":case"hour":case"hrs":case"hr":case"h":return R*n;case"minutes":case"minute":case"mins":case"min":case"m":return R*t;case"seconds":case"second":case"secs":case"sec":case"s":return R*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return R;default:return}}}}function a(u){var V=Math.abs(u);return V>=l?Math.round(u/l)+"d":V>=n?Math.round(u/n)+"h":V>=t?Math.round(u/t)+"m":V>=e?Math.round(u/e)+"s":u+"ms"}function s(u){var V=Math.abs(u);return V>=l?r(u,V,l,"day"):V>=n?r(u,V,n,"hour"):V>=t?r(u,V,t,"minute"):V>=e?r(u,V,e,"second"):u+" ms"}function r(u,V,R,g){var h=V>=R*1.5;return Math.round(u/R)+" "+g+(h?"s":"")}return _n}function mb(e){n.debug=n,n.default=n,n.coerce=s,n.disable=i,n.enable=o,n.enabled=c,n.humanize=Ab(),n.destroy=r,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let V=0;for(let R=0;R<u.length;R++)V=(V<<5)-V+u.charCodeAt(R),V|=0;return n.colors[Math.abs(V)%n.colors.length]}n.selectColor=t;function n(u){let V,R=null,g,h;function X(...p){if(!X.enabled)return;const W=X,A=Number(new Date),F=A-(V||A);W.diff=F,W.prev=V,W.curr=A,V=A,p[0]=n.coerce(p[0]),typeof p[0]!="string"&&p.unshift("%O");let y=0;p[0]=p[0].replace(/%([a-zA-Z%])/g,(N,U)=>{if(N==="%%")return"%";y++;const S=n.formatters[U];if(typeof S=="function"){const M=p[y];N=S.call(W,M),p.splice(y,1),y--}return N}),n.formatArgs.call(W,p),(W.log||n.log).apply(W,p)}return X.namespace=u,X.useColors=n.useColors(),X.color=n.selectColor(u),X.extend=l,X.destroy=n.destroy,Object.defineProperty(X,"enabled",{enumerable:!0,configurable:!1,get:()=>R!==null?R:(g!==n.namespaces&&(g=n.namespaces,h=n.enabled(u)),h),set:p=>{R=p}}),typeof n.init=="function"&&n.init(X),X}function l(u,V){const R=n(this.namespace+(typeof V>"u"?":":V)+u);return R.log=this.log,R}function o(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let V;const R=(typeof u=="string"?u:"").split(/[\s,]+/),g=R.length;for(V=0;V<g;V++)R[V]&&(u=R[V].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function i(){const u=[...n.names.map(a),...n.skips.map(a).map(V=>"-"+V)].join(",");return n.enable(""),u}function c(u){if(u[u.length-1]==="*")return!0;let V,R;for(V=0,R=n.skips.length;V<R;V++)if(n.skips[V].test(u))return!1;for(V=0,R=n.names.length;V<R;V++)if(n.names[V].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function s(u){return u instanceof Error?u.stack||u.message:u}function r(){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 gb=mb;(function(e,t){t.formatArgs=l,t.save=o,t.load=i,t.useColors=n,t.storage=c(),t.destroy=(()=>{let s=!1;return()=>{s||(s=!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 l(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;s.splice(1,0,r,"color: inherit");let u=0,V=0;s[0].replace(/%[a-zA-Z%]/g,R=>{R!=="%%"&&(u++,R==="%c"&&(V=u))}),s.splice(V,0,r)}t.log=console.debug||console.log||(()=>{});function o(s){try{s?t.storage.setItem("debug",s):t.storage.removeItem("debug")}catch{}}function i(){let s;try{s=t.storage.getItem("debug")}catch{}return!s&&typeof B<"u"&&"env"in B&&(s=B.env.DEBUG),s}function c(){try{return localStorage}catch{}}e.exports=gb(t);const{formatters:a}=e.exports;a.j=function(s){try{return JSON.stringify(s)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}})(Xl,Xl.exports);var wc=Xl.exports;const hb=mc,Wb=yc.EventEmitter,Zb=Nn.inherits,be=wc("avvio"),{AVV_ERR_READY_TIMEOUT:Eb}=Lc,qn=Symbol.for("plugin-meta");function Gb(e,t){return e[qn]&&e[qn].name?e[qn].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
16
- `).slice(0,2).map(n=>n.trim()).join(" -- ")}function Xb(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function ft(e,t,n,l,o){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=o===void 0?e._timeout:o,this.name=Gb(t,n),this.isAfter=l,this.q=hb(e,pb,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Zb(ft,Wb);ft.prototype.exec=function(e,t){const n=this.func;let l=!1;const o=this.name;if(this.parent._error&&!this.isAfter){be("skipping loading of plugin as parent errored and it is not an after",o),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return be("override errored",o),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,be("exec",o);let i;const c=s=>{if(l){be("loading complete",o);return}this._error=s,be(s?"exec errored":"exec completed",o),l=!0,i&&clearTimeout(i),t(s)};this.timeout>0&&(be("setting up timeout",o,this.timeout),i=setTimeout(function(){be("timed out",o),i=null;const s=new Eb(o);s.fn=n,c(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const a=n(this.server,this.opts,c);a&&typeof a.then=="function"&&(be("exec: resolving promise",o),a.then(()=>B.nextTick(c),s=>B.nextTick(c,s)))};ft.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(be("rejecting promise",this.name,n),this._promise.reject(n)):(be("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(l,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=Xb(),t=this._promise.promise,this.server?e():this.on("start",e)),t};ft.prototype.enqueue=function(e,t){be("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};ft.prototype.finish=function(e,t){be("finish",this.name,e);const n=()=>{this.loaded||(be("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 l=()=>{if(be("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const o=()=>{be("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(o,o),this._promise=null}else n();else be("delayed",this.name),this.q.drain=()=>{be("drain",this.name),this.q.drain=yb,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function pb(e,t){const n=this;B.nextTick(eo.bind(n),e,t)}function eo(e,t){if(typeof e.func.then=="function"){e.func.then(l=>{typeof l.default=="function"&&(l=l.default),e.func=l,eo.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,l=>{e.finish(l,o=>{this._current.shift(),t(o)})})}function yb(){}$l.exports=ft;$l.exports.loadPlugin=eo;var Fb=$l.exports;const Ei=mc,Sb=yc.EventEmitter,Yb=Nn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:$n,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:Nb,AVV_ERR_ROOT_PLG_BOOTED:Ib,AVV_ERR_READY_TIMEOUT:Ub}=Lc,Bb=Rb,pl=Fb,Ut=wc("avvio"),pn=Symbol("kAvvio"),el=Symbol("kThenifyDoNotWrap");function fb(e,t,n){const l=t.expose||{},o=l.use||"use",i=l.after||"after",c=l.ready||"ready",a=l.onClose||"onClose",s=l.close||"close";if(e[o])throw new $n(o);if(e[i])throw new $n(i);if(e[c])throw new $n(c);e[o]=function(r,u){return n.use(r,u),this},Object.defineProperty(e,"then",{get:xc.bind(n)}),e[pn]=!0,e[i]=function(r){return typeof r!="function"?n._loadRegistered():(n.after(tl(r,this)),this)},e[c]=function(r){if(r&&typeof r!="function")throw new zt(c,typeof r);return n.ready(r?tl(r,this):void 0)},e[a]=function(r){if(typeof r!="function")throw new zt(a,typeof r);return n.onClose(vb(r,this)),this},e[s]=function(r){if(r&&typeof r!="function")throw new zt(s,typeof r);return r?(n.close(tl(r,this)),this):n.close()}}function Ve(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 Ve)){const l=new Ve(e,t,n);return e&&fb(e,t,l),l}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 Bb,this._readyQ=Ei(this,Mc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Gi},this._closeQ=Ei(this,Qb,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Gi},this._doStart=null,this._root=new pl(this,Cb.bind(this),t,!1,0),this._root.once("start",(l,o,i)=>{const c=this.pluginTree.start(null,o,i);this._root.once("loaded",(a,s,r)=>{this.pluginTree.stop(c,r)})}),pl.loadPlugin.call(this,this._root,l=>{Ut("root plugin ready");try{this.emit("preReady"),this._root=null}catch(o){l=l||this._error||o}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function Cb(e,t,n){this._doStart=n,t.autostart&&this.start()}Yb(Ve,Sb);Ve.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Ve.prototype.override=function(e,t,n){return e};function Jb(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new Nb(typeof e);return e}Ve.prototype[pn]=!0;Ve.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Ve.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(Ve.prototype,"then",{get:xc});Ve.prototype._addPlugin=function(e,t,n){if(e=Jb(e),t=t||{},this.booted)throw new Ib;const l=this._current[0],o=new pl(this,e,t,n);if(o.once("start",(i,c,a)=>{const s=this.pluginTree.start(l.name,c,a);o.once("loaded",(r,u,V)=>{this.pluginTree.stop(s,V)})}),l.loaded)throw new Error(o.name,l.name);return l.enqueue(o,i=>{i&&(this._error=i)}),o};Ve.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,l,o){Mc.call(this,e,o)}return this};Ve.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};Ve.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,l){e=function(o){if(o)return l(o);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Ve.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(o),this.start();const l=this._current[0].server;function o(i,c,a){i?n(i):t(l),B.nextTick(a)}})};Ve.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ve.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Gi(){}function xc(){if(this.booted){Ut("thenify returning null because we are already booted");return}if(this[el]){this[el]=!1;return}return Ut("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[el]=!0,e(this._server)),t)}function Mc(e,t){const n=this._server,l=this._error;let o;if(this._error=null,e.length===0)this._error=l,o=e(),o&&!o[pn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(e.length===1)o=e(l),o&&!o[pn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(this._timeout===0){const i=c=>{this._error=c,t(this._error)};e.length===2?e(l,i):e(l,n,i)}else Tb.call(this,e,l,n,t)}function Tb(e,t,n,l){const o=e.name;Ut("setting up ready timeout",o,this._timeout);let i=setTimeout(()=>{Ut("timed out",o),i=null;const a=new Ub(o);a.fn=e,this._error=a,l(a)},this._timeout);e.length===2?e(t,c.bind(this)):e(t,n,c.bind(this));function c(a){i&&(clearTimeout(i),this._error=a,l(this._error))}}function Qb(e,t){const n=this._server,l=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let o;l?o=e(n):o=e(this._error),o&&typeof o.then=="function"?(Ut("resolving close/onClose promise"),o.then(()=>B.nextTick(t),i=>B.nextTick(t,i))):B.nextTick(t)}else e.length===2?e(l?n:this._error,t):l?e(n,t):e(this._error,n,t)}function vb(e,t){return n.bind(t);function n(l,o){let i;e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===1?(i=e(this),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e(this,o)}}function tl(e,t){return n.bind(t);function n(l,o){let i;e?e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o,l)},o):B.nextTick(o,l)):e.length===1?(i=e(l),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===2?e(l,o):e(l,this,o):B.nextTick(o)}}Ll.exports=Ve;Ll.exports.express=function(e){return Ve(e,{expose:{use:"load"}})};var kb=Ll.exports;const zb=Ru(kb);(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(l){const o=n?window.performance.now():new Date().getTime(),i=Math.max(0,16-(o-t)),c=window.setTimeout(function(){l(o+i)},i);return t=o+i,c},window.cancelAnimationFrame=clearTimeout}})();function Kb(e,t=!0,n=!0,l={friendsTab:"enabled"}){const o=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",i=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",c=zb(Object.create({}),{autostart:!1});return c.use(Md,{hideFriends:l.hideFriends,skipOnboarding:l.skipOnboarding,betPack:l.betPack,friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),c.use(vd,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),c.use(Ld,{videoPlayerController:l==null?void 0:l.videoPlayerController}),c.use(xd,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),c.use(od,{sdkKey:e,host:o,analyticsHost:i,version:l==null?void 0:l.version,webOS:l==null?void 0:l.webOS}),c.use(rd),c.use(Kd),c.use(nu),c.use(Ud),c.use(bu),c.after((a,s,r)=>{if(a)throw a;s.ready(),r()}),n&&c.after(async(a,s,r)=>{if(a)throw a;await s.sdk.initializeApp(),r()}),c.onClose(()=>{console.log("close StreamLayer instance")}),c}const Lb=({sdkKey:e,plugins:t,production:n,autoEnable:l,onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:c,hideFriends:a,skipOnboarding:s,withAdNotification:r,withAd:u,friendsTab:V,betPack:R,webOS:g})=>{const[h,X]=oo.useState(null);return oo.useEffect(()=>{let p=!1;if(!e)return console.error("streamlayer sdk key should be provided"),X(A=>(A!==null&&typeof A.disableApp=="function"&&A.disableApp(),null)),()=>{p=!0};const W=Kb(e,n,l,{version:"1.21.0",onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:c,skipOnboarding:s,withAdNotification:r,withAd:u,hideFriends:a,friendsTab:V,betPack:R,webOS:g});if(t)for(const A of t)W.use(A);return W.ready().then(A=>{p||(X(A.sdk),typeof window<"u")}).catch(A=>console.log(A)),()=>{p=!0,W.close(function(A){if(A)throw A})}},[e,n]),h};exports.AdUnit=pe;exports.AutoPlayVideo=$s;exports.CloseTimerAuto=_s;exports.CtaIconMode=vs;exports.InvitationFrom=rl;exports.NotificationEnabled=sl;exports.NotificationPromotionImagePosition=Cs;exports.NotificationPromotionMode=Bs;exports.NotificationSponsorLogoMode=Ts;exports.NotificationUseContentMedia=Ds;exports.PickHistoryStatus=Tt;exports.PlayVideoMuted=tr;exports.PromotionButtonType=Ks;exports.PromotionLogoMode=ws;exports.PromotionType=T;exports.QuestionImages=Is;exports.QuestionStatus=ue;exports.QuestionType=f;exports.SdkOverlayType=O;exports.global=dl;exports.useStreamLayerApp=Lb;
16
+ `).slice(0,2).map(n=>n.trim()).join(" -- ")}function Xb(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function ft(e,t,n,l,o){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=o===void 0?e._timeout:o,this.name=Gb(t,n),this.isAfter=l,this.q=hb(e,pb,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Zb(ft,Wb);ft.prototype.exec=function(e,t){const n=this.func;let l=!1;const o=this.name;if(this.parent._error&&!this.isAfter){be("skipping loading of plugin as parent errored and it is not an after",o),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return be("override errored",o),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,be("exec",o);let i;const c=s=>{if(l){be("loading complete",o);return}this._error=s,be(s?"exec errored":"exec completed",o),l=!0,i&&clearTimeout(i),t(s)};this.timeout>0&&(be("setting up timeout",o,this.timeout),i=setTimeout(function(){be("timed out",o),i=null;const s=new Eb(o);s.fn=n,c(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const a=n(this.server,this.opts,c);a&&typeof a.then=="function"&&(be("exec: resolving promise",o),a.then(()=>B.nextTick(c),s=>B.nextTick(c,s)))};ft.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(be("rejecting promise",this.name,n),this._promise.reject(n)):(be("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(l,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=Xb(),t=this._promise.promise,this.server?e():this.on("start",e)),t};ft.prototype.enqueue=function(e,t){be("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};ft.prototype.finish=function(e,t){be("finish",this.name,e);const n=()=>{this.loaded||(be("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 l=()=>{if(be("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const o=()=>{be("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(o,o),this._promise=null}else n();else be("delayed",this.name),this.q.drain=()=>{be("drain",this.name),this.q.drain=yb,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function pb(e,t){const n=this;B.nextTick(eo.bind(n),e,t)}function eo(e,t){if(typeof e.func.then=="function"){e.func.then(l=>{typeof l.default=="function"&&(l=l.default),e.func=l,eo.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,l=>{e.finish(l,o=>{this._current.shift(),t(o)})})}function yb(){}$l.exports=ft;$l.exports.loadPlugin=eo;var Fb=$l.exports;const Ei=mc,Sb=yc.EventEmitter,Yb=Nn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:$n,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:Nb,AVV_ERR_ROOT_PLG_BOOTED:Ib,AVV_ERR_READY_TIMEOUT:Ub}=Lc,Bb=Rb,pl=Fb,Ut=wc("avvio"),pn=Symbol("kAvvio"),el=Symbol("kThenifyDoNotWrap");function fb(e,t,n){const l=t.expose||{},o=l.use||"use",i=l.after||"after",c=l.ready||"ready",a=l.onClose||"onClose",s=l.close||"close";if(e[o])throw new $n(o);if(e[i])throw new $n(i);if(e[c])throw new $n(c);e[o]=function(r,u){return n.use(r,u),this},Object.defineProperty(e,"then",{get:xc.bind(n)}),e[pn]=!0,e[i]=function(r){return typeof r!="function"?n._loadRegistered():(n.after(tl(r,this)),this)},e[c]=function(r){if(r&&typeof r!="function")throw new zt(c,typeof r);return n.ready(r?tl(r,this):void 0)},e[a]=function(r){if(typeof r!="function")throw new zt(a,typeof r);return n.onClose(vb(r,this)),this},e[s]=function(r){if(r&&typeof r!="function")throw new zt(s,typeof r);return r?(n.close(tl(r,this)),this):n.close()}}function Ve(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 Ve)){const l=new Ve(e,t,n);return e&&fb(e,t,l),l}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 Bb,this._readyQ=Ei(this,Mc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Gi},this._closeQ=Ei(this,Qb,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Gi},this._doStart=null,this._root=new pl(this,Cb.bind(this),t,!1,0),this._root.once("start",(l,o,i)=>{const c=this.pluginTree.start(null,o,i);this._root.once("loaded",(a,s,r)=>{this.pluginTree.stop(c,r)})}),pl.loadPlugin.call(this,this._root,l=>{Ut("root plugin ready");try{this.emit("preReady"),this._root=null}catch(o){l=l||this._error||o}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function Cb(e,t,n){this._doStart=n,t.autostart&&this.start()}Yb(Ve,Sb);Ve.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Ve.prototype.override=function(e,t,n){return e};function Jb(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new Nb(typeof e);return e}Ve.prototype[pn]=!0;Ve.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Ve.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(Ve.prototype,"then",{get:xc});Ve.prototype._addPlugin=function(e,t,n){if(e=Jb(e),t=t||{},this.booted)throw new Ib;const l=this._current[0],o=new pl(this,e,t,n);if(o.once("start",(i,c,a)=>{const s=this.pluginTree.start(l.name,c,a);o.once("loaded",(r,u,V)=>{this.pluginTree.stop(s,V)})}),l.loaded)throw new Error(o.name,l.name);return l.enqueue(o,i=>{i&&(this._error=i)}),o};Ve.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,l,o){Mc.call(this,e,o)}return this};Ve.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};Ve.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,l){e=function(o){if(o)return l(o);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Ve.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(o),this.start();const l=this._current[0].server;function o(i,c,a){i?n(i):t(l),B.nextTick(a)}})};Ve.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ve.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Gi(){}function xc(){if(this.booted){Ut("thenify returning null because we are already booted");return}if(this[el]){this[el]=!1;return}return Ut("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[el]=!0,e(this._server)),t)}function Mc(e,t){const n=this._server,l=this._error;let o;if(this._error=null,e.length===0)this._error=l,o=e(),o&&!o[pn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(e.length===1)o=e(l),o&&!o[pn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(this._timeout===0){const i=c=>{this._error=c,t(this._error)};e.length===2?e(l,i):e(l,n,i)}else Tb.call(this,e,l,n,t)}function Tb(e,t,n,l){const o=e.name;Ut("setting up ready timeout",o,this._timeout);let i=setTimeout(()=>{Ut("timed out",o),i=null;const a=new Ub(o);a.fn=e,this._error=a,l(a)},this._timeout);e.length===2?e(t,c.bind(this)):e(t,n,c.bind(this));function c(a){i&&(clearTimeout(i),this._error=a,l(this._error))}}function Qb(e,t){const n=this._server,l=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let o;l?o=e(n):o=e(this._error),o&&typeof o.then=="function"?(Ut("resolving close/onClose promise"),o.then(()=>B.nextTick(t),i=>B.nextTick(t,i))):B.nextTick(t)}else e.length===2?e(l?n:this._error,t):l?e(n,t):e(this._error,n,t)}function vb(e,t){return n.bind(t);function n(l,o){let i;e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===1?(i=e(this),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e(this,o)}}function tl(e,t){return n.bind(t);function n(l,o){let i;e?e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o,l)},o):B.nextTick(o,l)):e.length===1?(i=e(l),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===2?e(l,o):e(l,this,o):B.nextTick(o)}}Ll.exports=Ve;Ll.exports.express=function(e){return Ve(e,{expose:{use:"load"}})};var kb=Ll.exports;const zb=Ru(kb);(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(l){const o=n?window.performance.now():new Date().getTime(),i=Math.max(0,16-(o-t)),c=window.setTimeout(function(){l(o+i)},i);return t=o+i,c},window.cancelAnimationFrame=clearTimeout}})();function Kb(e,t=!0,n=!0,l={friendsTab:"enabled"}){const o=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",i=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",c=zb(Object.create({}),{autostart:!1});return c.use(Md,{hideFriends:l.hideFriends,skipOnboarding:l.skipOnboarding,betPack:l.betPack,friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),c.use(vd,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),c.use(Ld,{videoPlayerController:l==null?void 0:l.videoPlayerController}),c.use(xd,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),c.use(od,{sdkKey:e,host:o,analyticsHost:i,version:l==null?void 0:l.version,webOS:l==null?void 0:l.webOS}),c.use(rd),c.use(Kd),c.use(nu),c.use(Ud),c.use(bu),c.after((a,s,r)=>{if(a)throw a;s.ready(),r()}),n&&c.after(async(a,s,r)=>{if(a)throw a;await s.sdk.initializeApp(),r()}),c.onClose(()=>{console.log("close StreamLayer instance")}),c}const Lb=({sdkKey:e,plugins:t,production:n,autoEnable:l,onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:c,hideFriends:a,skipOnboarding:s,withAdNotification:r,withAd:u,friendsTab:V,betPack:R,webOS:g})=>{const[h,X]=oo.useState(null);return oo.useEffect(()=>{let p=!1;if(!e)return console.error("streamlayer sdk key should be provided"),X(A=>(A!==null&&typeof A.disableApp=="function"&&A.disableApp(),null)),()=>{p=!0};const W=Kb(e,n,l,{version:"1.21.2",onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:c,skipOnboarding:s,withAdNotification:r,withAd:u,hideFriends:a,friendsTab:V,betPack:R,webOS:g});if(t)for(const A of t)W.use(A);return W.ready().then(A=>{p||(X(A.sdk),typeof window<"u")}).catch(A=>console.log(A)),()=>{p=!0,W.close(function(A){if(A)throw A})}},[e,n]),h};exports.AdUnit=pe;exports.AutoPlayVideo=$s;exports.CloseTimerAuto=_s;exports.CtaIconMode=vs;exports.InvitationFrom=rl;exports.NotificationEnabled=sl;exports.NotificationPromotionImagePosition=Cs;exports.NotificationPromotionMode=Bs;exports.NotificationSponsorLogoMode=Ts;exports.NotificationUseContentMedia=Ds;exports.PickHistoryStatus=Tt;exports.PlayVideoMuted=tr;exports.PromotionButtonType=Ks;exports.PromotionLogoMode=ws;exports.PromotionType=T;exports.QuestionImages=Is;exports.QuestionStatus=ue;exports.QuestionType=f;exports.SdkOverlayType=O;exports.global=dl;exports.useStreamLayerApp=Lb;
@@ -1,6 +1,5 @@
1
1
  import { jsx as Y, jsxs as pe, Fragment as to } from "react/jsx-runtime";
2
2
  import { useEffect as It, useState as Lo, useRef as wi, useCallback as nn } from "react";
3
- import "@nanostores/react";
4
3
  import "nanostores";
5
4
  import { n as ai, s as J, i as Ht, O as Fr, B as gm, q as fm, k as mm, e as bs, y as io, E as ym, r as _m, t as bm, u as Tm, c as vm, d as Sm, a as Ni, h as Em } from "./provider.js";
6
5
  import "lodash.throttle";
@@ -34371,7 +34370,7 @@ const l2 = (i) => {
34371
34370
  containerId: A.containerId,
34372
34371
  muted: m
34373
34372
  });
34374
- }, D2 = ({
34373
+ }, L2 = ({
34375
34374
  event: i,
34376
34375
  sidebar: e,
34377
34376
  banner: t,
@@ -34406,6 +34405,6 @@ const l2 = (i) => {
34406
34405
  ] }) : null;
34407
34406
  };
34408
34407
  export {
34409
- D2 as StreamLayerSDKAdvertisement,
34408
+ L2 as StreamLayerSDKAdvertisement,
34410
34409
  _2 as StreamLayerSDKAdvertisementUI
34411
34410
  };
@@ -1,20 +1,19 @@
1
- import { S as p, a as y, b as L, h as c, u as f, d as u, c as D } from "./provider.js";
1
+ import { S as s, a as y, b as L, h as p, u as c, d as f, c as u } from "./provider.js";
2
2
  import "nanostores";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
- import "@nanostores/react";
6
5
  import "lodash.throttle";
7
6
  import "react-dom";
8
7
  import "react-countup";
9
- import { StreamLayerSDKNotification as d, StreamLayerSDKNotificationUI as h } from "./notification.js";
8
+ import { StreamLayerSDKNotification as K, StreamLayerSDKNotificationUI as d } from "./notification.js";
10
9
  export {
11
- p as StreamLayerProvider,
10
+ s as StreamLayerProvider,
12
11
  y as StreamLayerSDKEvent,
13
- d as StreamLayerSDKNotification,
14
- h as StreamLayerSDKNotificationUI,
12
+ K as StreamLayerSDKNotification,
13
+ d as StreamLayerSDKNotificationUI,
15
14
  L as StreamLayerSDKReact,
16
- c as StreamLayerThemeProvider,
17
- f as useStreamLayer,
18
- u as useStreamLayerTheme,
19
- D as useStreamLayerUI
15
+ p as StreamLayerThemeProvider,
16
+ c as useStreamLayer,
17
+ f as useStreamLayerTheme,
18
+ u as useStreamLayerUI
20
19
  };
@@ -1,6 +1,5 @@
1
- import { jsx as u, jsxs as c } from "react/jsx-runtime";
1
+ import { jsx as u, jsxs as p } from "react/jsx-runtime";
2
2
  import { useRef as l, useEffect as h } from "react";
3
- import "@nanostores/react";
4
3
  import "nanostores";
5
4
  import { e as m, s as f, T as S, u as I, d as g, h as v, a as k } from "./provider.js";
6
5
  import "lodash.throttle";
@@ -19,7 +18,7 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
19
18
  hideHeader: a,
20
19
  insightId: t
21
20
  }) => {
22
- const s = l(""), p = m(e.openedQuestion.$store);
21
+ const s = l(""), c = m(e.openedQuestion.$store);
23
22
  return h(() => t ? (!i || e.isOpenedQuestion(t) || (s.current = t, e.getFeedItem(t).then((r) => {
24
23
  var d;
25
24
  s.current === t && ((d = r == null ? void 0 : r.attributes) == null ? void 0 : d.attributes.case) === "insight" && e.openQuestion(t, r);
@@ -31,7 +30,7 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
31
30
  var d;
32
31
  r && ((d = r.feedItem) == null ? void 0 : d.type) === "insight" && (!i || e.isOpenedQuestion(r.feedItem.id) || (s.current = r.feedItem.id, e.openQuestion(r.feedItem.id, r.feedItem))), !r && s.current && (e.closeQuestion(s.current), s.current = "");
33
32
  }), () => {
34
- }), [e, i, t]), p ? /* @__PURE__ */ u(L, {
33
+ }), [e, i, t]), c ? /* @__PURE__ */ u(L, {
35
34
  sdk: n,
36
35
  skipAutoClose: o,
37
36
  hideHeader: a,
@@ -56,7 +55,7 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
56
55
  gamification: t,
57
56
  skipAutoClose: i
58
57
  }) : null;
59
- }, j = ({
58
+ }, O = ({
60
59
  event: e,
61
60
  theme: n,
62
61
  hideHeader: i,
@@ -64,7 +63,7 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
64
63
  persistent: a
65
64
  }) => {
66
65
  const t = I(), s = g();
67
- return t ? /* @__PURE__ */ c("div", { className: "StreamLayerSDK", children: [
66
+ return t ? /* @__PURE__ */ p("div", { className: "StreamLayerSDK", children: [
68
67
  /* @__PURE__ */ u(v, { customTheme: n ?? s.theme, themeMode: s.themeMode, children: /* @__PURE__ */ u(
69
68
  A,
70
69
  {
@@ -78,6 +77,6 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
78
77
  ] }) : null;
79
78
  };
80
79
  export {
81
- j as StreamLayerSDKInsight,
80
+ O as StreamLayerSDKInsight,
82
81
  A as StreamLayerSDKInsightUI
83
82
  };
@@ -1,6 +1,5 @@
1
1
  import { jsxs as l, jsx as s } from "react/jsx-runtime";
2
2
  import { useState as w, useRef as _, useEffect as y, useCallback as As, useMemo as hs } from "react";
3
- import "@nanostores/react";
4
3
  import "nanostores";
5
4
  import { s as n, B as A, D as Is, v as $s, x as K, w as G, z as gs, E as ws, O as x, y as ys, f as Ts, e as bs, i as Cs, N as O, u as fs, d as ks, c as Ns, h as qs } from "./provider.js";
6
5
  import "lodash.throttle";
@@ -999,11 +998,11 @@ const b = /* @__PURE__ */ n("div")({
999
998
  webos: i
1000
999
  }
1001
1000
  ) : c && /* @__PURE__ */ s(se, { ...c.data, action: c.action });
1002
- }, Oo = ({ theme: e }) => {
1001
+ }, Mo = ({ theme: e }) => {
1003
1002
  const i = fs(), t = ks(), o = Ns();
1004
1003
  return i && (o.appNotification || o.onboardingNotification) ? o.app && !o.onboardingNotification ? null : /* @__PURE__ */ s("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ s(qs, { customTheme: e ?? t.theme, themeMode: t.themeMode, children: /* @__PURE__ */ s(fo, { sdk: i }) }) }) : null;
1005
1004
  };
1006
1005
  export {
1007
- Oo as StreamLayerSDKNotification,
1006
+ Mo as StreamLayerSDKNotification,
1008
1007
  fo as StreamLayerSDKNotificationUI
1009
1008
  };
@@ -1,63 +1,62 @@
1
- import { jsx as a, jsxs as I } from "react/jsx-runtime";
2
- import { j as K, k as F, i as k, s as p, l as M, n as _, e as j, u as q, d as G, h as N } from "./provider.js";
1
+ import { jsx as l, jsxs as L } from "react/jsx-runtime";
2
+ import { j as K, k as M, i as k, s as m, l as _, n as $, e as F, u as N, d as j, h as q } from "./provider.js";
3
3
  import "nanostores";
4
- import { useRef as D, useCallback as L, useState as R, useEffect as T, Component as $ } from "react";
5
- import "@nanostores/react";
4
+ import { useRef as D, useCallback as I, useState as R, useEffect as T, Component as O } from "react";
6
5
  import "lodash.throttle";
7
6
  import "react-dom";
8
7
  import "react-countup";
9
8
  import { c as z } from "./vast-client.min-B0NUra1B.js";
10
- const O = {}, W = new z(), b = F(O), E = K("ui:gam-static"), U = (e) => new Promise((s, t) => {
11
- const n = new Image();
12
- n.onload = () => s(e), n.onerror = () => t(), n.src = e;
9
+ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Promise((s, t) => {
10
+ const o = new Image();
11
+ o.onload = () => s(e), o.onerror = () => t(), o.src = e;
13
12
  }), V = () => {
14
13
  const e = D(0);
15
- return [L(async (s) => {
16
- var t, n, r, d, c, i, h, l, f, g, y;
17
- if ((t = b.get()[s]) != null && t.imageSrc)
14
+ return [I(async (s) => {
15
+ var t, o, r, c, d, n, h, i, y, g, f;
16
+ if ((t = w.get()[s]) != null && t.imageSrc)
18
17
  return { success: !0 };
19
18
  const v = Date.now();
20
- e.current = v, b.setKey(s, { id: "", url: s });
19
+ e.current = v, w.setKey(s, { id: "", url: s });
21
20
  try {
22
21
  k.emit("exposedPauseAd", {
23
22
  action: "load",
24
23
  payload: {}
25
24
  });
26
- const u = await W.get(s);
27
- if (E.debug(u, "parsedVAST"), e.current === v && b.get()[s].url) {
28
- const o = u.ads.find((m) => m.creatives.length > 0);
29
- if (o) {
30
- E.debug(o, "validAd");
31
- const m = o.creatives.find((A) => A.type === "nonlinear");
32
- if (m) {
33
- E.debug(m, "nonlinear");
34
- const A = (r = (n = m.variations) == null ? void 0 : n[0]) == null ? void 0 : r.staticResource, C = (c = (d = m.variations) == null ? void 0 : d[0]) == null ? void 0 : c.nonlinearClickThroughURLTemplate;
25
+ const u = await J.get(s);
26
+ if (E.debug(u, "parsedVAST"), e.current === v && w.get()[s].url) {
27
+ const a = u.ads.find((p) => p.creatives.length > 0);
28
+ if (a) {
29
+ E.debug(a, "validAd");
30
+ const p = a.creatives.find((A) => A.type === "nonlinear");
31
+ if (p) {
32
+ E.debug(p, "nonlinear");
33
+ const A = (r = (o = p.variations) == null ? void 0 : o[0]) == null ? void 0 : r.staticResource, C = (d = (c = p.variations) == null ? void 0 : c[0]) == null ? void 0 : d.nonlinearClickThroughURLTemplate;
35
34
  if (A)
36
- return await U(A), b.setKey(s, {
37
- id: o.id || "",
35
+ return await U(A), w.setKey(s, {
36
+ id: a.id || "",
38
37
  url: s,
39
38
  imageSrc: A,
40
39
  adUrl: C
41
40
  }), k.emit("exposedPauseAd", {
42
41
  action: "loaded",
43
42
  payload: {
44
- id: o.id || ""
43
+ id: a.id || ""
45
44
  }
46
45
  }), { success: !0 };
47
46
  }
48
- const P = o.creatives.find((A) => A.type === "companion");
47
+ const P = a.creatives.find((A) => A.type === "companion");
49
48
  E.debug(P, "companion");
50
- const w = (f = (l = (h = (i = P == null ? void 0 : P.variations) == null ? void 0 : i[0]) == null ? void 0 : h.staticResources) == null ? void 0 : l[0]) == null ? void 0 : f.url, S = (y = (g = P == null ? void 0 : P.variations) == null ? void 0 : g[0]) == null ? void 0 : y.companionClickThroughURLTemplate;
51
- if (w)
52
- return await U(w), b.setKey(s, {
53
- id: o.id || "",
49
+ const b = (y = (i = (h = (n = P == null ? void 0 : P.variations) == null ? void 0 : n[0]) == null ? void 0 : h.staticResources) == null ? void 0 : i[0]) == null ? void 0 : y.url, S = (f = (g = P == null ? void 0 : P.variations) == null ? void 0 : g[0]) == null ? void 0 : f.companionClickThroughURLTemplate;
50
+ if (b)
51
+ return await U(b), w.setKey(s, {
52
+ id: a.id || "",
54
53
  url: s,
55
- imageSrc: w,
54
+ imageSrc: b,
56
55
  adUrl: S
57
56
  }), k.emit("exposedPauseAd", {
58
57
  action: "loaded",
59
58
  payload: {
60
- id: o.id || ""
59
+ id: a.id || ""
61
60
  }
62
61
  }), { success: !0 };
63
62
  }
@@ -66,58 +65,54 @@ const O = {}, W = new z(), b = F(O), E = K("ui:gam-static"), U = (e) => new Prom
66
65
  console.error("Error parsing VAST", u);
67
66
  }
68
67
  return { success: !1 };
69
- }, []), b];
70
- }, X = /* @__PURE__ */ p("div")({
68
+ }, []), w];
69
+ }, Q = /* @__PURE__ */ m("div")({
71
70
  name: "PauseAdOverlay",
72
71
  class: "pw9gih8",
73
72
  propsAsIs: !1
74
- }), H = /* @__PURE__ */ p("div")({
73
+ }), H = /* @__PURE__ */ m("div")({
75
74
  name: "PauseAdContent",
76
75
  class: "p8lpomy",
77
76
  propsAsIs: !1
78
- }), J = /* @__PURE__ */ p("div")({
79
- name: "PauseAdGradientRight",
77
+ }), W = /* @__PURE__ */ m("div")({
78
+ name: "PauseAdTopLeft",
80
79
  class: "pv7u167",
81
80
  propsAsIs: !1
82
- }), Q = /* @__PURE__ */ p("div")({
83
- name: "PauseAdGradientBottom",
81
+ }), X = /* @__PURE__ */ m("h2")({
82
+ name: "PauseAdTitle",
84
83
  class: "p1kh2yb0",
85
84
  propsAsIs: !1
86
- }), Y = /* @__PURE__ */ p("div")({
87
- name: "PauseAdTopLeft",
85
+ }), Y = /* @__PURE__ */ m("p")({
86
+ name: "PauseAdCaption",
88
87
  class: "pl8f94x",
89
88
  propsAsIs: !1
90
- }), Z = /* @__PURE__ */ p("h2")({
91
- name: "PauseAdTitle",
89
+ }), Z = /* @__PURE__ */ m("div")({
90
+ name: "PauseAdBottomLeft",
92
91
  class: "p1m6zmrt",
93
92
  propsAsIs: !1
94
- }), ee = /* @__PURE__ */ p("p")({
95
- name: "PauseAdCaption",
93
+ }), ee = /* @__PURE__ */ m("button")({
94
+ name: "PauseAdPlayButton",
96
95
  class: "pm3vwfa",
97
96
  propsAsIs: !1
98
- }), se = /* @__PURE__ */ p("div")({
99
- name: "PauseAdBottomLeft",
97
+ }), se = /* @__PURE__ */ m("div")({
98
+ name: "PauseAdSidebarGradient",
100
99
  class: "p1tibuhw",
101
100
  propsAsIs: !1
102
- }), re = /* @__PURE__ */ p("button")({
103
- name: "PauseAdPlayButton",
104
- class: "ptqqrqd",
105
- propsAsIs: !1
106
- }), te = /* @__PURE__ */ p("div")({
101
+ }), re = /* @__PURE__ */ m("div")({
107
102
  name: "PauseAdSidebar",
108
- class: "p14estxv",
103
+ class: "ptqqrqd",
109
104
  propsAsIs: !1
110
- }), oe = /* @__PURE__ */ p("span")({
105
+ }), te = /* @__PURE__ */ m("span")({
111
106
  name: "PauseAdTitleDescription",
112
- class: "p1dpvfl1",
107
+ class: "p14estxv",
113
108
  propsAsIs: !1
114
- }), B = /* @__PURE__ */ p("img")({
109
+ }), B = /* @__PURE__ */ m("img")({
115
110
  name: "ExternalAdContainer",
116
- class: "ezfmabr",
111
+ class: "e1dpvfl1",
117
112
  propsAsIs: !1
118
113
  }), ae = ({ vastUrl: e, isDesktop: s }) => {
119
114
  var t;
120
- const [, n] = V(), r = j(n, { keys: [e] });
115
+ const [, o] = V(), r = F(o, { keys: [e] });
121
116
  return T(() => {
122
117
  r && r[e] && r[e].imageSrc && r[e].id && k.emit("exposedPauseAd", {
123
118
  action: "rendered",
@@ -125,7 +120,7 @@ const O = {}, W = new z(), b = F(O), E = K("ui:gam-static"), U = (e) => new Prom
125
120
  id: r[e].id
126
121
  }
127
122
  });
128
- }, [r, e]), (t = r == null ? void 0 : r[e]) != null && t.imageSrc ? !r[e].adUrl || !s ? /* @__PURE__ */ a(B, { src: r[e].imageSrc }) : /* @__PURE__ */ a(
123
+ }, [r, e]), (t = r == null ? void 0 : r[e]) != null && t.imageSrc ? !r[e].adUrl || !s ? /* @__PURE__ */ l(B, { src: r[e].imageSrc }) : /* @__PURE__ */ l(
129
124
  "a",
130
125
  {
131
126
  onClick: () => {
@@ -139,81 +134,79 @@ const O = {}, W = new z(), b = F(O), E = K("ui:gam-static"), U = (e) => new Prom
139
134
  href: r[e].adUrl,
140
135
  target: "_blank",
141
136
  rel: "noopener noreferrer",
142
- children: /* @__PURE__ */ a(B, { src: r[e].imageSrc })
137
+ children: /* @__PURE__ */ l(B, { src: r[e].imageSrc })
143
138
  }
144
139
  ) : null;
145
- }, ne = ({ isClosing: e, title: s, caption: t, onPlay: n, onClose: r, vastUrl: d, options: c, isDesktop: i }) => {
146
- const h = (c == null ? void 0 : c.showPauseButton) ?? !0, { ref: l, focusSelf: f } = M.useFocusable({
140
+ }, oe = ({ isClosing: e, title: s, caption: t, onPlay: o, onClose: r, vastUrl: c, options: d, isDesktop: n }) => {
141
+ const h = (d == null ? void 0 : d.showPauseButton) ?? !0, { ref: i, focusSelf: y } = _.useFocusable({
147
142
  focusKey: "sl-pause-ad-play",
148
- onEnterRelease: n,
143
+ onEnterRelease: o,
149
144
  isFocusBoundary: !0,
150
145
  forceFocus: !0
151
146
  });
152
147
  return T(() => {
153
- l.current && f();
154
- }, [l, f]), T(() => {
148
+ i.current && y();
149
+ }, [i, y]), T(() => {
155
150
  if (!r)
156
151
  return () => {
157
152
  };
158
- const g = (y) => {
159
- const v = y.keyCode;
153
+ const g = (f) => {
154
+ const v = f.keyCode;
160
155
  if (v === 461 || v === 10009 || v === 27 || v === 8) {
161
- y.preventDefault(), y.stopPropagation(), y.stopImmediatePropagation(), r();
156
+ f.preventDefault(), f.stopPropagation(), f.stopImmediatePropagation(), r();
162
157
  return;
163
158
  }
164
159
  };
165
160
  return window.addEventListener("keydown", g, { capture: !0 }), () => window.removeEventListener("keydown", g, { capture: !0 });
166
- }, [r]), /* @__PURE__ */ a(X, { className: _("SL_PauseAdOverlay", e && "pause-ad-closing"), children: /* @__PURE__ */ I(H, { children: [
167
- /* @__PURE__ */ a(J, {}),
168
- /* @__PURE__ */ a(Q, {}),
169
- /* @__PURE__ */ I(Y, { children: [
170
- /* @__PURE__ */ a(Z, { children: s }),
171
- /* @__PURE__ */ a(ee, { children: t })
161
+ }, [r]), /* @__PURE__ */ l(Q, { className: $("SL_PauseAdOverlay", e && "pause-ad-closing"), children: /* @__PURE__ */ L(H, { children: [
162
+ /* @__PURE__ */ L(W, { children: [
163
+ /* @__PURE__ */ l(X, { children: s }),
164
+ /* @__PURE__ */ l(Y, { children: t })
172
165
  ] }),
173
- h && /* @__PURE__ */ a(se, { children: /* @__PURE__ */ a(
174
- re,
166
+ h && /* @__PURE__ */ l(Z, { children: /* @__PURE__ */ l(
167
+ ee,
175
168
  {
176
- ref: l,
177
- onClick: n,
178
- onMouseEnter: () => l.current.focus(),
169
+ ref: i,
170
+ onClick: o,
171
+ onMouseEnter: () => i.current.focus(),
179
172
  "aria-label": "Resume playback"
180
173
  }
181
174
  ) }),
182
- /* @__PURE__ */ I(te, { children: [
183
- d && /* @__PURE__ */ a(ae, { isDesktop: i, vastUrl: d }),
184
- /* @__PURE__ */ a(oe, { children: "ADVERTISEMENT" })
185
- ] })
175
+ /* @__PURE__ */ l(se, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ L(re, { children: [
176
+ c && /* @__PURE__ */ l(ae, { isDesktop: n, vastUrl: c }),
177
+ /* @__PURE__ */ l(te, { children: "ADVERTISEMENT" })
178
+ ] }) })
186
179
  ] }) });
187
- }, ie = ({ showPauseAd: e, vastUrls: s, title: t, caption: n, sdk: r, onClose: d, onRender: c, options: i, isDesktop: h }) => {
188
- const l = (i == null ? void 0 : i.pauseAdDelay) ?? 5e3, [f, g] = R(!1), [y, v] = R(!1), u = D(), o = s == null ? void 0 : s[0].url, m = D(o);
189
- m.current = o;
190
- const [P, w] = V(), S = L(() => {
191
- d && (k.emit("exposedPauseAd", {
180
+ }, ne = ({ showPauseAd: e, vastUrls: s, title: t, caption: o, sdk: r, onClose: c, onRender: d, options: n, isDesktop: h }) => {
181
+ const i = (n == null ? void 0 : n.pauseAdDelay) ?? 5e3, [y, g] = R(!1), [f, v] = R(!1), u = D(), a = s == null ? void 0 : s[0].url, p = D(a);
182
+ p.current = a;
183
+ const [P, b] = V(), S = I(() => {
184
+ c && (k.emit("exposedPauseAd", {
192
185
  action: "closed",
193
186
  payload: {}
194
- }), d());
195
- }, [d]), A = L(() => {
187
+ }), c());
188
+ }, [c]), A = I(() => {
196
189
  r.controlVideoPlayer({ play: !0 });
197
190
  }, [r]);
198
191
  return T(() => {
199
- if (e && o) {
192
+ if (e && a) {
200
193
  k.emit("exposedPauseAd", {
201
194
  action: "enabled",
202
195
  payload: {}
203
- }), P(o).then((x) => {
204
- m.current === o && (x == null ? void 0 : x.success) !== !0 && (clearTimeout(u.current), S == null || S());
196
+ }), P(a).then((x) => {
197
+ p.current === a && (x == null ? void 0 : x.success) !== !0 && (clearTimeout(u.current), S == null || S());
205
198
  }).catch(() => {
206
- m.current === o && (clearTimeout(u.current), S == null || S());
199
+ p.current === a && (clearTimeout(u.current), S == null || S());
207
200
  });
208
201
  const C = () => {
209
- const x = w.get()[m.current];
202
+ const x = b.get()[p.current];
210
203
  x != null && x.imageSrc ? (clearTimeout(u.current), v(!1), g(!0)) : u.current = setTimeout(() => {
211
204
  C();
212
205
  }, 200);
213
206
  };
214
207
  u.current = setTimeout(() => {
215
208
  C();
216
- }, l);
209
+ }, i);
217
210
  } else
218
211
  k.emit("exposedPauseAd", {
219
212
  action: "disabled",
@@ -224,61 +217,61 @@ const O = {}, W = new z(), b = F(O), E = K("ui:gam-static"), U = (e) => new Prom
224
217
  return () => {
225
218
  u.current && clearTimeout(u.current);
226
219
  };
227
- }, [w, P, S, l, e, o]), T(() => {
228
- c == null || c({ rendered: f });
229
- }, [f, c]), T(() => () => {
230
- c == null || c({ rendered: !1 });
231
- }, [c]), f ? /* @__PURE__ */ a(
232
- ne,
220
+ }, [b, P, S, i, e, a]), T(() => {
221
+ d == null || d({ rendered: y });
222
+ }, [y, d]), T(() => () => {
223
+ d == null || d({ rendered: !1 });
224
+ }, [d]), y ? /* @__PURE__ */ l(
225
+ oe,
233
226
  {
234
227
  onClose: S,
235
- isClosing: y,
228
+ isClosing: f,
236
229
  title: t,
237
- caption: n,
230
+ caption: o,
238
231
  onPlay: A,
239
- vastUrl: o,
240
- options: i,
232
+ vastUrl: a,
233
+ options: n,
241
234
  isDesktop: h
242
235
  }
243
236
  ) : null;
244
- }, le = ({
237
+ }, ie = ({
245
238
  showPauseAd: e,
246
239
  pauseAdVastUrl: s,
247
240
  videoPlayerController: t,
248
- onRenderPauseAd: n,
241
+ onRenderPauseAd: o,
249
242
  onClosePauseAd: r,
250
- children: d,
251
- options: c
243
+ children: c,
244
+ options: d
252
245
  }) => {
253
- const i = q(), h = G(), l = D();
254
- return T(() => i ? (t && (l.current = t, i.addVideoPlayerController(l.current)), () => {
255
- l.current && i.removeVideoPlayerController(l.current);
246
+ const n = N(), h = j(), i = D();
247
+ return T(() => n ? (t && (i.current = t, n.addVideoPlayerController(i.current)), () => {
248
+ i.current && n.removeVideoPlayerController(i.current);
256
249
  }) : () => {
257
- }, [i, t]), i ? /* @__PURE__ */ a("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ I(
258
- N,
250
+ }, [n, t]), n ? /* @__PURE__ */ l("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ L(
251
+ q,
259
252
  {
260
- style: d ? { position: "relative" } : {},
253
+ style: c ? { position: "relative" } : {},
261
254
  customTheme: h.theme,
262
255
  themeMode: h.themeMode,
263
256
  children: [
264
- d,
265
- s && /* @__PURE__ */ a(
266
- ie,
257
+ c,
258
+ s && /* @__PURE__ */ l(
259
+ ne,
267
260
  {
268
- sdk: i,
261
+ sdk: n,
269
262
  showPauseAd: e,
270
263
  vastUrls: s,
271
264
  onClose: r,
272
- onRender: n,
273
- options: c,
265
+ onRender: o,
266
+ options: d,
274
267
  isDesktop: !0
275
268
  }
276
269
  )
277
270
  ]
278
271
  }
279
- ) }) : d;
272
+ ) }) : c;
280
273
  };
281
- class Ae extends $ {
274
+ class ye extends O {
282
275
  constructor(s) {
283
276
  super(s), this.state = { hasError: !1 };
284
277
  }
@@ -289,9 +282,9 @@ class Ae extends $ {
289
282
  console.error(s, t.componentStack);
290
283
  }
291
284
  render() {
292
- return this.state.hasError ? this.props.children : /* @__PURE__ */ a(le, { ...this.props });
285
+ return this.state.hasError ? this.props.children : /* @__PURE__ */ l(ie, { ...this.props });
293
286
  }
294
287
  }
295
288
  export {
296
- Ae as StreamLayerPauseAd
289
+ ye as StreamLayerPauseAd
297
290
  };
@@ -1,6 +1,5 @@
1
1
  import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
2
  import { useState as u, useEffect as d } from "react";
3
- import "@nanostores/react";
4
3
  import "nanostores";
5
4
  import { s as a, B as y, m as h, f as S, e as f, F as c, i as r, u as v, d as g, h as k } from "./provider.js";
6
5
  import "lodash.throttle";
@@ -68,10 +67,10 @@ const I = /* @__PURE__ */ a("div")({
68
67
  return null;
69
68
  const e = s.getFeature(A.GAMES);
70
69
  return e ? /* @__PURE__ */ t(C, { gamification: e }) : null;
71
- }, V = ({ theme: s }) => {
70
+ }, R = ({ theme: s }) => {
72
71
  const e = v(), o = g();
73
72
  return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(k, { customTheme: s ?? o.theme, themeMode: o.themeMode, children: /* @__PURE__ */ t(j, { sdk: e }) }) }) : null;
74
73
  };
75
74
  export {
76
- V as StreamLayerSDKPoints
75
+ R as StreamLayerSDKPoints
77
76
  };