1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6769],{10418:function(e,t,i){"use strict";!function(t,i){e.exports=i()}("undefined"!=typeof self?self:i.g,function(){return(("undefined"!=typeof self?self:i.g).webpackChunkSmartLibModule=("undefined"!=typeof self?self:i.g).webpackChunkSmartLibModule||[]).push([[256],{7575:function(e,t,i){i.r(t),i.d(t,{AdBreakTracker:function(){return p},AdDataTracker:function(){return u},AdEventTracker:function(){return S},AdFriendlyObstructionPurpose:function(){return E.D6},AdManager:function(){return E.X2},AdMetrics:function(){return a},AdMetricsBuilder:function(){return r},AdMetricsManager:function(){return y},AdSession:function(){return f.A},AdTracker:function(){return g},AdTrackingManager:function(){return A},AdType:function(){return E.eQ},AdViewState:function(){return E.up},InternalAdManager:function(){return D.A},OMSDKManager:function(){return R},OMSessionHandler:function(){return T}});var s=i(3445);class a{adSkippable;adSkipped;adProgress;adDuration;stallsNumber;stallsDuration;layerSwitchesNumber;averageBitrate;creativeId;adId;adIndex;adCount;adFormat;impressionDate;constructor(e){void 0===e?(this.adSkippable=!1,this.adSkipped=!1,this.adProgress=-1,this.adDuration=0,this.stallsNumber=0,this.stallsDuration=0,this.layerSwitchesNumber=0,this.averageBitrate=0,this.creativeId="",this.adId="",this.adIndex=-1,this.adCount=-1,this.adFormat="",this.impressionDate=-1):(this.adSkippable=e.adSkippable,this.adSkipped=e.adSkipped,this.adProgress=e.adProgress,this.adDuration=e.adDuration,this.stallsNumber=e.stallsNumber,this.stallsDuration=e.stallsDuration,this.layerSwitchesNumber=e.layerSwitchesNumber,this.averageBitrate=e.averageBitrate,this.creativeId=e.creativeId,this.adId=e.adId,this.adIndex=e.adIndex,this.adCount=e.adCount,this.adFormat=e.adFormat,this.impressionDate=e.impressionDate)}static merge(e){if(void 0!==e&&e.length>0){let t=new a,i=e[e.length-1];t.adSkippable=i.adSkippable,t.adSkipped=i.adSkipped,t.adProgress=i.adProgress,t.creativeId=i.creativeId,t.adId=i.adId;let s=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];t.adDuration+=a.adDuration,t.stallsNumber+=a.stallsNumber,t.stallsDuration+=a.stallsDuration,t.layerSwitchesNumber+=a.layerSwitchesNumber,s+=a.averageBitrate*a.adDuration,r+=a.adDuration}return 0!==r&&(t.averageBitrate=Math.round(s/r)),t}}toString(){return"\n{ adSkippable="+this.adSkippable+"\n adSkipped="+this.adSkipped+"\n adProgress="+this.adProgress+"\n adDuration="+this.adDuration+"\n stallsNumber="+this.stallsNumber+"\n stallsDuration="+this.stallsDuration+"\n layerSwitchesNumber="+this.layerSwitchesNumber+"\n averageBitrate="+this.averageBitrate+"\n creativeId='"+this.creativeId+"'\n adId='"+this.adId+"'\n adIndex="+this.adIndex+"\n adCount="+this.adCount+"\n adFormat='"+this.adFormat+"'\n impressionDate="+this.impressionDate+" ("+s.A.formatTime(this.impressionDate)+")\n}"}}class r{adMetrics;timeSpentPerLayer;quartiles;constructor(e,t,i){void 0===e&&void 0===t&&void 0===i?(this.timeSpentPerLayer={},this.quartiles={},this.reset()):(this.adMetrics=e,this.timeSpentPerLayer=t,this.quartiles=i)}isInitialized(){return""!==this.adMetrics.adId}import(e){return void 0!==e&&1===e.length&&e[0].impressionDate<=0&&(this.adMetrics=e[0]),this.adMetrics.impressionDate=Date.now(),this}setAdSkippable(e){return this.adMetrics.adSkippable=e,this}setAdSkipped(e){return this.adMetrics.adSkipped=e,this}addProgress(e){return this.quartiles[e]=!0,this.adMetrics.adProgress=Math.max(this.adMetrics.adProgress,e),this}init(e,t,i){return this.adMetrics.adFormat=e,this.adMetrics.adIndex=t,this.adMetrics.adCount=i,this}setCreativeId(e){return this.adMetrics.creativeId=e,this}setAdId(e){return this.adMetrics.adId=e,this}addTimeSpentPerLayer(e,t){return(e=Math.round(e))>0&&(void 0!==this.timeSpentPerLayer[e]?this.timeSpentPerLayer[e]+=t:this.timeSpentPerLayer[e]=t),this}addLayerSwitch(){return this.adMetrics.layerSwitchesNumber++,this}addStall(e){return this.adMetrics.stallsNumber++,this.adMetrics.stallsDuration+=e,this}reset(){return this.adMetrics=new a,this.timeSpentPerLayer={},this.quartiles={},this}
1clone(){return new r(new a(this.adMetrics),Object.assign({},this.timeSpentPerLayer),Object.assign({},this.quartiles))}build(){let e=0,t=0;for(let i in this.timeSpentPerLayer){let s=this.timeSpentPerLayer[i];e+=i*s,t+=s}return 0!==t&&(this.adMetrics.averageBitrate=Math.round(e/t)),this.adMetrics.adDuration=t,this.adMetrics}}var n=i(8379),o=i(1142),d=i(1134),h=i(6506);let l="BpkAdTracker";class c{proceeded;constructor(){this.proceeded={},this.prepared=!1}canProcess(e=0){let t=void 0===this.proceeded[e];return t&&(this.proceeded[e]=Date.now()),t}resetProcess(){this.proceeded={}}}class u{adTrackingManager;sessionToken;timeReference;adBreaks;constructor(e,t,i){this.adTrackingManager=e,this.sessionToken=t,this.timeReference=i,this.adBreaks=[]}hasRemainingAdBreaks(e){return void 0!==this.adBreaks.find(t=>e<t.position+t.duration)}resetProgression(e){this.adBreaks.forEach(t=>t.resetProgression(e))}}class p extends c{adData;id;position;duration;live;ads;constructor(e,t,i,s,a){super(),this.adData=e,this.id=t,this.position=i,this.duration=s,this.live=a,this.ads=[]}resetProgression(e){e<=this.position&&this.resetProcess(),this.ads.forEach(t=>t.resetProgression(e))}processPrepare(){let e=this.adData.adTrackingManager,t=e.handler.adSession?.adEventsListener;!1===this.prepared&&void 0!==t?.onPrepareAdBreak&&(t.onPrepareAdBreak(this.toData()),this.prepared=!0)}processBegin(){if(!this.canProcess(0))return;let e=this.adData.adTrackingManager;n.g.d(l,"Processing ad break begin...",e.handler.id),n.g.d(l,"Duration: "+this.duration+"ms",e.handler.id),e.notifyAdBreakData(this),e.notifyAdBreakBegin(this.adData.sessionToken);let t=e.handler.adSession?.adEventsListener;this.processPrepare(),t?.onAdBreakBegin(this.toData())}processEnd(){if(!this.canProcess(1))return;let e=this.adData.adTrackingManager;n.g.d(l,"Processing ad break end...",e.handler.id),e.notifyAdBreakEnd(this.adData.sessionToken);let t=e.handler.adSession?.adEventsListener;t?.onAdBreakEnd(this.toData()),this.resetProcess(),this.prepared=!1}resetProcess(){super.resetProcess(),this.ads.forEach(e=>e.resetProcess())}toData(){return{id:this.id,startPosition:this.position||0,duration:!0===this.live?-1:this.duration,ads:this.ads.map(e=>e.toData()),adCount:!0===this.live?-1:this.ads.length}}}class g extends c{adType;adBreak;index;position;duration;skippablePosition;skippable;creativeId;adId;events;clickable;verifications;watched;progression;nonLinearInfo;errorURL;constructor(e,t,i,s,a,r,n,o,d,h,l,c,u){super(),this.adType=e,this.adBreak=t,this.index=i,this.position=s,this.duration=a,this.skippable=r,this.skippablePosition=n,this.creativeId=o,this.adId=d,this.events=[],this.clickable=h,this.verifications=l,this.watched=[],this.progression=0,this.nonLinearInfo=c,this.errorURL=u}flatWatched(){let e=JSON.parse(JSON.stringify(this.watched)).slice(0),t=[],i=null;t.push((e=e.sort((e,t)=>e[0]>t[0]?1:e[0]<t[0]?-1:0))[0]);for(let s=1;s<e.length;s++)(i=t[t.length-1])[1]<e[s][0]?t.push(e[s]):i[1]<e[s][1]&&(i[1]=e[s][1],t.pop(),t.push(i));this.watched=t}resetProgression(e){e<=this.position&&(this.watched=[],this.progression=0,this.resetProcess()),this.events.forEach(t=>t.resetProgression(e))}updateProgression(e,t){if(e>t||e<this.position||t<this.position||e>this.position+this.duration||t>this.position+this.duration)return;let i=this.watched.reduce((e,t)=>e+(t[1]-t[0]),0)/this.duration;this.watched.push([e-this.position,t-this.position]),this.flatWatched();let s=this.watched.reduce((e,t)=>e+(t[1]-t[0]),0)/this.duration;this.progression=s;let a=this.adBreak.adData,r=a.adTrackingManager;i<=.25&&s>=.25&&r.notifyAdProgress(a.sessionToken,this,25),i<=.5&&s>=.5&&r.notifyAdProgress(a.sessionToken,this,50),i<=.75&&s>=.75&&r.notifyAdProgress(a.sessionToken,this,75),this.events.forEach(e=>e.processEvents(i,s)),1===i&&1===s?n.g.d(l,"Ad already seen (100%)",r.handler.id):n.g.d(l,"Ad progressed from "+Math.floor(1e5*i)/1e3+"% to "+Math.floor(1e5*s)/1e3+"%",r.handler.id)}processPrepare(){let e=this.adBreak.adData.adTrackingManager,t=e.handler.adSession?.adEventsListener;!1===this.prepared&&void 0!==t?.onPrepareAd&&(t.onPrepareAd(this.toData(),this.adBreak.toData()),this.prepared=!0)}processBegin(){if(!this.canProcess(0))return;let e=this.adBreak.adData,t=e.adTrackingManager;n.g.d(l,"Processing ad begin "+this.adId+"...",t.handler.id),n.g.d(l,"Start: "+this.position+"ms",t.handler.id),n.g.d(l,"End : "+(this.position+this.duration)+"ms",t.handler.id),n.g.d(l,"Duration: "+this.duration+"ms",t.handler.id),n.g.d(l,"Type: "+this.adType,t.handler.id),t.notifyAdData(this),t.notifyAdBegin(e.sessionToken,this),!0===this.skippable&&t.notifyAdSkippable(e.sessionToken,this.skippablePosition,this.position+this.duration,this.adBreak.position+this.adBreak.duration),t.notifyAdProgress(e.sessionToken,this,0);let i=t.handler.adSession?.adEventsListener,s=this.toData(),a=this.adBreak.toData();this.processPrepare(),t.handler?.omSessionHandler&&(s.omAdSessionId=t.handler.omSessionHandler.omAdSession?.adSession?.getAdSessionId(),t.currentAdData=s),i?.onAdBegin(s,a),!0===this.skippable&&i?.onAdSkippable(s,a,this.skippablePosition,this.position+this.duration,this.adBreak.position+this.adBreak.duration)}processEnd(){if(!this.canProcess(1))return;let e=this.adBreak.adData,t=e.adTrackingManager;n.g.d(l,"Processing ad end "+this.adId+"...",t.handler.id),this.progression>=.95&&(this.updateProgression(this.position,this.position+this.duration),t.notifyAdProgress(e.sessionToken,this,100)),t.notifyAdEnd(e.sessionToken,this);let i=t.handler.adSession?.adEventsListener;i?.onAdEnd(this.toData(),this.adBreak.toData()),this.resetProcess(),this.prepared=!1}getNonLinearResources(e){return this.nonLinearInfo.filter(t=>""!==t[e]).map(t=>({url:t[e],parameters:t.adParameters}))}toData(){return{adType:this.adType,index:this.index,creativeId:this.creativeId,adId:this.adId,startPosition:this.position,skipPosition:this.skippablePosition,duration:this.duration,clickURL:this.clickable.uri,nonLinearIframeResources:this.getNonLinearResources("iframeResource"),nonLinearStaticResources:this.getNonLinearResources("staticResource")}}}class S extends c{ad;type;url;offset;position;progression;constructor(e,t,i,s,a){super(),this.ad=e,this.type=t,this.url=i,this.offset=s,this.position=a,this.progression=0,this.processProgression()}resetProgression(e){e<=this.ad.position&&this.resetProcess()}processProgression(){switch(void 0!==this.type?this.type.toLowerCase():void 0){case void 0:this.progression=(this.position-this.ad.position)/this.ad.duration;break;case"start":case"impression":this.progression=0;break;case"firstquartile":this.progression=.25;break;case"midpoint":this.progression=.5;break;case"thirdquartile":this.progression=.75;break;case"complete":this.progression=1;break;case"progress":this.progression=this.offset/this.ad.duration}}processEvents(e,t){let i=this.ad.adBreak.adData.adTrackingManager;if(e<=this.progression&&this.progression<=t){if(!this.canProcess())return!1;n.g.d(l,"Processing "+(this.type||"timed event")+" ("+Math.floor(100*this.progression)+"%)...",i.handler.id),void 0!==this.url&&this.url.length>0&&(n.g.d(l,"Requesting "+this.url,i.handler.id),h.A.getInstance().adEvent(i.handler,this.url))}return!0}}var E=i(5690);let m="BpkAdTrackingMgr";class A{static POSITION_UPDATE_INTERVAL=1e3;static POSITION_START_DELTA=4e3;static POSITION_SEEK_ERROR_DELTA=6e3;static POSITION_PREPARE_DELTA=3e3;static SESSION_UPDATE_INTERVAL=5e3;static NEAR_AD_DELTA=1.2*this.POSITION_UPDATE_INTERVAL;handler;playerAdapter;listeners;adData;adList;updatePositionJob;updateSessionJob;started;paused;buffering;lastPosition;lastPositionBeforePause;lastPositionAfterSeek;firstImageDate;currentAdTracker;currentAdBreakTracker;currentAdData;currentAdBreakData;adPalSession;bkYouSession;sessionToken;baseURL;nonce;adPalSessionRequest;firstFileReceived;firstFileProceeded;
1podsSentNumber;sessionUpdateInterval;positionHistory;constructor(e,t){this.handler=e,this.playerAdapter=t,this.listeners=[],this.adData=void 0,this.adList=[],this.updatePositionJob=void 0,this.updateSessionJob=void 0,this.started=!1,this.paused=!1,this.buffering=!1,this.lastPosition=0,this.lastPositionBeforePause=0,this.lastPositionAfterSeek=0,this.bkYouSession=!1,this.baseURL=void 0,this.nonce=void 0,this.adPalSessionRequest=void 0,this.firstFileReceived=!1,this.firstFileProceeded=!1,this.podsSentNumber=0,this.sessionUpdateInterval=A.SESSION_UPDATE_INTERVAL,this.positionHistory=[]}initBkYouSession(e,t,i,s,a){this.baseURL=e,this.sessionToken=t,this.bkYouSession=!0,void 0!==s&&(this.adPalSession=s,this.nonce=a),this.parseAdPods(i),n.g.d(m,"BkYou session initialized",this.handler.id)}updateBkYouSession(){if(!0!==this.handler.stopped&&!0===this.bkYouSession){n.g.d(m,"Updating ad tracking file...",this.handler.id);let e=this.baseURL,t={userAgent:this.handler.smartLib.getParameters().userAgent};h.A.getInstance().adTracking(this.handler,t,e,!0).then(e=>{if(!0!==this.handler.stopped){if(void 0!==this.updateSessionJob&&d.A.getInstance().cancel(this.updateSessionJob),e.httpStatus>=200&&e.httpStatus<300){let t;try{t=JSON.parse(e.content)}catch(e){return n.g.d(m,"Ad tracking updated file unreadable",this.handler.id),void(!0===this.firstFileReceived&&(this.updateSessionJob=d.A.getInstance().asyncDelay(this.sessionUpdateInterval,()=>{this.updateSessionJob=void 0,this.updateBkYouSession()})))}this.firstFileReceived=!0,this.parseAdPods(t),this.isLive()?this.updateSessionJob=d.A.getInstance().asyncDelay(this.sessionUpdateInterval,()=>{this.updateSessionJob=void 0,this.updateBkYouSession()}):n.g.d(m,"Stopping ad tracking file update (VOD stream)...",this.handler.id)}else n.g.d(m,"Stopping ad tracking file update (status code "+e.httpStatus+")",this.handler.id)}})}}fixAdBreak(e){let t;e.ads.forEach((i,s)=>{let a=e.ads[s+1];void 0!==a&&a.position<i.position+i.duration&&(a.position=i.position+i.duration,a.events.filter(e=>e.position<a.position).forEach(e=>{e.position=a.position})),t=i}),void 0!==t&&(e.duration=t.position+t.duration-e.position)}parseAdPods(e){let t=e.sessiontoken||"",i=e.timereference_ms||0,s=e.refresh_delay_ms||A.SESSION_UPDATE_INTERVAL;s>=2e3&&s<=A.SESSION_UPDATE_INTERVAL?(this.sessionUpdateInterval=s,n.g.d(m,"Setting refresh delay to "+this.sessionUpdateInterval+"ms",this.handler.id)):n.g.d(m,"Setting refresh delay to "+A.SESSION_UPDATE_INTERVAL+"ms (default value)",this.handler.id);let a=new u(this,t,i),r=e.adpods;Array.isArray(r)&&(r.forEach(e=>{let t=e.id||"",s=e.starttime_ms+i,r=e.duration_ms||0,n=e.ads,o=new p(a,t,s,r,this.isLive());Array.isArray(n)&&n.forEach((e,t)=>{let s=e.starttime_ms+i,a=e.duration_ms,r=e.trackingevents,n=!0;if(Array.isArray(r)&&r.length>0&&(n=s>0&&r[0].time_ms>0||0===s),void 0!==s&&void 0!==a&&!0===n){let n=E.eQ.getAdType(e.adtype),d=e.skippable_ms+i||0,h=0!==d&&null!=d,l=e.creativeid||"",c=e.adid+"-"+s||"",u={uri:e.videoclicks?.clickthroughurl||"",trackers:e.videoclicks?.clicktracking||[],customClick:e.videoclicks?.customclick||[]},p=e.adverifications||[],m=[];p.forEach(e=>{m.push({vendor:e.vendor||"",javascriptResources:e.javascriptresources||[],executableResources:e.executableresources||[],trackingEvents:e.trackingevents||[],verificationParameters:e.verificationparameters||""})});let A=e.nonlinearinfo||[],v=[];A.forEach(e=>{v.push({staticResource:e.staticresource||"",iframeResource:e.iframeresource||"",adParameters:e.adparameters||"",trackingEvents:e.trackingevents||[]})});let y=new g(n,o,t,s,a,h,d,l,c,u,m,v,e.errorurl||"");o.ads.push(y),Array.isArray(r)&&r.forEach(e=>{let t=e.callbackurl;if(void 0!==t){let a=new S(y,e.type,t,e.offset_ms,e.time_ms+i||s);y.events.push(a)}})}}),o.ads.length>0&&a.adBreaks.push(o)}),a.adBreaks.forEach(e=>{this.fixAdBreak(e)}));let o=this.mergeEvents(a);this.adList=this.adData.adBreaks.map(e=>e.toData()),this.notifyAdDataListener(o)}start(e=A.POSITION_UPDATE_INTERVAL,t){void 0===this.updatePositionJob&&(this.updatePositionJob=d.A.getInstance().asyncDelay(e,()=>{this.updatePositionJob=void 0,this.onPositionUpdated(void 0!==t?t:this.playerAdapter.getPosition())}))}stop(){void 0!==this.updatePositionJob&&(n.g.d(m,"Ad tracking paused (player event)",this.handler.id),d.A.getInstance().cancel(this.updatePositionJob),this.updatePositionJob=void 0)}isLive(){return void 0!==this.firstImageDate&&0>=this.playerAdapter.getDuration()}mergeEvents(e){let t=!1;if(void 0===this.adData)this.adData=e,n.g.d(m,e.adBreaks.length+" ad break(s) parsed",this.handler.id),t=!0;else{let i=0,s=0;this.adData.sessionToken=e.sessionToken,this.adData.timeReference=e.timeReference;let a=e.adBreaks.map(e=>e.id);this.adData.adBreaks.forEach((e,i,r)=>{a.includes(e.id)||this.currentAdTracker?.adBreak.id===e.id||(r.splice(i,1),s++,t=!0)}),e.adBreaks.forEach((e,s)=>{e.adData=this.adData;let a=this.adData.adBreaks.find(t=>
1t.id===e.id);if(void 0!==a){e.ads.filter(e=>void 0===a.ads.find(t=>t.adId===e.adId)).forEach(e=>{let s=a.ads.findIndex(t=>t.position>e.position);-1===s?a.ads.push(e):a.ads.splice(s,0,e),i++,t=!0});let r=a.duration;this.fixAdBreak(a),r!==a.duration&&n.g.d(m,"Ad break "+(s+1)+"/"+this.adData.adBreaks.length+": updated duration from "+r+" to "+a.duration,this.handler.id)}else this.adData.adBreaks.push(e),i+=e.ads.length,t=!0}),n.g.d(m,this.adData.adBreaks.length+" ad break(s) in total, "+e.adBreaks.length+" ad break(s) parsed, "+i+" new ad(s), "+s+" deleted ad(s)",this.handler.id)}if(this.notifyAdsUpdated(this.adData),this.started&&!this.paused&&!this.buffering){let e=this.playerAdapter.getPosition();void 0===this.updatePositionJob&&this.adData.hasRemainingAdBreaks(e)>0&&(n.g.d(m,"Ad tracking resumed",this.handler.id),this.lastPosition=e),this.checkStart(),this.isLive()&&this.checkAdBreakEnded(e)}return t}onPositionUpdated(e){let t=this.lastPosition!==e?this.lastPosition:e-1,i=e;if(!0===this.firstFileReceived&&!1===this.firstFileProceeded&&(this.firstFileProceeded=!0,n.g.d(m,"Processing all events since first image...",this.handler.id),void 0===this.positionHistory[this.positionHistory.length-1].end&&(this.positionHistory[this.positionHistory.length-1].end=e),this.positionHistory.forEac
1h(e=>{n.g.d(m,"Between "+e.start+" and "+e.end,this.handler.id),this.lastPosition=e.start;for(let t=e.start;t<=e.end+A.POSITION_UPDATE_INTERVAL;t+=A.POSITION_UPDATE_INTERVAL){let i=Math.min(t,e.end);this.onPositionUpdated(i),this.lastPosition=i}}),n.g.d(m,"Tracking catch-up finished",this.handler.id)),t<i&&i-t<A.POSITION_SEEK_ERROR_DELTA){let s=this.adData?.adBreaks.find(e=>e.position<=i&&i<e.position+e.duration),a=this.adData?.adBreaks.find(e=>e.position<=i+A.POSITION_PREPARE_DELTA&&i+A.POSITION_PREPARE_DELTA<e.position+e.duration),r=s?.ads.find(e=>e.position<=i&&i<e.position+e.duration),o=a?.ads.find(e=>e.position<=i+A.POSITION_PREPARE_DELTA&&i+A.POSITION_PREPARE_DELTA<e.position+e.duration);if(a?.processPrepare(),o?.processPrepare(),void 0!==r){if(void 0===this.currentAdTracker){n.g.d(m,"Entering ad "+r.adId+"...",this.handler.id);let e=t-r.position>=A.POSITION_SEEK_ERROR_DELTA;e||(n.g.d(m,"Update position start from "+t+" to "+r.position,this.handler.id),t=r.position),this.currentAdData=r.toData(),this.currentAdBreakData=s.toData(),s.processBegin(),r.processBegin(),r.updateProgression(t,i),e&&(n.g.d(m,"Ad skipped (previous position was "+A.POSITION_SEEK_ERROR_DELTA+"ms after ad start)",this.handler.id),this.notifyAdSkipped(this.adData.sessionToken,r))}else this.currentAdTracker===r?r.updateProgression(t,i):this.currentAdTracker!==r&&(n.g.d(m,"Changing from ad "+this.currentAdTracker.adId+" to "+r.adId+"...",this.handler.id),r.adBreak.id===this.currentAdTracker.adBreak.id&&this.currentAdTracker.updateProgression(t,this.currentAdTracker.position+this.currentAdTracker.duration),this.currentAdTracker.progression<1&&(n.g.d(m,"Ad skipped (progression not complete)",this.handler.id),this.notifyAdSkipped(this.adData.sessionToken,this.currentAdTracker)),this.currentAdTracker.processEnd(),r.adBreak.id!==this.currentAdTracker.adBreak.id?(this.currentAdTracker.adBreak.processEnd(),this.currentAdData=r.toData(),this.currentAdBreakData=s.toData(),s.processBegin()):this.currentAdData=r.toData(),r.processBegin(),i-r.position>=A.POSITION_SEEK_ERROR_DELTA?(n.g.d(m,"Ad skipped (new position is "+A.POSITION_SEEK_ERROR_DELTA+"ms after ad start)",this.handler.id),this.notifyAdSkipped(this.adData.sessionToken,r)):r.updateProgression(r.position,i));this.currentAdTracker=r,this.currentAdBreakTracker=s}else void 0!==this.currentAdTracker&&(n.g.d(m,"Exiting ad "+this.currentAdTracker.adId+"...",this.handler.id),i-(this.currentAdTracker.position+this.currentAdTracker.duration)<A.POSITION_UPDATE_INTERVAL&&(i=this.currentAdTracker.position+this.currentAdTracker.duration),t>=this.currentAdTracker.position&&this.currentAdTracker.updateProgression(t,i),this.currentAdTracker.progression<1&&(n.g.d(m,"Ad skipped (progression not complete)",this.handler.id),this.notifyAdSkipped(this.adData.sessionToken,this.currentAdTracker)),this.currentAdTracker.processEnd(),void 0!==s||this.isLive()||(this.currentAdBreakTracker.processEnd(),this.currentAdBreakTracker=void 0,this.currentAdBreakData=void 0),this.currentAdTracker=void 0,this.currentAdData=void 0);if(this.lastPosition=e,this.adData?.hasRemainingAdBreaks(i)){if(this.paused||this.buffering)n.g.d(m,"Ad tracking paused (playback paused, onPositionUpdated)",this.handler.id);else{let t,i=A.POSITION_UPDATE_INTERVAL;if(void 0!==o){let s=o.position-e;s>0&&s<A.NEAR_AD_DELTA&&(i=s,t=o.position,n.g.getInstance().printDebugLogs(m,"Ad incoming in "+s+"ms",this.handler.id))}if(void 0!==r){let s=r.position+r.duration-e;s>0&&s<A.NEAR_AD_DELTA&&(i=s,t=r.position+r.duration,n.g.getInstance().printDebugLogs(m,"Ad ending in "+s+"ms",this.handler.id))}i=Math.round(i),this.start(i,t)}}else n.g.d(m,"Ad tracking paused (no more event, onPositionUpdated)",this.handler.id)}else this.adData?.hasRemainingAdBreaks(i)&&(this.paused||this.buffering||(n.g.d(m,"Processing trackers from "+t+"ms to "+i+"ms, resuming tracking...",this.handler.id),this.start()))}checkStart(e=this.playerAdapter.getPosition()){this.adData?.hasRemainingAdBreaks(e)>0?this.onPositionUpdated(e):n.g.d(m,"Ad tracking paused (no more event, checkStart)",this.handler.id)}checkAdBreakEnded(e){let t=this.lastPosition!==e?this.lastPosition:e-1,i=e;
1if(t<i&&i-t<A.POSITION_SEEK_ERROR_DELTA){let e=this.adData?.adBreaks.find(e=>e.position<=i&&i<e.position+e.duration);void 0!==this.currentAdBreakTracker&&(void 0===e?(void 0!==this.currentAdTracker&&this.currentAdTracker.position+this.currentAdTracker.duration-i<A.POSITION_SEEK_ERROR_DELTA&&(this.currentAdTracker.updateProgression(this.currentAdTracker.position,this.currentAdTracker.position+this.currentAdTracker.duration),this.currentAdTracker.processEnd(),this.currentAdTracker=void 0,this.currentAdData=void 0),this.currentAdBreakTracker.processEnd(),this.currentAdBreakTracker=void 0,this.currentAdBreakData=void 0,n.g.d(m,"Ad break end detected",this.handler.id)):n.g.d(m,"Ad break not yet ended",this.handler.id))}}adUserInteraction(e){this.currentAdTracker?.clickable?.trackers.forEach(e=>{n.g.d(m,"Requesting click tracker "+e.clickurl,this.handler.id),h.A.getInstance().adEvent(this.handler,e.clickurl)})}getCurrentAd(){return this.currentAdData}getCurrentAdBreak(){return this.currentAdBreakData}getPositionForBookmark(){if(this.playerAdapter.getDuration()>0){let e=this.playerAdapter.getPosition(),t=this.adList.find(t=>t.startPosition<e&&e<=t.startPosition+t.duration);return void 0!==t&&(e=t.startPosition),this.adList.filter(t=>t.startPosition+t.duration<e).forEach(t=>{e-=t.duration}),e}return -1}getPositionForPlayback(e,t){let i,s=e;for(let e of this.adList.sort((e,t)=>e.startPosition-t.startPosition)){if(e.startPosition>s)break;s+=e.duration,i=e}return!0===t&&void 0!==i&&s===i.startPosition+i.duration?i.startPosition:s}onFirstImage(e,t){this.started=!0,this.paused=!1,this.buffering=!1,this.lastPosition=t,this.firstImageDate=Date.now(),this.positionHistory.push({start:t}),n.g.d(m,"Ad tracking enabled (live:"+this.isLive()+")",this.handler.id),void 0!==this.adData&&(this.adList=this.adData.adBreaks.map(e=>(e.live=this.isLive(),e.toData()))),this.checkStart(t),this.updateBkYouSession(),this.isLive()&&12623004e5>this.playerAdapter.getPosition()&&n.g.e(m,"The player position does not return a position as a timestamp in millis. The ad tracking might not work.",this.handler.id),this.adPalSession?.sendPlaybackStart()}onPause(){let e=this.playerAdapter.getPosition();this.buffering||this.firstFileProceeded||(this.positionHistory[this.positionHistory.length-1].end=e),this.paused=!0,this.stop(),this.lastPosition!==e?this.onPositionUpdated(e):n.g.d(m,"Ignoring player position "+e+", already proceeded...",this.handler.id),this.lastPosition=e,this.lastPositionBeforePause=this.lastPosition}onResume(){this.paused=!1,this.buffering||(this.lastPosition=this.playerAdapter.getPosition(),!1===this.firstFileProceeded&&this.positionHistory.push({start:this.lastPosition}),1e3>Math.abs(this.lastPosition-this.lastPositionBeforePause)&&(n.g.d(m,"Reverting position because of bad position when resuming...",this.handler.id),this.lastPosition=this.lastPositionBeforePause,this.lastPositionBeforePause=0),this.checkStart())}onBufferingStart(){let e=this.playerAdapter.getPosition();!1===this.buffering&&!1===this.firstFileProceeded&&(this.positionHistory[this.positionHistory.length-1].end=e),this.buffering=!0,this.stop(),this.lastPosition!==e?this.onPositionUpdated(e):n.g.d(m,"Ignoring player position "+e+", already proceeded...",this.handler.id),this.lastPosition=e}onBufferingEnd(e){if(this.buffering=!1,!this.paused){let e=this.playerAdapter.getPosition();!1===this.firstFileProceeded&&(this.positionHistory.length>0&&void 0===this.positionHistory[this.positionHistory.length-1].end&&(this.positionHistory[this.positionHistory.length-1].end=this.lastPosition),this.positionHistory.push({start:e})),this.lastPosition!==e&&(n.g.d(m,"Position updated during buffering, period switch ?",this.handler.id),this.onPositionUpdated(e)),1e3>Math.abs(this.lastPosition-this.lastPositionAfterSeek)&&(n.g.d(m,"Reverting position because of seek...",this.handler.id),this.lastPosition=this.lastPositionAfterSeek,this.lastPositionAfterSeek=0),this.checkStart()}}handlePlayerSeek(e,t,i){if(t<e){if(e-t<2e3)return n.g.d(m,"Ignoring seek...",this.handler.id),this.lastPosition=e,void this.onPositionUpdated(e);n.g.d(m,"Reset ad trackers with position "+t,this.handler.id),this.adData?.resetProgression(t)}else{n.g.d(m,"Small seek detected, proceeding events from "+i+" to "+t,this.handler.id);for(let e=i;e<=t;e+=A.POSITION_UPDATE_INTERVAL){let i=Math.min(e+A.POSITION_UPDATE_INTERVAL,t);n.g.d(m,"Between "+e+" and "+i,this.handler.id),this.lastPosition=e,this.onPositionUpdated(i)}}}onSeek(e,t){let i;!1===this.firstFileProceeded&&!1===this.buffering&&(this.positionHistory[this.positionHistory.length-1].end=e,this.positionHistory.push({start:t})),e<this.lastPosition&&this.lastPosition-e<A.POSITION_SEEK_ERROR_DELTA&&(n.g.d(m,"Updating seek start position from "+e+" to "+this.lastPosition,this.handler.id),e=this.lastPosition),this.buffering?(this.lastPositionAfterSeek=t,i=this.lastPosition):(Math.abs(this.lastPosition-e)<A.POSITION_SEEK_ERROR_DELTA&&(this.onPositionUpdated(e),this.lastPosition=e),i=e,this.lastPositionAfterSeek=0),this.lastPosition=t,Math.abs(t-e)<A.POSITION_SEEK_ERROR_DELTA?this.handlePlayerSeek(e,t,i):(void 0!==this.currentAdTracker&&this.notifyAdSkipped(this.adData.sessionToken,this.currentAdTracker),this.onPositionUpdated(t),n.g.d(m,"Reset ad trackers with position "+t,this.handler.id),this.adData?.resetProgression(t))}onStop(e){this.stop(),this.lastPosition=this.playerAdapter.getPosition(),this.onPositionUpdated(this.lastPosition),this.stop(),void 0!==this.updateSessionJob&&d.A.getInstance().cancel(this.updateSessionJob),this.adPalSession?.sendPlaybackEnd()}addListener(e){void 0===e||this.listeners.includes(e)||this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);-1!==t&&this.listeners.splice(t,1)}notifyEvent(e,t,i,s,a,r){"function"==typeof e[t]&&e[t](i,s,a,r)}
1notifyAdBreakData(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onAdBreakData",e)})}notifyAdBreakBegin(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onAdBreakBegin",e)})}notifyAdData(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onAdData",e)})}notifyAdBegin(e,t){this.listeners.forEach(i=>{this.notifyEvent(i,"onAdBegin",e,t.creativeId,t.adId)}),this.adPalSession?.sendAdImpression()}notifyAdSkippable(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onAdSkippable",e)})}notifyAdProgress(e,t,i){this.listeners.forEach(s=>{this.notifyEvent(s,"onAdProgress",e,t.creativeId,t.adId,i)})}notifyAdSkipped(e,t){let i=[];t.adBreak.ads.forEach(e=>{e.position>t.position&&this.lastPosition>=e.position+e.duration&&i.push(e.adId)}),this.listeners.forEach(s=>{this.notifyEvent(s,"onAdSkipped",e,t.creativeId,t.adId,i)})}notifyAdEnd(e,t){this.isLive()&&(void 0!==this.updateSessionJob&&d.A.getInstance().cancel(this.updateSessionJob),this.updateBkYouSession()),this.listeners.forEach(i=>{this.notifyEvent(i,"onAdEnd",e,t.creativeId,t.adId)})}notifyAdBreakEnd(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onAdBreakEnd",e)})}notifyAdsUpdated(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onAdsUpdated",e)})}notifyAdDataListener(e){let t=this.firstImageDate||Date.now(),i=0===this.podsSentNumber&&!1===this.firstFileProceeded&&Date.now()-t<=A.POSITION_START_DELTA;n.g.d(m,"On ad data (firstData: "+i+", dataUpdated: "+e+")",this.handler.id),!0!==i&&!0!==e||(this.podsSentNumber=this.adList.length,n.g.d(m,"On ad data (length: "+this.podsSentNumber+")",this.handler.id),this.handler.adSession?.adDataListener?.onAdData(this.adList))}}let v="BpkAdMetricsMgr";class y{handler;timeline;builder;adMetrics;firstImageDate;lastLayerBitrate;adBreakPlaying;adPlaying;adSkipped;adLastLayerSwitchDate;adLastBufferingStartDate;adBreakPosition;constructor(e){this.handler=e,this.timeline=this.handler.sessionReport.timeline,this.builder=new r,this.adMetrics={}}onStart(){this.adMetrics={},this.adLastLayerSwitchDate=0,this.firstImageDate=0,this.lastLayerBitrate=0,this.adLastBufferingStartDate=-1,this.adBreakPlaying=!1,this.adPlaying=!1,this.adSkipped=!1,this.adBreakPosition="midroll"}onFirstImage(e,t){this.lastLayerBitrate=e,this.adLastLayerSwitchDate=Date.now(),this.firstImageDate=Date.now()}onLayerSwitch(e){this.adBreakPlaying&&this.firstImageDate>0&&(this.builder.addTimeSpentPerLayer(this.lastLayerBitrate,Date.now()-this.adLastLayerSwitchDate),this.adLastLayerSwitchDate=Date.now(),this.lastLayerBitrate!==e&&this.builder.addLayerSwitch()),this.lastLayerBitrate=e}onBufferingStart(){this.adBreakPlaying&&(this.adLastBufferingStartDate=Date.now())}onStallEnd(){this.adBreakPlaying&&this.adLastBufferingStartDate>=0&&this.builder.addStall(Date.now()-this.adLastBufferingStartDate),this.adLastBufferingStartDate=-1}onRebufferingEnd(){this.adLastBufferingStartDate=-1}onSeek(e,t){this.adBreakPlaying&&(n.g.d(v,"Ad seeked from "+s.A.formatTime(e)+" to "+s.A.formatTime(t),this.handler?.id),Math.abs(t-e)<A.POSITION_SEEK_ERROR_DELTA?n.g.d(v,"Ignoring seek < "+A.POSITION_SEEK_ERROR_DELTA+"ms",this.handler?.id):(n.g.d(v,"Ad skipped (above seek threshold)",this.handler?.id),this.adSkipped=!0))}onStop(e){this.adBreakPlaying&&(this.handleAdEnd(),this.adBreakPlaying=!1)}onAdBreakData(e){1e4>Math.abs(e.position+e.duration-this.handler.playerAdapter?.getDuration())?this.adBreakPosition="postroll":Date.now()-this.firstImageDate<A.POSITION_START_DELTA?this.adBreakPosition="preroll":this.adBreakPosition="midroll",n.g.d(v,"Ad break position is "+this.adBreakPosition,this.handler?.id),this.adBreakPlaying=!0,void 0!==this.timeline&&this.timeline.pushEvent(o.A.analyticsModule?.SessionTrackerEvents.AdBreakStart)}onAdData(e){this.builder.isInitialized()&&this.adSkipped&&this.handleAdEnd();let t=!0===e.adBreak.live?-1:e.adBreak.ads.length;this.builder.reset().import(this.adMetrics[e.adId]).setCreativeId(e.creativeId).setAdId(e.adId).init(this.adBreakPosition,e.index,t),this.adSkipped=!1,this.adLastLayerSwitchDate=Date.now(),this.adPlaying=!0}onAdSkippable(e){this.builder.setAdSkippable(!0)}onAdSkipped(e,t,i,s){if(this.adSkipped=!0,s.length>0){n.g.d(v,"Ad break skipped",this.handler?.id);let e=1;
1s.forEach(t=>{this.adMetrics[t].forEach(t=>{if(t.impressionDate<=0){t.adSkipped=!0,t.adProgress=0,t.impressionDate=Date.now();let i=this.builder.adMetrics;t.adIndex=i.adIndex+e,t.adCount=i.adCount,t.adFormat=i.adFormat,e++}})})}}onAdProgress(e,t,i,s){this.builder.addProgress(s),s>0&&void 0===this.builder.quartiles[s-25]&&(n.g.d(v,"Ad skipped (no previous progress)",this.handler?.id),this.adSkipped=!0)}onAdEnd(e,t,i){this.handleAdEnd(),this.adPlaying=!1}onAdBreakEnd(e){!0===this.adPlaying&&(this.builder.setAdSkipped(!0),this.handleAdEnd()),this.adBreakPlaying=!1,void 0!==this.timeline&&this.timeline.pushEventProgress(o.A.analyticsModule?.SessionTrackerEvents.AdBreakStop,0)}onKeepaliveSessionReportUpdateRequested(e){if(this.adBreakPlaying){let e=this.builder.clone().addTimeSpentPerLayer(this.lastLayerBitrate,Date.now()-this.adLastLayerSwitchDate);this.adLastBufferingStartDate>=0&&e.addStall(Date.now()-this.adLastBufferingStartDate);let t=e.build();t.adId.length>0&&this.storeMetrics(t)}e.adMetrics=this.generateMetrics()}onEndSessionReportUpdateRequested(e){e.adMetrics=this.generateMetrics()}storeMetrics(e){let t=e.adId;void 0===this.adMetrics[t]&&(this.adMetrics[t]=[]);let i=this.adMetrics[t].findIndex(t=>t.impressionDate===e.impressionDate);-1===i?this.adMetrics[t].push(e):this.adMetrics[t][i]=e}generateMetrics(){let e=[];return Object.values(this.adMetrics).forEach(t=>{t.forEach(t=>e.push(t))}),e}handleAdEnd(){this.builder.setAdSkipped(this.adSkipped).addTimeSpentPerLayer(this.lastLayerBitrate,Date.now()-this.adLastLayerSwitchDate);let e=this.builder.build();e.adId.length>0&&this.storeMetrics(e),n.g.d(v,"Ad metrics : "+e.toString(),this.handler?.id),this.builder.reset(),this.adSkipped=!1}onAdsUpdated(e){e.adBreaks.forEach(e=>{e.ads.forEach(e=>{if(void 0===this.adMetrics[e.adId]){let t=(new r).setCreativeId(e.creativeId).setAdId(e.adId).build();this.adMetrics[e.adId]=[t],n.g.d(v,"Adding ad metrics report for ad id "+e.adId,this.handler?.id)}})})}}var f=i(1105),D=i(5305);let N="BpkOMSDKMgr";class R{static #e;smartLib;static getInstance(){return R.#e||(R.#e=new R),R.#e}constructor(){}init(){n.g.d(N,"Initializing OM SDK manager...")}release(){}attachInstance(e){this.smartLib=e}attachHandler(e){n.g.d(N,"Attaching OM SDK handler..."),this.omsdkHandler=e}isEnabled(){return void 0!==this.omsdkHandler&&null!==this.omsdkHandler}}let I="BpkOMSessionHandler";class T{handler;adSession;playerAdapter;internalAdManager;omsdkHandler;omAdSession;firstImageDate;adBreakPosition;pause;buffering;constructor(e,t){this.handler=e,this.adSession=e.adSession,this.playerAdapter=t,this.internalAdManager=this.handler.smartLib.internalAdManager,this.omsdkHandler=R.getInstance().omsdkHandler,this.firstImageDate=0,this.adBreakPosition="midroll",this.pause=!1,this.buffering=!1}onStart(){}onRedirectionEnd(){}onFirstImage(e,t){this.firstImageDate=Date.now()}onLayerSwitch(e){}onPause(){!1===this.pause&&this.omAdSession?.pause(),this.pause=!0}onResume(){!0===this.pause&&this.omAdSession?.resume(),this.pause=!1}onBufferingStart(){!1===this.buffering&&this.omAdSession?.bufferStart(),this.buffering=!0}onBufferingEnd(e){!0===this.buffering&&this.omAdSession?.bufferFinish(),this.buffering=!1}onStallEnd(){}onRebufferingEnd(){}onSeek(e,t){void 0!==this.adData&&Math.abs(t-e)>=1e3&&(t>=this.adData.position+this.adData.duration||t<this.adData.position)&&this.omAdSession?.skipped()}onStop(e){this.adData=void 0,void 0!==this.omAdSession&&(this.omAdSession.finish(),this.omAdSession=void 0),this.adBreakPosition="midroll"}onStartSessionReportUpdateRequested(e){}onKeepaliveSessionReportUpdateRequested(e){}onEndSessionReportUpdateRequested(e){}onAdBreakData(e){1e4>Math.abs(e.position+e.duration-this.playerAdapter.getDuration())?this.adBreakPosition="postroll":Date.now()-this.firstImageDate<A.POSITION_START_DELTA?this.adBreakPosition="preroll":this.adBreakPosition="midroll",n.g.d(I,"Ad break position is "+this.adBreakPosition,this.handler.id)}onPrepareAdBreak(e){}onAdBreakBegin(e){}startAdSession(e,t){this.omAdSession=e,void 0!==this.adSession?.adView&&this.omAdSession.setAdView(this.adSession.adView),this.adSession?.adFriendlyObstructionViews.length>
10&&this.adSession.adFriendlyObstructionViews.forEach(e=>{this.omAdSession.registerAdFriendlyObstructionView(e.view,e.purpose,e.reason)}),this.omAdSession.start(),void 0!==this.adSession?.adViewState&&this.omAdSession.setAdViewState(this.adSession.adViewState),!0===t.skippable?this.omAdSession.loaded(t.skippablePosition-t.position,t.duration,this.adBreakPosition,this.playerAdapter.getVolume()):this.omAdSession.loaded(-1,t.duration,this.adBreakPosition,this.playerAdapter.getVolume()),n.g.d(I,"OM ad session loaded",this.handler.id)}onAdData(e){let t;void 0!==this.adData&&(this.omAdSession?.finish(),this.omAdSession=void 0),this.adData=e,t=void 0!==this.adSession?.adVerificationData?[...this.adSession.adVerificationData]:[],this.adData.verifications.forEach(e=>{let i=e.javascriptResources.find(e=>"omid"===e.apiframework);t.push({verificationVendor:e.vendor,verificationURL:i.url,verificationParameters:e.verificationParameters})});let i=this.omsdkHandler.createOMAdSession(this.internalAdManager.omPartnerName,this.internalAdManager.omPartnerVersion,this.adSession?.adCustomReference,t,t=>{this.startAdSession(t,e)});void 0!==i&&this.startAdSession(i,e)}onPrepareAd(e,t,i){}onAdBegin(e,t,i){}onAdSkippable(e){}onAdProgress(e,t,i,s){this.omAdSession?.progress(s)}onAdEnd(e,t,i){this.adData=void 0,this.omAdSession?.finish(),this.omAdSession=void 0}onAdBreakEnd(e){this.adData=void 0,void 0!==this.omAdSession&&(this.omAdSession.finish(),this.omAdSession=void 0),this.adBreakPosition="midroll"}onVolumeChanged(e){n.g.d(I,"Volume is now "+e,this.handler.id),this.omAdSession?.volumeChange(e)}onPlayerError(e,t){n.g.e(I,"Broadpeak status code "+e,this.handler.id),n.g.e(I,"Player error code "+t,this.handler.id),this.omAdSession?.error(e,t)}}o.A.adModule={AdMetrics:a,AdMetricsBuilder:r,AdMetricsManager:y,AdTrackingManager:A,AdDataTracker:u,AdBreakTracker:p,AdTracker:g,AdEventTracker:S,AdManager:E.X2,AdViewState:E.up,AdFriendlyObstructionPurpose:E.D6,AdType:E.eQ,AdSession:f.A,InternalAdManager:D.A,OMSDKManager:R,OMSessionHandler:T}}},function(e){return e.O(0,[153],function(){var t;return t=7575,e(e.s=t)}),e.O()}])})},30045:function(e,t,i){"use strict";!function(t,i){e.exports=i()}("undefined"!=typeof self?self:i.g,function(){return(("undefined"!=typeof self?self:i.g).webpackChunkSmartLibModule=("undefined"!=typeof self?self:i.g).webpackChunkSmartLibModule||[]).push([[153],{4404:function(e,t,i){i.d(t,{A:function(){return s}});class s{static hasMethods(e,t){let i=!0;return void 0!==e&&(t.forEach(t=>{"function"!=typeof e[t]&&(i=!1)}),i)}static count(e,t){let i=0;for(let s in e)!0===t(s,e[s])&&i++;return i}}},5387:function(e,t,i){i.d(t,{bW:function(){return E.A},Bw:function(){return K},_7:function(){return J},sX:function(){return z},Go:function(){return j},qT:function(){return d},NQ:function(){return S},K1:function(){return y},pi:function(){return N},nm:function(){return n},Wy:function(){return l},dx:function(){return p},lX:function(){return L},c5:function(){return R},EC:function(){return H}});var s=i(8379),a=i(3473);let r="BpkPlayerAdapter";class n{handler;diversityPlugin;webOSVersion;constructor(){"undefined"!=typeof webOS&&webOS.deviceInfo(e=>{this.webOSVersion=e.sdkVersion})}getName(){return""}getVersion(){return""}getOSName(){return a.A.getInstance().osName}getOSVersion(){return a.A.getInstance().osVersion}getDeviceType(){return a.A.getInstance().deviceType}getBitrate(){return -1}getPosition(){return 0}getDuration(){return 0}getVolume(){return 1}getCapabilities(){return{adTracking:!1}}initSessionPlayerObjects(){}releaseSessionPlayerObjects(){}initDiversityPlugin(e,t){s.g.i(r,"Diversity plugin not yet supported for player "+e)}initDiversitySession(e){}setDiversityManifest(e){}releaseDiversitySession(){}fillSessionReport(e){e.playerName=this.getName(),e.playerVersion=this.getVersion(),e.osName=this.getOSName(),e.osVersion=this.getOSVersion(),e.deviceType=this.getDeviceType()}onStart(){let e=this.handler.sessionReport;this.fillSessionReport(e)}onKeepaliveSessionReportUpdateRequested(e){this.fillSessionReport(e)}onEndSessionReportUpdateRequested(e){this.fillSessionReport(e)}notifyLoading(){void 0!==this.handler?this.handler.notifyLoading():s.g.e(r,"Implementation error: session.attachPlayer should be called prior to onLoading event. This event is called when the player starts buffering the first time.")}notifyPrecacheEnded(){void 0!==this.handler?this.handler.notifyPrecacheEnded():s.g.e(r,"Implementation error: session.attachPlayer should be called prior to onPrecachedEnded event. This event is called when the player starts buffering chunks.")}notifyFirstImage(){void 0!==this.handler?this.handler.notifyFirstImage(this.getBitrate(),this.getPosition()):s.g.e(r,"Implementation error: session.getURL(...) or session.getQuery()/session.startStreamingSession(...) should be called prior to onSessionStart event. This event is called when the first image is displayed.")}notifyPause(){void 0!==this.handler?this.handler.notifyPause():s.g.e(r,"Implementation error: session.getURL(...) or session.getQuery()/session.startStreamingSession(...) should be called prior to onSessionPause event.")}notifyResume(){void 0!==this.handler?this.handler.notifyResume():s.g.e(r,"Implementation error: session.getURL(...) or session.getQuery()/session.startStreamingSession(...) should be called prior to onSessionResume event.")}notifyLayerSwitch(e=this.getBitrate()){void 0!==this.handler?this.handler.notifyLayerSwitch(e):s.g.e(r,"Implementation error: session.getURL(...) or session.getQuery()/session.startStreamingSession(...) should be called prior to onLayerSwitch event.")}notifySeek(e,t){void 0!==this.handler?this.handler.notifySeek(e,t):s.g.e(r,"Implementation error: session.getURL(...) or session.getQuery()/session.startStreamingSession(...) should be called prior to onSeek event.")}notifyStallStart(){void 0!==this.handler?this.handler.notifyBufferingStart():s.g.e(r,"Implementation error: session.getURL(...) or session.getQuery()/session.startStreamingSession(...) should be called prior to onStallStart event.")}notifyStallEnd(e=!0){void 0!==this.handler?this.handler.notifyBufferingEnd(e):s.g.e(r,"Implementation error: session.getURL(...) or session.getQuery()/session.startStreamingSession(...) should be called prior to onStallEnd event.")}notifyClose(e){void 0!==this.handler?this.handler.notifyClose(e):s.g.e(r,"Implementation error: session.attachPlayer should be called prior to onSessionStart event. This event is called when the player is closing.")}notifyVolumeChanged(e){void 0!==this.handler?this.handler.notifyVolumeChanged(e):s.g.e(r,"Implementation error: session.getURL(...) or session.getQuery()/session.startStreamingSession(...) should be called prior to onVolumeChanged event.")}notifyPlayerError(e,t){void 0!==this.handler?this.handler.notifyPlayerError(e,t):s.g.e(r,"Implementation error: session.getURL(...) or session.getQuery()/session.startStreamingSession(...) should be called prior to onPlayerError event.")}static checkPlayer(e,t){return s.g.e(r,"Implementation error: static checkPlayer not implemented for this adapter."),!1}attachPlayer(e,t){return s.g.e(r,"Implementation error: attachPlayer not implemented for this adapter."),!1}detachPlayer(){s.g.e(r,"Implementation error: detachPlayer not implemented for this adapter.")}attachSession(e){this.handler=e}detachSession(){this.handler=void 0}setStatusCode(e){void 0!==this.handler&&(this.handler.sessionReport.statusCode=e)}setPlayerErrorCode(e){void 0!==this.handler&&(this.handler.sessionReport.playerErrorCode=String(e))}setCustomParameter(e,t){void 0!==this.handler&&(void 0===this.handler.streamingSession?s.g.e(r,"Set custom parameter on player adapter is only available when using StreamingSession API.",this.handler.id):this.handler.streamingSession.setCustomParameter(e,t))}}var o=i(4404);class d extends n{player;listener;constructor(){super()}getName(){return this.player.getPlayerName()}getVersion(){return this.player.getVersion()}getOSName(){return this.player.getOSName()}getOSVersion(){return this.player.getDeviceVersion()}getDeviceType(){return this.player.getDeviceType()}getBitrate(){return this.player.getCurrentBitrate()}getPosition(){return this.player.getCurrentPosition()}getDuration(){return this.player.getTotalDuration()}getCapabilities(){return"function"==typeof this.player.getCapabilities?this.player.getCapabilities():super.getCapabilities()}static checkPlayer(e,t){return o.A.hasMethods(e,["getPlayerName","getVersion","getOSName","getDeviceVersion","getDeviceType","getCurrentPosition","getTotalDuration","getCurrentBitrate"])}initDiversitySession(e){return this.player.initDiversitySession(e)}attachPlayer(e,t){return!!d.checkPlayer(e,t)&&(this.player=e,this.listener=t,this.player.playerAdapter=this,!0)}detachPlayer(){void 0!==this.player&&(this.player.playerAdapter=void 0),this.player=void 0,this.listener=void 0}}let h="BpkPlayerEventListener";class l{static playerAdapters=[];static addPlayerAdapter(e){-1===l.playerAdapters.indexOf(e)&&l.playerAdapters.push(e)}static removePlayerAdapter(e){let t=l.playerAdapters.indexOf(e);-1!==t&&l.playerAdapters.splice(t,1)}static isStarted(){let e=l.playerAdapters;return e.length>0&&void 0!==e[e.length-1].handler&&e[e.length-1].handler.metricsManager.started}static isPlaying(){let e=l.playerAdapters;return e.length>0&&void 0!==e[e.length-1].handler&&e[e.length-1].handler.metricsManager.playing}static isBuffering(){let e=l.playerAdapters;return e.length>0&&void 0!==e[e.length-1].handler&&e[e.length-1].handler.metricsManager.buffering}static onSessionStart(){let e=l.playerAdapters;e.length>
10?e.forEach(e=>e.notifyFirstImage()):s.g.e(h,"Implementation error: SmartLib.attachPlayer(...) should be called prior to onSessionStart event. If you don't attach any player, please remove this call, SmartLib is now handling it automatically.")}static onSessionPause(){let e=l.playerAdapters;e.length>0?e.forEach(e=>e.notifyPause()):s.g.e(h,"Implementation error: SmartLib.attachPlayer(...) should be called prior to onSessionPause event.")}static onSessionResume(){let e=l.playerAdapters;e.length>0?e.forEach(e=>e.notifyResume()):s.g.e(h,"Implementation error: SmartLib.attachPlayer(...) should be called prior to onSessionResume event.")}static onLayerSwitch(e){let t=l.playerAdapters;t.length>0?t.forEach(t=>t.notifyLayerSwitch(e)):s.g.e(h,"Implementation error: SmartLib.attachPlayer(...) should be called prior to onLayerSwitch event.")}static onSeek(e,t){let i=l.playerAdapters;i.length>0?i.forEach(i=>i.notifySeek(e,t)):s.g.e(h,"Implementation error: SmartLib.attachPlayer(...) should be called prior to onSeek event.")}static onStallStart(){let e=l.playerAdapters;e.length>0?e.forEach(e=>e.notifyStallStart()):s.g.e(h,"Implementation error: SmartLib.attachPlayer(...) should be called prior to onStallStart event.")}static onStallEnd(e){let t=l.playerAdapters;t.length>0?t.forEach(t=>t.notifyStallEnd(e)):s.g.e(h,"Implementation error: SmartLib.attachPlayer(...) should be called prior to onStallEnd event.")}}let c="BpkPlayerMgr";class u{static loadPlayerAdapters(){return{}}}class p{static #e;smartLib;#t=u;#i={};#s;static getInstance(){return p.#e||(p.#e=new p),p.#e}init(e){this.#t===u&&(this.#t=e,this.#i=this.#t.loadPlayerAdapters(),s.g.v(c,"Compatible players: "+Object.keys(this.#i)))}release(){this.setPlayerAdapter(void 0)}attachInstance(e){this.smartLib=e}getAdapters(){return this.#i}setPlayerAdapter(e){void 0!==this.#s&&this.#s!==e&&(s.g.i(c,"Player "+this.#s.getName()+" detached"),this.#s.detachPlayer()),this.#s!==e&&void 0!==e?e instanceof d&&(s.g.d(c,"Attaching generic player to SmartLib singleton"),l.addPlayerAdapter(e)):this.#s!==e&&void 0===e&&this.#s instanceof d&&(s.g.d(c,"Detaching generic player from SmartLib singleton"),l.removePlayerAdapter(this.#s)),this.#s!==e?this.#s=e:void 0!==e&&s.g.i(c,"Player "+this.#s.getName()+" already attached"),void 0!==e&&s.g.i(c,"Player "+e.getName()+" attached")}getPlayerAdapter(){return this.#s}}let g="BpkGenericPlayerApi";class S{playerAdapter;constructor(){}getPlayerName(){return""}getVersion(){return""}getOSName(){return""}getDeviceVersion(){return""}getDeviceType(){return""}getCurrentPosition(){return 0}getTotalDuration(){return 0}getCurrentBitrate(){return 0}getCapabilities(){return{}}notifyPrecacheEnded(){void 0!==this.playerAdapter?this.playerAdapter.notifyPrecacheEnded():s.g.e(g,"Implementation error: session.attachPlayer(...) should be called prior to notifyPrecacheEnded. This event is called when the player starts buffering chunks.")}notifyFirstImage(){void 0!==this.playerAdapter?this.playerAdapter.notifyFirstImage():s.g.e(g,"Implementation error: session.attachPlayer(...) should be called prior to notifyFirstImage. This event is called when the first image is displayed.")}notifyPause(){void 0!==this.playerAdapter?this.playerAdapter.notifyPause():s.g.e(g,"Implementation error: session.attachPlayer(...) should be called prior to notifyPause.")}notifyResume(){void 0!==this.playerAdapter?this.playerAdapter.notifyResume():s.g.e(g,"Implementation error: session.attachPlayer(...) should be called prior to notifyResume.")}notifyLayerSwitch(e){void 0!==this.playerAdapter?this.playerAdapter.notifyLayerSwitch(e):s.g.e(g,"Implementation error: session.attachPlayer(...) should be called prior to notifyLayerSwitch.")}notifyStallStart(){void 0!==this.playerAdapter?this.playerAdapter.notifyStallStart():s.g.e(g,"Implementation error: session.attachPlayer(...) should be called prior to notifyStallStart.")}notifyStallEnd(e){void 0!==this.playerAdapter?this.playerAdapter.notifyStallEnd(e):s.g.e(g,"Implementation error: session.attachPlayer(...) should be called prior to notifyStallEnd.")}notifySeek(e,t){void 0!==this.playerAdapter?this.playerAdapter.notifySeek(e,t):s.g.e(g,"Implementation error: session.attachPlayer(...) should be called prior to notifySeek.")}setPlayerErrorCode(e){void 0!==this.playerAdapter?this.playerAdapter.setPlayerErrorCode(e):s.g.e(g,"Implementation error: session.attachPlayer(...) should be called prior to setPlayerErrorCode. This has to be called before stopStreamingSession when the player error code as a string.")}}var E=i(9880),m=i(4943);
1class A{static EMPTY=new this(0);index;buffer;constructor(e){this.index=0,this.buffer=new Uint8Array(e)}put(e){return this.buffer[this.index++]=e,this}putChar(e){return this.buffer[this.index++]=(65280&e)>>8,this.buffer[this.index++]=255&e,this}putByteBuffer(e,t=e.buffer.length){let i=e.buffer;return this.buffer.length>=this.index+t&&(this.buffer.set(i,this.index),this.index+=t),this}set(e,t){return this.buffer[t]=e,this}data(){return this.buffer}base64(){return m.A.bufferToBase64(this)}length(){return this.index}capacity(){return this.buffer.length}remaining(){return this.capacity()-this.length()}toString(){return m.A.bufferToString(this.buffer,this.index)+"(length:"+this.length()+")"}}var v=i(3445);class y{static PLAYBACK_TYPE_LIVE="LIVE";static PLAYBACK_TYPE_VOD="VOD";redirectionTime;startupTime;completion;playbackType;playbackDuration;sessionDuration;contentDuration;stallsNumber;maxStallDuration;totalStallsDuration;rebufferingsNumber;maxRebufferingDuration;totalRebufferingDuration;minBitrate;maxBitrate;averageBitrate;layerSwitchesNumber;timeSpentPerLayer;preStartupTime;constructor(e){void 0!==e?(this.redirectionTime=e.redirectionTime,this.startupTime=e.startupTime,this.completion=e.completion,this.playbackType=e.playbackType,this.playbackDuration=e.playbackDuration,this.sessionDuration=e.sessionDuration,this.contentDuration=e.contentDuration,this.stallsNumber=e.stallsNumber,this.maxStallDuration=e.maxStallDuration,this.totalStallsDuration=e.totalStallsDuration,this.rebufferingsNumber=e.rebufferingsNumber,this.maxRebufferingDuration=e.maxRebufferingDuration,this.totalRebufferingDuration=e.totalRebufferingDuration,this.minBitrate=e.minBitrate,this.maxBitrate=e.maxBitrate,this.averageBitrate=e.averageBitrate,this.layerSwitchesNumber=e.layerSwitchesNumber,this.timeSpentPerLayer=JSON.parse(JSON.stringify(e.timeSpentPerLayer)),this.preStartupTime=e.preStartupTime):(this.redirectionTime=0,this.startupTime=0,this.completion=0,this.playbackType="",this.playbackDuration=0,this.sessionDuration=0,this.contentDuration=0,this.stallsNumber=0,this.maxStallDuration=0,this.totalStallsDuration=0,this.rebufferingsNumber=0,this.maxRebufferingDuration=0,this.totalRebufferingDuration=0,this.minBitrate=0,this.maxBitrate=0,this.averageBitrate=0,this.layerSwitchesNumber=0,this.timeSpentPerLayer={},this.preStartupTime=0)}}class f{metrics;watchingRanges;constructor(e=new y){this.metrics=e,this.reset()}setRedirectionTime(e){return this.metrics.redirectionTime=e,this}setStartupTime(e){return this.metrics.startupTime=e,this}setSessionDuration(e){return this.metrics.sessionDuration=e,this}setContentDuration(e){return this.metrics.contentDuration=e,this}setPlaybackType(e){return this.metrics.playbackType=e,this}setFirstLayer(e){return e>0&&(this.metrics.maxBitrate=e,this.metrics.minBitrate=e),this}setPreStartupTime(e){return this.metrics.preStartupTime=e,this}addTimeSpentPerLayer(e,t){if((e=Math.round(e))>0){let i=this.metrics.timeSpentPerLayer[e];void 0===i&&(i=0),i+=t,this.metrics.timeSpentPerLayer[e]=i,this.metrics.maxBitrate<e&&(this.metrics.maxBitrate=e),(this.metrics.minBitrate>e||0===this.metrics.minBitrate)&&(this.metrics.minBitrate=e)}return this}addLayerSwitch(){return this.metrics.layerSwitchesNumber++,this}addPlaybackDuration(e){return this.metrics.playbackDuration+=e,this}
1addWatchingRange(e,t){return e<t&&(s.g.v("BpkMetrics","Add watching range, duration "+(t-e)+"ms"),this.watchingRanges.push({start:e,end:t,duration:t-e})),this}addStall(e){return this.metrics.stallsNumber++,this.metrics.totalStallsDuration+=e,this.metrics.maxStallDuration<e&&(this.metrics.maxStallDuration=e),this}addRebuffering(e){return this.metrics.rebufferingsNumber++,this.metrics.totalRebufferingDuration+=e,this.metrics.maxRebufferingDuration<e&&(this.metrics.maxRebufferingDuration=e),this}clone(){let e=new f(new y(this.metrics));return e.watchingRanges=JSON.parse(JSON.stringify(this.watchingRanges)),e}computeCompletion(){if(this.metrics.playbackType===y.PLAYBACK_TYPE_LIVE||0===this.metrics.contentDuration)return 1e3;let e=JSON.parse(JSON.stringify(this.watchingRanges)),t=e.slice(0);if(1===e.length)return Math.floor(1e3*t[0].duration/this.metrics.contentDuration);if(0===e.length)return 0;let i=[],s=null;i.push((t=t.sort((e,t)=>parseInt(e.start,10)>parseInt(t.start,10)?1:parseInt(e.start,10)<parseInt(t.start,10)?-1:0))[0]);for(let e=1;e<t.length;e++)parseInt((s=i[i.length-1]).end,10)<parseInt(t[e].start,10)?i.push(t[e]):parseInt(s.end,10)<parseInt(t[e].end,10)&&(s.end=parseInt(t[e].end,10),s.duration=s.end-s.start,i.pop(),i.push(s));let a=0;for(let e=0;e<i.length;e++)i[e].duration=parseInt(i[e].end,10)-parseInt(i[e].start,10),a+=parseInt(i[e].duration,10);this.watchingRanges=i;let r=Math.floor(1e3*a/this.metrics.contentDuration);return r>1e3?1e3:r}build(){let e=0,t=0;for(let i in this.metrics.timeSpentPerLayer){let s=this.metrics.timeSpentPerLayer[i];e+=i*s,t+=s}return 0!==t&&(this.metrics.averageBitrate=Math.round(e/t)),this.metrics.completion=this.computeCompletion(),this.metrics.completion<0?this.metrics.completion=0:this.metrics.completion>1e3&&(this.metrics.completion=1e3),this.metrics.startupTime+=this.metrics.preStartupTime,this.metrics}reset(){return this.watchingRanges=[],this}}let D="BpkMetricsMgr";class N{static MAX_TIME_BETWEEN_SEEK_AND_REBUFFERING=1e3;handler;builder;playerAdapter;timeline;started;playing;buffering;seeking;bitrate;redirectionStartDate;playingStartDate;bufferingStartDate;lastLayerSwitchDate;lastSeekDate;playOnNextBufferingEnd;startPosition;constructor(e,t){this.handler=e,this.builder=new f,this.playerAdapter=t,this.timeline=this.handler.sessionReport.timeline,this.started=!1,this.playing=!1,this.buffering=!1,this.seeking=!1,this.bitrate=-1,this.redirectionStartDate=Date.now(),this.playingStartDate=Date.now(),this.bufferingStartDate=0,this.lastLayerSwitchDate=0,this.lastSeekDate=0,this.playOnNextBufferingEnd=!1,this.startPosition=0}onStart(){this.redirectionStartDate=Date.now()}onRedirectionEnd(){this.builder.setRedirectionTime(Date.now()-this.redirectionStartDate),this.playingStartDate=Date.now()}onPrecacheEnded(){this.playingStartDate=Date.now()}onFirstImage(e,t){s.g.i(D,"Streaming session started ("+e+"kbps,"+v.A.formatTime(t)+")",this.handler.id),this.started=!0,this.playing=!0,this.startPosition=t,this.builder.setContentDuration(this.playerAdapter.getDuration()).setPlaybackType(0>=this.playerAdapter.getDuration()?y.PLAYBACK_TYPE_LIVE:y.PLAYBACK_TYPE_VOD),this.builder.setStartupTime(Date.now()-this.redirectionStartDate),this.playingStartDate=Date.now(),this.builder.setFirstLayer(e),this.bitrate=e,this.lastLayerSwitchDate=Date.now()}onLayerSwitch(e){s.g.d(D,"Player changed layer to "+e+"kbps",this.handler.id),this.started&&(this.builder.addTimeSpentPerLayer(this.bitrate,Date.now()-this.lastLayerSwitchDate),this.lastLayerSwitchDate=Date.now(),this.bitrate!==e&&this.bitrate>0&&(s.g.d(D,"Player changed layer, before: "+this.bitrate+"kbps, now: "+e+"kbps",this.handler.id),this.timeline?.pushEventBitrate(R.LayerSwitch,e),this.builder.addLayerSwitch())),this.bitrate=e}onPause(){this.playing&&(s.g.d(D,"Player is paused",this.handler.id),this.timeline?.pushEvent(R.Pause),this.playing=!1,this.buffering||this.builder.addPlaybackDuration(Date.now()-this.playingStartDate),this.builder.addWatchingRange(this.startPosition,this.playerAdapter.getPosition()))}onResume(){this.started&&!this.playing&&(s.g.d(D,"Player is resumed",this.handler.id),this.timeline?.pushEvent(R.Resume),this.playing=!0,this.buffering=!1,this.playingStartDate=Date.now())}
1onBufferingStart(){if(!this.buffering&&this.started){s.g.d(D,"Player is buffering",this.handler.id),this.timeline?.pushEvent(R.BufferingStart);let e=Date.now();this.buffering=!0,this.seeking&&e-this.lastSeekDate>N.MAX_TIME_BETWEEN_SEEK_AND_REBUFFERING&&(this.seeking=!1),this.bufferingStartDate=e,this.playOnNextBufferingEnd=!1,this.playing&&this.builder.addPlaybackDuration(e-this.playingStartDate)}}onBufferingEnd(e){let t=Date.now();e&&this.playOnNextBufferingEnd&&!this.buffering&&(this.playingStartDate=t,this.playOnNextBufferingEnd=!1),this.started&&this.bufferingStartDate>0&&(this.buffering=!1,e?this.playingStartDate=t:this.playOnNextBufferingEnd=!0,this.seeking?(this.seeking=!1,this.handler.notifyRebufferingEnd()):this.handler.notifyStallEnd(),this.bufferingStartDate=0)}onStallEnd(){let e=Date.now()-this.bufferingStartDate;this.builder.addStall(e),this.timeline?.pushEvent(R.StallStop),s.g.d(D,"Player stalled for "+e+"ms",this.handler.id)}onRebufferingEnd(){let e=Date.now()-this.bufferingStartDate;this.builder.addRebuffering(e),this.timeline?.pushEvent(R.RebufferingStop),s.g.d(D,"Player buffered for "+e+"ms",this.handler.id)}onSeek(e,t){s.g.d(D,"Player seeked from "+v.A.formatTime(e)+" to "+v.A.formatTime(t),this.handler.id),this.timeline?.pushEventPositionStartEnd(R.Seek,e,t),this.builder.addWatchingRange(this.startPosition,e),this.startPosition=t,this.seeking=!0,this.lastSeekDate=Date.now()}onStop(e){if(this.started){let e=Date.now();this.playing&&!this.buffering&&this.builder.addPlaybackDuration(e-this.playingStartDate),this.buffering&&this.onBufferingEnd(!1),this.playing&&(this.builder.addWatchingRange(this.startPosition,this.playerAdapter.getPosition()),this.playing=!1),this.builder.setSessionDuration(e-this.redirectionStartDate).addTimeSpentPerLayer(this.bitrate,e-this.lastLayerSwitchDate),this.started=!1}}onStartSessionReportUpdateRequested(e){e.metrics=this.builder.build()}onKeepaliveSessionReportUpdateRequested(e){let t=Date.now(),i=this.builder.clone();if(this.playing&&!this.buffering&&i.addPlaybackDuration(t-this.playingStartDate),this.started&&this.bufferingStartDate>0){let e=Date.now()-this.bufferingStartDate;this.seeking?i.addRebuffering(e):i.addStall(e)}this.playing&&i.addWatchingRange(this.startPosition,this.playerAdapter.getPosition()),i.setSessionDuration(t-this.redirectionStartDate).addTimeSpentPerLayer(this.bitrate,t-this.lastLayerSwitchDate);let s=this.handler.getCustomParameters().pre_startup_time,a=0;void 0===s||isNaN(s)||(a=parseInt(s,10)),i.setPreStartupTime(a),e.metrics=i.build()}onEndSessionReportUpdateRequested(e){let t=Date.now();this.builder.setSessionDuration(t-this.redirectionStartDate);let i=this.handler.getCustomParameters().pre_startup_time,s=0;void 0===i||isNaN(i)||(s=parseInt(i,10)),this.builder.setPreStartupTime(s),e.metrics=this.builder.build()}}let R={None:0,Start:1,Stop:2,RedirectionEnd:3,FirstImage:4,Pause:5,Resume:6,BufferingStart:7,StallStart:8,StallStop:9,RebufferingStart:10,RebufferingStop:11,Seek:12,LayerSwitch:13,AdBreakStart:14,AdBreakStop:15,NetworkAvailable:16,NetworkLost:17,Mute:18,Unmute:19,Multicast:20,Unicast:21,PrecacheEnded:22,DataSummary:144,EmptySummary:145},I=[R.RedirectionEnd,R.Pause,R.Resume,R.BufferingStart,R.StallStart,R.StallStop,R.RebufferingStart,R.RebufferingStop,R.AdBreakStart,R.NetworkLost,R.Mute,R.Unmute,R.Multicast,R.Unicast,R.PrecacheEnded],T=[R.Start],_=[R.LayerSwitch],P=[R.FirstImage],b=[R.Seek],M=[R.Stop],k=[R.AdBreakStop],C=[R.NetworkAvailable],O="BpkSessionTrackerEvent";class L{eventId;eventDate;eventData;startStopEvent;startEventId;stopEventId;triggerStartEventId;keepLastOnly;attachEventId;attachMaxDurationBeforeStart;startEvent;stopEvent;attachedEvent;
1compressed;compressedData;constructor(e){this.eventId=e,this.eventDate=Date.now(),this.eventData={},this.startStopEvent=!1,this.startEventId=0,this.stopEventId=0,this.triggerStartEventId=0,this.keepLastOnly=!1,this.attachEventId=0,this.attachMaxDurationBeforeStart=-1,this.startEvent=null,this.stopEvent=null,this.attachedEvent=null,this.addDataSizeInTimeline=!1,this.compressed=!1,this.compressedData=void 0,this.updateMetadata()}updateMetadata(){switch(this.startStopEvent=!1,this.startEventId=R.None,this.stopEventId=R.None,this.triggerStartEventId=R.None,this.keepLastOnly=!1,this.attachEventId=R.None,this.attachMaxDurationBeforeStart=-1,this.eventId){case R.None:break;case R.Start:this.startStopEvent=!0,this.startEventId=R.Start,this.stopEventId=R.Stop,this.addDataSizeInTimeline=!0;break;case R.Stop:this.startStopEvent=!0,this.startEventId=R.Start,this.stopEventId=R.Stop;break;case R.RedirectionEnd:this.startStopEvent=!1,this.attachEventId=R.Start;break;case R.FirstImage:this.startStopEvent=!1,this.keepLastOnly=!0,this.attachEventId=R.RedirectionEnd;break;case R.Pause:case R.Resume:this.startStopEvent=!0,this.startEventId=R.Pause,this.stopEventId=R.Resume;break;case R.StallStart:this.startStopEvent=!0,this.startEventId=R.StallStart,this.stopEventId=R.StallStop;break;case R.StallStop:this.startStopEvent=!0,this.startEventId=R.StallStart,this.stopEventId=R.StallStop,this.triggerStartEventId=R.BufferingStart;break;case R.RebufferingStart:this.startStopEvent=!0,this.startEventId=R.RebufferingStart,this.stopEventId=R.RebufferingStop;break;case R.RebufferingStop:this.startStopEvent=!0,this.startEventId=R.RebufferingStart,this.stopEventId=R.RebufferingStop,this.triggerStartEventId=R.BufferingStart,this.attachEventId=R.Seek,this.attachMaxDurationBeforeStart=N.MAX_TIME_BETWEEN_SEEK_AND_REBUFFERING;break;case R.AdBreakStart:this.startStopEvent=!0,this.startEventId=R.AdBreakStart,this.stopEventId=R.AdBreakStop;break;case R.AdBreakStop:this.startStopEvent=!0,this.startEventId=R.AdBreakStart,this.stopEventId=R.AdBreakStop,this.attachEventId=R.Seek,this.attachMaxDurationBeforeStart=0;break;case R.BufferingStart:case R.Seek:case R.LayerSwitch:case R.NetworkAvailable:case R.NetworkLost:this.startStopEvent=!1;break;case R.Mute:case R.Unmute:case R.Multicast:case R.Unicast:case R.PrecacheEnded:this.startStopEvent=!1,this.addDataSizeInTimeline=!0}}getEventName(){switch(this.eventId){case R.None:return"None";case R.Start:return"Start";case R.Stop:return"Stop";case R.RedirectionEnd:return"RedirectionEnd";case R.FirstImage:return"FirstImage";case R.Pause:return"Pause";case R.Resume:return"Resume";case R.BufferingStart:return"BufferingStart";case R.StallStart:return"StallStart";case R.StallStop:return"StallStop";case R.RebufferingStart:return"RebufferingStart";case R.RebufferingStop:return"RebufferingStop";case R.Seek:return"Seek";case R.LayerSwitch:return"LayerSwitch";case R.AdBreakStart:return"AdBreakStart";case R.AdBreakStop:return"AdBreakStop";case R.NetworkAvailable:return"NetworkAvailable";case R.NetworkLost:return"NetworkLost";case R.Mute:return"Mute";case R.Unmute:return"Unmute";case R.Multicast:return"Multicast";case R.Unicast:return"Unicast";case R.PrecacheEnded:return"PrecacheEnded"}return""}isStartEvent(){return this.startStopEvent&&this.eventId===this.startEventId}isStopEvent(){return this.startStopEvent&&this.eventId===this.stopEventId}addEventData(e,t){"string"==typeof e&&(this.eventData[e]=t)}toData(e){let t=Math.abs(this.eventDate-e)/100,i=m.A.floor(t/65535),s=t%65535,a=Object.keys(this.eventData).length,r=new A(3*i+1+2+2*a+(this.addDataSizeInTimeline?1:0));for(let e=0;e<i;e++)r.put(R.None),r.put(255),r.put(255);switch(r.put(this.eventId),r.putChar(s),this.addDataSizeInTimeline&&r.put(2*a),this.eventId){case R.Start:{let e=parseInt(this.eventData.networkType,10),t=parseInt(this.eventData.muteState,10);r.putChar(e),r.putChar(t)}break;case R.Stop:{let e=parseInt(this.eventData.statusCode,10);r.putChar(e)}break;case R.FirstImage:{let e=parseInt(this.eventData.bitrate,10),t=parseInt(this.eventData.position,10);r.putChar(e),r.putChar(t)}break;case R.Seek:{let e=parseInt(this.eventData.positionStart,10),t=parseInt(this.eventData.positionEnd,10);r.putChar(e),r.putChar(t)}break;case R.LayerSwitch:{let e=parseInt(this.eventData.bitrate,10);r.putChar(e)}break;
1case R.AdBreakStop:{let e=parseInt(this.eventData.progress,10);r.putChar(e)}break;case R.NetworkAvailable:{let e=parseInt(this.eventData.state,10);r.putChar(e)}}return r}formatDate(e){return v.A.formatDate(new Date(e))}print(){for(let e in s.g.v(O," |"),s.g.v(O," ├--> "+this.getEventName()+" -> "+(!0===this.compressed?"compressed":"not compressed")+" -> "+this.eventDate),s.g.v(O," | date: "+this.formatDate(this.eventDate)),this.eventData)s.g.v(O," | "+e+": "+this.eventData[e]);this.isStartEvent()&&null!==this.stopEvent&&s.g.v(O," | stop event: "+this.stopEvent.getEventName()+" "+this.stopEvent.eventDate),this.isStopEvent()&&null!==this.startEvent&&s.g.v(O," | start event: "+this.startEvent.getEventName()+" "+this.startEvent.eventDate),null!==this.attachedEvent&&s.g.v(O," | attached event: "+this.attachedEvent.getEventName()+" "+this.attachedEvent.eventDate)}toString(){return this.getEventName()+" ("+this.formatDate(this.eventDate)+")"}}class w{static BUFFER_SIZE=28;timeline;minIndex;initialBitrate;builder;summaryDuration;pauseDuration;nbNetworkDisconnected;nbNetworkWifi;nbNetworkMobile;nbNetworkEthernet;lastNetworkState;muteDuration;lastMuteState;constructor(e,t){this.timeline=e,this.minIndex=t,this.initialBitrate=void 0,this.builder=void 0,this.summaryDuration=0,this.pauseDuration=0,this.nbNetworkDisconnected=0,this.nbNetworkWifi=0,this.nbNetworkMobile=0,this.nbNetworkEthernet=0,this.lastNetworkState=void 0,this.muteDuration=0,this.lastMuteState=void 0,this.init()}init(){for(let e=this.minIndex;e>=0;e--){let t=this.timeline.events[e];switch(t.eventId){case R.LayerSwitch:case R.FirstImage:void 0===this.initialBitrate&&(this.initialBitrate=parseInt(t.eventData.bitrate,10));break;case R.Start:void 0===this.lastNetworkState&&(this.lastNetworkState=parseInt(t.eventData.networkType,10)),void 0===this.lastMuteState&&(this.lastMuteState=parseInt(t.eventData.muteState,10));break;case R.NetworkAvailable:void 0===this.lastNetworkState&&(this.lastNetworkState=parseInt(t.eventData.state,10));break;case R.NetworkLost:void 0===this.lastNetworkState&&(this.lastNetworkState=0);break;case R.Mute:void 0===this.lastMuteState&&(this.lastMuteState=1);break;case R.Unmute:void 0===this.lastMuteState&&(this.lastMuteState=0)}}void 0!==this.initialBitrate&&0!==this.initialBitrate||(this.initialBitrate=-1),void 0===this.lastNetworkState&&(this.lastNetworkState=1),void 0===this.lastMuteState&&(this.lastMuteState=0)}update(e){if(this.minIndex>=this.timeline.events.length||e>=this.timeline.events.length)return;let t=this.timeline.events[this.minIndex],i=this.timeline.events[e],s,a,r,n=this.initialBitrate,o=t.eventDate,d=1===this.lastMuteState?t.eventDate:-1;this.builder=new f,this.summaryDuration=i.eventDate-t.eventDate,this.pauseDuration=0,this.nbNetworkDisconnected=0,this.nbNetworkWifi=0,this.nbNetworkMobile=0,this.nbNetworkEthernet=0,this.muteDuration=0;for(let h=this.minIndex;h<=e;h++){let e=this.timeline.events[h];switch(e.eventId){case R.Pause:!1!==s&&void 0!==s||(null!==e.stopEvent&&e.stopEvent.eventDate<=i.eventDate&&(this.pauseDuration+=e.stopEvent.eventDate-e.eventDate),s=!0);break;case R.Resume:void 0===s&&(this.pauseDuration+=e.eventDate-t.eventDate),s=!1;break;case R.StallStart:!1!==a&&void 0!==a||(null!==e.stopEvent&&e.stopEvent.eventDate<=i.eventDate&&this.builder.addStall(e.stopEvent.eventDate-e.eventDate),a=!0);break;case R.StallStop:void 0===a&&this.builder.addStall(e.eventDate-t.eventDate),a=!1;break;case R.RebufferingStart:!1!==r&&void 0!==r||(null!==e.stopEvent&&e.stopEvent.eventDate<=i.eventDate&&this.builder.addRebuffering(e.stopEvent.eventDate-e.eventDate),r=!0);break;case R.RebufferingStop:void 0===r&&this.builder.addRebuffering(e.eventDate-t.eventDate),r=!1;break;case R.LayerSwitch:this.builder.addLayerSwitch(),-1!==n&&this.builder.addTimeSpentPerLayer(n,e.eventDate-o),n=parseInt(e.eventData.bitrate,10),o=e.eventDate;break;case R.NetworkAvailable:this.lastNetworkState=parseInt(e.eventData.state,10),this.lastNetworkState>=10&&this.lastNetworkState<20?this.nbNetworkWifi++:this.lastNetworkState>=20&&this.lastNetworkState<30?this.nbNetworkMobile++:this.lastNetworkState>=30&&this.lastNetworkState<40&&this.nbNetworkEthernet++;break;case R.NetworkLost:this.lastNetworkState=0,this.nbNetworkDisconnected++;break;case R.Mute:this.lastMuteState=1,d=e.eventDate;break;case R.Unmute:this.lastMuteState=0,-1!==d&&(this.muteDuration+=e.eventDate-d,d=-1)}}-1!==n&&this.builder.addTimeSpentPerLayer(n,i.eventDate-o),-1!==d&&(this.muteDuration+=i.eventDate-d),this.builder.build()}data(){if(void 0===this.builder)return A.EMPTY;let e=new A(w.BUFFER_SIZE),t=this.builder.metrics;return e.put(R.DataSummary).putChar(Math.round(this.summaryDuration/1e3)).put(w.BUFFER_SIZE-2-1-1).putChar(this.pauseDuration/100).put(t.stallsNumber).putChar(t.totalStallsDuration/100).put(t.rebufferingsNumber).putChar(t.totalRebufferingDuration/100).put(t.layerSwitchesNumber).putChar(t.minBitrate).putChar(t.maxBitrate).putChar(t.averageBitrate).put(this.nbNetworkDisconnected).put(this.nbNetworkWifi).put(this.nbNetworkMobile).put(this.nbNetworkEthernet).putChar(this.lastNetworkState).putChar(Math.round(this.muteDuration/1e3)).put(this.lastMuteState),e}toString(){if(void 0===this.builder)return"no data";let e=this.builder.metrics;return this.summaryDuration+", "+this.pauseDuration+", "+e.minBitrate+", "+e.maxBitrate+", "+e.layerSwitchesNumber+", "+e.averageBitrate+", "+e.stallsNumber+", "+e.totalStallsDuration+", "+e.rebufferingsNumber+", "+e.totalRebufferingDuration+", "+this.nbNetworkDisconnected+", "+this.nbNetworkWifi+", "+this.nbNetworkMobile+", "+this.nbNetworkEthernet+", "+this.lastNetworkState+", "+this.muteDuration+", "+this.lastMuteState}}let U="BpkSessionTrackerEncoder";class B{static DEFAULT_BUFFER_SIZE=384;static DEFAULT_END_EVENTS_DURATION=15e3;static DEFAULT_END_EVENTS_NUMBER=20;timeline;maxBufferSize;maxEndEventsDuration;maxEndEventsNumber;events;uncompressedData;uncompressedDataFull;compressedStartData;minSummaryIndex;maxEndBufferSize;summary;constructor(e,t=B.DEFAULT_BUFFER_SIZE,i=B.DEFAULT_END_EVENTS_DURATION,s=B.DEFAULT_END_EVENTS_NUMBER){this.maxBufferSize=t,this.maxEndEventsDuration=i,this.maxEndEventsNumber=s,this.timeline=e,this.events=this.timeline.events,this.uncompressedData=new A(this.maxBufferSize),this.uncompressedDataFull=!1,this.compressedStartData=void 0,this.minSummaryIndex=0,this.maxEndBufferSize=this.maxBufferSize,this.summary=void 0}onEventAdded(e){if(this.uncompressedDataFull)return;let t=e;this.events.length>=2&&(t=this.events[this.events.length-2]),e.compressedData=e.toData(t.eventDate),e.compressed=!0,e.compressedData.capacity()<=this.uncompressedData.remaining()?this.uncompressedData.putByteBuffer(e.compressedData):(this.uncompressedDataFull=!0,this.compressedStartData=new A(this.maxBufferSize))}onEventUpdated(){this.uncompressedData=new A(this.maxBufferSize);for(let e=0;e<this.events.length;e++)void 0!==this.events[e].compressedData&&this.uncompressedData.putByteBuffer(this.events[e].compressedData)}process(){let e=Date.now();if(!this.uncompressedDataFull)return s.g.d(U,"Timeline encoder generated uncompressed data ("+this.events.length+" events, "+this.uncompressedData.length()+" bytes)"),this.uncompressedData;let t,i="",a=[],r=0;for(let i=this.events.length-1;i>=0;i--){let s=this.events[i];if(!(e-s.eventDate<this.maxEndEventsDuration&&a.length<this.maxEndEventsNumber)){t=i;break}{let e;if(i<this.events.length-1){let t=this.events[i+1];e=s.toData(t.eventDate)}else e=s.toData(s.eventDate);if(!(r+e.length()<=this.maxEndBufferSize)){t=i;break}a.push(e),r+=e.length()}}if(0===this.compressedStartData.length()){this.minSummaryIndex=t;let e=this.maxBufferSize-w.BUFFER_SIZE-r;for(let i=0;i<t;i++){let t=this.events[i];if(this.compressedStartData.length()+t.compressedData.length()>e){this.minSummaryIndex=i;break}this.compressedStartData.putByteBuffer(t.compressedData)}this.maxEndBufferSize=this.compressedStartData.remaining()-w.BUFFER_SIZE,this.uncompressedData=void 0,i+="first iteration, "}let n=new A(this.maxBufferSize);
1if(n.putByteBuffer(this.compressedStartData,this.compressedStartData.length()),this.minSummaryIndex===t)n.put(R.EmptySummary),i+="no summary";else{void 0===this.summary&&(this.summary=new w(this.timeline,this.minSummaryIndex)),this.summary.update(t);let e=this.summary.data();n.putByteBuffer(e),i+="summary {"+this.summary.toString()+"}"}for(let e=0;e<a.length;e++)n.putByteBuffer(a[e]);return s.g.d(U,"Timeline encoder generated compressed data ("+this.events.length+" events before encoding, "+(this.minSummaryIndex+a.length)+" events after encoding, "+n.length()+" bytes, ~"+(Date.now()-e)+"ms, "+i+")"),n}extend(){if(this.uncompressedDataFull)s.g.w(U,"Failed to extend size from "+B.DEFAULT_BUFFER_SIZE+" to 768");else{this.maxBufferSize=768,this.maxEndEventsDuration=4e4,this.maxEndEventsNumber=40;let e=this.uncompressedData;this.uncompressedData=new A(this.maxBufferSize),this.uncompressedData.putByteBuffer(e,e.length()),s.g.v(U,"Extended size from "+B.DEFAULT_BUFFER_SIZE+" to 768")}}}let V="BpkSessionTrackerTimeline";class H{session;startDate;stopDate;events;firstImageWithoutBitrateEvent;encoder;constructor(){this.startDate=null,this.stopDate=null,this.events=[],this.firstImageWithoutBitrateEvent=null,this.encoder=new B(this)}pushEvent(e){if(this.checkType(e,I)){let t=this.createEvent(e);this.encoder.onEventAdded(t)}}pushEventStart(e,t,i){if(this.checkType(e,T)){let s=this.createEvent(e);s.addEventData("networkType",t),s.addEventData("muteState",i),this.encoder.onEventAdded(s)}}pushEventBitrate(e,t){if(this.checkType(e,_)){let i=this.createEvent(e);i.addEventData("bitrate",t),null!==this.firstImageWithoutBitrateEvent&&(this.firstImageWithoutBitrateEvent.addEventData("bitrate",t),this.firstImageWithoutBitrateEvent=null),this.encoder.onEventAdded(i)}}pushEventBitratePosition(e,t,i){if(this.checkType(e,P)){let s=this.createEvent(e);s.addEventData("bitrate",t),s.addEventData("position",i),e===R.FirstImage&&t<=0&&(this.firstImageWithoutBitrateEvent=s),this.encoder.onEventAdded(s)}}pushEventPositionStartEnd(e,t,i){if(this.checkType(e,b)){let s=this.createEvent(e);s.addEventData("positionStart",t),s.addEventData("positionEnd",i),this.encoder.onEventAdded(s)}}pushEventStatusCode(e,t){if(this.checkType(e,M)){let i=this.createEvent(e);i.addEventData("statusCode",t),this.encoder.onEventAdded(i)}}pushEventProgress(e,t){if(this.checkType(e,k)){let i=this.createEvent(e);i.addEventData("progress",t),this.encoder.onEventAdded(i)}}pushEventState(e,t){if(this.checkType(e,C)){let i=this.createEvent(e);i.addEventData("state",t),this.encoder.onEventAdded(i)}}createEvent(e){let t=new L(e);return s.g.v(V,"Creating event "+t.getEventName()+"..."),this.applyKeepLastOnly(t),this.events.push(t),this.updateTimelineProperties(t),this.reconciliateStopWithStartEvent(t),t}checkType(e,t){return t.indexOf(e)>=0||(s.g.v(V,"Can't push event '"+e+"' to timeline, invalid parameters"),!1)}applyKeepLastOnly(e){if(e.keepLastOnly){for(let t=this.events.length-1;t>=0;t--)if(this.events[t].eventId===e.eventId)return this.events.splice(t,1),void this.encoder.onEventUpdated()}}attachEvent(e){if(e.attachEventId>R.None){let t=-1;null!==e.startEvent&&-1!==e.attachMaxDurationBeforeStart&&(t=e.startEvent.eventDate-e.attachMaxDurationBeforeStart);for(let i=this.events.length-1;i>=0;i--){let s=this.events[i];if(s.eventId===e.attachEventId&&(-1===t||s.eventDate>=t))return void(e.attachedEvent=s)}}}updateTimelineProperties(e){switch(e.eventId){case R.Start:this.startDate=Date.now();break;case R.Stop:this.stopDate=Date.now()}}reconciliateStopWithStartEvent(e){if(e.isStopEvent())for(let t=this.events.length-1;t>=0;t--){let i=this.events[t];if(i.eventId===e.startEventId)return i.stopEvent=e,void(e.startEvent=i);if(i.eventId===e.triggerStartEventId)return i.eventId=e.startEventId,i.startStopEvent=!0,i.startEventId=e.startEventId,i.stopEventId=e.stopEventId,void 0!==i.compressedData&&(i.compressedData.set(i.eventId,0),this.encoder.onEventUpdated()),i.stopEvent=e,void(e.startEvent=i)}}onStart(e,t){this.pushEventStart(R.Start,e,t)}onRedirectionEnd(){this.pushEvent(R.RedirectionEnd)}onPrecacheEnded(){this.pushEvent(R.PrecacheEnded)}onFirstImage(e,t){this.pushEventBitratePosition(R.FirstImage,e,t)}onStop(e){this.pushEventStatusCode(R.Stop,e)}onForeground(){s.g.d(V,"Received event onForeground but ignored")}
1onBackground(){s.g.d(V,"Received event onBackground but ignored")}onNetworkAvailable(e){s.g.v(V,"Received event onNetworkAvailable type:"+e),this.pushEventState(R.NetworkAvailable,e)}onNetworkLost(){s.g.d(V,"Received event onNetworkLost"),this.pushEvent(R.NetworkLost)}onMute(){s.g.d(V,"Received event onMute"),this.pushEvent(R.Mute)}onUnmute(){s.g.d(V,"Received event onUnmute"),this.pushEvent(R.Unmute)}onMulticastUsed(){this.pushEvent(R.Multicast)}onUnicastUsed(){this.pushEvent(R.Unicast)}data(){return this.encoder.process()}formatDate(e){return v.A.formatDate(new Date(e))}print(){s.g.v(V,"Timeline (startDate:"+this.formatDate(this.startDate)+", stopDate:"+this.formatDate(this.stopDate)+")");for(let e=0;e<this.events.length;e++)this.events[e].print()}toString(){let e=[];for(let t=0;t<this.events.length;t++)e.push(this.events[t].toString());return e.join(", ")}}var F=i(828);let x="BpkAnalyticsSession";class K extends F.f{started;constructor(e,t){super(e,t),this.getURL=void 0,this.getQuery=void 0,this.startStreamingSession=void 0,this.stopAnalyticsSession=this.stopStreamingSession,this.stopStreamingSession=void 0,this.started=!1}attachPlayer(e,t){super.attachPlayer(e,t),void 0===this.handler&&(this.handler=this.smartLib.sessionManager.createSessionHandler(this),this.handler.initPlayerAdapter(),this.handler.addListener(this))}onLoading(){s.g.i(x,"Session is loading...",this.id),!1===this.started?(this.started=!0,this.handler.adSession=this.adSession,void 0!==this.adSession&&(this.adSession.handler=this.handler),this.handler.start("").catch(e=>{})):s.g.d(x,"Exception: onLoading, the session is already running.",this.id)}updateSessionReportValue(e){let t=this.handler.sessionReport;void 0!==this.customParameters["report."+e]&&(t[e]=this.customParameters["report."+e])}onClose(e){s.g.i(x,"Session is closing (status code: "+e+")...",this.id),void 0!==this.handler.sessionReport.metrics&&(this.handler.sessionReport.metrics.redirectionTime=-1),this.updateSessionReportValue("requestedURL"),this.updateSessionReportValue("redirectedURL"),this.stopAnalyticsSession(e)}}var G=i(1142),q=i(7418),Y=i(1134);let Q="BpkCacheMgr";class W{set(e,t){}get(e){}delete(e){}keys(){return[]}}class j{static CACHE_DURATION=1728e5;static CACHE_LIMIT=20;static #e;smartLib;cacheHandler;static getInstance(){return j.#e||(j.#e=new j),j.#e}constructor(){this.cacheHandler=new W}init(e){this.cacheHandler=e}attachInstance(e){s.g.d(Q,"Init cache manager..."),this.smartLib=e,this.getCacheData("report-").forEach(e=>{void 0!==e&&(e.value.sending=!1,this.store(e.key,e.value))})}get(e){let t=this.cacheHandler.get(e);if(void 0!==t)try{return t.startsWith("{")||(t=m.A.base64ToString(t)),t=JSON.parse(t)}catch(t){return s.g.e(Q,"Error while parsing "+e+" ("+t.message+")"),void this.cacheHandler.delete(e)}}store(e,t){this.cacheHandler.set(e,m.A.stringToBase64(JSON.stringify(t)))}update(e,t,i){let a=this.get(e);void 0!==a&&(s.g.d(Q,"Updating "+e+", set "+t+" to "+i),a[t]=i,this.store(e,a))}storeSessionReport(e,t,i=!0,a=Date.now(),r=!1){let n="report-"+m.A.randomIntFromInterval(1e6,9999999)+a;s.g.i(Q,"Storing "+n+" in cache...");let o={version:this.smartLib.getVersion(),date:a,sending:r,address:e,report:t};return this.store(n,o),!0===i&&this.cleanCache(),n}deleteSessionReport(e){s.g.i(Q,"Deleting "+e+" from cache..."),this.cacheHandler.delete(e)}storeKeepaliveReport(e,t){s.g.i(Q,"Storing keepalive-"+t.session_id+" in cache...");let i={version:this.smartLib.getVersion(),date:Date.now(),address:e,report:t};this.store("keepalive-"+t.session_id,i)}deleteKeepaliveReport(e){s.g.i(Q,"Deleting keepalive-"+e+" from cache..."),this.cacheHandler.delete("keepalive-"+e)}getCacheData(e=""){return this.cacheHandler.keys().filter(t=>t.startsWith(e)).map(e=>{let t=this.get(e);return void 0===t?void 0:{key:e,value:t}})}push(){this.cleanCache(),s.g.i(Q,"Sending cache content if any..."),this.getCacheData("report-").forEach(e=>{void 0!==e&&(!0===e.value.sending?s.g.d(Q,"Sending cache "+e.key+" already in progress..."):(s.g.d(Q,"Sending cache "+e.key+"..."),e.value.sending=!0,e.value.report.delay=Math.round((Date.now()-e.value.date)/1e3),this.store(e.key,e.value),G.A.analyticsModule?.AnalyticsRequestManager.getInstance().endSessionCache(e.value.address,e.value.report,this.smartLib.getParameters()).then(t=>{!0===t?this.deleteSessionReport(e.key):(e.value.sending=!1,this.store(e.key,e.value))})))})}cleanExpiredData(e){return this.getCacheData(e).map(e=>void 0!==e&&(void 0===e.value.date||Date.now()-e.value.date>j.CACHE_DURATION)?(s.g.d(Q,"Cleaning "+e.key+" (cache duration reached)..."),void this.cacheHandler.delete(e.key)):e).filter(e=>void 0!==e).sort((e,t)=>
1t.value.date-e.value.date)}cleanCache(){s.g.i(Q,"Clean expired data if any...");let e=this.cleanExpiredData("keepalive-"),t=this.smartLib.sessionManager.sessions.map(e=>e.handler?.sessionReport?.sessionId);e.forEach(e=>{-1===t.indexOf(e.value.report.session_id)&&(s.g.d(Q,"Migrating keepalive "+e.value.report.session_id+" to session..."),e.value.report.timeout=!0,e.value.address.split(",").forEach(t=>{0===t.indexOf(E.A.NOCACHE_PREFIX)?s.g.d(Q,E.A.NOCACHE_PREFIX+" option used, no need to store the report in cache"):this.storeSessionReport(E.A.getInstance().buildAnalyticsAddress(t),e.value.report,!1,e.value.date)}),this.cacheHandler.delete(e.key))});let i=this.cleanExpiredData("report-");if(i.length>=j.CACHE_LIMIT)for(let e=j.CACHE_LIMIT;e<i.length;e++)this.deleteSessionReport(i[e].key)}clean(){Y.A.getInstance().asyncDelay(0,()=>{this.cleanCache()})}release(){this.cleanCache()}}class z extends q.E{analyticsAddress;constructor(e){super(e),this.analyticsAddress=this.handler.smartLib.getParameters().analyticsAddress,s.g.d(Q,"Using cache keepalive manager...",this.handler.id)}start(){super.start(),this.store()}callback(e,t=!0){this.store(),!0===t&&this.next()}stop(){super.stop(),this.delete()}store(){G.A.analyticsModule?.CacheManager.getInstance().storeKeepaliveReport(this.analyticsAddress,this.handler.sessionReport.toEndSessionJSON())}delete(){G.A.analyticsModule?.CacheManager.getInstance().deleteKeepaliveReport(this.handler.sessionReport.sessionId)}}class J extends q.q{cacheKeepaliveManager;constructor(e){super(e),this.cacheKeepaliveManager=new z(e),this.cacheKeepaliveManager.next=()=>{}}start(){super.start(),this.cacheKeepaliveManager.store()}callback(e){this.cacheKeepaliveManager.callback(e),super.callback(e)}stop(){super.stop(),this.cacheKeepaliveManager.delete()}}G.A.analyticsModule={PlayerManager:p,PlayerAdapter:n,GenericPlayerAdapter:d,PlayerEventListener:l,GenericPlayerApi:S,AnalyticsRequestManager:E.A,SessionTrackerTimeline:H,SessionTrackerEvent:L,SessionTrackerEvents:R,Metrics:y,MetricsManager:N,AnalyticsSession:K,CacheManager:j,CacheKeepaliveManager:z,BroadpeakCDNCacheKeepaliveManager:J}},7745:function(e,t,i){i.r(t),i.d(t,{AnalyticsRequestManager:function(){return a.bW},AnalyticsSession:function(){return a.Bw},BroadpeakCDNCacheKeepaliveManager:function(){return a._7},CacheHandler:function(){return o},CacheKeepaliveManager:function(){return a.sX},CacheManager:function(){return a.Go},GenericPlayerAdapter:function(){return a.qT},GenericPlayerApi:function(){return a.NQ},Metrics:function(){return a.K1},MetricsManager:function(){return a.pi},PlayerAdapter:function(){return a.nm},PlayerEventListener:function(){return a.Wy},PlayerManager:function(){return a.dx},SessionTrackerEvent:function(){return a.lX},SessionTrackerEvents:function(){return a.c5},SessionTrackerTimeline:function(){return a.EC}});var s=i(8100),a=i(5387),r=i(1262);let n="sl-";class o{storage;constructor(){if(r.gD.d("BpkCacheHandler","Init cache handler, localStorage is "+("undefined"!=typeof localStorage?"available":"unavailable")+"..."),this.storage={},"undefined"!=typeof localStorage){let e=[];for(let t=0;t<localStorage.length;t++)e.push(localStorage.key(t));e.filter(e=>e.startsWith(n)).map(e=>({key:e,value:localStorage.getItem(e)})).forEach(e=>{void 0!==e.value&&(this.storage[e.key]=e.value)})}}set(e,t){e=n+e,this.storage[e]=t,setTimeout(()=>{localStorage?.setItem(e,t)},1)}get(e,t=!1){let i;return(!1===t&&(e=n+e),e in this.storage)?this.storage[e]:("undefined"!=typeof localStorage&&(i=localStorage.getItem(e)),null!=i?(this.storage[e]=i,i):void 0)}delete(e){e=n+e,delete this.storage[e],setTimeout(()=>{localStorage?.removeItem(e)},1)}keys(){return void 0!==this.storage?Object.keys(this.storage).map(e=>e.replace(n,"")):[]}}s.A.analyticsModule={PlayerManagerHandler:class{#a;loadPlayerAdapters(){return this.#a={},this.#a.generic=a.qT,this.addAdapter("voplayer",s.A.voplayerModule?.VOPlayerAdapter),this.addAdapter("theoplayer",s.A.theoplayerModule?.THEOPlayerAdapter),this.addAdapter("shaka",s.A.shakaModule?.ShakaPlayerAdapter),this.addAdapter("dashjs",s.A.dashjsModule?.DashJsPlayerAdapter),this.addAdapter("html5",s.A.html5Module?.HTML5PlayerAdapter),this.addAdapter("avplay",s.A.avplayModule?.AVPlayAdapter),this.addAdapter("diw387",s.A.diw387Module?.SagemcomDIW387Adapter),this.addAdapter("hbbtv1",s.A.hbbtv1Module?.HbbTV1PlayerAdapter),this.addAdapter("kaltura",s.A.kalturaModule?.KalturaPlayerAdapter),this.addAdapter("connectplayer",s.A.connectplayerModule?.ConnectPlayerAdapter),this.addAdapter("rxplayer",s.A.rxplayerModule?.RxPlayerAdapter),this.addAdapter("videojs",s.A.videojsModule?.VideoJsPlayerAdapter),this.addAdapter("hlsjs",s.A.hlsjsModule?.HlsJsPlayerAdapter),this.addAdapter("bitmovin",s.A.bitmovinModule?.BitmovinPlayerAdapter),this.addAdapter("reactnativeconnectplayer",s.A.reactnativeconnectplayerModule?.ReactNativeConnectPlayerAdapter),this.addAdapter("reactnativetheoplayer",s.A.reactnativetheoplayerModule?.ReactNativeTHEOplayerAdapter),this.addAdapter("reactnativebitmovin",s.A.reactnativebitmovinModule?.ReactNativeBitmovinPlayerAdapter),this.addAdapter("chromecast",s.A.chromecastModule?.ChromecastPlayerAdapter),this.#a}addAdapter(e,t){void 0!==t&&(this.#a[e]=t)}attachPlayer(e,t){for(let i in this.#a)if(void 0!==this.#a[i]&&this.#a[i].checkPlayer(e,t)){let s=new this.#a[i];return s.attachPlayer(e,t),s}}},PlayerEventListener:a.Wy,GenericPlayerApi:a.NQ,CacheHandler:o},s.A.getInstance().registerPlayerAdapters()},9880:function(e,t,i){i.d(t,{A:function(){return o}});var s=i(8379),a=i(1134),r=i(1142);let n="BpkAnalyticsRequestMgr";class o{static METRICS_RECEIVER_PATH="fservices/metricsReceiver";static POST_SESSION_REQUEST_TIMEOUT=5e3;static NOCACHE_PREFIX="nocache=";static #e;static getInstance(){return o.#e||(o.#e=new o),o.#e}buildAnalyticsAddress(e){return(e=e.trim()).endsWith("/")||(e+="/"),e+=o.METRICS_RECEIVER_PATH}endSession(e,t){let i=e.sessionReport;if(0!==t.analyticsAddress.length){let a=t.analyticsAddress.split(","),d=[];return a.forEach(a=>{let h=0===a.indexOf(o.NOCACHE_PREFIX);h?(s.g.d(n,o.NOCACHE_PREFIX+" option used, no need to store the report in cache"),a=this.buildAnalyticsAddress(a.substring(o.NOCACHE_PREFIX.length))):a=this.buildAnalyticsAddress(a),s.g.i(n,"Posting metrics to "+a,e.id);let l=this.postSession(a,i.toEndSessionJSON(),t).then(t=>(s.g.i(n,"Send session metrics ended with status code "+t.httpStatus+" ("+a+")",e.i
1d),t.httpStatus>=200&&t.httpStatus<300?(r.A.analyticsModule.CacheManager.getInstance().push(),!0):(h||r.A.analyticsModule.CacheManager.getInstance().storeSessionReport(a,i.toEndSessionJSON(),!0,Date.now()),!1)));d.push(l)}),Promise.all(d).then(()=>{s.g.d(n,"Send session metrics done",e.id)})}return s.g.w(n,"Metrics platform URL is null, metrics won't be posted anywhere.",e.id),Promise.resolve(!1)}endSessionCache(e,t,i){return 0!==e.length?(s.g.i(n,"Posting cache to "+e),this.postSession(e,t,i).then(t=>(s.g.i(n,"Send cache ended with status code "+t.httpStatus+" ("+e+")"),t.httpStatus>=200&&t.httpStatus<300))):(s.g.w(n,"Metrics platform URL is null, cache won't be posted anywhere."),Promise.resolve(!1))}postSession(e,t,i){return new Promise((r,d)=>{let h={Connection:"close"};void 0!==i.userAgent&&(h["User-Agent"]=i.userAgent);let l=JSON.stringify(t);s.g.v(n,"Executing POST request with body: "+l),a.A.getInstance().asyncPost(e,h,l,o.POST_SESSION_REQUEST_TIMEOUT,e=>{let t=0;void 0!==e.statusCode&&(t=parseInt(e.statusCode,10)),r({httpStatus:t})})})}}}},function(e){var t;return t=7745,e(e.s=t)}])})},50587:function(module,__unused_webpack_exports,__webpack_require__){var process=__webpack_require__(25566);!function(e,t){module.exports=t()}("undefined"!=typeof self?self:__webpack_require__.g,function(){return function(){"use strict";var deferred,__webpack_modules__={828:function(e,t,i){i.d(t,{f:function(){return p}});var s=i(5690),a=i(8379),r=i(7832),n=i(3121),o=i(2765),d=i(5941),h=i(4943),l=i(1105),c=i(1142);let u="BpkStreamingSession";class p{smartLib;options;customParameters;diversitySession;adSession;id;date;handler;playerAdapter;simidControllerAdapter;stopped;multicastStatusListener;constructor(e,t){this.smartLib=e,this.options=t,this.customParameters={},this.id=h.A.randomIntFromInterval(1e4,99999),this.date=Date.now(),this.stopped=!1}attachPlayer(e,t){void 0!==e?void 0===this.handler?(this.playerAdapter=e,a.g.i(u,"Player "+this.playerAdapter.getName()+" attached",this.id)):a.g.e(u,"Exception: attachPlayer error, you cannot attach a player when a session is running.",this.id):void 0===c.A.analyticsModule?a.g.w(u,"Try to attach a player, but analytics module not loaded",this.id):a.g.w(u,"Try to attach a player, but it is not recognized",this.id)}attachSimidController(e){void 0!==e?void 0===this.handler?(this.simidControllerAdapter=e,a.g.i(u,"SIMID Controller "+this.simidControllerAdapter.getName()+" attached",this.id)):a.g.e(u,"Exception: attachSimidController error, you cannot attach a player when a session is running.",this.id):void 0===c.A.simidModule||void 0===c.A.adModule?a.g.w(u,"Try to attach a SIMID controller, but need simid and ad modules",this.id):a.g.w(u,"Try to attach a SIMID controller, but it is not recognized",this.id)}setOption(e,t){void 0===this.handler?(a.g.d(u,"Setting session option "+r.H.optionToString(e)+" to "+r.H.valueToString(e,t),this.id),this.options.set(e,t)):a.g.e(u,"Exception: setOption error, you cannot set an option when a session is running.",this.id)}setAdEventsListener(e){void 0===this.adSession&&(this.adSession=new l.A),this.adSession.setAdEventsListener(e)}setAdDataListener(e){void 0===this.adSession&&(this.adSession=new l.A),this.adSession.setAdDataListener(e)}activateDiversity(e){void 0!==c.A.diversityModule.DiversitySession?void 0===this.diversitySession&&(this.diversitySession=new c.A.diversityModule.DiversitySession,this.diversitySession.activate(e)):a.g.e(u,"Diversity module not loaded, please import it",this.id)}activateAdvertising(){void 0===this.adSession&&(this.adSession=new l.A),this.adSession.activateAdvertising()}setAdParameter(e,t){void 0===this.adSession&&(this.adSession=new l.A),this.adSession.setAdParameter(e,t)}setAdView(e){void 0===this.adSession&&(this.adSession=new l.A),this.adSession.adView=e,this.handler?.omSessionHandler?.omAdSession?.setAdView(e)}setAdViewState(e){void 0===this.adSession&&(this.adSession=new l.A),!0===s.up.isAdViewState(e)?(this.adSession.adViewState=e,this.handler?.omSessionHandler?.omAdSession?.setAdViewState(e)):a.g.e(u,"Please use a defined state within the AdViewState enum.",this.id)}registerAdFriendlyObstructionView(e,t,i){void 0===this.adSession&&(this.adSession=new l.A),s.D6.isAdFriendlyObstructionPurpose(t)&&"string"==typeof i?(this.adSession.adFriendlyObstructionViews.push({view:e,purpose:t,reason:i}),this.handler?.omSessionHandler?.omAdSession?.registerAdFriendlyObstructionView(e,t,i)):a.g.e(u,"Ad friendly objection view not registered, please check arguments types: purpose -> state within the AdFriendlyObstructionPurpose enum, reason -> string",this.id)}unregisterFriendlyObstruction(e){void 0!==this.adSession&&(this.adSession.adFriendlyObstructionViews=this.adSession.adFriendlyObstructionViews.filter(t=>t.view!==e),this.handler?.omSessionHandler?.omAdSession?.unregisterFriendlyObstruction(e))}unregisterAllFriendlyObstructions(){void 0!==this.adSession&&(this.adSession.adFriendlyObstructionViews=[],this.handler?.omSessionHandler?.omAdSession?.unregisterAllFriendlyObstructions())}setAdCustomReference(e){void 0===this.adSession&&(this.adSession=new l.A),"string"==typeof e?(this.adSession.adCustomReference=e,void 0!==this.handler?.omSessionHandler?.omAdSession&&a.g.w(u,'An ad is already playing, the ad custom reference "'+e+'" will be set for the next ad',this.id)):a.g.e(u,"Ad custom reference not set, reference argument has to be a string",this.id)}registerAdVerificationData(e,t,i){void 0===this.adSession&&(this.adSession=new l.A);
1let s={verificationVendor:t,verificationURL:e,verificationParameters:i};this.adSession.adVerificationData.push(s),void 0!==this.handler?.omSessionHandler?.omAdSession&&a.g.w(u,'An ad is already playing, the ad verification data "'+JSON.stringify(s)+'" will be set for the next ad',this.id)}adUserInteraction(e){void 0===this.adSession&&(this.adSession=new l.A),"string"==typeof e?(a.g.d(u,"Ad interaction: "+e,this.id),this.handler?.adTrackingManager?.adUserInteraction(e),this.adSession.adPalSession?.sendAdClick(),void 0!==this.handler?.omSessionHandler?.omAdSession&&this.handler.omSessionHandler.omAdSession.adUserInteraction(e)):a.g.e(u,"Ad interaction type not triggered, interactionType argument has to be a string",this.id)}adTouch(e){void 0===this.adSession&&(this.adSession=new l.A),a.g.d(u,"Ad touch",this.id),this.adSession.adPalSession?.sendTouch(e)}setCustomParameter(e,t){"string"==typeof e?this.customParameters[e]=d.A.toBkAString(String(t)):a.g.e(u,"Error: Only string values are accepted for custom parameters",this.id)}setEventCallbackEnabled(e){void 0===this.adSession&&(this.adSession=new l.A),this.adSession.setEventCallbackEnabled(e)}getURL(e){return a.g.i(u,"getURL with "+e,this.id),void 0===this.handler?d.A.typeParameter(e,"string","Error: requestedURL should be a string")&&d.A.stringNonEmpty(e,"Error: requestedURL is empty")?(this.handler=this.smartLib.sessionManager.createSessionHandler(this),this.handler.diversitySession=this.diversitySession,void 0!==this.diversitySession&&(this.diversitySession.handler=this.handler),this.handler.adSession=this.adSession,void 0!==this.adSession&&(this.handler.simidControllerAdapter=this.simidControllerAdapter,this.adSession.handler=this.handler),this.handler.start(e)):Promise.resolve(n.S.error(n.S.RESULT_API_PARAMETER_FORMAT_ERROR)):(a.g.e(u,"Exception: getURL error, the session is already running.",this.id),Promise.resolve(n.S.error(n.S.RESULT_REQUEST_ALREADY_DONE)))}getQuery(){return a.g.i(u,"getQuery",this.id),void 0===this.handler?(this.handler=this.smartLib.sessionManager.createProxySessionHandler(this),this.handler.getQuery()):(a.g.e(u,"Exception: getQuery error, the session is already running.",this.id),"")}precacheEnded(){this.handler?.notifyPrecacheEnded()}startStreamingSession(e,t){return a.g.i(u,"startStreamingSession with "+e+" and "+t,this.id),!(!d.A.typeParameter(e,"string","Error: requestedURL should be a string")||!d.A.typeParameter(t,"string","Error: redirectedURL should be a string"))&&(void 0===this.handler?(a.g.e(u,"Exception: startSteamingSession error, getQuery() should be called prior to startStreamingSession(...)"),!1):this.handler instanceof o.A?(this.handler.start(e,t),!0):(a.g.e(u,"Exception: startSteamingSession error, startStreamingSession(...) cannot be called once getURL(...) has been called"),!1))}stopStreamingSession(e){return void 0!==e?a.g.i(u,"Stopping streaming session with statusCode "+e+"...",this.id):a.g.i(u,"Stopping streaming session...",this.id),void 0!==this.handler&&this.handler.stop(e),void 0!==this.playerAdapter&&this.playerAdapter.detachPlayer(),void 0!==this.simidControllerAdapter&&this.simidControllerAdapter.detachSimidController(),this.stopped=!0,this.handler}isNanoCDNUsed(){return void 0!==this.handler&&this.handler.isNanoCDNUsed()}getVideoMulticastStatus(){return void 0!==this.handler?this.handler.videoMulticastStatus:r.H.MULTICAST_INACTIVE}getAudioMulticastStatus(){return void 0!==this.handler?this.handler.audioMulticastStatus:r.H.MULTICAST_INACTIVE}getDataMulticastStatus(){return void 0!==this.handler?this.handler.dataMulticastStatus:r.H.MULTICAST_INACTIVE}setMulticastStatusListener(e){a.g.d(u,"Multicast status listener "+(void 0!==e?"set":"unset"),this.id),this.multicastStatusListener=e}getAdList(){return this.handler?.adTrackingManager?.adList||[]}getCurrentAd(){return this.handler?.adTrackingManager?.getCurrentAd()}getCurrentAdBreak(){return this.handler?.adTrackingManager?.getCurrentAdBreak()}getPositionForBookmark(){let e=this.handler?.adTrackingManager?.getPositionForBookmark();return void 0!==e?e:-1}getPositionForPlayback(e,t=!1){let i=this.handler?.adTrackingManager?.getPositionForPlayback(Number(e),t);return void 0!==i?i:-1}}},1105:function(e,t,i){i.d(t,{A:function(){return n}});var s=i(8379),a=i(5690);let r="BpkAdSession";class n{handler;adEventsListener;adDataListener;adActivated;adParameters;eventCallbackEnabled;adView;adViewState;adFriendlyObstructionViews;adCustomReference;adVerificationData;adPalSession;constructor(){this.adEventsListener={onAdBreakBegin:e=>{},onAdBegin:(e,t)=>{},onAdEnd:(e,t)=>{},onAdBreakEnd:e=>{},onAdSkippable:(e,t,i,s,a)=>{}},this.adActivated=!1,this.adParameters={},this.eventCallbackEnabled=!0,this.adView=void 0,this.adViewState=a.up.NORMAL,this.adFriendlyObstructionViews=[],this.adCustomReference="",this.adVerificationData=[]}setAdEventsListener(e){Object.assign(this.adEventsListener,e),s.g.d(r,"Ad events listener "+(void 0!==e?"set":"unset"),this.handler?.id)}setAdDataListener(e){this.adDataListener=e,s.g.d(r,"Ad data listener "+(void 0!==e?"set":"unset"),this.handler?.id)}activateAdvertising(){!0!==this.adActivated&&(this.adActivated=!0,s.g.d(r,"Ad session activated",this.handler?.id))}setAdParameter(e,t){this.activateAdvertising(),this.adParameters[e]=String(t),s.g.d(r,"Adding parameter "+e+"="+t,this.handler?.id)}setEventCallbackEnabled(e){this.eventCallbackEnabled=e}isAdActivated(){return!0===this.adActivated}getAdAllowedQuery(){let e=["ad_allowed","adallowed"],t=["0","false"],i=!0;
1return Object.keys(this.adParameters).forEach(s=>{e.indexOf(s.toLowerCase())>=0&&t.indexOf(this.adParameters[s].toLowerCase())>=0&&(i=!1)}),i}resetAdParameters(){this.adParameters={}}hasAdParameters(){return Object.keys(this.adParameters).length>0}onDashEvent(e){this.isAdActivated()?this.eventCallbackEnabled?s.g.d(r,"Event received but legacy mode has been deprecated",this.handler.id):s.g.d(r,"Event received but callbacks are disabled",this.handler.id):s.g.d(r,"Event received but ad not enabled (advertising not activated)",this.handler.id)}}},1134:function(e,t,i){i.d(t,{A:function(){return o}});var s=i(4943),a=i(1262),r=i(6506);let n="BpkJobMgr";class o{static #t;worker;jobs;static getInstance(){return o.#t||(o.#t=new o),o.#t}constructor(){this.jobs={}}async(e,t,i,s){return this.start(e,0,-1,t,i,s)}asyncGet(e,t,i,s){return this.start("get",0,-1,()=>{r.A.getInstance().requestHandler.get(e,t,i,s)},()=>({url:e,headers:t,timeout:i}),s)}asyncPost(e,t,i,s,a){return this.start("post",0,-1,()=>{r.A.getInstance().requestHandler.post(e,t,i,s,a)},()=>({url:e,headers:t,body:i,timeout:s}),a)}asyncDelay(e,t){let i;let s=this.start("delay",e,-1,t=>{i=setTimeout(t,e)},void 0,t);return s.task=i,s}asyncDelayPromise(e){return new Promise((t,i)=>{o.getInstance().asyncDelay(e,()=>{t()})})}asyncNonce(e,t,i,s){let r;void 0===s&&(s=()=>{a.gD.d(n,"ios async nonce"),r=setTimeout(i,e)});let o=this.start("waitNonce",0,e,s,void 0,t,i,!0);return o.task=r,o}waitNonce(e,t,i,s){let r;void 0===s&&(s=()=>{a.gD.d(n,"ios wait nonce"),r=setTimeout(i,e)});let o=this.start("waitNonce",0,e,s,void 0,t,i,!1);return o.task=r,o}start(e,t,i,s,r,o,d=()=>{},h=!0){if(void 0===this.worker&&("function"==typeof CoreWorker?this.worker=new CoreWorker:"object"==typeof CoreWorker&&(this.worker=CoreWorker)),void 0!==this.worker){let s=this.createJob();return s.active=!0,s.command=e,s.startDelay=t,s.timeoutDelay=i,s.requestInfo=r,s.result=o,s.timeout=d,s.async=h,a.gD.v(n,'Starting job "'+e+'" (id: '+s.id+", async: "+s.async+")..."),h?this.worker.async(s.id,s.command,s.startDelay,s.timeoutDelay):this.worker.sync(s.id,s.command,s.startDelay,s.timeoutDelay),s}return s(o),{command:e}}interrupt(e){void 0!==e&&void 0!==this.worker&&(a.gD.v(n,'Interrupting job "'+e.command+'"...'),this.worker.interrupt(e.id))}cancel(e){void 0!==e&&(void 0!==this.worker&&(a.gD.v(n,'Cancelling job "'+e.command+'"...'),e.active=!1,this.worker.cancel(e.id),delete this.jobs[e.id]),void 0!==e.task&&clearTimeout(e.task))}requestInfo(e){let t=this.jobs[e];return void 0!==t&&"function"==typeof t.requestInfo?t.requestInfo():{}}result(e,t){let i=this.jobs[e];void 0!==i&&"function"==typeof i.result&&!0===i.active&&(i.active=!1,i.result(t)),delete this.jobs[e]}timeout(e){let t=this.jobs[e];void 0!==t&&"function"==typeof t.timeout&&!0===t.active&&(a.gD.v(n,'Job "'+t.command+'" timeout...'),t.active=!1,t.timeout()),delete this.jobs[e]}createJob(){let e=s.A.randomIntFromInterval(1e6,9999999);for(;void 0!==this.jobs[e];)e=s.A.randomIntFromInterval(1e6,9999999);return this.jobs[e]={id:e},this.jobs[e]}}},1142:function(e,t,i){i.d(t,{A:function(){return y}});var s=i(8379),a=i(6506),r=i(5866),n=i(5941),o=i(8724),d=i(2765),h=i(7832),l=i(828),c=i(1262),u=i(4943);let p="BpkSessionMgr";class g{static UNSTARTED_SESSION_MAX_DURATION=36e4;smartLib;sessions;init(e){this.smartLib=e,this.sessions=[]}createStreamingSession(e,t){this.cleanFinishedSessions();let i=new l.f(this.smartLib,h.H.create(e,t));return this.sessions.push(i),this.sessions.length>10&&c.gD.w(p,"There are "+this.sessions.length+" active sessions. Use session.stopStreamingSession() to free up memory."),i}createAnalyticsSession(e,t){this.cleanFinishedSessions();let i=new y.analyticsModule.AnalyticsSession(this.smartLib,h.H.create(e,t));return this.sessions.push(i),this.sessions.length>10&&c.gD.w(p,"There are "+this.sessions.length+" active sessions. Use session.stopStreamingSession() to free up memory."),i}cleanFinishedSessions(){for(let e=this.sessions.length-1;e>=0;e--){let t=this.sessions[e];void 0===t.handler&&Date.now()-t.date>g.UNSTARTED_SESSION_MAX_DURATION?(t.playerAdapter?.detachPlayer(),t.simidControllerAdapter?.detachSimidController(),this.sessions.splice(e,1)):(!0===t.handler?.stopped||!0===t.stopped)&&this.sessions.splice(e,1)}}createSessionHandler(e){let t=new o.A(this.smartLib,e);return void 0!==e?(t.id=e.id,t.options=e.options,t.playerAdapter=e.playerAdapter):(t.id="main-"+u.A.randomIntFromInterval(10,99),t.options=new h.H),t}createProxySessionHandler(e){let t=new d.A(this.smartLib,e);return void 0!==e?(t.id=e.id,t.options=e.options,t.playerAdapter=e.playerAdapter):(t.id="main-"+u.A.randomIntFromInterval(10,99),t.options=new h.H),t}
1release(){this.cleanFinishedSessions(),this.sessions.forEach(e=>{void 0!==y.analyticsModule&&e instanceof y.analyticsModule.AnalyticsSession?e.stopAnalyticsSession():e.stopStreamingSession()}),this.sessions=[]}}var S=i(3473),E=i(5690),m=i(5305),A=i(1105);let v="BpkSmartLib";class y{static #t;static FORCE_TEARDOWN_DISABLED=-1;static FORCE_TEARDOWN_DEFAULT=0;static FORCE_TEARDOWN_ENABLED=1;static BPSessionEndsNormally=200;static BPFormatNotSupportedError=3001;static BPDecodingError=3002;static BPNetworkingError=3003;static BPAccessRightError=3004;static BPUnspecifiedError=3005;static analyticsModule;static adModule;static nanoCDNModule;static diversityModule;static monitoringModule;#e;#s;#a;options;sessionManager;nanoCDNHostManager;adManager;internalAdManager;monitoringManager;handler;nanoCDNReceiver;nanoCDNHttpsEnabled;nanoCDNHttpsEnabledStrict=!1;static getInstance(){return y.#t||(y.#t=new y),y.#t}constructor(){this.#e=!1,this.#s=!1,this.#a={analyticsAddress:"",nanoCDNHost:"",broadpeakDomainNames:"",forceTeardown:y.FORCE_TEARDOWN_DEFAULT,uuid:"",userAgent:void 0,deviceType:"",customParameters:{}},this.options=new h.H,this.sessionManager=new g,this.adManager=new E.X2,this.internalAdManager=new m.A}init(e,t,i,o){return s.g.i(v,"Init SmartLib..."),s.g.i(v,"Version: "+r.A),this.#e||this.#s?(s.g.e(v,"Error: SmartLib already initialized, please use SmartLib.release() before initializing."),!1):void 0!==o?(s.g.e(v,"Error: this init method has been removed, please use SmartLib.init(analyticsAddress, nanoCDNHost, broadpeakDomainNames) instead."),!1):n.A.typeOrNullParameter(e,"string","Error: analyticsAddress should be a string or null")&&n.A.typeOrNullParameter(t,"string","Error: nanoCDNHost should be a string or null")&&n.A.typeOrNullParameter(i,"string","Error: broadpeakDomainNames should be a string or null")?(this.#i(e),this.#r(t),this.#n(i),this.setForceTeardown(y.FORCE_TEARDOWN_DEFAULT),s.g.i(v,"Parameters:analyticsAddress="+e+", nanoCDNHost="+t+", broadpeakDomainNames="+i),void 0!==y.nanoCDNModule&&void 0===this.nanoCDNHostManager&&(this.nanoCDNHostManager=new y.nanoCDNModule.NanoCDNHostManager,void 0!==this.nanoCDNReceiver&&(this.nanoCDNHostManager.registerNanoCDNReceiver(this.nanoCDNReceiver),this.nanoCDNReceiver=void 0),void 0!==this.nanoCDNHttpsEnabled&&(this.nanoCDNHostManager.setNanoCDNHttpsEnabled(this.nanoCDNHttpsEnabled,this.nanoCDNHttpsEnabledStrict),this.nanoCDNHttpsEnabled=void 0,this.nanoCDNHttpsEnabledStrict=!1)),this.sessionManager.init(this),this.nanoCDNHostManager?.init(this,t),this.adManager.init(this),this.internalAdManager.init(this),void 0!==y.monitoringModule&&(this.monitoringManager=new y.monitoringModule.RealTimeMonitoringManager(this)),a.A.getInstance().attachInstance(this),y.analyticsModule?.CacheManager.getInstance().attachInstance(this),y.analyticsModule?.PlayerManager.getInstance().attachInstance(this),y.nanoCDNModule?.MdnsManager.getInstance().attachInstance(this),y.diversityModule?.DiversityPluginManager.getInstance().attachInstance(this),y.adModule?.OMSDKManager.getInstance().attachInstance(this),y.simidModule?.SimidControllerManager.getInstance().attachInstance(this),S.A.getInstance().init(this),S.A.getInstance().addListener(this.nanoCDNHostManager),y.analyticsModule?.CacheManager.getInstance().clean(),this.#e=!0,!0):(s.g.e(v,"Error: initialization aborted"),!1)}initAnalytics(e){return s.g.i(v,"Init SmartLib analytics..."),s.g.i(v,"Version: "+r.A),this.#s||this.#e?(s.g.e(v,"Error: SmartLib analytics already initialized, please use SmartLib.release() before initializing."),!1):void 0===y.analyticsModule?(s.g.e(v,"Error: Analytics module not loaded, please import it."),!1):n.A.typeOrNullParameter(e,"string","Error: analyticsAddress should be a string or null")?(this.#i(e),this.options=new h.H,s.g.i(v,"Parameters:analyticsAddress="+e),this.sessionManager.init(this),this.adManager.init(this),this.internalAdManager.init(this),void 0!==y.monitoringModule&&(this.monitoringManager=new y.monitoringModule.RealTimeMonitoringManager(this)),a.A.getInstance().attachInstance(this),y.analyticsModule?.CacheManager.getInstance().attachInstance(this),y.analyticsModule?.PlayerManager.getInstance().attachInstance(this),y.adModule?.OMSDKManager.getInstance().attachInstance(this),y.simidModule?.SimidControllerManager.getInstance().attachInstance(this),S.A.getInstance().init(this),y.analyticsModule?.CacheManager.getInstance().clean(),this.#s=!0,!0):(s.g.e(v,"Error: initialization aborted"),!1)}getURL(e,t){return void 0!==this.handler&&(s.g.e(v,"Exception: A session is already running, please use SmartLib.stopStreamingSession(...) before. Stopping the current one...",this.handler.id),this.stopStreamingSession()),s.g.i(v,"getURL with "+e,this.handler?.id),void 0===t&&(t=()=>{}),n.A.typeParameter(t,"function","Error: callback should be a function")?this.#e?n.A.typeParameter(e,"string","Error: requestedURL should be a string")&&n.A.stringNonEmpty(e,"Error: requestedURL is empty")?(this.handler=this.sessionManager.createSessionHandler(),this.handler.options=h.H.create(this.options),this.handler.playerAdapter=y.analyticsModule?.PlayerManager.getInstance().getPlayerAdapter(),this.handler.adSession=this.internalAdManager.adSession,void 0!==this.internalAdManager.adSession&&(this.internalAdManager.adSession.handler=this.handler),this.internalAdManager.adSession=new A.A,this.internalAdManager.adSession.setEventCallbackEnabled(this.internalAdManager.eventCallbackEnabled),this.internalAdManager.adSession.setAdEventsListener(this.internalAdManager.adEventsListener),this.handler.start(e,t)):(t(""),Promise.resolve("")):(s.g.e(v,"Exception: Implementation error, SmartLib.init(...) should be called prior to SmartLib.getURL(...)",this.handler?.id),t(""),Promise.resolve("")):Promise.resolve("")}getQuery(){return void 0!==this.handler&&(s.g.e(v,"Exception: A session is already running, please use SmartLib.stopStreamingSession(...) before. Stopping the current one..."),this.stopStreamingSession()),s.g.i(v,"getQuery"),this.#e?(this.handler=this.sessionManager.createProxySessionHandler(),this.handler.options=h.H.create(this.options),this.handler.playerAdapter=y.analyticsModule?.PlayerManager.getInstance().getPlayerAdapter(),this.handler.getQuery()):(s.g.e(v,"Exception: Implementation error, SmartLib.init(...) should be called prior to SmartLib.getQuery(...)"),"")}startStreamingSession(e,t){return s.g.i(v,"startStreamingSession with "+e+" and "+t,this.handler?.id),this.#e?!(!n.A.typeParameter(e,"string","Error: contentURL should be a string")||!n.A.typeParameter(t,"string","Error: redirectedURL should be a string"))&&(void 0===this.handler?(s.g.e(v,"Exception: Implementation error, SmartLib.getQuery() should be called prior to SmartLib.startStreamingSession(...)",this.handler?.id),!1):this.handler instanceof d.A?(this.handler.start(e,t),
1!0):(s.g.e(v,"Exception: Implementation error, SmartLib.startStreamingSession(...) cannot be called with SmartLib.getURL(...)",this.handler?.id),!1)):(s.g.e(v,"Exception: Implementation error, SmartLib.init(...) should be called prior to SmartLib.startStreamingSession(...)",this.handler?.id),!1)}stopStreamingSession(e){void 0!==e?s.g.i(v,"Stopping streaming session with statusCode "+e+"...",this.handler?.id):s.g.i(v,"Stopping streaming session...",this.handler?.id);let t=this.handler;return void 0!==this.handler?(this.handler.stop(e),this.handler=void 0):s.g.d(v,"Stopping streaming session aborted, no session started"),t}createStreamingSession(e){if(this.#e){let t=void 0===e;t&&(e=this.options);let i=this.sessionManager.createStreamingSession(this.options,e);return t?s.g.i(v,"Creating streaming session...",i.id):(s.g.i(v,"Creating streaming session with options...",i.id),e.printUpdates(v,"",i.id)),i}s.g.e(v,"Exception: Implementation error, SmartLib.init(...) should be called prior to SmartLib.createStreamingSession(...)")}getStreamingSession(e){this.sessionManager.cleanFinishedSessions();let t=this.sessionManager.sessions.find(t=>t.id===e);return void 0===t&&s.g.w(v,"Streaming session with id "+e+" not found"),t}createAnalyticsSession(e){if(this.#s){let t=void 0===e;t&&(e=this.options);let i=this.sessionManager.createAnalyticsSession(this.options,e);return t?s.g.i(v,"Creating analytics session...",i.id):(s.g.i(v,"Creating analytics session with options...",i.id),e.printUpdates(v,"",i.id)),i}s.g.e(v,"Exception: Implementation error, SmartLib.initAnalytics(...) should be called prior to SmartLib.createAnalyticsSession(...)")}release(){this.#e&&(s.g.i(v,"Releasing SmartLib..."),this.stopStreamingSession(),this.internalAdManager.release(),this.adManager.release(),this.nanoCDNHostManager?.release(),this.sessionManager.release(),this.monitoringManager?.release(),S.A.getInstance().release(),y.nanoCDNModule?.MdnsManager.getInstance().release(),y.analyticsModule?.PlayerManager.getInstance().release(),y.analyticsModule?.CacheManager.getInstance().release(),a.A.getInstance().release(),y.diversityModule?.DiversityPluginManager.getInstance().release(),y.adModule?.OMSDKManager.getInstance().release(this),y.simidModule?.SimidControllerManager.getInstance().release(),this.#e=!1),this.#s&&(s.g.i(v,"Releasing SmartLib analytics..."),this.stopStreamingSession(),this.internalAdManager.release(),this.adManager.release(),this.sessionManager.release(),this.monitoringManager?.release(),S.A.getInstance().release(),y.analyticsModule?.PlayerManager.getInstance().release(),y.analyticsModule?.CacheManager.getInstance().release(),a.A.getInstance().release(),y.adModule?.OMSDKManager.getInstance().release(this),y.simidModule?.SimidControllerManager.getInstance().release(),this.#s=!1),this.options=new h.H,this.#i(""),this.#r(""),this.#n(""),this.nanoCDNReceiver=void 0,this.nanoCDNHttpsEnabled=void 0,this.nanoCDNHttpsEnabledStrict=!1}attachPlayer(e,t){void 0!==e?(y.analyticsModule?.PlayerManager.getInstance().setPlayerAdapter(e),void 0!==this.handler&&s.g.e(v,"Exception: You cannot attach a player when a session is running, this player will be used for the next session.",this.handler.id)):void 0===y.analyticsModule?s.g.w(v,"Try to attach a player, but analytics module not loaded",this.handler?.id):s.g.w(v,"Try to attach a player, but it is not recognized",this.handler?.id)}detachPlayer(){return void 0!==this.handler?(s.g.e(v,"Exception: You cannot detach the player when a session is running",this.handler.id),!1):(y.analyticsModule?.PlayerManager.getInstance().setPlayerAdapter(void 0),!0)}isInitialized(){return this.#e}isAnalyticsInitialized(){return this.#s}getMetricsManager(){if(void 0!==this.handler)return this.handler.metricsManager}getListener(){return y.analyticsModule?.PlayerManager.getInstance().getPlayerAdapter()}getVersion(){return r.A}getParameters(){return this.#a}setUUID(e){n.A.typeParameter(e,"string","Error: uuid should be a string")&&(this.#a.uuid=n.A.toBkAString(e.substring(0,36)))}setUserAgent(e){n.A.typeOrUndefinedParameter(e,"string","Error: userAgent should be a string")&&(this.#a.userAgent=e)}setDeviceType(e){n.A.typeParameter(e,"string","Error: deviceType should be a string")&&(this.#a.deviceType=e,S.A.getInstance().deviceType=e)}setCustomParameter(e,t){"string"==typeof e?this.#a.customParameters[e]=n.A.toBkAString(String(t)):s.g.e(v,"Error: Only string values are accepted for custom parameters")}resetCustomParameters(){this.#a.customParameters={}}setForceTeardown(e){"number"==typeof e?this.#a.forceTeardown=e>=1?y.FORCE_TEARDOWN_ENABLED:e<=-1?y.FORCE_TEARDOWN_DISABLED:y.FORCE_TEARDOWN_DEFAULT:s.g.e(v,"Exception: parameter forceTeardown must be SmartLib.FORCE_TEARDOWN_DISABLED, SmartLib.FORCE_TEARDOWN_DEFAULT or SmartLib.FORCE_TEARDOWN_ENABLED")}setNanoCDNResolvingRetryDelay(e){void 0!==this.nanoCDNHostManager?(s.g.v(v,"Updating nanoCDN resolving retry asyncDelay to "+e+"ms"),this.nanoCDNHostManager?.setNanoCDNResolvingRetryDelay(e)):s.g.e(v,"Exception: Implementation error, SmartLib.init(...) should be called prior to SmartLib.setNanoCDNResolvingRetryDelay(...)")}registerNanoCDNReceiver(e){void 0!==this.nanoCDNHostManager?(this.nanoCDNReceiver=void 0,this.nanoCDNHostManager.registerNanoCDNReceiver(e)):this.nanoCDNReceiver=e}
1setNanoCDNHttpsEnabled(e,t=!1){let i=e?t?" (HTTP fallback disabled)":" with HTTP fallback":"";s.g.v(v,"Updating nanoCDN https enabled to "+e+i),void 0!==this.nanoCDNHostManager?(this.nanoCDNHttpsEnabled=void 0,this.nanoCDNHostManager.setNanoCDNHttpsEnabled(e,t)):(this.nanoCDNHttpsEnabled=e,this.nanoCDNHttpsEnabledStrict=t)}restartNanoCDNResolving(){this.nanoCDNHostManager?.restartNanoCDNResolving()}setOption(e,t){s.g.d(v,"Setting global option "+h.H.optionToString(e)+" to "+h.H.valueToString(e,t)),this.options.set(e,t)}#i=e=>{null!=e&&0!==e.length?this.#a.analyticsAddress=e:this.#a.analyticsAddress=""};#r=e=>{null!=e&&0!==e.length?(void 0===y.nanoCDNModule&&s.g.w(v,"Warning: nanoCDNHost is set while the module is not loaded."),this.#a.nanoCDNHost=e.replace(/\s/g,"")):this.#a.nanoCDNHost=""};#n=e=>{null!=e&&0!==e.length?this.#a.broadpeakDomainNames=e.replace(/\s/g,""):this.#a.broadpeakDomainNames=""}}},1262:function(e,t,i){i.d(t,{X2:function(){return o.X2},GM:function(){return h},r2:function(){return c},CE:function(){return n.A},Em:function(){return S.A},$b:function(){return r.$},gD:function(){return r.g},Je:function(){return a.A},x6:function(){return s.A},fF:function(){return u.f},H1:function(){return p.H},Sy:function(){return g.S}});var s=i(1142),a=i(6506),r=i(8379),n=(i(1134),i(3473)),o=i(5690);let d="BpkAdPalMgr";class h{setConsentSettings(e){r.g.e(d,"setConsentSettings not implemented")}registerPalManagerCallback(e){r.g.e(d,"registerPalManagerCallback not implemented")}unregisterPalManagerCallback(){r.g.e(d,"unregisterPalManagerCallback not implemented")}generateAdPalSession(e){r.g.e(d,"generateAdPalSession not implemented")}reset(){r.g.e(d,"reset not implemented")}release(){r.g.e(d,"release not implemented")}setValue(e,t,i){r.g.e(d,"setValue not implemented")}setDescriptionURL(e){this.setValue("setDescriptionURL",e)}setOmidPartner(e,t){this.setValue("setOmidPartner",e,t)}setOmidVersion(e){this.setValue("setOmidVersion",e)}setPlayerType(e){this.setValue("setPlayerType",e)}setPlayerVersion(e){this.setValue("setPlayerVersion",e)}setPpid(e){this.setValue("setPpid",e)}setVideoPlayerHeight(e){this.setValue("setVideoPlayerHeight",e)}setVideoPlayerWidth(e){this.setValue("setVideoPlayerWidth",e)}setWillAdAutoPlay(e){this.setValue("setWillAdAutoPlay",e)}setWillAdPlayMuted(e){this.setValue("setWillAdPlayMuted",e)}}let l="BpkAdPalSession";class c{getNonce(){return r.g.e(l,"getNonce not implemented"),""}sendAdClick(){r.g.e(l,"sendAdClick not implemented")}sendAdImpression(){r.g.e(l,"sendAdImpression not implemented")}sendPlaybackStart(){r.g.e(l,"sendPlaybackStart not implemented")}sendPlaybackEnd(){r.g.e(l,"sendPlaybackEnd not implemented")}sendTouch(e){r.g.e(l,"sendTouch not implemented")}setAdView(e){r.g.d(l,"setAdView not implemented")}}var u=i(828),p=i(7832),g=i(3121),S=i(3445)},2765:function(e,t,i){i.d(t,{A:function(){return h}});var s=i(8724),a=i(1262),r=i(5866),n=i(1142),o=i(3641);let d="BpkProxySessionHandler";class h extends s.A{startCalled;constructor(e,t){super(e,t),this.startCalled=!1}getQuery(){let e=this.smartLib.nanoCDNHostManager?.getCurrentNanoCDNDescr(),t=void 0!==e?"nanoCDN host: "+e.hostIP:"No nanoCDN found";a.gD.i(d,t+" ("+r.A+")",this.id),this.options.print(d,"",this.id),this.initPlayerAdapter(),this.initManagers(),this.notifyStart();let i="bk-ml=1";return void 0!==e?n.A.nanoCDNModule.NanoCDNRequestManager.getInstance().getQuery(e,this).then(e=>(i+=e,a.gD.i(d,"getQuery result : "+i,this.id),i)):(a.gD.i(d,"getQuery result : "+i,this.id),Promise.resolve(i))}start(e,t){if(this.startCalled)a.gD.e(d,"Implementation error: SmartLib.startStreamingSession(...) already called.",this.id);else{a.gD.i(d,"Starting streaming session...",this.id),this.startCalled=!0,this.sessionReport.startSessionDate=Date.now(),this.sessionReport.requestedURL=o.A.parse(e),this.sessionReport.redirectedURL=o.A.parse(t),this.sessionReport.precached=this.isPrecached(),this.sessionResult=a.Sy.success(t);let i=this.smartLib.getParameters(),s={broadpeakDomainNames:i.broadpeakDomainNames,forceTeardown:i.forceTeardown};this.handleRedirectedURL(s)}}}},3121:function(e,t,i){i.d(t,{S:function(){return s}});class s{static RESULT_NO_ERROR=0;static RESULT_NO_STREAMING_URL_FOUND=3100;static RESULT_CDN_RESPONSE_UNREADABLE=3101;static RESULT_REQUESTED_URL_NOT_FOUND_ON_CDN=3102;static RESULT_REQUESTED_URL_NOT_FOUND_ON_NANOCDN=3103;static RESULT_REQUESTED_URL_CDN_ERROR=3104;static RESULT_NANOCDN_SESSION_LIMIT_REACHED=3201;static RESULT_NANOCDN_SESSION_LIMIT_REACHED_ON_REQUESTED_CHANNEL=3202;static RESULT_NANOCDN_SERVICE_UNAVAILABLE=3203;static RESULT_NANOCDN_CHANNEL_UNAVAILABLE=3204;static RESULT_NANOCDN_REQUEST_LOCAL_IF_CONNECTED_TO_WIFI_NOT_ALLOWED=3205;static RESULT_NANOCDN_RESPONSE_UNREADABLE=3206;static RESULT_API_PARAMETER_FORMAT_ERROR=3400;static RESULT_API_NOT_INITIALIZED=3401;static RESULT_SESSION_HAS_BEEN_STOPPED_DURING_REQUEST=3402;static RESULT_REQUEST_ALREADY_DONE=3403;static RESULT_NO_DETAILED_ERROR=0;static RESULT_DETAILED_ERROR_PARSING_ERROR=-1;url;errorCode;detailedErrorCode;detailedErrorMessage;nanoCDNUsed;
1nanoCDNDescr;constructor(e,t,i=""){this.url=e,this.errorCode=t,this.detailedErrorMessage=i.trim();let a=i.match("^([0-9]+).*");null!==a&&void 0!==a[1]?this.detailedErrorCode=parseInt(a[1],10):""===this.detailedErrorMessage?this.detailedErrorCode=s.RESULT_NO_DETAILED_ERROR:this.detailedErrorCode=s.RESULT_DETAILED_ERROR_PARSING_ERROR,this.nanoCDNUsed=!1,this.nanoCDNDescr=void 0}static success(e){return new s(e,s.RESULT_NO_ERROR)}static error(e,t=""){return new s("",e,t)}getURL(){return this.url}isError(){return this.errorCode!==s.RESULT_NO_ERROR}getErrorCode(){return this.errorCode}getErrorMessage(){return s.getErrorMessage(this.errorCode)}getDetailedErrorCode(){return this.detailedErrorCode}getDetailedErrorMessage(){return this.detailedErrorMessage}isNanoCDNUsed(){return this.nanoCDNUsed}static getErrorMessage(e){switch(e){case s.RESULT_NO_ERROR:return"Result success. The session has been created.";case s.RESULT_NO_STREAMING_URL_FOUND:return"Request error. No streaming URL has been found. Default error when requesting the CDN (BkM/uCDN).";case s.RESULT_CDN_RESPONSE_UNREADABLE:return"Request error. The CDN response is unreadable (timeout error, CORS error, connection error).";case s.RESULT_REQUESTED_URL_NOT_FOUND_ON_CDN:return"Request error. Content not found on the CDN (error 4XX).";case s.RESULT_REQUESTED_URL_NOT_FOUND_ON_NANOCDN:return"Request error. Content not found on the nanoCDN (error 404, timeout error, CORS error or connection error).";case s.RESULT_REQUESTED_URL_CDN_ERROR:return"Request error. The CDN returned an unknown error (error 5XX).";case s.RESULT_NANOCDN_SESSION_LIMIT_REACHED:return"nanoCDN error. All nanoCDN on the network responded with session limit reached error.";case s.RESULT_NANOCDN_SESSION_LIMIT_REACHED_ON_REQUESTED_CHANNEL:return"nanoCDN error. All nanoCDN on the network responded with session limit reached error for the requested channel.";case s.RESULT_NANOCDN_SERVICE_UNAVAILABLE:return"nanoCDN error. All nanoCDN on the network have their service unavailable.";case s.RESULT_NANOCDN_CHANNEL_UNAVAILABLE:return"nanoCDN error. The requested channel is unavailable on all nanoCDN of the network.";case s.RESULT_NANOCDN_REQUEST_LOCAL_IF_CONNECTED_TO_WIFI_NOT_ALLOWED:return"nanoCDN error. A nanoCDN on 127.0.0.1 has been found and is connected to Wi-Fi but it is not allowed.";case s.RESULT_API_PARAMETER_FORMAT_ERROR:return"Api error. A method parameter does not have the right format.";case s.RESULT_API_NOT_INITIALIZED:return"Api error. SmartLib init not called";case s.RESULT_SESSION_HAS_BEEN_STOPPED_DURING_REQUEST:return"Workflow error. The session has been stopped during request.";case s.RESULT_REQUEST_ALREADY_DONE:return"Workflow error. The request has already been done for that session."}return"No error message for the error code "+e}}},3445:function(e,t,i){i.d(t,{A:function(){return s}});class s{static formatDate(e=new Date){let t="";e<0&&(e*=-1,t="-");let i=9>=e.getDate()?"0"+e.getDate():e.getDate(),s=e.getMonth()+1<=9?"0"+(e.getMonth()+1):e.getMonth()+1,a=9>=e.getHours()?"0"+e.getHours():e.getHours(),r=9>=e.getMinutes()?"0"+e.getMinutes():e.getMinutes(),n=9>=e.getSeconds()?"0"+e.getSeconds():e.getSeconds(),o=String(e.getMilliseconds());return 1===o.length?o="00"+o:2===o.length&&(o="0"+o),t+s+"-"+i+" "+a+":"+r+":"+n+"."+o}static formatTime(e){let t="";e<0&&(e*=-1,t="-");let i=e%1e3,s=Math.floor(e/1e3%60),a=Math.floor(e/6e4%60),r=Math.floor(e/36e5%24),n=r<=9?"0"+r:r,o=a<=9?"0"+a:a,d=s<=9?"0"+s:s,h=String(i);return 1===h.length?h="00"+h:2===h.length&&(h="0"+h),t+n+":"+o+":"+d+"."+h}}},3473:function(e,t,i){i.d(t,{A:function(){return r}});var s=i(1262);let a="BpkAppStateMgr";class r{static #t;smartLib;listeners;bound;networkAvailable;appInBackground;networkType=99;mute=0;osName="";osVersion="";deviceType="";static getInstance(){return r.#t||(r.#t=new r),r.#t}constructor(){this.bound=!1,this.release()}init(e){s.gD.d(a,"Initializing core app state manager..."),this.smartLib=e,!1===this.bound?(this.networkAvailable=!0,this.appInBackground=!1):s.gD.d(a,"Core app state manager is bound to the target, skipping default values..."),this.release()}release(){this.listeners=[]}setDeviceInfo(e,t,i){this.osName=e,this.osVersion=t,this.deviceType=i}bind(){s.gD.i(a,"Device:osName="+this.osName+", osVersion="+this.osVersion),s.gD.i(a,"Device:type="+this.deviceType),this.bound=!0}isConnectedToWifi(){return this.networkType>=10&&this.networkType<=12}addListener(e){void 0===e||this.listeners.includes(e)||this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);-1!==t&&this.listeners.splice(t,1)}notifyEvent(e,t,i,s){"function"==typeof e[t]&&e[t](i,s)}notifyForeground(){s.gD.d(a,"App is in foreground"),this.appInBackgroun
1d=!1,this.listeners.forEach(e=>{this.notifyEvent(e,"onForeground")})}notifyBackground(){s.gD.d(a,"App is in background"),this.appInBackground=!0,this.listeners.forEach(e=>{this.notifyEvent(e,"onBackground")})}notifyNetworkAvailable(e){void 0===e?(s.gD.d(a,"Network is available (networkType:"+e+")"),this.networkAvailable=!0,this.listeners.forEach(e=>{this.notifyEvent(e,"onNetworkAvailable",99)})):this.networkType!==e&&(s.gD.d(a,"Network is available (networkType:"+e+")"),this.networkAvailable=!0,this.networkType=e,this.listeners.forEach(t=>{this.notifyEvent(t,"onNetworkAvailable",e)}))}notifyNetworkLost(){!1!==this.networkAvailable&&(s.gD.d(a,"Network is unavailable"),this.networkAvailable=!1,this.networkType=0,this.listeners.forEach(e=>{this.notifyEvent(e,"onNetworkLost")}))}notifyMute(){s.gD.d(a,"Volume is muted"),this.mute=1,this.listeners.forEach(e=>{this.notifyEvent(e,"onMute")})}notifyUnmute(){s.gD.d(a,"Volume is unmuted"),this.mute=0,this.listeners.forEach(e=>{this.notifyEvent(e,"onUnmute")})}}},3641:function(e,t,i){i.d(t,{A:function(){return s}});class s{static REGEX_URL="^(https?)\\:\\/\\/(([^:\\/?#]*)(?:\\:([0-9]+))?)([\\/]{0,1}[^?#]*)(\\?[^#]*|)(#.*|)$";href;protocol;host;hostname;port;path;query;params;hash;dirty;static parse(e){if(!e||!e.length)return null;let t=e.match(s.REGEX_URL);if(!t)return null;let i=new s;return i.href=e,i.protocol=t[1],i.host=t[2],i.hostname=t[3],i.port=t[4],i.path=t[5],i.query=t[6],i.hash=t[7],i.params=[],(i.query&&i.query.length?i.query.substring(1).split("&"):[]).forEach(e=>{let t=e.indexOf("="),s=t>0?e.substring(0,t):e,a=t>0?e.substring(t+1):null;i.params.push({key:s,value:a})}),i.dirty=!1,i}static clone(e){if(!(e instanceof s))return null;let t=new s;return t.href=e.href,t.protocol=e.protocol,t.host=e.host,t.hostname=e.hostname,t.port=e.port,t.path=e.path,t.query=e.query,t.params=e.params?.map(e=>Object.assign({},e)),t.hash=e.hash,t.dirty=e.dirty,t}constructor(){}getProtocol(){return this.protocol}getHost(){return this.host}getHostname(){return this.hostname}getPort(){return this.port}getPath(){return this.path}getPathParts(){return this.path?this.path.split("/").filter(e=>""!==e):[]}getQuery(){return this.query}hasParam(e){return this.params&&this.params.some(t=>t.key===e)}getParam(e){let t=this.params?.find(t=>t.key===e);return t?t.value:null}getParams(){return this.params}setProtocol(e){return this.protocol=e,this.dirty=!0,this}setHost(e){return this.host=e,this.dirty=!0,this}setPath(e){return this.path=e,this.dirty=!0,this}addParam(e,t){return this.params.push({key:e,value:t}),this.dirty=!0,this}setParam(e,t){let i=this.params.find(t=>t.key===e);return i?i.value=t:this.addParam(e,t),this.dirty=!0,this}setParams(e){return this.params=e,this.dirty=!0,this}clearParams(){return this.params=[],this.dirty=!0,this}applyRelativeUrl(e){if(!e||!e.length)return this;let t=this.getPathParts(),i=(e.startsWith("/")?"":"/")+e,a=s.parse("http://domain"+i),r=a.getPathParts();if(e.startsWith("/"))this.path=a.getPath();else{for(let e of(this.path.endsWith("/")||t.pop(),r))"."!==e&&(".."===e?t.pop():t.push(e));this.path="/"+t.join("/")}return this.params=a.getParams(),this.dirty=!0,this}toString(){return this.dirty&&(this.query=this.params.length?"?"+this.params.map(e=>null!==e.value?`${e.key}=${e.value}`:e.key).join("&"):"",this.href=this.protocol+"://"+this.host+this.path+this.query,this.dirty=!1),this.href}}},4623:function(__unused_webpack_module,__nested_webpack_exports__,__nested_webpack_require_40289__){function nativeRequire(lib){return eval("require")(lib)}function nativeMainRequire(lib){return eval("require").main.require(lib)}__nested_webpack_require_40289__.d(__nested_webpack_exports__,{C:function(){return nativeMainRequire},t:function(){return nativeRequire}})},4943:function(e,t,i){i.d(t,{A:function(){return s}});class s{static randomIntFromInterval(e,t){return Math.floor(Math.random()*(t-e+1)+e)}static bufferToBase64Lookup(e){return e<26?String.fromCharCode(e+65):e<52?String.fromCharCode(e-26+97):e<62?String.fromCharCode(e-52+48):62===e?"-":63===e?"_":""}static bufferToBase64(e){let t;let i=e.data(),a=e.length(),r="";for(t=0;t<a;t+=3){let e=[void 0,void 0,void 0,void 0];e[0]=i[t]>>2,e[1]=(3&i[t])<<4,a>t+1&&(e[1]|=i[t+1]>>4,e[2]=(15&i[t+1])<<2),a>t+2&&(e[2]|=i[t+2]>>6,e[3]=63&i[t+2]);for(let t=0;t<e.length;t++)void 0===e[t]||(r+=s.bufferToBase64Lookup(e[t]))}return r}static BASE64_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/";static stringToBase64(e){let t="",i="",a=e.length%3;if(a>0)for(;a<3;a++)i+="=",e+="\0";for(a=0;a<e.length;a+=3){let i=(e.charCodeAt(a)<<16)+(e.charCodeAt(a+1)<<8)+e.charCodeAt(a+2);i=[i>>>18&63,i>>>12&63,i>>>6&63,63&i],t+=s.BASE64_CHARS[i[0]]+s.BASE64_CHARS[i[1]]+s.BASE64_CHARS[i[2]]+s.BASE64_CHARS[i[3]]}return t.substring(0,t.length-i.length)+i}static base64ToString(e){let t="="===(e=e.replace(RegExp("[^"+s.BASE64_CHARS.split("")+"=]","g"),"")).charAt(e.length-1)?"="===e.charAt(e.length-2)?"AA":"A":"",i="";e=e.substr(0,e.length-t.length)+t;for(let t=0;t<e.length;t+=4){let a=(s.BASE64_CHARS.indexOf(e.charAt(t))<<18)+(s.BASE64_CHARS.indexOf(e.charAt(t+1))<<12)+(s.BASE64_CHARS.indexOf(e.charAt(t+2))<<6)+s.BASE64_CHARS.indexOf(e.charAt(t+3));i+=String.fromCharCode(a>>>16&255,a>>>8&255,255&a)}return i.substring(0,i.length-t.length)}static floor(e){return e>>>0}static bufferToString(e,t=e.length){let i="[0x";for(let s=0;s<t;s++)i+=("00"+Number(e[s]).toString(16)).slice(-2),s<t-1&&(i+=",0x");return i+"] (capacity:"+e.length+")"}}},5305:function(e,t,i){i.d(t,{A:function(){return h}});var s=i(8379),a=i(1134);let r="BpkAdPalSessionRequest";class n{static TIMEOUT_DELAY=5e3;active;timeout;adPalManager;adPalSession;generating;waitNonceResolveCallback;constructor(e){this.active=!0,this.timeout=!1,this.adPalManager=e,this.generating=!1}setAdPalSession(e){this.adPalSession=e,this.active=!1}generateAdPalSession(){s.g.d(r,"Generating nonce...");let e=()=>{s.g.d(r,"Nonce generation timeout"),this.timeout=!0,void 0!==this.waitNonceResolveCallback&&(this.setAdPalSession(void 0),this.waitNonceResolveCallback(void 0))};this.generating=!0,a.A.getInstance().asyncNonce(n.TIMEOUT_DELAY,e=>{let t=e.adPalSession;s.g.d(r,"Generated (async) nonce="+t?.getNonce()),this.setAdPalSession(t)},e,()=>{let t=setTimeout(e,n.TIMEOUT_DELAY);this.adPalManager.generateAdPalSession(e=>{clearTimeout(t),s.g.d(r,"Generated (legacy) nonce="+e?.getNonce()),this.setAdPalSession(e),void 0!==this.waitNonceResolveCallback&&!1===this.timeout?this.waitNonceResolveCallback(e):void 0!==this.waitNonceResolveCallback&&!0===this.timeout&&this.waitNonceResolveCallback(void 0)})})}getAdPalSession(){return void 0===this.adPalSession&&!0===this.active?(s.g.getInstance().printDebugLogs(r,"Trying to get nonce, but not yet ready"),new Promise((e,t)=>{a.A.getInstance().waitNonce(n.TIMEOUT_DELAY,t=>{let i=t.adPalSession;s.g.d(r,"Found nonce="+i?.getNonce()),this.setAdPalSession(i),e(this.adPalSession)},()=>{this.active=!1,this.timeout=!0,this.waitNonceResolveCallback=void 0,e(this.adPalSession)},()=>{!0===this.generating?this.waitNonceResolveCallback=e:(this.waitNonceResolveCallback=e,this.generateAdPalSession())})})):new Promise((e,t)=>{e(this.adPalSession)})}}var o=i(1105);let d="BpkInternalAdMgr";class h{static AD_NONCE_QUERY_PARAMETER="paln";smartLib;initialized;adPalManager;omPartnerName;omPartnerVersion;firstAdPalSessionRequest;palSessionEnabled=!1;adSession;eventCallbackEnabled;adEventsListener;constructor(){this.initialized=!1,this.palSessionEnabled=!1,this.adSession=new o.A,this.eventCallbackEnabled=!0,this.adEventsListener=void 0}init(e){this.smartLib=e,this.initialized||(this.initialized=!0,this.adSession=new o.A,this.eventCallbackEnabled=!0,this.adEventsListener=void 0,this.omPartnerName="Broadpeak_tv",this.omPartnerVersion=e.adManager.getVersion(),s.g.d(d,"Ad manager version: "+this.omPartnerVersion),s.g.d(d,"Ad manager loaded"))}setPalManager(e){s.g.d(d,"Native PAL manager registered"),this.adPalManager=e}requestAdPalSession(){let e=this.firstAdPalSessionRequest;return void 0!==e&&void 0===e.adPalSession&&!0===e.active&&!1===e.timeout?(s.g.d(d,"Nonce generation in progress, will use it"),this.firstAdPalSessionRequest=void 0):(this.firstAdPalSessionRequest=void 0,e=new n(this.adPalManager),this.initialized&&this.palSessionEnabled?(e.generateAdPalSession(),void 0===this.adPalManager&&e.setAdPalSession(void 0)):e.setAdPalSession(void 0)),e}release(){this.initialized=!1,this.palSessionEnabled=!1,this.adSession=new o.A,this.eventCallbackEnabled=!0,this.adEventsListener=void 0,void 0!==this.firstAdPalSessionRequest&&(this.firstAdPalSessionRequest.setAdPalSession(void 0),this.firstAdPalSessionRequest=void 0),void 0!==this.adPalManager&&this.adPalManager.reset()}setConsentSettings(e){this.adPalManager?.setConsentSettings(e)}setPalParameters(e,t,i,a,r,o,h,l,c,u,p){void 0!==this.adPalManager?(void 0!==e&&this.adPalManager.setDescriptionURL(e),void 0!==t&&void 0!==i&&this.adPalManager.setOmidPartner(t,i),void 0!==a&&this.adPalManager.setOmidVersion(a),void 0!==r&&this.adPalManager.setPlayerType(r),void 0!==o&&this.adPalManager.setPlayerVersion(o),void 0!==h&&this.adPalManager.setPpid(h),0!==l&&this.adPalManager.setVideoPlayerHeight(l),0!==c&&this.adPalManager.setVideoPlayerWidth(c),this.adPalManager.setWillAdAutoPlay(u),this.adPalManager.setWillAdPlayMuted(p),this.palSessionEnabled||(this.palSessionEnabled=!0,s.g.d(d,"Generating first nonce..."),this.firstAdPalSessionRequest=new n(this.adPalManager),this.firstAdPalSessionRequest.generateAdPalSession())):s.g.e(d,"Google PAL manager not set, cannot set parameters")}}},5690:function(e,t,i){i.d(t,{D6:function(){return n},X2:function(){return h},eQ:function(){return o},up:function(){return r}});var s=i(1142),a=i(8379);class r{static MINIMIZED="minimized";static COLLAPSED="collapsed";static NORMAL="normal";static EXPANDED="expanded";static FULLSCREEN="fullscreen";static isAdViewState(e){switch(e){case r.MINIMIZED:case r.COLLAPSED:case r.NORMAL:case r.EXPANDED:case r.FULLSCREEN:return!0}return!1}}class n{static VIDEO_CONTROLS=0;static CLOSE_AD=1;static NOT_VISIBLE=2;static OTHER=3;static isAdFriendlyObstructionPurpose(e){return e>=0&&e<=3}}class o{static AD_LINEAR="linear";static AD_NON_LINEAR="nonlinear";static AD_LINEAR_AND_NON_LINEAR="linear_and_nonlinear";static UNSUPPORTED="unsupported";static getAdType(e){switch(e){case this.AD_LINEAR:case this.AD_NON_LINEAR:case this.AD_LINEAR_AND_NON_LINEAR:return e;case void 0:return this.AD_LINEAR;default:return this.UNSUPPORTED}}}let d="BpkAdMgr";class h{smartLib;palSDK;static getInstance(){return s.A.getInstance().adManager}init(e){this.smartLib=e}release(){}getVersion(){return"05.02.03"}attachPALSDK(e){"object"==typeof e.pal?(a.g.d(d,"PAL SDK attached"),this.palSDK=e):a.g.e(d,"Try to attach PAL SDK, but it is not recognized")}setConsentSettings(e){this.smartLib.internalAdManager.setConsentSettings(e)}setPalParameters(e,t,i,s,a,r,n,o,d,h,l){this.smartLib.internalAdManager.setPalParameters(e,t,i,s,a,r,n,o,d,h,l)}activateAdvertising(){this.smartLib.internalAdManager.adSession.activateAdvertising()}setAdParameter(e,t){this.smartLib.internalAdManager.adSession.setAdParameter(e,t)}setEventCallbackEnabled(e){this.smartLib.internalAdManager.eventCallbackEnabled=e,this.smartLib.internalAdManager.adSession.setEventCallbackEnabled(e)}setAdEventsListener(e){this.smartLib.internalAdManager.adEventsListener=e,this.smartLib.internalAdManager.adSession.setAdEventsListener(e)}}},5866:function(e,t){t.A="05.03.03.7957d5f"},5941:function(e,t,i){i.d(t,{A:function(){return r}});var s=i(8379);let a="BpkValidator";class r{static typeParameter(e,t,i){return typeof e===t||(s.g.e(a,i),!1)}static typeOrUndefinedParameter(e,t,i){return typeof e===t||void 0===e||(s.g.e(a,i),!1)}static typeOrNullParameter(e,t,i){return typeof e===t||null===e||(s.g.e(a,i),!1)}static stringNonEmpty(e,t){return"string"==typeof e&&e.length>0||(s.g.e(a,t),!1)}static toBkAString(e){return void 0!==e&&"string"==typeof e?e.replace(/\n/g,"").replace(/\t/g,"").replace(/\r/g,""):e}}},6506:function(e,t,i){i.d(t,{A:function(){return u}});var s=i(8379),a=i(5866),r=i(1134),n=i(1262),o=i(5305),d=i(1142),h=i(3641);let l="BpkRequestMgr";class c{static get(e,t,i,s){s({body:void 0,headers:void 0,statusCode:-1,message:"",responseURL:null})}static post(e,t,i,s,a){a({body:void 0,headers:void 0,statusCode:-1,message:"",responseURL:null})}}class u{static TEARDOWN_PATH="/teardown/";static TEARDOWN_METRICS_QUERY="metrics";static TEARDOWN_TIMELINE_QUERY="metricsTL";static KEEPALIVE_PATH="/keepalive";static QUERY_PARAMETER_SESSION_ID="bk-session_id";static QUERY_PARAMETER_SESSION_CREATED="bk-session";static HEADER_CDN_DETAILED_ERROR_CODE="x-bpk-error";static HEADER_CDN_TIMING="x-bpk-timing";static CDN_REQUEST_TIMEOUT=2e4;static BKS_REQUEST_TIMEOUT=5e3;static KEEPALIVE_REQUEST_INTERVAL=5e3;static PAL_TIMEOUT=150;static #t;requestHandler=c;smartLib;static getInstance(){return u.#t||(u.#t=new u),u.#t}constructor(){}init(e){this.requestHandler=e}attachInstance(e){this.smartLib=e}release(){}getHeaders(e=this.smartLib.getParameters()){let t={};return void 0!==e.userAgent&&(t["User-Agent"]=e.userAgent),t}async getURL(e,t,i){let h,c,p;let g=i.options,S=void 0!==t.nanoCDNDescr&&!0===g.get(n.H1.REQUEST_NANO_CDN),E=u.isBroadpeakDomainName(e,t.broadpeakDomainNames)&&!0===g.get(n.H1.REQUEST_BROADPEAK_CDN),m=!0===g.get(n.H1.MULTICAST_ONLY)||!0===g.get(n.H1.LEGACY_MULTICAST_ONLY);if(S?"*"===t.broadpeakDomainNames?s.g.i(l,"Workflow 5.2 (v"+a.A+")",i.id):""===t.broadpeakDomainNames?s.g.i(l,"Workflow 5.4 (v"+a.A+")",i.id):E?s.g.i(l,"Workflow 5.6 => 5.2 (v"+a.A+")",i.id):s.g.i(l,"Workflow 5.6 => 5.4 (v"+a.A+")",i.id):"*"===t.broadpeakDomainNames?s.g.i(l,"Workflow 5.1 (v"+a.A+")",i.id):""===t.broadpeakDomainNames?s.g.i(l,"Workflow 5.3 (v"+a.A+")",i.id):E?s.g.i(l,"Workflow 5.5 => 5.1 (v"+a.A+")",i.id):s.g.i(l,"Workflow 5.5 => 5.3 (v"+a.A+")",i.id),s.g.i(l," Parameters",i.id),s.g.i(l," analyticsAddress="+t.analyticsAddress,i.id),s.g.i(l," nanoCDNHost="+(void 0===t.nanoCDNDescr?"":t.nanoCDNDescr.hostIP),i.id),s.g.i(l," broadpeakDomainNames="+t.broadpeakDomainNames,i.id),g.print(l," ",i.id),S){if
1(void 0===d.A.nanoCDNModule)return s.g.e(l,"Error: detected nanoCDN session but nanoCDNModule not loaded."),n.Sy.error(n.Sy.RESULT_REQUESTED_URL_NOT_FOUND_ON_NANOCDN);if((h=await d.A.nanoCDNModule.NanoCDNRequestManager.getInstance().requestNanoCDNSession(e,t,i)).result.isError()){if(E)s.g.d(l,"nanoCDN responded an error, requesting the BkM (using nanoCDN: "+h.nanoCDNHostIP+")",i.id);else{if(!0===m)return h.noFallbackResult;h.result=n.Sy.success(e)}}}else if(!0===m)return s.g.e(l,"Error: multicast only option enabled but session is not using nanoCDN."),n.Sy.error(n.Sy.RESULT_REQUESTED_URL_NOT_FOUND_ON_NANOCDN);if(!0===i.adSession?.getAdAllowedQuery()&&(c=this.smartLib.internalAdManager.requestAdPalSession()),(!m||!S||h?.result.isError())&&(p=await this.requestBkM(e,t,h?.nanoCDNHostIP,i)).isError())return p;if(void 0===h||h.result.isError()||(void 0!==p&&!0===E&&!1===m?p.url.getHostname()===h.nanoCDNHostIP&&(p.nanoCDNUsed=!0,p.nanoCDNDescr=h.nanoCDNDescr,!0===i.options.get(n.H1.ULTRA_LOW_LATENCY_SUPPORT)&&p.url.setParam("ulls","1")):p=h.result),void 0!==p&&void 0!==i.adSession&&i.adSession.isAdActivated()){let e;let s=i.adSession.adParameters;for(let e in s)p.url.addParam(e,encodeURIComponent(s[e]));void 0!==c&&(!0!==c.generating||E||await r.A.getInstance().asyncDelayPromise(u.PAL_TIMEOUT),void 0!==(e=await c.getAdPalSession())&&(p.url.addParam(o.A.AD_NONCE_QUERY_PARAMETER,e.getNonce()),i.adSession.adPalSession=e,e.setAdView(i.adSession.adView))),await this.requestBkYou(p,t,i,E,e)}return void 0===p?n.Sy.error(n.Sy.RESULT_NO_STREAMING_URL_FOUND):p}requestBkM(e,t,i,a){let r=h.A.clone(e),o=a.options,c=u.isBroadpeakDomainName(e,t.broadpeakDomainNames);if(c&&!0===o.get(n.H1.REQUEST_BROADPEAK_CDN)||!0===o.get(n.H1.REQUEST_REDIRECT_THIRD_PARTY_CDN)){r.addParam("response","200"),r.addParam("bk-ml","1"),"string"==typeof i&&0!==i.length&&r.addParam("nanocdnhost",i),!0===o.get(n.H1.SESSION_PRECACHE)&&r.addParam("bk-precache","1");let p=null;return!0===a.diversitySession?.activated?p=d.A.diversityModule.DiversityRequestManager.getInstance().requestDiversitySession(e,u.CDN_REQUEST_TIMEOUT,t,a):(c?s.g.d(l,"Sending request to the BkM/umbrella: "+r.toString(),a.id):s.g.d(l,"Sending request to third party CDN: "+r.toString(),a.id),p=this.getRedirectionLocation(r,u.CDN_REQUEST_TIMEOUT,t,a)),p.then(t=>(c?s.g.d(l,"BkM/umbrella responded with status code "+t.httpStatus,a.id):s.g.d(l,"Third party CDN responded with status code "+t.httpStatus,a.id),this.parseCDNTiming(t,a),a.sessionReport.cdnStatusCode=t.httpStatus,t.httpStatus>=200&&t.httpStatus<400?""===t.redirectedURL?n.Sy.error(n.Sy.RESULT_CDN_RESPONSE_UNREADABLE,this.getBkMDetailedErrorMessage(t,a)):t.redirectedURL.startsWith("/")||t.redirectedURL.startsWith("../")?(s.g.i(l,"Redirected URL is relative, patching to absolute URL",a.id),n.Sy.success(h.A.clone(e).applyRelativeUrl(t.redirectedURL))):n.Sy.success(h.A.parse(t.redirectedURL)):t.httpStatus<=0?n.Sy.error(n.Sy.RESULT_CDN_RESPONSE_UNREADABLE):t.httpStatus>=400&&t.httpStatus<500?n.Sy.error(n.Sy.RESULT_REQUESTED_URL_NOT_FOUND_ON_CDN,this.getBkMDetailedErrorMessage(t,a)):t.httpStatus>=500&&t.httpStatus<600?n.Sy.error(n.Sy.RESULT_REQUESTED_URL_CDN_ERROR,this.getBkMDetailedErrorMessage(t,a)):n.Sy.error(n.Sy.RESULT_NO_STREAMING_URL_FOUND,this.getBkMDetailedErrorMessage(t,a)))).then(e=>(e.isError()&&(a.sessionReport.cdnStatusCode=e.getDetailedErrorCode()),e))}return Promise.resolve(n.Sy.success(r))}parseCDNTiming(e,t){let i=e.headers[u.HEADER_CDN_TIMING];if(void 0!==i&&"string"==typeof i){for(let e of i.split(";"))if(e.startsWith("bpkhttpserver,")){let i=e;try{let i=parseInt(e.split(",")[1],10);if(!isNaN(i))return s.g.d(l,"bpkhttpserver response timing: "+i+"ms",t.id),void(t.sessionReport.bpkhttpserverTiming=i)}catch(e){}return void s.g.e(l,"BkM/umbrella is providing a bpkhttpserver response timing but it cannot be parsed ("+i+")",t.id)}}s.g.d(l,"BkM/umbrella is not providing a response timing",t.id)}getBkMDetailedErrorMessage(e,t){if(!0===e.headers.hasOwnProperty(u.HEADER_CDN_DETAILED_ERROR_CODE)){let i=e.headers[u.HEADER_CDN_DETAILED_ERROR_CODE];return s.g.d(l,"Reading detailed error code from header: "+i,t.id),i}return s.g.d(l,"Reading detailed error code from http status: "+e.httpStatus+" "+e.httpMessage,t.id),String(e.httpStatus+" "+e.httpMessage)}requestBkYou(e,t,i,a,r){i.simidControllerAdapter?.attachSession(i);let o=void 0!==i.adSession?.adDataListener,d=h.A.clone(e.url);if(d.addParam("bk-ml","1.0"),!1===i.options.get(n.H1.REQUEST_BKYOU_IF_BROADPEAK_CDN)&&a&&!o)return i.adTrackingManager?.initBkYouSession(d,void 0,{},r,r?.getNonce()),e;let c=h.A.clone(e.url);return c.addParam("bk-ml",o?"2.0":"1.0"),this.adTracking(i,t,c,!1).then(t=>{if(!(t.httpStatus>=200&&t.httpStatus<300))return s.g.d(l,"BkYou response unreadable (status code), falling back to legacy mode",i.id),i.adTrackingManager?.notifyAdDataListener(!0),e;{let n;!a&&t.responseURL&&(s.g.d(l,"Using BkYou redirection: "+t.responseURL,i.id),e.url=t.responseURL,(d=h.A.clone(e.url)).setParam("bk-ml","1.0"));try{n=JSON.parse(t.content)}catch(t){return s.g.d(l,"BkYou file unreadable (parsing), falling back to legacy mode",i.id),i.adTrackingManager?.notifyAdDataListener(!0),e}let o=n.sessiontoken;if(void 0===o)return e;s.g.d(l,"BkYou session token: "+o,i.id);let c=n.playbackqueries;
1Array.isArray(c)&&c.forEach(t=>{if(-1!==t.indexOf("=")){let i=t.split("=");e.url.setParam(i[0],i[1]),d.setParam(i[0],i[1])}}),i.adTrackingManager?.initBkYouSession(d,o,n,r,r?.getNonce())}return e})}getRedirectionLocation(e,t,i,a){return new Promise((n,o)=>{let d=this.getHeaders(i);d.Connection="close";let h=r.A.getInstance().asyncGet(e.toString(),d,t,e=>{let t=0,i="";void 0!==e.statusCode&&(t=parseInt(e.statusCode,10)),void 0!==e.headers&&void 0!==e.headers.location?i=e.headers.location:t>=200&&t<400&&s.g.e(l,'Location header cannot be read, please ensure "Access-Control-Expose-Headers: Location" is configured.',a.id),n({httpStatus:t,httpMessage:e.message,headers:e.headers,redirectedURL:i})});a.jobs.push(h)})}requestSession(e,t,i,a){let o=t.sessionReport,d=h.A.clone(o.redirectedURL);d.setPath(d.getPath()+e),d.clearParams();let c=t.options.get(n.H1.SESSION_REPORTING_MODE),p=c===n.H1.SESSION_REPORTING_MODE_DEFAULT||c===n.H1.SESSION_REPORTING_MODE_KEEPALIVE_TEARDOWN;return!0===p?(void 0!==o.timeline&&o.gdpr!==n.H1.GDPR_DELETE&&d.addParam(u.TEARDOWN_TIMELINE_QUERY,o.timeline.data().base64()),d.addParam(u.TEARDOWN_METRICS_QUERY,o.toQuery()),!0===t.isPrecached()&&d.addParam("precache",!0===t.sessionReport.precacheEnded?0:1),s.g.i(l,"Sending session request using method "+a+" with metrics to "+d.toString(),t.id)):s.g.i(l,"Sending session request using method "+a+" without metrics to "+d.toString(),t.id),new Promise((n,h)=>{let c=this.getHeaders(i),g=r=>{s.g.i(l,"Send session request ends with status code: "+r.statusCode,t.id);let o="";void 0!==r.body&&(o=r.body),"POST"===a&&(r.statusCode<200||r.statusCode>=300)?this.requestSession(e,t,i,"GET").then(e=>{n({httpStatus:e.httpStatus,body:e.body,method:"GET"})}):n({httpStatus:r.statusCode,body:o,method:a})};if("GET"===a)r.A.getInstance().asyncGet(d.toString(),c,u.BKS_REQUEST_TIMEOUT,g);else if("POST"===a){c["Content-Type"]="application/json";let e="";!0===p&&(e=JSON.stringify({Player:o.toEndSessionJSON()})),s.g.v(l,"Executing POST request with body: "+e),r.A.getInstance().asyncPost(d.toString(),c,e,u.BKS_REQUEST_TIMEOUT,g)}})}keepalive(e,t,i){return this.requestSession(u.KEEPALIVE_PATH,e,t,i)}teardown(e,t,i){let s=u.TEARDOWN_PATH+e.sessionReport.statusCode;return this.requestSession(s,e,t,i)}adEvent(e,t){let i=this.getHeaders(),a=e.options.get(n.H1.USERAGENT_AD_EVENT);void 0!==a&&(i["User-Agent"]=a),r.A.getInstance().asyncGet(t,i,2e4,t=>{s.g.i(l,"Ad event request ends with status code: "+t.statusCode,e.id)})}adTracking(e,t,i,a=!1){return s.g.d(l,"Sending request to the BkYou (async:"+a+"): "+i,e.id),new Promise((t,n)=>{let o=this.getHeaders();if(!1===a){let a=r.A.getInstance().asyncGet(i.toString(),o,u.BKS_REQUEST_TIMEOUT,i=>{s.g.d(l,"BkYou responded with status code "+i.statusCode,e.id),t({httpStatus:i.statusCode,content:i.body,responseURL:h.A.parse(i.responseURL)})});e.jobs.push(a)}else r.A.getInstance().asyncGet(i.toString(),o,u.BKS_REQUEST_TIMEOUT,i=>{s.g.d(l,"BkYou responded with status code "+i.statusCode,e.id),t({httpStatus:i.statusCode,content:i.body,responseURL:h.A.parse(i.responseURL)})})})}static isBroadpeakDomainName(e,t){return null!==t&&""!==t&&("*"===t||!!e&&t.split(",").indexOf(e.getHostname())>=0)}}},7418:function(e,t,i){i.d(t,{E:function(){return d},q:function(){return h}});var s=i(6506),a=i(8379),r=i(1134),n=i(7832);let o="BpkKeepAliveMgr";class d{handler;active;delay;job;constructor(e){this.handler=e,this.active=!0,this.delay=e.options.get(n.H.SESSION_KEEPALIVE_FREQUENCY)}start(){this.job=r.A.getInstance().asyncDelay(this.delay,()=>{this.process()})}callback(e,t=!0){a.g.e(o,"callback method should be overridden")}process(e=!0){if(this.active){this.handler.notifyKeepaliveSessionReportRequested(this.handler.sessionReport),this.handler.sessionReport.keepaliveRequestDate=Date.now();let t={userAgent:this.handler.smartLib.getParameters().userAgent};this.callback(t,e)}}next(e=!0){this.job=r.A.getInstance().asyncDelay(this.delay,()=>{this.process()})}stop(){this.active=!1,r.A.getInstance().cancel(this.job)}isActive(){return this.active}}class h extends d{method;constructor(e){super(e),this.method="POST",a.g.d(o,"Using Broadpeak CDN keepalive manager...",this.handler.id)}callback(e,t=!0){s.A.getInstance().keepalive(this.handler,e,this.method).then(e=>{if(this.method=e.method,e.httpStatus>0&&(e.httpStatus<200||e.httpStatus>=300))a.g.d(o,"Stopping keepalive...",this.handler.id),this.stop();else{let i="";try{i=JSON.parse(e.body.trim())}catch(t){i=e.body.trim()}this.handler.notifyKeepaliveRequestEnded(e.httpStatus,i),!0===t&&this.next()}})}}},7832:function(e,t,i){i.d(t,{H:function(){return n}});var s=i(8379),a=i(6506);let r="BpkStreamingSessionOptions";class n{static MULTICAST_ONLY=0;static ULTRA_LOW_LATENCY_SUPPORT=1;static PIP_SESSION=2;static GDPR_PREFERENCE=3;static REQUEST_REDIRECT_THIRD_PARTY_CDN=100;static REQUEST_NANO_CDN=102;static REQUEST_BROADPEAK_CDN=103;static REQUEST_LOCAL_NANO_CDN_IF_CONNECTED_TO_WIFI=104;static REQUEST_NANO_CDN_DURING_GET_QUERY=106;static REQUEST_BKYOU_IF_BROADPEAK_CDN=107;static REQUEST_NANO_CDN_PRIORITY=108;static SESSION_KEEPALIVE=200;static SESSION_TEARDOWN=201;static SESSION_REPORTING_MODE=202;static SESSION_KEEPALIVE_FREQUENCY=203;static SESSION_PRECACHE=204;static USERAGENT_AD_EVENT=300;static TIMEOUT_NANO_CDN_REQUEST_ROUTER=500;static TIMEOUT_NANO_CDN_STATIC_RESOLVING=501;static TIMEOUT_NANO_CDN_DISCOVER_RESOLVING=502;static PRIORITY_NANO_CDN_CONF=600;static PRIORITY_APP_CONF=601;static PRIORITY_LOAD_BALANCING=602;static EXPERIMENTAL_METRICS_LATENCY=900;static LEGACY_MULTICAST_ONLY=1e3;static SESSION_DISABLED=-1;static SESSION_ENABLED_IF_BROADPEAK_DOMAIN=0;static SESSION_ENABLED=1;static SESSION_REPORTING_MODE_DEFAULT=0;static SESSION_REPORTING_MODE_KEEPALIVE_TEARDOWN=1;static SESSION_REPORTING_MODE_METRICS_RECEIVER=2;static SESSION_REPORTING_MODE_DISABLED=-1;static MULTICAST_UNKNOWN=-1;static MULTICAST_INACTIVE=0;static MULTICAST_INACTIVE_WAS_ACTIVE=1;static MULTICAST_ACTIVE=2;static GDPR_DELETE=1;static GDPR_ANONYMIZED=2;static GDPR_ENCRYPTED=3;static GDPR_CLEAR=4;options;updates;constructor(){this.options={},this.options[n.MULTICAST_ONLY]=!1,this.options[n.ULTRA_LOW_LATENCY_SUPPORT]=!1,this.options[n.PIP_SESSION]=!1,this.options[n.GDPR_PREFERENCE]=n.GDPR_CLEAR,this.options[n.REQUEST_REDIRECT_THIRD_PARTY_CDN]=!1,this.options[n.REQUEST_NANO_CDN]=!0,this.options[n.REQUEST_BROADPEAK_CDN]=!0,this.options[n.REQUEST_LOCAL_NANO_CDN_IF_CONNECTED_TO_WIFI]=!0,this.options[n.REQUEST_NANO_CDN_DURING_GET_QUERY]=!0,this.options[n.REQUEST_BKYOU_IF_BROADPEAK_CDN]=!1,this.options[n.REQUEST_NANO_CDN_PRIORITY]=n.PRIORITY_NANO_CDN_CONF,this.options[n.SESSION_KEEPALIVE]=n.SESSION_ENABLED_IF_BROADPEAK_DOMAIN,this.options[n.SESSION_TEARDOWN]=n.SESSION_ENABLED_IF_BROADPEAK_DOMAIN,this.options[n.SESSION_REPORTING_MODE]=n.SESSION_REPORTING_MODE_DEFAULT,this.options[n.SESSION_KEEPALIVE_FREQUENCY]=a.A.KEEPALIVE_REQUEST_INTERVAL,this.options[n.SESSION_PRECACHE]=!1,this.options[n.USERAGENT_AD_EVENT]=void 0,this.options[n.TIMEOUT_NANO_CDN_REQUEST_ROUTER]=2e3,this.options[n.TIMEOUT_NANO_CDN_STATIC_RESOLVING]=3e3,this.options[n.TIMEOUT_NANO_CDN_DISCOVER_RESOLVING]=3e3,this.options[n.EXPERIMENTAL_METRICS_LATENCY]=!1,this.options[n.LEGACY_MULTICAST_ONLY]=!1,this.updates=[]}static create(e,t){let i=new n;return e instanceof n&&(i.options={...e.options}
1),void 0!==t&&t.updates.forEach(e=>{i.options[e]=t.options[e]}),i}option(e,t){return this.validate(e,t)&&(this.options[e]=t,e===n.PIP_SESSION&&!0===t&&this.option(n.REQUEST_NANO_CDN,!1),-1===this.updates.indexOf(e)&&this.updates.push(e)),this}get(e){let t=[n.USERAGENT_AD_EVENT];return void 0===this.options[e]&&-1===t.indexOf(e)&&s.g.w(r,"Warning: get option "+e+" not found"),this.options[e]}set(e,t){this.option(e,t)}validate(e,t){if(e===n.SESSION_REPORTING_MODE)return t===n.SESSION_REPORTING_MODE_DEFAULT||t===n.SESSION_REPORTING_MODE_KEEPALIVE_TEARDOWN||t===n.SESSION_REPORTING_MODE_METRICS_RECEIVER||t===n.SESSION_REPORTING_MODE_DISABLED||(s.g.e(r,"Error: SESSION_REPORTING_MODE should be SESSION_REPORTING_MODE_DEFAULT, SESSION_REPORTING_MODE_KEEPALIVE_TEARDOWN, SESSION_REPORTING_MODE_METRICS_RECEIVER or SESSION_REPORTING_MODE_DISABLED"),!1);if(e===n.SESSION_KEEPALIVE||e===n.SESSION_TEARDOWN)return t===n.SESSION_DISABLED||t===n.SESSION_ENABLED_IF_BROADPEAK_DOMAIN||t===n.SESSION_ENABLED||(s.g.e(r,"Error: "+n.optionToString(e)+" value should be SESSION_ENABLED_IF_BROADPEAK_DOMAIN, SESSION_DISABLED or SESSION_ENABLED"),!1);if(e===n.SESSION_KEEPALIVE_FREQUENCY)return"number"==typeof t&&t>=5e3&&t<=6e4||(s.g.e(r,"Error: "+n.optionToString(e)+" value should be a number within 5000ms and 60000ms"),!1);if(e===n.USERAGENT_AD_EVENT)return"string"==typeof t||void 0===t||(s.g.e(r,"Error: "+n.optionToString(e)+" value should be a string or undefined"),!1);if(e===n.GDPR_PREFERENCE)return"number"==typeof t&&t>=1&&t<=4||(s.g.e(r,"Error: "+n.optionToString(e)+" value should be a number within 1 and 4"),!1);if(e>=n.TIMEOUT_NANO_CDN_REQUEST_ROUTER&&e<=n.TIMEOUT_NANO_CDN_DISCOVER_RESOLVING)return"number"==typeof t||(s.g.e(r,"Error: "+n.optionToString(e)+" value should be a number"),!1);if(e===n.REQUEST_NANO_CDN_PRIORITY)return t>=n.PRIORITY_NANO_CDN_CONF&&t<=n.PRIORITY_LOAD_BALANCING||(s.g.e(r,"Error: "+n.optionToString(e)+" value should be PRIORITY_NANO_CDN_CONF, PRIORITY_APP_CONF or PRIORITY_LOAD_BALANCING"),!1);if(void 0===e)return s.g.e(r,"Error: option should not be undefined"),!1;let i="boolean"==typeof t;return i||s.g.e(r,"Error: "+n.optionToString(e)+" value should be a boolean"),i}print(e=r,t="",i){s.g.i(e,t+"Options",i),s.g.i(e,t+" MULTICAST_ONLY="+this.get(n.MULTICAST_ONLY),i),s.g.i(e,t+" LEGACY_MULTICAST_ONLY="+this.get(n.LEGACY_MULTICAST_ONLY),i),s.g.i(e,t+" REQUEST_REDIRECT_THIRD_PARTY_CDN="+this.get(n.REQUEST_REDIRECT_THIRD_PARTY_CDN),i),s.g.i(e,t+" REQUEST_NANO_CDN="+this.get(n.REQUEST_NANO_CDN),i),s.g.i(e,t+" REQUEST_NANO_CDN_DURING_GET_QUERY="+this.get(n.REQUEST_NANO_CDN_DURING_GET_QUERY),i),s.g.i(e,t+" REQUEST_BROADPEAK_CDN="+this.get(n.REQUEST_BROADPEAK_CDN),i),s.g.i(e,t+" REQUEST_LOCAL_NANO_CDN_IF_CONNECTED_TO_WIFI="+this.get(n.REQUEST_LOCAL_NANO_CDN_IF_CONNECTED_TO_WIFI),i),s.g.i(e,t+" REQUEST_BKYOU_IF_BROADPEAK_CDN="+this.get(n.REQUEST_BKYOU_IF_BROADPEAK_CDN),i),s.g.i(e,t+" REQUEST_NANO_CDN_PRIORITY="+n.nanoCDNPriorityToString(this.get(n.REQUEST_NANO_CDN_PRIORITY)),i),s.g.i(e,t+" SESSION_KEEPALIVE="+n.stateToString(this.get(n.SESSION_KEEPALIVE)),i),s.g.i(e,t+" SESSION_KEEPALIVE_FREQUENCY="+this.get(n.SESSION_KEEPALIVE_FREQUENCY)+"ms",i),s.g.i(e,t+" SESSION_TEARDOWN="+n.stateToString(this.get(n.SESSION_TEARDOWN)),i),s.g.i(e,t+" SESSION_REPORTING_MODE="+n.reportingModeToString(this.get(n.SESSION_REPORTING_MODE)),i),s.g.i(e,t+" SESSION_PRECACHE="+this.get(n.SESSION_PRECACHE),i),s.g.i(e,t+" TIMEOUT_NANO_CDN_REQUEST_ROUTER="+this.get(n.TIMEOUT_NANO_CDN_REQUEST_ROUTER)+"ms",i),void 0!==this.get(n.USERAGENT_AD_EVENT)&&s.g.i(e,t+" USERAGENT_AD_EVENT="+this.get(n.USERAGENT_AD_EVENT),i),s.g.i(e,t+" PIP_SESSION="+this.get(n.PIP_SESSION),i),s.g.i(e,t+" ULTRA_LOW_LATENCY_SUPPORT="+this.get(n.ULTRA_LOW_LATENCY_SUPPORT),i),s.g.i(e,t+" GDPR_PREFERENCE="+this.get(n.GDPR_PREFERENCE),i)}printUpdates(e=r,t="",i){this.updates.forEach(a=>{s.g.i(e,t+" "+n.optionToString(a)+"="+n.valueToString(a,this.get(a)),i)})}static optionToString(e){switch(e){case this.MULTICAST_ONLY:return"MULTICAST_ONLY";case this.PIP_SESSION:return"PIP_SESSION";case this.ULTRA_LOW_LATENCY_SUPPORT:return"ULTRA_LOW_LATENCY_SUPPORT";case this.GDPR_PREFERENCE:return"GDPR_PREFERENCE";case this.REQUEST_REDIRECT_THIRD_PARTY_CDN:return"REQUEST_REDIRECT_THIRD_PARTY_CDN";case this.REQUEST_NANO_CDN:return"REQUEST_NANO_CDN";case this.REQUEST_BROADPEAK_CDN:return"REQUEST_BROADPEAK_CDN";case this.REQUEST_LOCAL_NANO_CDN_IF_CONNECTED_TO_WIFI:return"REQUEST_LOCAL_NANO_CDN_IF_CONNECTED_TO_WIFI";case this.REQUEST_NANO_CDN_DURING_GET_QUERY:return"REQUEST_NANO_CDN_DURING_GET_QUERY";case this.REQUEST_BKYOU_IF_BROADPEAK_CDN:return"REQUEST_BKYOU_IF_BROADPEAK_CDN";case this.REQUEST_NANO_CDN_PRIORITY:return"REQUEST_NANO_CDN_PRIORITY";case this.SESSION_KEEPALIVE:return"SESSION_KEEPALIVE";case this.SESSION_TEARDOWN:return"SESSION_TEARDOWN";case this.SESSION_REPORTING_MODE:return"SESSION_REPORTING_MODE";case this.SESSION_KEEPALIVE_FREQUENCY:return"SESSION_KEEPALIVE_FREQUENCY";case this.SESSION_PRECACHE:return"SESSION_PRECACHE";case this.USERAGENT_AD_EVENT:return"USERAGENT_AD_EVENT";case this.TIMEOUT_NANO_CDN_REQUEST_ROUTER:return"TIMEOUT_NANO_CDN_REQUEST_ROUTER";case this.TIMEOUT_NANO_CDN_STATIC_RESOLVING:return"TIMEOUT_NANO_CDN_STATIC_RESOLVING";case this.TIMEOUT_NANO_CDN_DISCOVER_RESOLVING:return"TIMEOUT_NANO_CDN_DISCOVER_RESOLVING";case this.PRIORITY_NANO_CDN_CONF:return"PRIORITY_NANO_CDN_CONF";case this.PRIORITY_APP_CONF:return"PRIORITY_APP_CONF";case this.PRIORITY_LOAD_BALANCING:return"PRIORITY_LOAD_BALANCING";case this.LEGACY_MULTICAST_ONLY:return"LEGACY_MULTICAST_ONLY"}return"unknown"}static valueToString(e,t){switch(e){case this.SESSION_KEEPALIVE:case this.SESSION_TEARDOWN:return this.stateToString(t);case this.SESSION_REPORTING_MODE:return this.reportingModeToString(t);case this.REQUEST_NANO_CDN_PRIORITY:return this.nanoCDNPriorityToString(t)}return String(t)}static stateToString(e){switch(e){case n.SESSION_DISABLED:return"disabled";case n.SESSION_ENABLED_IF_BROADPEAK_DOMAIN:return"enabled if broadpeak domain name";case n.SESSION_ENABLED:return"enabled"}return"unknown"}static reportingModeToString(e){switch(e){case n.SESSION_REPORTING_MODE_DEFAULT:return"default";case n.SESSION_REPORTING_MODE_KEEPALIVE_TEARDOWN:return"keepalive/teardown";case n.SESSION_REPORTING_MODE_METRICS_RECEIVER:return"metricsReceiver";case n.SESSION_REPORTING_MODE_DISABLED:return"disabled"}return"unknown"}static nanoCDNPriorityToString(e){switch(e){case n.PRIORITY_NANO_CDN_CONF:return"nanoCDN conf";case n.PRIORITY_APP_CONF:return"init order";case n.PRIORITY_LOAD_BALANCING:return"load balancing"}return"unknown"}}},8100:function(e,t,i){i.d(t,{A:function(){return y}});var s=i(1262);class a{log(e,t,i){let a=s.Em.formatDate();switch(e){case 0:console.log(a+" V/"+t+": "+i);break;case 1:console.log(a+" D/"+t+": "+i);break;case 2:console.log(a+" I/"+t+": "+i);break;case 3:console.log(a+" W/"+t+": "+i);break;case 4:console.log(a+" E/"+t+": "+i);break;default:console.log(a+" ?/"+t+": "+i)}}}let r="BpkRequestHandler";class n{get(e,t,i,a){let n=new XMLHttpRequest,o=!1,d={};for(let h in n.onreadystatechange=function(){if(n.readyState===n.DONE){let e=n.getAllResponseHeaders()?.trim().split(/[\r\n]+/);e?.forEach(function(e){let t=e.split(": ");d[t.shift().toLowerCase()]=t.join(": ")}),n.status>=200&&n.status<300?a({body:n.responseText,headers:d,statusCode:n.status,message:n.statusText,responseURL:n.responseURL}):0!==n.status&&a({body:"",headers:d,statusCode:n.status,message:n.statusText})}},n.onerror=function(){o||(n.status<=0&&s.gD.e(r,"Request ended with error (CORS error, connection error...)"),a({body:"",headers:d,statusCode:n.status,message:n.statusText}))},n.ontimeout=function(){s.gD.d(r,"Request ended with timeout (xhr)"),a({body:"",headers:d,statusCode:n.status,message:n.statusText})},n.open("GET",e,!0),n.timeout=i,this.deleteUnsafeHeaders(t),t)n.setRequestHeader(h,t[h]);n.send(),setTimeout(()=>{n.readyState!==n.DONE&&(o=!0,n.abort(),s.gD.d(r,"Request ended with timeout (setTimeout)"),a({body:"",headers:d,statusCode:n.status,message:n.statusText}))},i+100)}post(e,t,i,a,n){let o=new XMLHttpRequest,d=!1,h={};for(let i in o.onreadystatechange=function(){if(o.readyState===o.DONE){let e=o.getAllResponseHeaders()?.trim().split(/[\r\n]+/);e?.forEach(function(e){let t=e.split(": ");h[t.shift().toLowerCase()]=t.join(": ")}),o.status>=200&&o.status<300?n({body:o.responseText,headers:h,statusCode:o.status,message:o.statusText,responseURL:o.responseURL}):0!==o.status&&n({body:"",headers:h,statusCode:o.status,message:o.statusText})}},o.onerror=function(){d||(o.status<=0&&s.gD.e(r,"Request ended with error (CORS error, connection error...)"),n({body:"",headers:h,statusCode:o.status,message:o.statusText}))},o.ontimeout=function(){s.gD.d(r,"Request ended with timeout (xhr)"),n({body:"",headers:h,statusCode:o.status,message:o.statusText})},o.open("POST",e,!0),o.timeout=a,this.deleteUnsafeHeaders(t),t)o.setRequestHeader(i,t[i]);o.send(i),setTimeout(()=>
1{o.readyState!==o.DONE&&(d=!0,o.abort(),s.gD.d(r,"Request ended with timeout (setTimeout)"),n({body:"",headers:h,statusCode:o.status,message:o.statusText}))},a+100)}deleteUnsafeHeaders(e){"object"!=typeof window&&"function"!=typeof XMLHttpRequest||(delete e["User-Agent"],delete e["Accept-Charset"],delete e["Accept-Encoding"],delete e["Access-Control-Request-Headers"],delete e["Access-Control-Request-Method"],delete e.Connection,delete e["Content-Length"],delete e.Cookie,delete e.Cookie2,delete e.Date,delete e.DNT,delete e.Expect,delete e.Host,delete e["Keep-Alive"],delete e.Origin,delete e.Referer,delete e.TE,delete e.Trailer,delete e["Transfer-Encoding"],delete e.Upgrade,delete e.Via)}}var o=i(4623);let d="BpkBrowserAppStateMgr";class h{initialized;listeners;init(){s.gD.d(d,"Initializing browser app state manager..."),this.initialized||(s.CE.getInstance().setDeviceInfo(this.getOSName(),this.getOSVersion(),this.getDeviceType()),s.CE.getInstance().bind(),this.listeners={},"undefined"!=typeof window&&void 0===window.addEventListener&&s.gD.w(d,"Are you running a React Native app? If yes, please import module '@broadpeak/smartlib-react-native'"),this.registerNetworkObserver(),this.initialized=!0)}getOSName(){return"undefined"!=typeof device&&void 0!==device.platform?device.platform:"undefined"!=typeof window&&void 0!==window.navigator&&void 0!==window.navigator.platform?window.navigator.platform:"NA"}getOSVersion(){let e;"undefined"!=typeof device&&void 0!==device.version?e=device.version:"undefined"!=typeof window&&void 0!==window.navigator&&void 0!==window.navigator.appVersion&&(e=window.navigator.appVersion),void 0===e&&(e="");let t=e.replace(/ /g,"_").replace(/;/g,"_");return t.length>=30?t.substring(0,30):0===t.length?"NA":t}getDeviceType(){return"undefined"!=typeof cast&&void 0!==cast.receiver?"chromecast":"browser"}release(){this.initialized&&(this.unregisterNetworkObserver(),this.initialized=!1)}registerNetworkObserver(){this.listeners[0]=this.onNetworkOnline.bind(this),this.listeners[1]=this.onNetworkOffline.bind(this),"undefined"!=typeof window&&void 0!==window.navigator&&void 0!==window.navigator.onLine&&(!0===window.navigator.onLine?s.CE.getInstance().notifyNetworkAvailable(1):s.CE.getInstance().notifyNetworkLost()),window.addEventListener("online",this.listeners[0]),window.addEventListener("offline",this.listeners[1])}unregisterNetworkObserver(){window.removeEventListener("online",this.listeners[0]),window.removeEventListener("offline",this.listeners[1]),this.listeners[0]=void 0,this.listeners[1]=void 0}onNetworkOnline(){s.CE.getInstance().notifyNetworkAvailable(1)}onNetworkOffline(){s.CE.getInstance().notifyNetworkLost()}registerLifecycleEvents(){this.listeners[2]=this.onMoveToForeground.bind(this),this.listeners[3]=this.onMoveToBackground.bind(this),window.addEventListener("focus",this.listeners[2]),window.addEventListener("blur",this.listeners[3])}unregisterLifecycleEvents(){window.removeEventListener("focus",this.listeners[2]),window.removeEventListener("blur",this.listeners[3]),this.listeners[2]=void 0,this.listeners[3]=void 0}onMoveToForeground(){s.CE.getInstance().notifyForeground()}onMoveToBackground(){s.CE.getInstance().notifyBackground()}}let l="BpkWebOSAppStateMgr";class c{initialized;subscriptionHandle;webOSVersion;init(){s.gD.d(l,"Initializing webOS app state manager..."),this.initialized||(this.webOSVersion="",webOS.deviceInfo(e=>{this.webOSVersion=e.sdkVersion,void 0!==this.webOSVersion?(s.gD.d(l,"Receiving sdk version through deviceInfo: "+this.webOSVersion),this.registerNetworkObserver(),s.CE.getInstance().setDeviceInfo("webOS",this.webOSVersion,"tv"),s.CE.getInstance().bind()):webOS.service.request("luna://com.webos.service.tv.systemproperty",{method:"getSystemInfo",parameters:{keys:["sdkVersion"]},onSuccess:e=>{void 0!==e.sdkVersion&&(this.webOSVersion=e.sdkVersion,s.gD.d(l,"Receiving sdk version through luna API: "+this.webOSVersion),this.registerNetworkObserver(),s.CE.getInstance().setDeviceInfo("webOS",this.webOSVersion,"tv"),s.CE.getInstance().bind())},onFailure:e=>{s.gD.d(l,"Error while receiving webOS version ("+JSON.stringify(e)+")")}})}),this.initialized=!0)}release(){this.initialized&&(this.unregisterNetworkObserver(),this.initialized=!1)}updateNetworkState(e){let t="yes"===e.wifi?.onInternet;!0==("yes"===e.wired?.onInternet)?s.CE.getInstance().notifyNetworkAvailable(30):!0===t?s.CE.getInstance().notifyNetworkAvailable(10):s.CE.getInstance().notifyNetworkLost()}registerNetworkObserver(){let e=this.webOSVersion.startsWith("3")?"luna://com.webos.service.connectionmanager"
1:"luna://com.palm.connectionmanager",t=this;webOS.service.request(e,{method:"getStatus",onSuccess:function(e){t.updateNetworkState(e)},onFailure:function(e){s.gD.e(l,"Failed to get network state"),s.gD.e(l,"["+e.errorCode+"]: "+e.errorText)}}),this.subscriptionHandle=webOS.service.request(e,{method:"getStatus",parameters:{subscribe:!0},onSuccess:function(e){void 0===e.subscribed||e.subscribed?t.updateNetworkState(e):s.gD.e(l,"Failed to subscribe network state")},onFailure:function(e){s.gD.e(l,"Failed to get network state"),s.gD.e(l,"["+e.errorCode+"]: "+e.errorText)}})}unregisterNetworkObserver(){void 0!==this.subscriptionHandle&&(this.subscriptionHandle.cancel(),this.subscriptionHandle=void 0)}}let u="BpkTizenAppStateMgr";class p{initialized;networkInitializer;networkInitializerNumber;listeners;init(){s.gD.d(u,"Initializing tizen app state manager..."),this.initialized||(s.CE.getInstance().setDeviceInfo("Tizen",this.getOSVersion(),"tv"),s.CE.getInstance().bind(),this.listeners={},this.startNetworkInitializer(),this.initialized=!0)}getOSVersion(){return"undefined"!=typeof tizen&&void 0!==tizen.systeminfo?tizen.systeminfo.getCapability("http://tizen.org/feature/platform.version"):"NA"}release(){this.initialized&&(this.unregisterNetworkObserver(),this.initialized=!1)}onNetworkChange(e){let t=null;try{t=webapis.network.getActiveConnectionType()}catch(e){s.gD.e(u,"getActiveConnectionType exception ["+e.code+"] message: "+e.message)}if(null!=t){switch(t){case webapis.network.NetworkActiveConnectionType.DISCONNECTED:s.CE.getInstance().notifyNetworkLost();break;case webapis.network.NetworkActiveConnectionType.WIFI:s.CE.getInstance().notifyNetworkAvailable(10);break;case webapis.network.NetworkActiveConnectionType.ETHERNET:s.CE.getInstance().notifyNetworkAvailable(30)}s.gD.d(u,"Active connection type: "+t)}}startNetworkInitializer(){void 0!==this.networkInitializer&&clearInterval(this.networkInitializer),this.networkInitializerNumber=0,this.networkInitializer=setInterval(()=>{void 0!==webapis.network?(s.gD.d(u,"Network API is now available"),clearInterval(this.networkInitializer),this.networkInitializer=void 0,this.registerNetworkObserver()):this.networkInitializerNumber>30?(s.gD.e(u,"The webapis.js script is required in order to get the network type."),clearInterval(this.networkInitializer),this.networkInitializer=void 0):this.networkInitializerNumber++},100)}registerNetworkObserver(){void 0===webapis.network&&s.gD.e(u,"The webapis.js script is required in order to get the network type."),this.onNetworkChange(void 0);try{this.listeners[0]=webapis.network.addNetworkStateChangeListener(this.onNetworkChange)}catch(e){s.gD.e(u,"addNetworkStateChangeListener exception ["+e.code+"] name: "+e.name+" message: "+e.message)}}unregisterNetworkObserver(){try{webapis.network.removeNetworkStateChangeListener(this.listeners[0])}catch(e){s.gD.e(u,"removeNetworkStateChangeListener exception ["+e.code+"] name: "+e.name+" message: "+e.message)}this.listeners[0]=void 0}}class g extends s.r2{nonceManager;constructor(e){super(),this.nonceManager=e}getNonce(){return this.nonceManager.getNonce()}sendAdClick(){"function"==typeof this.nonceManager.sendAdClick&&this.nonceManager.sendAdClick()}sendAdImpression(){"function"==typeof this.nonceManager.sendAdImpression&&this.nonceManager.sendAdImpression()}sendPlaybackStart(){"function"==typeof this.nonceManager.sendPlaybackStart&&this.nonceManager.sendPlaybackStart()}sendPlaybackEnd(){"function"==typeof this.nonceManager.sendPlaybackEnd&&this.nonceManager.sendPlaybackEnd()}sendTouch(e){"function"==typeof this.nonceManager.sendAdTouch&&this.nonceManager.sendAdTouch(e)}}let S="BpkBrowserAdPalManager";class E extends s.GM{palSDK;consentSettings;nonceLoader;descriptionURL;partnerName;partnerVersion;omidVersion;playerType;playerVersion;ppid;videoPlayerHeight;videoPlayerWidth;willAdAutoPlay;willAdPlayMuted;constructor(){super()}loadPALSDK(){this.palSDK=s.X2.getInstance().palSDK}setConsentSettings(e){this.loadPALSDK(),void 0!==this.palSDK?(this.consentSettings=e,this.nonceLoader=new this.palSDK.pal.NonceLoader(e)):s.gD.e(S,"PAL SDK not attached, please set it through AdManager.getInstance().attachPALSDK(...)")}generateAdPalSession(e){if(void 0===this.nonceLoader||void 0===this.consentSettings)return s.gD.e(S,"Cannot generate a nonce, please set a ConsentSettings through AdManager.getInstance().setConsentSettings(...)"),void e(void 0);let t=new this.palSDK.pal.NonceRequest;void 0!==this.descriptionURL&&(t.descriptionUrl=this.descriptionURL),void 0!==this.partnerName&&(t.omidPartnerName=this.partnerName),void 0!==this.partnerVersion&&(t.omidPartnerVersion=this.partnerVersion),void 0!==this.omi
1dVersion&&(t.omidVersion=this.omidVersion),void 0!==this.playerType&&(t.playerType=this.playerType),void 0!==this.playerVersion&&(t.playerVersion=this.playerVersion),void 0!==this.ppid&&(t.ppid=this.ppid),void 0!==this.videoPlayerHeight&&(t.videoHeight=this.videoPlayerHeight),void 0!==this.videoPlayerWidth&&(t.videoWidth=this.videoPlayerWidth),void 0!==this.willAdAutoPlay&&(t.adWillAutoPlay=this.willAdAutoPlay),void 0!==this.willAdPlayMuted&&(t.adWillPlayMuted=this.willAdPlayMuted),this.nonceLoader.loadNonceManager(t).then(t=>{e(new g(t))}).catch(t=>{s.gD.e(S,"Error when generating the nonce"),console.log(t),e(void 0)})}reset(){}release(){this.consentSettings=void 0,this.nonceLoader=void 0}setDescriptionURL(e){this.descriptionURL=e}setOmidPartner(e,t){this.partnerName=e,this.partnerVersion=t}setOmidVersion(e){this.omidVersion=e}setPlayerType(e){this.playerType=e}setPlayerVersion(e){this.playerVersion=e}setPpid(e){this.ppid=e}setVideoPlayerHeight(e){this.videoPlayerHeight=e}setVideoPlayerWidth(e){this.videoPlayerWidth=e}setWillAdAutoPlay(e){this.willAdAutoPlay=e}setWillAdPlayMuted(e){this.willAdPlayMuted=e}}class m{initialized;
1init(){s.gD.d("BpkNodeAppStateMgr","Initializing Node.js app state manager..."),this.initialized||(s.CE.getInstance().setDeviceInfo(this.getOSName(),this.getOSVersion(),this.getDeviceType()),s.CE.getInstance().bind(),this.initialized=!0)}getOSName(){return void 0!==process?process.platform:"NA"}getOSVersion(){let e=(0,o.t)("os");return void 0!==e?e.release():"NA"}getDeviceType(){return"nodejs"}release(){this.initialized&&(this.initialized=!1)}}class A{static CLICK="click";static INVITATION_ACCEPTED="invitationAccept"}let v="BpkCoreEngine";class y{static #t;static modular=!0;static analyticsModule;static reactNativeModule;static omsdkModule;static simidModule;static shakaModule;static dashjsModule;static html5Module;static avplayModule;static diw387Module;static hbbtv1Module;static kalturaModule;static connectplayerModule;static rxplayerModule;static hlsjsModule;static bitmovinModule;static theoplayerModule;static videojsModule;static voplayerModule;static reactnativeconnectplayerModule;static reactnativetheoplayerModule;static reactnativebitmovinModule;static chromecastModule;#e;#o;#d;#h;#l;#c;#u;#p;#g;#S;#E;static getInstance(){return y.#t||(y.#t=new y),y.#t}constructor(){this.#e=!1,this.#o=void 0,this.#d=new a}init(){if(!this.#e){this.#e=!0;let e=Date.now();this.log(s.$b.VERBOSE,v,"Loading engine..."),this.log(s.$b.VERBOSE,v,"Version: 7957d5f"),this.registerSystemFunctions(),"object"==typeof window?this.registerSmartLibFunctions(window):"object"==typeof quickjs?this.registerSmartLibFunctions(quickjs.global):(this.registerSmartLibFunctions(),"undefined"==typeof XMLHttpRequest&&(i.g.XMLHttpRequest=(0,o.t)("xmlhttprequest").XMLHttpRequest)),this.log(s.$b.VERBOSE,v,"Took "+(Date.now()-e)+"ms to load")}}registerSystemFunctions(){this.log(s.$b.VERBOSE,v,"Registering system functions..."),s.gD.getInstance().init(this.#d),"object"==typeof quickjs?s.Je.getInstance().init({get:(e,t,i,s)=>{setTimeout(()=>{quickjs.request.get(e,t,i,s)},0)},post:(e,t,i,s,a)=>{setTimeout(()=>{quickjs.request.post(e,t,i,s,a)},0)}}):s.Je.getInstance().init(new n),s.x6.getInstance().internalAdManager.setPalManager(new E)}registerPlayerAdapters(){void 0!==y.analyticsModule&&(this.#h=new y.analyticsModule.PlayerManagerHandler,"object"==typeof window&&(window.PlayerEventListener=y.analyticsModule.PlayerEventListener,window.GenericPlayerApi=y.analyticsModule.GenericPlayerApi))}registerSimidControllerAdapters(){"object"==typeof window&&(window.GenericSimidControllerApi=y.simidModule.GenericSimidControllerApi)}loadModules(){"object"==typeof window?(s.x6.analyticsModule=this.getBrowserModule("analyticsSmartLibModule","Analytics",s.x6.analyticsModule),s.x6.adModule=this.getBrowserModule("adSmartLibModule","Ad",s.x6.adModule),s.x6.nanoCDNModule=this.getBrowserModule("nanocdnSmartLibModule","nanoCDN",s.x6.nanoCDNModule),s.x6.monitoringModule=this.getBrowserModule("monitoringSmartLibModule","Monitoring",s.x6.monitoringModule),s.x6.diversityModule=this.getBrowserModule("diversitySmartLibModule","Diversity",s.x6.diversityModule),y.reactNativeModule=this.getBrowserModule("reactnativeSmartLibModule","React Native",y.reactNativeModule),y.omsdkModule=this.getBrowserModule("omsdkModuleSmartLibModule","OMSDK",y.omsdkModule),void 0!==y.omsdkModule&&(window.OMSDKHandler=y.omsdkModule.OMSDKHandler),y.simidModule=this.getBrowserModule("simidSmartLibModule","SIMID",y.simidModule),y.shakaMo
1dule=this.getBrowserModule("shakaSmartLibModule","Shaka Player",y.shakaModule),void 0!==y.shakaModule&&(window.ShakaPlayerAdapter=y.shakaModule.ShakaPlayerAdapter),y.dashjsModule=this.getBrowserModule("dashjsSmartLibModule","Dash.js",y.dashjsModule),void 0!==y.dashjsModule&&(window.DashJsPlayerAdapter=y.dashjsModule.DashJsPlayerAdapter),y.html5Module=this.getBrowserModule("html5SmartLibModule","HTML5 player",y.html5Module),y.avplayModule=this.getBrowserModule("avplaySmartLibModule","AVPlay",y.avplayModule),y.diw387Module=this.getBrowserModule("diw387SmartLibModule","Sagemcom",y.diw387Module),y.hbbtv1Module=this.getBrowserModule("hbbtv1SmartLibModule","HbbTV1",y.hbbtv1Module),y.kalturaModule=this.getBrowserModule("kalturaSmartLibModule","Kaltura",y.kalturaModule),y.connectplayerModule=this.getBrowserModule("connectplayerSmartLibModule","CONNECT Player",y.connectplayerModule),void 0!==y.connectplayerModule&&(window.ConnectPlayerAdapter=y.connectplayerModule.ConnectPlayerAdapter),y.rxplayerModule=this.getBrowserModule("rxplayerSmartLibModule","RxPlayer",y.rxplayerModule),y.hlsjsModule=this.getBrowserModule("hlsjsModule","HLS.js",y.hlsjsModule),y.bitmovinModule=this.getBrowserModule("bitmovinModule","Bitmovin",y.bitmovinModule),y.theoplayerModule=this.getBrowserModule("theoplayerModule","THEOplayer",y.theoplayerModule),void 0!==y.theoplayerModule&&(window.THEOPlayerAdapter=y.theoplayerModule.THEOPlayerAdapter),y.videojsModule=this.getBrowserModule("videojsSmartLibModule","Video.js",y.videojsModule),void 0!==y.videojsModule&&(window.VideoJsPlayerAdapter=y.videojsModule.VideoJsPlayerAdapter),y.voplayerModule=this.getBrowserModule("voplayerModule","VOPlayer",y.voplayerModule),y.reactnativeconnectplayerModule=this.getBrowserModule("reactnativeconnectplayerModule","React Native CONNECT Player",y.reactnativeconnectplayerModule),y.reactnativetheoplayerModule=this.getBrowserModule("reactnativetheoplayerModule","React Native THEOplayer",y.reactnativetheoplayerModule),y.reactnativebitmovinModule=this.getBrowserModule("reactnativebitmovinModule","React Native Bitmovin",y.reactnativebitmovinModule),y.chromecastModule=this.getBrowserModule("chromecastModule","Chromecast",y.chromecastModule)):!0===y.modular&&(s.x6.analyticsModule=this.getNodeModule("analytics","Analytics"),s.x6.adModule=this.getNodeModule("ad","Ad"),s.x6.nanoCDNModule=this.getNodeModule("nanocdn","nanoCDN"),s.x6.monitoringModule=this.getNodeModule("monitoring","Monitoring"),s.x6.diversityModule=this.getNodeModule("diversity","Diversity"),y.reactNativeModule=this.getNodeModule("reactnative","React Native"),y.omsdkModule=this.getNodeModule("omsdkModule","OMSDK"),y.simidModule=this.getNodeModule("simid","SIMID"),y.shakaMo
1dule=this.getNodeModule("shaka","Shaka Player"),y.dashjsModule=this.getNodeModule("dashjs","Dash.js"),y.html5Module=this.getNodeModule("html5","HTML5 player"),y.avplayModule=this.getNodeModule("avplay","AVPlay"),y.diw387Module=this.getNodeModule("diw387","Sagemcom"),y.hbbtv1Module=this.getNodeModule("hbbtv1","HbbTV1"),y.kalturaModule=this.getNodeModule("kaltura","Kaltura"),y.connectplayerModule=this.getNodeModule("connectplayer","CONNECT Player"),y.rxplayerModule=this.getNodeModule("rxplayer","RxPlayer"),y.hlsjsModule=this.getNodeModule("hlsjs","HLS.js"),y.bitmovinModule=this.getNodeModule("bitmovin","Bitmovin"),y.theoplayerModule=this.getNodeModule("theoplayer","THEOplayer"),y.videojsModule=this.getNodeModule("videojs","Video.js"),y.voplayerModule=this.getNodeModule("voplayer","VOPlayer"),y.reactnativeconnectplayerModule=this.getNodeModule("reactnativeconnectplayer","React Native CONNECT Player"),y.reactnativetheoplayerModule=this.getNodeModule("reactnativetheoplayer","React Native THEOplayer"),y.reactnativebitmovinModule=this.getNodeModule("reactnativebitmovin","React Native Bitmovin"),y.chromecastModule=this.getNodeModule("chromecast","Chromecast")),void 0!==this.#o&&(void 0!==s.x6.monitoringModule&&(this.#o.RealTimeMonitoringManager=s.x6.monitoringModule.RealTimeMonitoringManager),void 0!==s.x6.diversityModule&&(this.#o.DiversityPluginManager=s.x6.diversityModule.DiversityPluginManager,this.#o.DiversityOptions=s.x6.diversityModule.DiversityOptions))}getBrowserModule(e,t,i){if(void 0!==i)return s.gD.i(v,t+" module loaded (from index)"),i;s.gD.i(v,t+" module not loaded")}getNodeModule(e,t){try{let i=(0,o.C)("@broadpeak/smartlib-"+e);return s.gD.i(v,t+" module loaded"),i}catch(i){try{let i=(0,o.t)("./"+e+".smartlib.browser");return s.gD.i(v,t+" module loaded"),i}catch(e){s.gD.i(v,t+" module not loaded")}}}registerSmartLibFunctions(e){let t=this;this.#o=e;let i=function(){"undefined"!=typeof webOS?(void 0===t.#p&&(t.#p=new c),t.#p.init()):"undefined"!=typeof tizen&&"undefined"!=typeof webapis?(void 0===t.#g&&(t.#g=new p),t.#g.init()):"undefined"!=typeof sagem||(void 0!==y.reactNativeModule?.ReactNativeAppStateManager.platform?(void 0===t.#E&&(t.#E=new y.reactNativeModule.ReactNativeAppStateManager),t.#E.init()):"undefined"!=typeof window?(void 0===t.#u&&(t.#u=new h),t.#u.init()):void 0!==process&&"node"===process.release.name&&(void 0===t.#S&&(t.#S=new m),t.#S.init())),t.loadModules(),void 0!==t.#E?t.#c=new y.reactNativeModule.ReactNativeCacheHandler(y.reactNativeModule.ReactNativeAppStateManager.asyncCache):void 0!==y.analyticsModule&&(t.#c=new y.analyticsModule.CacheHandler),s.x6.analyticsModule?.CacheManager.getInstance().init(t.#c),void 0!==y.omsdkModule&&s.x6.adModule.OMSDKManager.getInstance().attachHandler(new y.omsdkModule.OMSDKHandler),void 0!==y.simidModule&&(t.#l=new y.simidModule.SimidControllerManagerHandler)};s.x6.prototype.defaultInit=s.x6.prototype.init,s.x6.prototype.init=function(e,t,s,a){i(),this.defaultInit(e,t,s,a)},s.x6.prototype.defaultInitAnalytics=s.x6.prototype.initAnalytics,s.x6.prototype.initAnalytics=function(e){i(),this.defaultInitAnalytics(e)},s.x6.prototype.defaultAttachPlayer=s.x6.prototype.attachPlayer,s.x6.prototype.attachPlayer=function(e,i){s.x6.analyticsModule?.PlayerManager.getInstance().init(t.#h);let a=t.#h?.attachPlayer(e,i);this.defaultAttachPlayer(a)},s.x6.prototype.defaultRelease=s.x6.prototype.release,s.x6.prototype.release=function(){this.defaultRelease(),void 0!==t.#u&&(t.#u.release(),t.#u=void 0),void 0!==t.#p&&(t.#p.release(),t.#p=void 0),void 0!==t.#g&&(t.#g.release(),t.#g=void 0),void 0!==t.#S&&(t.#S.release(),t.#S=void 0),void 0!==t.#E&&(t.#E.release(),t.#E=void 0)},s.fF.prototype.defaultAttachPlayer=s.fF.prototype.attachPlayer,s.fF.prototype.attachPlayer=function(e,i){s.x6.analyticsModule?.PlayerManager.getInstance().init(t.#h);let a=t.#h?.attachPlayer(e,i);this.defaultAttachPlayer(a)},s.fF.prototype.defaultAttachSimidController=s.fF.prototype.attachSimidController,s.fF.prototype.attachSimidController=function(e,i){y.simidModule?.SimidControllerManager.getInstance().init(t.#l);let s=t.#l?.attachSimidController(e,i);this.defaultAttachSimidController(s,i)},"object"==typeof e&&(e.SmartLib=Object.assign(s.x6.getInstance(),s.x6),e.SmartLib.getInstance=()=>s.x6.getInstance(),e.LoggerManager=s.gD,e.PlayerEventListener=y.analyticsModule?.PlayerEventListener,e.GenericPlayerApi=y.analyticsModule?.GenericPlayerApi,e.GenericSimidControllerApi=y.simidModule?.GenericSimidControllerApi,e.PlayerApiImp={getVersion:()=>{let e=s.x6.analyticsModule?.PlayerManager.getInstance().getPlayerAdapter();return void 0!==e&&"function"==typeof e.getVersion?e.getVersion():"undefined"},getErrorCode:e=>{let t=s.x6.analyticsModule?.PlayerManager.getInstance().getPlayerAdapter();return void 0!==t&&"function"==typeof t.getErrorCode?t.getErrorCode(e):s.x6.BPUnspecifiedError}},e.StreamingSession=s.fF,e.StreamingSessionOptions=s.H1,e.StreamingSessionResult=s.Sy,e.AdManager=s.X2,e.AdInteractionType=A)}log(e,t,i){this.#d.log(e,t,i)}}},8379:function(e,t,i){i.d(t,{$:function(){return r},g:function(){return o}});var s=i(3445);class a{static log(e,t,i){}}class r{static VERBOSE=0;static DEBUG=1;static INFO=2;static WARN=3;static ERROR=4}class n{static NONE=-1;static BASIC=0;static VERBOSE=1}class o{static instance;#d=a;#m;#A;#v;static getInstance(){return o.instance||(o.instance=new o),o.instance}constructor(){this.#m=[],this.#A=n.VERBOSE}init(e){this.#d=e}release(){this.#d=void 0}printLogs(e,t,i,a){if(this.#m.length>100&&(this.#m=[]),void 0!==a&&(i="["+a+"] "+i),this.#m.push(t+": "+i),void 0!==this.#v){let a=s.A.formatDate()+" ";switch(e){case r.VERBOSE:a+="V/";break;case r.DEBUG:a+="D/";break;case r.INFO:a+="I/";break;case r.WARN:a+="W/";break;case r.ERROR:a+="E/"}a+=t+": "+i,this.#v?.onLog(a)}else this.#d.log(e,t,i,a)}printVerboseLogs(e,t,i){this.#A<n.VERBOSE||this.printLogs(r.VERBOSE,e,t,i)}static v(e,t,i){o.getInstance().printVerboseLogs(e,t,i)}printDebugLogs(e,t,i){this.#A<n.VERBOSE||this.printLogs(r.DEBUG,e,t,i)}static d(e,t,i){o.getInstance().printDebugLogs(e,t,i)}printInfoLogs(e,t,i){this.#A<=n.NONE||this.printLogs(r.INFO,e,t,i)}static i(e,t,i){o.getInstance().printInfoLogs(e,t,i)}printWarnLogs(e,t,i){this.#A<=n.NONE||this.printLogs(r.WARN,e,t,i)}static w(e,t,i){o.getInstance().printWarnLogs(e,t,i)}printErrorLogs(e,t,i){this.#A<=n.NONE||this.printLogs(r.ERROR,e,t,i)}static e(e,t,i){o.getInstance().printErrorLogs(e,t,i)}getLogs(){return this.#m.join("\n")}resetLogs(){this.#m=[]}getLogLevel(e){return this.#A}setLogLevel(e){this.#A=e}setLogRedirectListener(e){this.#v=e}}},8724:function(e,t,i){i.d(t,{A:function(){return m}});var s=i(1142),a=i(8379),r=i(6506),n=i(3641),o=i(4943),d=i(5866),h=i(5305),l=i(7832),c=i(3121);class u{static SESSION_ID="session_id";static IS_START="start";static STATUS_CODE="status_code";static STARTUP_TIME="startup_time";static REDIRECTION_TIME="redirection_time";static COMPLETION="completion";static PLAYED_TIME="played_time";static DURATION="duration";static PLAYBACK_TYPE="playback_type";static NUMBER_OF_STALLS="cnt_stall";static TOTAL_STALL_TIME="total_stall_time";static MAX_STALL_TIME="max_stall_time";static NUMBER_OF_REBUFFERING="cnt_rebuffering";static TOTAL_REBUFFERING_TIME="total_rebuffering_time";static MAX_REBUFFERING_TIME="max_rebuffering_time";static REDIRECT_URL="redirect_url";static CONTENT_URL="content_url";static MAX_BITRATE="max_bitrate";static MIN_BITRATE="min_bitrate";static AVERAGE_BITRATE="average_bitrate";static NUMBER_OF_LAYER_SWITCH="cnt_layer_switch";static TIME_SPENT_PER_LAYER="time_spent_per_layer";static PLAYER_NAME="player_name";static PLAYER_VERSION="player_version";static DEVICE_OS="device_os";static DEVICE_VERSION="device_version";static DEVICE_TYPE="device_type";static DIVERSITY="diversity";static UUID="uuid";static NANOCDN_STATUS="nano_status";static CUSTOM_PARAMETERS="custom_parameters";static TIMELINE="timeline";static SMARTLIB_VERSION="smartlib_version";static AD_METRICS="ad_metrics";static NETWORK_TYPE="network_type_list";static PLAYER_ERROR_CODE="player_error_code";static CDN_STATUS_CODE="cdn_status_code";static NANOCDN_STATUS_CODE="nanocdn_status_code";static BPKHTTPSERVER_TIMING="bpkhttpserver_timing";static GDPR="gdpr";static PRECACHED="precached";static PRECACHE_ENDED="precache_ended";static PRECACHE_DURATION="precache_duration";requestedURL;redirectedURL;sessionRunning;sessionCreated;sessionId;teardownActivated;smartLibParameters;customParameters;playerName;playerVersion;osName;osVersion;deviceType;smartLibVersion;networkTypeList;nanoCDNStatus;statusCode;cdnStatusCode;nanoCDNStatusCode;nanoCDNErrorCode;bpkhttpserverTiming;playerErrorCode;metrics;adMetrics;timeline;diversity;startSessionDate;endSessionDate;keepaliveRequestDate;teardownRequestDate;endSessionRequestDate;precached;precacheEnded;precacheDuration;constructor(){this.requestedURL=null,this.redirectedURL=null,this.sessionRunning=!1,this.sessionCreated=!1,this.sessionId="",this.teardownActivated=!1,this.smartLibParameters={},this.customParameters={},this.playerName="",this.playerVersion="",this.osName="",this.osVersion="",this.deviceType="",this.smartLibVersion=d.A,this.networkTypeList=[],this.nanoCDNStatus=m.NANOCDN_STATUS_UNAVAILABLE,this.statusCode=s.A.BPSessionEndsNormally,this.cdnStatusCode=-1,this.nanoCDNStatusCode=-1,this.nanoCDNErrorCode=c.S.RESULT_NO_ERROR,this.bpkhttpserverTiming=-1,this.playerErrorCode="",this.gdpr=l.H.GDPR_CLEAR,void 0!==s.A.analyticsModule&&(this.timeline=new s.A.analyticsModule.SessionTrackerTimeline),this.startSessionDate=0,this.endSessionDate=0,this.keepaliveRequestDate=0,this.teardownRequestDate=0,this.endSessionRequestDate=0,this.precached=!1,this.precacheEnded=!1,this.precacheDuration=0}toQuery(){let e=""===this.playerName?"Generic":this.playerName,t,i=this.customParameters.pre_startup_time;if(this.gdpr===l.H.GDPR_DELETE)return"+++++++++++++++++++++++++++++++++++++++1";if(t=(void 0===this.metrics?"-1+"+encodeURIComponent(e)+"+"+encodeURIComponent(this.playerVersion)+"+"+encodeURIComponent(this.osName)+"+"+encodeURIComponent(this.osVersion)+"+"+(""!==this.smartLibParameters.deviceType?encodeURIComponent(this.smartLibParameters.deviceType):encodeURIComponent(this.deviceType))+"+-1+-1+-1++-1+-1+-1+-1+-1+-1+-1+-1+-1+-1+-1++":this.metrics.redirectionTime+"+"+encodeURIComponent(e)+"+"+encodeURIComponent(this.playerVersion)+"+"+encodeURIComponent(this.osName)+"+"+encodeURIComponent(this.osVersion)+"+"+(""!==this.smartLibParameters.deviceType?encodeURIComponent(this.smartLibParameters.deviceType):encodeURIComponent(this.deviceType))+"+"+this.metrics.startupTime+"+"+this.metrics.completion+"+"+Math.round(this.metrics.playbackDuration/1e3)+"+"+this.metrics.playbackType+"+"+this.metrics.stallsNumber+"+"+this.metrics.maxStallDuration+"+"+this.metrics.totalStallsDuration+"+"+this.metrics.rebufferingsNumber+"+"+this.metrics.maxRebufferingDuration+"+"+this.metrics.totalRebufferingDuration+"+"+Math.round(this.metrics.maxBitrate)+"+"+Math.round(this.metrics.minBitrate)+"+"+Math.round(this.metrics.averageBitrate)+"+"+this.metrics.layerSwitchesNumber+"+"+Math.round(this.metrics.sessionDuration/1e3)+"+"+this.getTimeSpentPerLayerQuery()+"+")+(encodeURIComponent(this.smartLibParameters.uuid)+"+"+this.nanoCDNStatus+"+"+(void 0!==i?encodeURIComponent(i):"")+"+")+encodeURIComponent(this.smartLibVersion)+"+",void 0!==s.A.adMo
1dule&&void 0!==this.adMetrics&&this.adMetrics.length>0){let e=s.A.adModule.AdMetrics.merge(this.adMetrics);t+=(e.adSkippable?1:0)+"+"+(e.adSkipped?1:0)+"+"+(e.adProgress>=0?e.adProgress/25:e.adProgress)+"+"+Math.round(e.adDuration/1e3)+"+"+e.stallsNumber+"+"+Math.round(e.stallsDuration/1e3)+"+"+e.layerSwitchesNumber+"+"+e.averageBitrate}else t+="+++++++";return t+("+"+this.getNetworkTypeListStr()+"+"+encodeURIComponent(this.playerErrorCode)+("+"+(this.cdnStatusCode>=0?this.cdnStatusCode:"")+"+"+(this.nanoCDNStatusCode>=0?this.nanoCDNStatusCode:"")+"+"+this.bpkhttpserverTiming))+"+"+this.gdpr}toEndSessionJSON(){let e={};if(e[u.IS_START]=!1,e[u.GDPR]=this.gdpr,this.gdpr===l.H.GDPR_DELETE)return e;if(e[u.SESSION_ID]=this.sessionId,e[u.STATUS_CODE]=this.statusCode,e[u.CONTENT_URL]=this.requestedURL?.toString(),this.redirectedURL instanceof n.A==!0&&this.redirectedURL.hasParam(h.A.AD_NONCE_QUERY_PARAMETER)&&this.redirectedURL.setParam(h.A.AD_NONCE_QUERY_PARAMETER,"ignored"),e[u.REDIRECT_URL]=this.redirectedURL?.toString(),void 0!==this.metrics?(e[u.REDIRECTION_TIME]=this.metrics.redirectionTime,e[u.STARTUP_TIME]=this.metrics.startupTime,e[u.COMPLETION]=this.metrics.completion,e[u.PLAYED_TIME]=Math.round(this.metrics.playbackDuration/1e3),e[u.DURATION]=Math.round(this.metrics.sessionDuration/1e3),e[u.PLAYBACK_TYPE]=this.metrics.playbackType,e[u.NUMBER_OF_STALLS]=this.metrics.stallsNumber,e[u.MAX_STALL_TIME]=this.metrics.maxStallDuration,e[u.TOTAL_STALL_TIME]=this.metrics.totalStallsDuration,e[u.NUMBER_OF_REBUFFERING]=this.metrics.rebufferingsNumber,e[u.MAX_REBUFFERING_TIME]=this.metrics.maxRebufferingDuration,e[u.TOTAL_REBUFFERING_TIME]=this.metrics.totalRebufferingDuration,e[u.MIN_BITRATE]=Math.round(this.metrics.minBitrate),e[u.MAX_BITRATE]=Math.round(this.metrics.maxBitrate),e[u.AVERAGE_BITRATE]=Math.round(this.metrics.averageBitrate),e[u.NUMBER_OF_LAYER_SWITCH]=this.metrics.layerSwitchesNumber,e[u.TIME_SPENT_PER_LAYER]=this.metrics.timeSpentPerLayer):(e[u.REDIRECTION_TIME]=-1,e[u.STARTUP_TIME]=-1,e[u.COMPLETION]=-1,e[u.PLAYED_TIME]=-1,e[u.DURATION]=-1,e[u.PLAYBACK_TYPE]="",e[u.NUMBER_OF_STALLS]=-1,e[u.MAX_STALL_TIME]=-1,e[u.TOTAL_STALL_TIME]=-1,e[u.NUMBER_OF_REBUFFERING]=-1,e[u.MAX_REBUFFERING_TIME]=-1,e[u.TOTAL_REBUFFERING_TIME]=-1,e[u.MIN_BITRATE]=-1,e[u.MAX_BITRATE]=-1,e[u.AVERAGE_BITRATE]=-1,e[u.NUMBER_OF_LAYER_SWITCH]=-1,e[u.TIME_SPENT_PER_LAYER]={}),e[u.PLAYER_NAME]=this.playerName,e[u.PLAYER_VERSION]=this.playerVersion,e[u.DEVICE_OS]=this.osName,e[u.DEVICE_VERSION]=this.osVersion,""!==this.smartLibParameters.deviceType?e[u.DEVICE_TYPE]=this.smartLibParameters.deviceType:e[u.DEVICE_TYPE]=this.deviceType,e[u.UUID]=this.smartLibParameters.uuid,e[u.NANOCDN_STATUS]=this.nanoCDNStatus,e[u.CUSTOM_PARAMETERS]=this.customParameters,void 0!==this.timeline?e[u.TIMELINE]=this.timeline.data().base64():e[u.TIMELINE]="",e[u.SMARTLIB_VERSION]=this.smartLibVersion,e[u.DIVERSITY]=this.diversity,e[u.PLAYER_ERROR_CODE]=this.playerErrorCode,e[u.AD_METRICS]=[],void 0!==this.adMetrics&&this.adMetrics.length>0)for(let t=0;t<this.adMetrics.length;t++){let i=this.adMetrics[t],s=this.cleanJson({ad_skippable:i.adSkippable?1:0,ad_skipped:i.adSkipped?1:0,ad_progress:i.adProgress>=0?i.adProgress/25:i.adProgress,ad_duration:Math.round(i.adDuration/1e3),stalls_number:i.stallsNumber,stalls_duration:Math.round(i.stallsDuration/1e3),layer_switches_number:i.layerSwitchesNumber,average_bitrate:i.averageBitrate,creative_id:i.creativeId,ad_id:i.adId.slice(0,i.adId.lastIndexOf("-")),ad_index:i.adIndex,ad_count:i.adCount,ad_format:i.adFormat,impression_date:i.impressionDate});e[u.AD_METRICS].push(s)}return e[u.NETWORK_TYPE]=this.getNetworkTypeListStr(),e[u.CDN_STATUS_CODE]=this.cdnStatusCode>=0?this.cdnStatusCode:"",e[u.NANOCDN_STATUS_CODE]=this.nanoCDNStatusCode>=0?this.nanoCDNStatusCode:"",e[u.BPKHTTPSERVER_TIMING]=this.bpkhttpserverTiming,e[u.PRECACHED]=this.precached,e[u.PRECACHE_ENDED]=this.precacheEnded,e[u.PRECACHE_DURATION]=this.precacheDuration,e}cleanJson(e){let t=["ad_progress","ad_index","ad_count"];for(let i in e){let s=e[i];-1===t.indexOf(i)&&(s<=0||""===s)&&delete e[i]}return e}getTimeSpentPerLayerQuery(){let e="";for(let t in this.metrics.timeSpentPerLayer)""!==e&&(e+=","),e+=t+":"+this.metrics.timeSpentPerLayer[t];return e}addNetworkType(e){this.networkTypeList.includes(e)||this.networkTypeList.push(e)}getNetworkTypeListStr(){return this.networkTypeList.length>0?this.networkTypeList.sort((e,t)=>
1String(e).localeCompare(String(t))).join("-"):""}toString(){return JSON.stringify(this,(e,t)=>"timeline"===e&&void 0!==s.A.analyticsModule&&t instanceof s.A.analyticsModule.SessionTrackerTimeline?t.toString():"requestedURL"===e||"redirectedURL"===e?t?t.toString():"":void 0===t?"undefined":t," ")}}var p=i(7418),g=i(1262),S=i(1134);let E="BpkSessionHandler";class m{static NANOCDN_STATUS_UNAVAILABLE=1;static NANOCDN_STATUS_DETECTED_NOT_USED=2;static NANOCDN_STATUS_USED=3;static REGEX_TICKET="^[0-5a-z]{30,50}$";static REGEX_TICKET_TRANSCODED="^.*@[0-5a-z]{30,50}$";smartLib;streamingSession;analyticsAddress;options;diversitySession;adSession;omSessionHandler;id;listeners;playerAdapterInitialized;playerAdapter;simidControllerAdapter;metricsManager;keepAliveManager;adMetricsManager;adTrackingManager;sessionResult;sessionReport;firstImageCalled;stopped;jobs;deviceInitDate;manifestInitDate;videoMulticastStatus;audioMulticastStatus;dataMulticastStatus;constructor(e,t){this.smartLib=e,this.streamingSession=t,this.diversitySession=void 0,this.adSession=void 0,this.listeners=[],this.playerAdapterInitialized=!1,this.sessionResult=void 0,this.sessionReport=new u,this.firstImageCalled=!1,this.stopped=!1,this.jobs=[],this.sessionReport.smartLibParameters=e.getParameters(),this.sessionReport.customParameters=this.getCustomParameters(),this.videoMulticastStatus=l.H.MULTICAST_INACTIVE,this.audioMulticastStatus=l.H.MULTICAST_INACTIVE,this.dataMulticastStatus=l.H.MULTICAST_INACTIVE,this.analyticsAddress=this.sessionReport.smartLibParameters.analyticsAddress,this.multicastStatusListener=void 0}initPlayerAdapter(){!1===this.playerAdapterInitialized&&(this.playerAdapterInitialized=!0,void 0!==this.playerAdapter?(a.g.i(E,"Player:name="+this.playerAdapter.getName()+", version="+this.playerAdapter.getVersion(),this.id),a.g.i(E,"Player:capabilities="+JSON.stringify(this.playerAdapter.getCapabilities()),this.id),this.playerAdapter.attachSession(this),this.playerAdapter.initSessionPlayerObjects()):a.g.i(E,"Player:no player attached",this.id))}initManagers(){void 0!==s.A.analyticsModule&&(this.metricsManager=new s.A.analyticsModule.MetricsManager(this,this.playerAdapter),this.addListener(this.sessionReport.timeline),g.CE.getInstance().addListener(this.sessionReport.timeline)),void 0!==s.A.adModule&&(this.adMetricsManager=new s.A.adModule.AdMetricsManager(this),this.adTrackingManager=new s.A.adModule.AdTrackingManager(this,this.playerAdapter),this.addListener(this.adMetricsManager),this.adTrackingManager.addListener(this.adMetricsManager),void 0!==this.simidControllerAdapter&&this.addListener(this.simidControllerAdapter)),void 0!==this.playerAdapter&&(this.addListener(this.metricsManager),this.addListener(this.playerAdapter)),void 0!==this.adSession&&this.adSession.isAdActivated()&&s.A.adModule?.OMSDKManager.getInstance().isEnabled()&&(this.omSessionHandler=new s.A.adModule.OMSessionHandler(this,this.playerAdapter),this.addListener(this.omSessionHandler),this.adTrackingManager?.addListener(this.omSessionHandler)),this.addListener(this),g.CE.getInstance().addListener(this),this.smartLib.monitoringManager?.startSession(this)}start(e,t=()=>{}){a.g.i(E,"Starting session...",this.id);let i=n.A.parse(e);this.sessionReport.startSessionDate=Date.now(),this.sessionReport.requestedURL=i,this.sessionReport.precached=this.isPrecached(),this.initPlayerAdapter(),this.initManagers(),this.notifyStart();let s=this.smartLib.getParameters(),o={analyticsAddress:this.analyticsAddress,nanoCDNDescr:this.smartLib.nanoCDNHostManager?.getCurrentNanoCDNDescr(),nanoCDNDescrConfigured:this.smartLib.nanoCDNHostManager?.getCurrentNanoCDNDescr(),broadpeakDomainNames:s.broadpeakDomainNames,forceTeardown:s.forceTeardown,userAgent:s.userAgent};if(void 0!==o.nanoCDNDescr&&(this.sessionReport.nanoCDNStatus=m.NANOCDN_STATUS_DETECTED_NOT_USED),this.sessionReport.gdpr=this.options.get(l.H.GDPR_PREFERENCE),!i){let s=g.Sy.success(i);this.sessionResult=s,this.handleRedirectedURL(o),s.url=e;let a=new n.A;return a.href=e,this.sessionReport.requestedURL=a,this.sessionReport.redirectedURL=a,t(e),Promise.resolve(s)}return r.A.getInstance().getURL(i,o,this).then(e=>(this.sessionResult=e,e.isError()&&(this.sessionReport.statusCode=e.getErrorCode()),this.sessionReport.redirectedURL=this.patchBkmResult(e.getURL()),this.handleRedirectedURL(o),e.url=this.sessionReport.redirectedURL?this.sessionReport.redirectedURL.toString():"",this.stopped?(a.g.d(E,"The session has been stopped while creating it.",this.id),this.stop(),e=g.Sy.error(g.Sy.RESULT_SESSION_HAS_BEEN_STOPPED_DURING_REQUEST),a.g.i(E,"Session error code: "+e.getErrorMessage()+" (code "+e.getErrorCode()+", detail "+e.getDetailedErrorMessage()+")",this.id),a.g.i(E,"Session redirected URL: ",this.id),t("")):(a.g.i(E,"Session status: "+e.getErrorMessage()+" (code "+e.getErrorCode()+", detail "+e.getDetailedErrorMessage()+")",this.id),e.url.length>0?a.g.i(E,"Session redirected URL: "+e.url,this.id):(this.sessionReport.redirectedURL=new n.A,this.sessionReport.redirectedURL.href=""),t(e.url)),e))}handleRedirectedURL(e){this.isNanoCDNUsed()&&(this.sessionReport.nanoCDNStatus=m.NANOCDN_STATUS_USED,this.notifyUnicastUsed());let t=this.sessionResult.nanoCDNDescr||this.smartLib.nanoCDNHostManager?.getCurrentNanoCDNDescr(),i=t?.bka100;if(void 0!==i&&(a.g.i(E,"nanoCDN is overwriting the analytics address to "+i,this.id),this.analyticsAddress=i),this.sessionReport.redirectedURL){if(!0===this.diversitySession?.activated&&this.diversitySession?.manifest){let e=this.playerAdapter.initDiversitySession(this.diversitySession.options);this.addListener(e),this.playerAdapter.setDiversityManifest(this.diversitySession.manifest)}this.sessionReport.sessionRunning=!0}this.sessionReport.sessionCreated=!0,this.sessionReport.sessionRunning&&(this.sessionReport.teardownActivated=this.isTeardownActivated(e)),this.removeBroadpeakParameters(this.sessionReport.redirectedURL),this.sessionReport.sessionId=this.getTicket(),this.sessionReport.teardownActivated||this.sessionReport.timeline?.encoder.extend(),this.notifyRedirectionEnd(),this.isPrecached()&&this.startKeepalive(),void 0===this.playerAdapter&&this.sessionReport.sessionRunning&&this.notifyFirstImage(0,0)}stop(e){if(this.updatePrecacheDuration(),g.CE.getInstance().removeListener(this.sessionReport.timeline),g.CE.getInstance().removeListener(this),void 0===e||isNaN(e)||(this.sessionReport.statusCode=e),this.sessionReport.endSessionDate=Date.now(),this.notifyStop(this.sessionReport.statusCode),void 0!==this.keepAliveManager&&this.keepAliveManager.stop(),this.smartLib.monitoringManager?.stopSession(this),this.sessionReport.sessionCreated){a.g.d(E,"Session ends with status code: "+this.sessionReport.statusCode,this.id);let e=this.smartLib.getParameters();this.sessionReport.sessionRunning=!1,this.sessionReport.sessionCreated=!1,this.sessionReport.smartLibParameters=JSON.parse(JSON.stringify(this.sessionReport.smartLibParameters)),this.sessionReport.customParameters=JSON.parse(JSON.stringify(this.getCustomParameters())),this.notifyEndSessionReportUpdateRequested(this.sessionReport),a.g.d(E,"SessionReport: "+this.sessionReport.toString(),this.id),this.resetCustomParameters();let t={analyticsAddress:this.analyticsAddress,userAgent:e.userAgent},i=this.options.get(l.H.SESSION_TEARDOWN),n=this.options.get(l.H.SESSION_REPORTING_MODE),o=!1,d=!1;if(i===l.H.SESSION_ENABLED?(o=!0,n===l.H.SESSION_REPORTING_MODE_METRICS_RECEIVER&&(d=!0)):i===l.H.SESSION_ENABLED_IF_BROADPEAK_DOMAIN?this.sessionReport.teardownActivated?(o=!0,n===l.H.SESSION_REPORTING_MODE_METRICS_RECEIVER&&(d=!0)):n!==l.H.SESSION_REPORTING_MODE_DEFAULT&&n!==l.H.SESSION_REPORTING_MODE_METRICS_RECEIVER||(d=!0):i===l.H.SESSION_DISABLED&&(n!==l.H.SESSION_REPORTING_MODE_DEFAULT&&n!==l.H.SESSION_REPORTING_MODE_METRICS_RECEIVER||(d=!0)),o){let e=void 0===this.keepAliveManager||"POST"===this.keepAliveManager?.method?"POST":"GET";a.g.d(E,"Keepalive manager method set to "+e,this.id),this.sessionReport.teardownRequestDate=Date.now(),r.A.getInstance().teardown(this,t,e)}d&&(this.sessionReport.endSessionRequestDate=Date.now(),s.A.analyticsModule?.AnalyticsRequestManager.getInstance().endSession(this,t))}void 0!==this.playerAdapter&&(!0===this.diversitySession?.activated&&this.playerAdapter.releaseDiversitySession(),this.playerAdapter.releaseSessionPlayerObjects(),this.playerAdapter.detachSession());let t=0;for(let e=0;e<this.jobs.length;e++)!0===this.jobs[e].active&&t++,S.A.getInstance().interrupt(this.jobs[e]);a.g.d(E,t+" active job(s)",this.id),this.jobs=[],this.listeners=[],this.stopped=!0}onFirstImage(e,t){void 0===this.keepAliveManager&&this.startKeepalive()}startKeepalive(){this.notifyStartSessionReportUpdateRequested(this.sessionReport);let e=this.options.get(l.H.SESSION_KEEPALIVE),t=void 0!==s.A.analyticsModule&&this.options.get(l.H.SESSION_REPORTING_MODE)===l.H.SESSION_REPORTING_MODE_METRICS_RECEIVER,i=0===this.smartLib.getParameters().analyticsAddress.length;e===l.H.SESSION_ENABLED?(a.g.i(E,"Keepalive is enabled (SESSION_KEEPALIVE=SESSION_ENABLED)",this.id),this.keepAliveManager=t&&!i?new s.A.analyticsModule.BroadpeakCDNCacheKeepaliveManager(this):new p.q(this)):e===l.H.SESSION_ENABLED_IF_BROADPEAK_DOMAIN?this.sessionReport.teardownActivated?this.keepAliveManager=t&&!i?new s.A.analyticsModule.BroadpeakCDNCacheKeepaliveManager(this):new p.q(this):void 0===s.A.analyticsModule||i||(this.keepAliveManager=new s.A.analyticsModule.CacheKeepaliveManager(this)):e===l.H.SESSION_DISABLED&&(this.sessionReport.teardownActivated&&a.g.i(E,"Keepalive is disabled (SESSION_KEEPALIVE=SESSION_DISABLED)",this.id),void 0===s.A.analyticsModule||i||(this.keepAliveManager=new s.A.analyticsModule.CacheKeepaliveManager(this))),this.keepAliveManager?.start(),void 0!==s.A.monitoringModule&&!0===this.isNanoCDNUsed()&&this.keepAliveManager?.process(!1)}getMulticastStatus(e,t){if(void 0!==e&&"number"==typeof e.status){let i=e.status,s=e.daiperiod||0;if(1===i)return a.g.d(E,"Multicast status: active",this.id),l.H.MULTICAST_ACTIVE;if(0!==s||1!==i)return t!==l.H.MULTICAST_INACTIVE?(a.g.d(E,"Multicast status: inactive was active"+(s>
1=1?" (playing DAI period)":""),this.id),l.H.MULTICAST_INACTIVE_WAS_ACTIVE):(a.g.d(E,"Multicast status: inactive",this.id),l.H.MULTICAST_INACTIVE)}return a.g.d(E,"Multicast status: unknown (segment:"+JSON.stringify(e)+")",this.id),l.H.MULTICAST_UNKNOWN}onKeepaliveRequestEnded(e,t){if(this.isNanoCDNUsed()){if("object"!=typeof t)return a.g.d(E,"Data is not an object: (data:"+JSON.stringify(t)+")",this.id),this.videoMulticastStatus=l.H.MULTICAST_UNKNOWN,this.audioMulticastStatus=l.H.MULTICAST_UNKNOWN,void(this.dataMulticastStatus=l.H.MULTICAST_UNKNOWN);a.g.d(E,"nanoCDN data: "+JSON.stringify(t)+")",this.id);let e=this.videoMulticastStatus,i=this.audioMulticastStatus,s=this.dataMulticastStatus;a.g.d(E,"Getting multicast status for video",this.id),this.videoMulticastStatus=this.getMulticastStatus(t.last_video_segment,e),a.g.d(E,"Getting multicast status for audio",this.id),this.audioMulticastStatus=this.getMulticastStatus(t.last_audio_segment,i),a.g.d(E,"Getting multicast status for data",this.id),this.dataMulticastStatus=this.getMulticastStatus(t.last_data_segment,s),e!==this.videoMulticastStatus&&(this.streamingSession.multicastStatusListener?.onVideoMulticastStatusChange(this.videoMulticastStatus),this.videoMulticastStatus===l.H.MULTICAST_ACTIVE?this.notifyMulticastUsed():this.notifyUnicastUsed()),i!==this.audioMulticastStatus&&this.streamingSession.multicastStatusListener?.onAudioMulticastStatusChange(this.audioMulticastStatus),s!==this.dataMulticastStatus&&this.streamingSession.multicastStatusListener?.onDataMulticastStatusChange(this.dataMulticastStatus)}}isNanoCDNUsed(){let e=!1;if(void 0===s.A.nanoCDNModule||!this.sessionReport.redirectedURL)return!1;let t=this.sessionReport.redirectedURL.getHostname(),i=this.smartLib.nanoCDNHostManager?.getNanoCDNDescrList();return i?.forEach(i=>{t===i.hostIP&&(e=!0)}),e}patchBkmResult(e){return e&&-1!==e.getPath().indexOf("//bpk-token")&&e.setPath(e.getPath().replace("//bpk-token","/bpk-token")),e}getTicket(){let e=null;void 0!==this.adTrackingManager&&!0===this.adTrackingManager.bkYouSession&&void 0!==this.adTrackingManager.sessionToken&&this.adTrackingManager.sessionToken.length>0&&(e=this.adTrackingManager.sessionToken),!e&&this.sessionReport.redirectedURL&&(e=this.sessionReport.redirectedURL.getParam(r.A.QUERY_PARAMETER_SESSION_ID)),!e&&this.sessionReport.redirectedURL&&(e=this.sessionReport.redirectedURL.getParam("bpkio_sessionid"));let t=this.sessionReport.redirectedURL?this.sessionReport.redirectedURL.getPathParts():null;if(!e&&t&&t.length&&(t[0].match("\\[(.*)\\]")?(e=t[0].substring(1,t[0].length-1),a.g.v(E,"Ticket detected: "+e,this.id)):t[0].match("\\%5B(.*)\\%5D")&&(e=t[0].substring(3,t[0].length-3),a.g.v(E,"Ticket detected: "+e,this.id))),!e&&t){let i="bpk-token"===t[0]?t[1]:t[0];i&&(i.match(m.REGEX_TICKET)||i.match(m.REGEX_TICKET_TRANSCODED))&&(e=i,a.g.v(E,"Ticket detected: "+e,this.id))}return e||(e=this.generateTicket()),e||(a.g.w(E,"Failed getting ticket",this.id),a.g.w(E,"SmartLib won't be able to post metrics",this.id)),e}generateTicket(){let e=Date.now(),t=o.A.randomIntFromInterval(1e6,9999999),i=o.A.randomIntFromInterval(1e6,9999999),s=o.A.stringToBase64(t+""+e+i);return a.g.w(E,s?"Ticket generated: "+s:"Cannot encode base 64 ticket",this.id),s}getTeardown(){let e=this.sessionReport.redirectedURL.getParam("bk-teardown");return!!e&&(e.startsWith("T")||e.startsWith("t")||e.startsWith("1"))}isTeardownActivated(e){return e.forceTeardown===s.A.FORCE_TEARDOWN_ENABLED?(a.g.i(E,"Session will start with keepalives/teardown (forceTeardown)",this.id),!0):e.forceTeardown===s.A.FORCE_TEARDOWN_DISABLED?(a.g.i(E,"Session will start without keepalives/teardown (forceTeardown)",this.id),!1):null!==this.sessionReport.redirectedURL&&"0"===this.sessionReport.redirectedURL.getParam("bk-teardown")?(a.g.i(E,"Session will start without keepalives/teardown (bk-teardown=0)",this.id),!1):null!==this.sessionReport.redirectedURL&&this.getTeardown()?(a.g.i(E,"Session will start with keepalives/teardown (bk-teardown=1)",this.id),!0):this.sessionReport.nanoCDNStatus===m.NANOCDN_STATUS_USED?(a.g.i(E,"Session will start with keepalives/teardown (nanoCDN used)",this.id),!0):!1===this.options.get(l.H.REQUEST_BROADPEAK_CDN)?(a.g.i(E,"Session will start without keepalives/teardown (REQUEST_BROADPEAK_CDN=false)",this.id),!1):null!==this.sessionReport.requestedURL&&r.A.isBroadpeakDomainName(this.sessionReport.requestedURL,e.broadpeakDomainNames)?(a.g.i(E,"Session will start with keepalives/teardown (in broadpeak domains list)",this.id),!0):(a.g.i(E,"Session will start without keepalives/teardown",this.id),!1)}removeBroadpeakParameters(e){if(!e)return;let t=e.getParams();if(t){for(let e=t.length-1;e>=0;e--){let i=t[e].key;i.startsWith("bk-")&&(a.g.d(E,"Remove query parameter '"+i+"' from url",this.id),t.splice(e,1))}e.setParams(t)}}isSessionCreated(e){if(null===e)return!1;let t=e.getParam(r.A.QUERY_PARAMETER_SESSION_ID);if(t&&t.length)return!0;let i=e.getParam(r.A.QUERY_PARAMETER_SESSION_CREATED);return!!i&&(i.startsWith("T")||i.startsWith("t")||i.startsWith("1"))}isPrecached(){return!0===this.options.get(l.H.SESSION_PRECACHE)}updatePrecacheDuration(){this.isPrecached()&&0===this.sessionReport.precacheDuration&&(this.sessionReport.precacheDuration=Date.now()-this.sessionReport.startSessionDate)}getCustomParameters(){return void 0!==this.streamingSession?this.streamingSession.customParameters:this.smartLib.getParameters().customParameters}resetCustomParameters(){void 0!==this.streamingSession||this.smartLib.resetCustomParameters()}addListener(e){void 0===e||this.listeners.includes(e)||this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);-1!==t&&this.listeners.splice(t,1)}notifyEvent(e,t,i,s){"function"==typeof e[t]&&e[t](i,s)}
1notifyLoading(){this.listeners.forEach(e=>{this.notifyEvent(e,"onLoading")})}notifyStart(){let e,t;e=g.CE.getInstance().networkType,this.sessionReport.addNetworkType(e),t=g.CE.getInstance().mute,this.listeners.forEach(i=>{this.notifyEvent(i,"onStart",e,t)})}notifyRedirectionEnd(){this.listeners.forEach(e=>{this.notifyEvent(e,"onRedirectionEnd")})}notifyPrecacheEnded(){this.isPrecached()&&!0!==this.sessionReport.precacheEnded&&(a.g.d(E,"Precache ended",this.id),this.sessionReport.precacheEnded=!0,this.updatePrecacheDuration(),this.listeners.forEach(e=>{this.notifyEvent(e,"onPrecacheEnded")}))}notifyFirstImage(e,t){this.firstImageCalled?a.g.e(E,"Implementation error: PlayerEventListener.onSessionStart() already called. If you don't attach any player, please remove this call, SmartLib is now handling it automatically.",this.id):(this.firstImageCalled=!0,void 0!==this.adSession&&this.adSession.isAdActivated()?void 0!==this.playerAdapter?!0===this.playerAdapter.getCapabilities().adTracking?this.addListener(this.adTrackingManager):a.g.d(E,"Ad tracking disabled (player not compatible)",this.id):a.g.d(E,"Ad tracking disabled (no player attached)",this.id):a.g.d(E,"Ad tracking disabled (advertising not activated)",this.id),this.listeners.forEach(i=>{this.notifyEvent(i,"onFirstImage",e,t)}))}notifyLayerSwitch(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onLayerSwitch",e)})}notifyPause(){this.listeners.forEach(e=>{this.notifyEvent(e,"onPause")})}notifyResume(){this.listeners.forEach(e=>{this.notifyEvent(e,"onResume")})}notifyBufferingStart(){this.listeners.forEach(e=>{this.notifyEvent(e,"onBufferingStart")})}notifyBufferingEnd(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onBufferingEnd",e)})}notifyStallEnd(){this.listeners.forEach(e=>{this.notifyEvent(e,"onStallEnd")})}notifyRebufferingEnd(){this.listeners.forEach(e=>{this.notifyEvent(e,"onRebufferingEnd")})}notifySeek(e,t){this.listeners.forEach(i=>{this.notifyEvent(i,"onSeek",e,t)})}notifyStop(e){this.adSession?.adPalSession?.setAdView(void 0),this.listeners.forEach(t=>{this.notifyEvent(t,"onStop",e)})}notifyClose(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onClose",e)})}notifyStartSessionReportUpdateRequested(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onStartSessionReportUpdateRequested",e)})}notifyKeepaliveSessionReportRequested(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onKeepaliveSessionReportUpdateRequested",e)})}notifyKeepaliveRequestEnded(e,t){this.listeners.forEach(i=>{this.notifyEvent(i,"onKeepaliveRequestEnded",e,t)})}notifyEndSessionReportUpdateRequested(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onEndSessionReportUpdateRequested",e)})}notifyVolumeChanged(e){this.listeners.forEach(t=>{this.notifyEvent(t,"onVolumeChanged",e)})}notifyPlayerError(e,t){this.listeners.forEach(i=>{this.notifyEvent(i,"onPlayerError",e,t)})}notifyMulticastUsed(){this.listeners.forEach(e=>{this.notifyEvent(e,"onMulticastUsed")})}notifyUnicastUsed(){this.listeners.forEach(e=>{this.notifyEvent(e,"onUnicastUsed")})}notifySimidClickthrough(e){a.g.d(E,"NOTIFY SIMID CLICKTHROUGH IN SESSION HANDLER"),this.listeners.forEach(t=>{this.notifyEvent(t,"onSimidClickthrough",e)})}notifySimidImpression(){a.g.d(E,"NOTIFY SIMID IMPRESSION IN SESSION HANDLER"),this.listeners.forEach(e=>{this.notifyEvent(e,"onSimidImpression")})}onNetworkAvailable(e){a.g.v(E,"Received event onNetworkAvailable type:"+e,this.id),this.sessionReport.addNetworkType(e)}}}},__webpack_module_cache__={};function __nested_webpack_require_124854__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](i,i.exports,__nested_webpack_require_124854__),i.exports}__nested_webpack_require_124854__.m=__webpack_modules__,deferred=[],__nested_webpack_require_124854__.O=function(e,t,i,s){if(!t){var a=1/0;for(d=0;d<deferred.length;d++){t=deferred[d][0],i=deferred[d][1],s=deferred[d][2];for(var r=!0,n=0;n<t.length;n++)a>=s&&Object.keys(__nested_webpack_require_124854__.O).every(function(e){return __nested_webpack_require_124854__.O[e](t[n])})?t.splice(n--,1):(r=!1,s<a&&(a=s));if(r){deferred.splice(d--,1);var o=i();void 0!==o&&(e=o)}}return e}
1s=s||0;for(var d=deferred.length;d>0&&deferred[d-1][2]>s;d--)deferred[d]=deferred[d-1];deferred[d]=[t,i,s]},__nested_webpack_require_124854__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __nested_webpack_require_124854__.d(t,{a:t}),t},__nested_webpack_require_124854__.d=function(e,t){for(var i in t)__nested_webpack_require_124854__.o(t,i)&&!__nested_webpack_require_124854__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__nested_webpack_require_124854__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__nested_webpack_require_124854__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__nested_webpack_require_124854__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={152:0};__nested_webpack_require_124854__.O.j=function(t){return 0===e[t]};var t=function(t,i){var s,a,r=i[0],n=i[1],o=i[2],d=0;if(r.some(function(t){return 0!==e[t]})){for(s in n)__nested_webpack_require_124854__.o(n,s)&&(__nested_webpack_require_124854__.m[s]=n[s]);if(o)var h=o(__nested_webpack_require_124854__)}for(t&&t(i);d<r.length;d++)a=r[d],__nested_webpack_require_124854__.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return __nested_webpack_require_124854__.O(h)},i=("undefined"!=typeof self?self:__webpack_require__.g).webpackChunkSmartLibModule=("undefined"!=typeof self?self:__webpack_require__.g).webpackChunkSmartLibModule||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))}();var __nested_webpack_exports__={};__nested_webpack_require_124854__.r(__nested_webpack_exports__),__nested_webpack_require_124854__.d(__nested_webpack_exports__,{AdInteractionType:function(){return core__WEBPACK_IMPORTED_MODULE_0__.AdInteractionType},AdManager:function(){return core__WEBPACK_IMPORTED_MODULE_0__.X2},LoggerManager:function(){return core__WEBPACK_IMPORTED_MODULE_0__.gD},RequestManager:function(){return core__WEBPACK_IMPORTED_MODULE_0__.Je},SmartLib:function(){return core__WEBPACK_IMPORTED_MODULE_0__.x6},StreamingSession:function(){return core__WEBPACK_IMPORTED_MODULE_0__.fF},StreamingSessionOptions:function(){return core__WEBPACK_IMPORTED_MODULE_0__.H1},StreamingSessionResult:function(){return core__WEBPACK_IMPORTED_MODULE_0__.Sy}});var core__WEBPACK_IMPORTED_MODULE_0__=__nested_webpack_require_124854__(1262),_engine_CoreEngine__WEBPACK_IMPORTED_MODULE_1__=__nested_webpack_require_124854__(8100);return _engine_CoreEngine__WEBPACK_IMPORTED_MODULE_1__.A.getInstance().init(),__nested_webpack_exports__=__nested_webpack_require_124854__.O(__nested_webpack_exports__)}()})},87138:function(e,t,i){"use strict";i.d(t,{default:function(){return a.a}});var s=i(231),a=i.n(s)},56800:function(e,t){var i;/*! 2 Copyright (c) 2018 Jed Watson. 3 Licensed under the MIT License (MIT), see 4 http://jedwatson.github.io/classnames 5*/!function(){"use strict";var s={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=n(e,r(i)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var i in e)s.call(e,i)&&e[i]&&(t=n(t,i));return t}function n(e,t){return t?e?e+" "+t:e+t:e}e.exports?(a.default=a,e.exports=a):void 0!==(i=(function(){return a}).apply(t,[]))&&(e.exports=i)}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.