@golstats/gsc-landing 1.0.26 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -248,7 +248,7 @@ browserWorkerPolyFill(self);
248
248
  `+e},Ox=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},Bge=Px(Ox(function(){var e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=function(){this.init=function(){var g={};this.on=function(v,T){g[v]||(g[v]=[]),g[v]=g[v].concat(T)},this.off=function(v,T){var S;return g[v]?(S=g[v].indexOf(T),g[v]=g[v].slice(),g[v].splice(S,1),S>-1):!1},this.trigger=function(v){var T,S,x,A;if(T=g[v],!!T)if(arguments.length===2)for(x=T.length,S=0;S<x;++S)T[S].call(this,arguments[1]);else{for(A=[],S=arguments.length,S=1;S<arguments.length;++S)A.push(arguments[S]);for(x=T.length,S=0;S<x;++S)T[S].apply(this,A)}},this.dispose=function(){g={}}}};t.prototype.pipe=function(g){return this.on("data",function(v){g.push(v)}),this.on("done",function(v){g.flush(v)}),this.on("partialdone",function(v){g.partialFlush(v)}),this.on("endedtimeline",function(v){g.endTimeline(v)}),this.on("reset",function(v){g.reset(v)}),g},t.prototype.push=function(g){this.trigger("data",g)},t.prototype.flush=function(g){this.trigger("done",g)},t.prototype.partialFlush=function(g){this.trigger("partialdone",g)},t.prototype.endTimeline=function(g){this.trigger("endedtimeline",g)},t.prototype.reset=function(g){this.trigger("reset",g)};var a=t,i=Math.pow(2,32),n=function(g){var v=new DataView(g.buffer,g.byteOffset,g.byteLength),T;return v.getBigUint64?(T=v.getBigUint64(0),T<Number.MAX_SAFE_INTEGER?Number(T):T):v.getUint32(0)*i+v.getUint32(4)},r={getUint64:n,MAX_UINT32:i},o=r.MAX_UINT32,l,c,d,u,h,m,p,f,y,b,E,D,M,N,P,L,V,$,U,ae,oe,Y,de,we,Se,pe,z,K,ue,ie,ne,fe,me,ye,ee,re;(function(){var g;if(de={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(g in de)de.hasOwnProperty(g)&&(de[g]=[g.charCodeAt(0),g.charCodeAt(1),g.charCodeAt(2),g.charCodeAt(3)]);we=new Uint8Array([105,115,111,109]),pe=new Uint8Array([97,118,99,49]),Se=new Uint8Array([0,0,0,1]),z=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),K=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),ue={video:z,audio:K},fe=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ne=new Uint8Array([0,0,0,0,0,0,0,0]),me=new Uint8Array([0,0,0,0,0,0,0,0]),ye=me,ee=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),re=me,ie=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),l=function(g){var v=[],T=0,S,x,A;for(S=1;S<arguments.length;S++)v.push(arguments[S]);for(S=v.length;S--;)T+=v[S].byteLength;for(x=new Uint8Array(T+8),A=new DataView(x.buffer,x.byteOffset,x.byteLength),A.setUint32(0,x.byteLength),x.set(g,4),S=0,T=8;S<v.length;S++)x.set(v[S],T),T+=v[S].byteLength;return x},c=function(){return l(de.dinf,l(de.dref,fe))},d=function(g){return l(de.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,g.audioobjecttype<<3|g.samplingfrequencyindex>>>1,g.samplingfrequencyindex<<7|g.channelcount<<3,6,1,2]))},u=function(){return l(de.ftyp,we,Se,we,pe)},L=function(g){return l(de.hdlr,ue[g])},h=function(g){return l(de.mdat,g)},P=function(g){var v=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,g.duration>>>24&255,g.duration>>>16&255,g.duration>>>8&255,g.duration&255,85,196,0,0]);return g.samplerate&&(v[12]=g.samplerate>>>24&255,v[13]=g.samplerate>>>16&255,v[14]=g.samplerate>>>8&255,v[15]=g.samplerate&255),l(de.mdhd,v)},N=function(g){return l(de.mdia,P(g),L(g.type),p(g))},m=function(g){return l(de.mfhd,new Uint8Array([0,0,0,0,(g&4278190080)>>24,(g&16711680)>>16,(g&65280)>>8,g&255]))},p=function(g){return l(de.minf,g.type==="video"?l(de.vmhd,ie):l(de.smhd,ne),c(),$(g))},f=function(g,v){for(var T=[],S=v.length;S--;)T[S]=ae(v[S]);return l.apply(null,[de.moof,m(g)].concat(T))},y=function(g){for(var v=g.length,T=[];v--;)T[v]=D(g[v]);return l.apply(null,[de.moov,E(4294967295)].concat(T).concat(b(g)))},b=function(g){for(var v=g.length,T=[];v--;)T[v]=oe(g[v]);return l.apply(null,[de.mvex].concat(T))},E=function(g){var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(g&4278190080)>>24,(g&16711680)>>16,(g&65280)>>8,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return l(de.mvhd,v)},V=function(g){var v=g.samples||[],T=new Uint8Array(4+v.length),S,x;for(x=0;x<v.length;x++)S=v[x].flags,T[x+4]=S.dependsOn<<4|S.isDependedOn<<2|S.hasRedundancy;return l(de.sdtp,T)},$=function(g){return l(de.stbl,U(g),l(de.stts,re),l(de.stsc,ye),l(de.stsz,ee),l(de.stco,me))},function(){var g,v;U=function(T){return l(de.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),T.type==="video"?g(T):v(T))},g=function(T){var S=T.sps||[],x=T.pps||[],A=[],j=[],q,G;for(q=0;q<S.length;q++)A.push((S[q].byteLength&65280)>>>8),A.push(S[q].byteLength&255),A=A.concat(Array.prototype.slice.call(S[q]));for(q=0;q<x.length;q++)j.push((x[q].byteLength&65280)>>>8),j.push(x[q].byteLength&255),j=j.concat(Array.prototype.slice.call(x[q]));if(G=[de.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(T.width&65280)>>8,T.width&255,(T.height&65280)>>8,T.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l(de.avcC,new Uint8Array([1,T.profileIdc,T.profileCompatibility,T.levelIdc,255].concat([S.length],A,[x.length],j))),l(de.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],T.sarRatio){var Q=T.sarRatio[0],se=T.sarRatio[1];G.push(l(de.pasp,new Uint8Array([(Q&4278190080)>>24,(Q&16711680)>>16,(Q&65280)>>8,Q&255,(se&4278190080)>>24,(se&16711680)>>16,(se&65280)>>8,se&255])))}return l.apply(null,G)},v=function(T){return l(de.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(T.channelcount&65280)>>8,T.channelcount&255,(T.samplesize&65280)>>8,T.samplesize&255,0,0,0,0,(T.samplerate&65280)>>8,T.samplerate&255,0,0]),d(T))}}(),M=function(g){var v=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(g.id&4278190080)>>24,(g.id&16711680)>>16,(g.id&65280)>>8,g.id&255,0,0,0,0,(g.duration&4278190080)>>24,(g.duration&16711680)>>16,(g.duration&65280)>>8,g.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(g.width&65280)>>8,g.width&255,0,0,(g.height&65280)>>8,g.height&255,0,0]);return l(de.tkhd,v)},ae=function(g){var v,T,S,x,A,j,q;return v=l(de.tfhd,new Uint8Array([0,0,0,58,(g.id&4278190080)>>24,(g.id&16711680)>>16,(g.id&65280)>>8,g.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),j=Math.floor(g.baseMediaDecodeTime/o),q=Math.floor(g.baseMediaDecodeTime%o),T=l(de.tfdt,new Uint8Array([1,0,0,0,j>>>24&255,j>>>16&255,j>>>8&255,j&255,q>>>24&255,q>>>16&255,q>>>8&255,q&255])),A=92,g.type==="audio"?(S=Y(g,A),l(de.traf,v,T,S)):(x=V(g),S=Y(g,x.length+A),l(de.traf,v,T,S,x))},D=function(g){return g.duration=g.duration||4294967295,l(de.trak,M(g),N(g))},oe=function(g){var v=new Uint8Array([0,0,0,0,(g.id&4278190080)>>24,(g.id&16711680)>>16,(g.id&65280)>>8,g.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return g.type!=="video"&&(v[v.length-1]=0),l(de.trex,v)},function(){var g,v,T;T=function(S,x){var A=0,j=0,q=0,G=0;return S.length&&(S[0].duration!==void 0&&(A=1),S[0].size!==void 0&&(j=2),S[0].flags!==void 0&&(q=4),S[0].compositionTimeOffset!==void 0&&(G=8)),[0,0,A|j|q|G,1,(S.length&4278190080)>>>24,(S.length&16711680)>>>16,(S.length&65280)>>>8,S.length&255,(x&4278190080)>>>24,(x&16711680)>>>16,(x&65280)>>>8,x&255]},v=function(S,x){var A,j,q,G,Q,se;for(G=S.samples||[],x+=20+16*G.length,q=T(G,x),j=new Uint8Array(q.length+G.length*16),j.set(q),A=q.length,se=0;se<G.length;se++)Q=G[se],j[A++]=(Q.duration&4278190080)>>>24,j[A++]=(Q.duration&16711680)>>>16,j[A++]=(Q.duration&65280)>>>8,j[A++]=Q.duration&255,j[A++]=(Q.size&4278190080)>>>24,j[A++]=(Q.size&16711680)>>>16,j[A++]=(Q.size&65280)>>>8,j[A++]=Q.size&255,j[A++]=Q.flags.isLeading<<2|Q.flags.dependsOn,j[A++]=Q.flags.isDependedOn<<6|Q.flags.hasRedundancy<<4|Q.flags.paddingValue<<1|Q.flags.isNonSyncSample,j[A++]=Q.flags.degradationPriority&61440,j[A++]=Q.flags.degradationPriority&15,j[A++]=(Q.compositionTimeOffset&4278190080)>>>24,j[A++]=(Q.compositionTimeOffset&16711680)>>>16,j[A++]=(Q.compositionTimeOffset&65280)>>>8,j[A++]=Q.compositionTimeOffset&255;return l(de.trun,j)},g=function(S,x){var A,j,q,G,Q,se;for(G=S.samples||[],x+=20+8*G.length,q=T(G,x),A=new Uint8Array(q.length+G.length*8),A.set(q),j=q.length,se=0;se<G.length;se++)Q=G[se],A[j++]=(Q.duration&4278190080)>>>24,A[j++]=(Q.duration&16711680)>>>16,A[j++]=(Q.duration&65280)>>>8,A[j++]=Q.duration&255,A[j++]=(Q.size&4278190080)>>>24,A[j++]=(Q.size&16711680)>>>16,A[j++]=(Q.size&65280)>>>8,A[j++]=Q.size&255;return l(de.trun,A)},Y=function(S,x){return S.type==="audio"?g(S,x):v(S,x)}}();var X={ftyp:u,mdat:h,moof:f,moov:y,initSegment:function(g){var v=u(),T=y(g),S;return S=new Uint8Array(v.byteLength+T.byteLength),S.set(v),S.set(T,v.byteLength),S}},R=function(g){var v,T,S=[],x=[];for(x.byteLength=0,x.nalCount=0,x.duration=0,S.byteLength=0,v=0;v<g.length;v++)T=g[v],T.nalUnitType==="access_unit_delimiter_rbsp"?(S.length&&(S.duration=T.dts-S.dts,x.byteLength+=S.byteLength,x.nalCount+=S.length,x.duration+=S.duration,x.push(S)),S=[T],S.byteLength=T.data.byteLength,S.pts=T.pts,S.dts=T.dts):(T.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(S.keyFrame=!0),S.duration=T.dts-S.dts,S.byteLength+=T.data.byteLength,S.push(T));return x.length&&(!S.duration||S.duration<=0)&&(S.duration=x[x.length-1].duration),x.byteLength+=S.byteLength,x.nalCount+=S.length,x.duration+=S.duration,x.push(S),x},he=function(g){var v,T,S=[],x=[];for(S.byteLength=0,S.nalCount=0,S.duration=0,S.pts=g[0].pts,S.dts=g[0].dts,x.byteLength=0,x.nalCount=0,x.duration=0,x.pts=g[0].pts,x.dts=g[0].dts,v=0;v<g.length;v++)T=g[v],T.keyFrame?(S.length&&(x.push(S),x.byteLength+=S.byteLength,x.nalCount+=S.nalCount,x.duration+=S.duration),S=[T],S.nalCount=T.length,S.byteLength=T.byteLength,S.pts=T.pts,S.dts=T.dts,S.duration=T.duration):(S.duration+=T.duration,S.nalCount+=T.length,S.byteLength+=T.byteLength,S.push(T));return x.length&&S.duration<=0&&(S.duration=x[x.length-1].duration),x.byteLength+=S.byteLength,x.nalCount+=S.nalCount,x.duration+=S.duration,x.push(S),x},ve=function(g){var v;return!g[0][0].keyFrame&&g.length>1&&(v=g.shift(),g.byteLength-=v.byteLength,g.nalCount-=v.nalCount,g[0][0].dts=v.dts,g[0][0].pts=v.pts,g[0][0].duration+=v.duration),g},Le=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},qe=function(g,v){var T=Le();return T.dataOffset=v,T.compositionTimeOffset=g.pts-g.dts,T.duration=g.duration,T.size=4*g.length,T.size+=g.byteLength,g.keyFrame&&(T.flags.dependsOn=2,T.flags.isNonSyncSample=0),T},Ge=function(g,v){var T,S,x,A,j,q=v||0,G=[];for(T=0;T<g.length;T++)for(A=g[T],S=0;S<A.length;S++)j=A[S],x=qe(j,q),q+=x.size,G.push(x);return G},J=function(g){var v,T,S,x,A,j,q=0,G=g.byteLength,Q=g.nalCount,se=G+4*Q,_e=new Uint8Array(se),Ve=new DataView(_e.buffer);for(v=0;v<g.length;v++)for(x=g[v],T=0;T<x.length;T++)for(A=x[T],S=0;S<A.length;S++)j=A[S],Ve.setUint32(q,j.data.byteLength),q+=4,_e.set(j.data,q),q+=j.data.byteLength;return _e},De=function(g,v){var T,S=v||0,x=[];return T=qe(g,S),x.push(T),x},Oe=function(g){var v,T,S=0,x=g.byteLength,A=g.length,j=x+4*A,q=new Uint8Array(j),G=new DataView(q.buffer);for(v=0;v<g.length;v++)T=g[v],G.setUint32(S,T.data.byteLength),S+=4,q.set(T.data,S),S+=T.data.byteLength;return q},We={groupNalsIntoFrames:R,groupFramesIntoGops:he,extendFirstKeyFrame:ve,generateSampleTable:Ge,concatenateNalData:J,generateSampleTableForFrame:De,concatenateNalDataForFrame:Oe},gt=[33,16,5,32,164,27],Ye=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Ze=function(g){for(var v=[];g--;)v.push(0);return v},Bt=function(g){return Object.keys(g).reduce(function(v,T){return v[T]=new Uint8Array(g[T].reduce(function(S,x){return S.concat(x)},[])),v},{})},rt,Su=function(){if(!rt){var g={96e3:[gt,[227,64],Ze(154),[56]],88200:[gt,[231],Ze(170),[56]],64e3:[gt,[248,192],Ze(240),[56]],48e3:[gt,[255,192],Ze(268),[55,148,128],Ze(54),[112]],44100:[gt,[255,192],Ze(268),[55,163,128],Ze(84),[112]],32e3:[gt,[255,192],Ze(268),[55,234],Ze(226),[112]],24e3:[gt,[255,192],Ze(268),[55,255,128],Ze(268),[111,112],Ze(126),[224]],16e3:[gt,[255,192],Ze(268),[55,255,128],Ze(268),[111,255],Ze(269),[223,108],Ze(195),[1,192]],12e3:[Ye,Ze(268),[3,127,248],Ze(268),[6,255,240],Ze(268),[13,255,224],Ze(268),[27,253,128],Ze(259),[56]],11025:[Ye,Ze(268),[3,127,248],Ze(268),[6,255,240],Ze(268),[13,255,224],Ze(268),[27,255,192],Ze(268),[55,175,128],Ze(108),[112]],8e3:[Ye,Ze(268),[3,121,16],Ze(47),[7]]};rt=Bt(g)}return rt},Us=9e4,js,as,is,Ql,wu,Tu,mt;js=function(g){return g*Us},as=function(g,v){return g*v},is=function(g){return g/Us},Ql=function(g,v){return g/v},wu=function(g,v){return js(Ql(g,v))},Tu=function(g,v){return as(is(g),v)},mt=function(g,v,T){return is(T?g:g-v)};var kt={ONE_SECOND_IN_TS:Us,secondsToVideoTs:js,secondsToAudioTs:as,videoTsToSeconds:is,audioTsToSeconds:Ql,audioTsToVideoTs:wu,videoTsToAudioTs:Tu,metadataTsToSeconds:mt},yv=Su,Zl=kt,_v=function(g){var v,T,S=0;for(v=0;v<g.length;v++)T=g[v],S+=T.data.byteLength;return S},bv=function(g,v,T,S){var x,A=0,j=0,q=0,G=0,Q,se,_e;if(v.length&&(x=Zl.audioTsToVideoTs(g.baseMediaDecodeTime,g.samplerate),A=Math.ceil(Zl.ONE_SECOND_IN_TS/(g.samplerate/1024)),T&&S&&(j=x-Math.max(T,S),q=Math.floor(j/A),G=q*A),!(q<1||G>Zl.ONE_SECOND_IN_TS/2))){for(Q=yv()[g.samplerate],Q||(Q=v[0].data),se=0;se<q;se++)_e=v[0],v.splice(0,0,{data:Q,dts:_e.dts-A,pts:_e.pts-A});return g.baseMediaDecodeTime-=Math.floor(Zl.videoTsToAudioTs(G,g.samplerate)),G}},$l=function(g,v,T){return v.minSegmentDts>=T?g:(v.minSegmentDts=1/0,g.filter(function(S){return S.dts>=T?(v.minSegmentDts=Math.min(v.minSegmentDts,S.dts),v.minSegmentPts=v.minSegmentDts,!0):!1}))},vv=function(g){var v,T,S=[];for(v=0;v<g.length;v++)T=g[v],S.push({size:T.data.byteLength,duration:1024});return S},Sv=function(g){var v,T,S=0,x=new Uint8Array(_v(g));for(v=0;v<g.length;v++)T=g[v],x.set(T.data,S),S+=T.data.byteLength;return x},wv={prefixWithSilence:bv,trimAdtsFramesByEarliestDts:$l,generateSampleTable:vv,concatenateFrameData:Sv},Tv=kt.ONE_SECOND_IN_TS,yi=function(g,v){typeof v.pts=="number"&&(g.timelineStartInfo.pts===void 0&&(g.timelineStartInfo.pts=v.pts),g.minSegmentPts===void 0?g.minSegmentPts=v.pts:g.minSegmentPts=Math.min(g.minSegmentPts,v.pts),g.maxSegmentPts===void 0?g.maxSegmentPts=v.pts:g.maxSegmentPts=Math.max(g.maxSegmentPts,v.pts)),typeof v.dts=="number"&&(g.timelineStartInfo.dts===void 0&&(g.timelineStartInfo.dts=v.dts),g.minSegmentDts===void 0?g.minSegmentDts=v.dts:g.minSegmentDts=Math.min(g.minSegmentDts,v.dts),g.maxSegmentDts===void 0?g.maxSegmentDts=v.dts:g.maxSegmentDts=Math.max(g.maxSegmentDts,v.dts))},Ef=function(g){delete g.minSegmentDts,delete g.maxSegmentDts,delete g.minSegmentPts,delete g.maxSegmentPts},Cv=function(g,v){var T,S,x=g.minSegmentDts;return v||(x-=g.timelineStartInfo.dts),T=g.timelineStartInfo.baseMediaDecodeTime,T+=x,T=Math.max(0,T),g.type==="audio"&&(S=g.samplerate/Tv,T*=S,T=Math.floor(T)),T},kv={clearDtsInfo:Ef,calculateTrackBaseMediaDecodeTime:Cv,collectDtsInfo:yi},If=4,Ev=128,Iv=function(g){for(var v=0,T={payloadType:-1,payloadSize:0},S=0,x=0;v<g.byteLength&&g[v]!==Ev;){for(;g[v]===255;)S+=255,v++;for(S+=g[v++];g[v]===255;)x+=255,v++;if(x+=g[v++],!T.payload&&S===If){var A=String.fromCharCode(g[v+3],g[v+4],g[v+5],g[v+6]);if(A==="GA94"){T.payloadType=S,T.payloadSize=x,T.payload=g.subarray(v,v+x);break}else T.payload=void 0}v+=x,S=0,x=0}return T},zs=function(g){return g.payload[0]!==181||(g.payload[1]<<8|g.payload[2])!==49||String.fromCharCode(g.payload[3],g.payload[4],g.payload[5],g.payload[6])!=="GA94"||g.payload[7]!==3?null:g.payload.subarray(8,g.payload.length-1)},ja=function(g,v){var T=[],S,x,A,j;if(!(v[0]&64))return T;for(x=v[0]&31,S=0;S<x;S++)A=S*3,j={type:v[A+2]&3,pts:g},v[A+2]&4&&(j.ccData=v[A+3]<<8|v[A+4],T.push(j));return T},xv=function(g){for(var v=g.byteLength,T=[],S=1,x,A;S<v-2;)g[S]===0&&g[S+1]===0&&g[S+2]===3?(T.push(S+2),S+=2):S++;if(T.length===0)return g;x=v-T.length,A=new Uint8Array(x);var j=0;for(S=0;S<x;j++,S++)j===T[0]&&(j++,T.shift()),A[S]=g[j];return A},xf={parseSei:Iv,parseUserData:zs,parseCaptionPackets:ja,discardEmulationPreventionBytes:xv,USER_DATA_REGISTERED_ITU_T_T35:If},ns=a,ti=xf,oa=function(g){g=g||{},oa.prototype.init.call(this),this.parse708captions_=typeof g.parse708captions=="boolean"?g.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Et(0,0),new Et(0,1),new Et(1,0),new Et(1,1)],this.parse708captions_&&(this.cc708Stream_=new st({captionServices:g.captionServices})),this.reset(),this.ccStreams_.forEach(function(v){v.on("data",this.trigger.bind(this,"data")),v.on("partialdone",this.trigger.bind(this,"partialdone")),v.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};oa.prototype=new ns,oa.prototype.push=function(g){var v,T,S;if(g.nalUnitType==="sei_rbsp"&&(v=ti.parseSei(g.escapedRBSP),!!v.payload&&v.payloadType===ti.USER_DATA_REGISTERED_ITU_T_T35&&(T=ti.parseUserData(v),!!T))){if(g.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(g.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}S=ti.parseCaptionPackets(g.pts,T),this.captionPackets_=this.captionPackets_.concat(S),this.latestDts_!==g.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=g.dts}},oa.prototype.flushCCStreams=function(g){this.ccStreams_.forEach(function(v){return g==="flush"?v.flush():v.partialFlush()},this)},oa.prototype.flushStream=function(g){if(!this.captionPackets_.length){this.flushCCStreams(g);return}this.captionPackets_.forEach(function(v,T){v.presortIndex=T}),this.captionPackets_.sort(function(v,T){return v.pts===T.pts?v.presortIndex-T.presortIndex:v.pts-T.pts}),this.captionPackets_.forEach(function(v){v.type<2?this.dispatchCea608Packet(v):this.dispatchCea708Packet(v)},this),this.captionPackets_.length=0,this.flushCCStreams(g)},oa.prototype.flush=function(){return this.flushStream("flush")},oa.prototype.partialFlush=function(){return this.flushStream("partialFlush")},oa.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(g){g.reset()})},oa.prototype.dispatchCea608Packet=function(g){this.setsTextOrXDSActive(g)?this.activeCea608Channel_[g.type]=null:this.setsChannel1Active(g)?this.activeCea608Channel_[g.type]=0:this.setsChannel2Active(g)&&(this.activeCea608Channel_[g.type]=1),this.activeCea608Channel_[g.type]!==null&&this.ccStreams_[(g.type<<1)+this.activeCea608Channel_[g.type]].push(g)},oa.prototype.setsChannel1Active=function(g){return(g.ccData&30720)===4096},oa.prototype.setsChannel2Active=function(g){return(g.ccData&30720)===6144},oa.prototype.setsTextOrXDSActive=function(g){return(g.ccData&28928)===256||(g.ccData&30974)===4138||(g.ccData&30974)===6186},oa.prototype.dispatchCea708Packet=function(g){this.parse708captions_&&this.cc708Stream_.push(g)};var wt={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Nv=function(g){var v=wt[g]||g;return g&4096&&g===v?"":String.fromCharCode(v)},_r=function(g){return 32<=g&&g<=127||160<=g&&g<=255},ai=function(g){this.windowNum=g,this.reset()};ai.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},ai.prototype.getText=function(){return this.rows.join(`
249
249
  `)},ai.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},ai.prototype.newLine=function(g){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(g),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ai.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},ai.prototype.addText=function(g){this.rows[this.rowIdx]+=g},ai.prototype.backspace=function(){if(!this.isEmpty()){var g=this.rows[this.rowIdx];this.rows[this.rowIdx]=g.substr(0,g.length-1)}};var ec=function(g,v,T){this.serviceNum=g,this.text="",this.currentWindow=new ai(-1),this.windows=[],this.stream=T,typeof v=="string"&&this.createTextDecoder(v)};ec.prototype.init=function(g,v){this.startPts=g;for(var T=0;T<8;T++)this.windows[T]=new ai(T),typeof v=="function"&&(this.windows[T].beforeRowOverflow=v)},ec.prototype.setCurrentWindow=function(g){this.currentWindow=this.windows[g]},ec.prototype.createTextDecoder=function(g){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(g)}catch(v){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+g+" encoding. "+v})}};var st=function(g){g=g||{},st.prototype.init.call(this);var v=this,T=g.captionServices||{},S={},x;Object.keys(T).forEach(A=>{x=T[A],/^SERVICE/.test(A)&&(S[A]=x.encoding)}),this.serviceEncodings=S,this.current708Packet=null,this.services={},this.push=function(A){A.type===3?(v.new708Packet(),v.add708Bytes(A)):(v.current708Packet===null&&v.new708Packet(),v.add708Bytes(A))}};st.prototype=new ns,st.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},st.prototype.add708Bytes=function(g){var v=g.ccData,T=v>>>8,S=v&255;this.current708Packet.ptsVals.push(g.pts),this.current708Packet.data.push(T),this.current708Packet.data.push(S)},st.prototype.push708Packet=function(){var g=this.current708Packet,v=g.data,T=null,S=null,x=0,A=v[x++];for(g.seq=A>>6,g.sizeCode=A&63;x<v.length;x++)A=v[x++],T=A>>5,S=A&31,T===7&&S>0&&(A=v[x++],T=A),this.pushServiceBlock(T,x,S),S>0&&(x+=S-1)},st.prototype.pushServiceBlock=function(g,v,T){var S,x=v,A=this.current708Packet.data,j=this.services[g];for(j||(j=this.initService(g,x));x<v+T&&x<A.length;x++)S=A[x],_r(S)?x=this.handleText(x,j):S===24?x=this.multiByteCharacter(x,j):S===16?x=this.extendedCommands(x,j):128<=S&&S<=135?x=this.setCurrentWindow(x,j):152<=S&&S<=159?x=this.defineWindow(x,j):S===136?x=this.clearWindows(x,j):S===140?x=this.deleteWindows(x,j):S===137?x=this.displayWindows(x,j):S===138?x=this.hideWindows(x,j):S===139?x=this.toggleWindows(x,j):S===151?x=this.setWindowAttributes(x,j):S===144?x=this.setPenAttributes(x,j):S===145?x=this.setPenColor(x,j):S===146?x=this.setPenLocation(x,j):S===143?j=this.reset(x,j):S===8?j.currentWindow.backspace():S===12?j.currentWindow.clearText():S===13?j.currentWindow.pendingNewLine=!0:S===14?j.currentWindow.clearText():S===141&&x++},st.prototype.extendedCommands=function(g,v){var T=this.current708Packet.data,S=T[++g];return _r(S)&&(g=this.handleText(g,v,{isExtended:!0})),g},st.prototype.getPts=function(g){return this.current708Packet.ptsVals[Math.floor(g/2)]},st.prototype.initService=function(g,v){var S="SERVICE"+g,T=this,S,x;return S in this.serviceEncodings&&(x=this.serviceEncodings[S]),this.services[g]=new ec(g,x,T),this.services[g].init(this.getPts(v),function(A){T.flushDisplayed(A,T.services[g])}),this.services[g]},st.prototype.handleText=function(g,v,T){var S=T&&T.isExtended,x=T&&T.isMultiByte,A=this.current708Packet.data,j=S?4096:0,q=A[g],G=A[g+1],Q=v.currentWindow,se,_e;function Ve(Ae){return Ae.map(Qe=>("0"+(Qe&255).toString(16)).slice(-2)).join("")}if(x?(_e=[q,G],g++):_e=[q],v.textDecoder_&&!S)se=v.textDecoder_.decode(new Uint8Array(_e));else if(x){const Ae=Ve(_e);se=String.fromCharCode(parseInt(Ae,16))}else se=Nv(j|q);return Q.pendingNewLine&&!Q.isEmpty()&&Q.newLine(this.getPts(g)),Q.pendingNewLine=!1,Q.addText(se),g},st.prototype.multiByteCharacter=function(g,v){var T=this.current708Packet.data,S=T[g+1],x=T[g+2];return _r(S)&&_r(x)&&(g=this.handleText(++g,v,{isMultiByte:!0})),g},st.prototype.setCurrentWindow=function(g,v){var T=this.current708Packet.data,S=T[g],x=S&7;return v.setCurrentWindow(x),g},st.prototype.defineWindow=function(g,v){var T=this.current708Packet.data,S=T[g],x=S&7;v.setCurrentWindow(x);var A=v.currentWindow;return S=T[++g],A.visible=(S&32)>>5,A.rowLock=(S&16)>>4,A.columnLock=(S&8)>>3,A.priority=S&7,S=T[++g],A.relativePositioning=(S&128)>>7,A.anchorVertical=S&127,S=T[++g],A.anchorHorizontal=S,S=T[++g],A.anchorPoint=(S&240)>>4,A.rowCount=S&15,S=T[++g],A.columnCount=S&63,S=T[++g],A.windowStyle=(S&56)>>3,A.penStyle=S&7,A.virtualRowCount=A.rowCount+1,g},st.prototype.setWindowAttributes=function(g,v){var T=this.current708Packet.data,S=T[g],x=v.currentWindow.winAttr;return S=T[++g],x.fillOpacity=(S&192)>>6,x.fillRed=(S&48)>>4,x.fillGreen=(S&12)>>2,x.fillBlue=S&3,S=T[++g],x.borderType=(S&192)>>6,x.borderRed=(S&48)>>4,x.borderGreen=(S&12)>>2,x.borderBlue=S&3,S=T[++g],x.borderType+=(S&128)>>5,x.wordWrap=(S&64)>>6,x.printDirection=(S&48)>>4,x.scrollDirection=(S&12)>>2,x.justify=S&3,S=T[++g],x.effectSpeed=(S&240)>>4,x.effectDirection=(S&12)>>2,x.displayEffect=S&3,g},st.prototype.flushDisplayed=function(g,v){for(var T=[],S=0;S<8;S++)v.windows[S].visible&&!v.windows[S].isEmpty()&&T.push(v.windows[S].getText());v.endPts=g,v.text=T.join(`
250
250
 
251
- `),this.pushCaption(v),v.startPts=g},st.prototype.pushCaption=function(g){g.text!==""&&(this.trigger("data",{startPts:g.startPts,endPts:g.endPts,text:g.text,stream:"cc708_"+g.serviceNum}),g.text="",g.startPts=g.endPts)},st.prototype.displayWindows=function(g,v){var T=this.current708Packet.data,S=T[++g],x=this.getPts(g);this.flushDisplayed(x,v);for(var A=0;A<8;A++)S&1<<A&&(v.windows[A].visible=1);return g},st.prototype.hideWindows=function(g,v){var T=this.current708Packet.data,S=T[++g],x=this.getPts(g);this.flushDisplayed(x,v);for(var A=0;A<8;A++)S&1<<A&&(v.windows[A].visible=0);return g},st.prototype.toggleWindows=function(g,v){var T=this.current708Packet.data,S=T[++g],x=this.getPts(g);this.flushDisplayed(x,v);for(var A=0;A<8;A++)S&1<<A&&(v.windows[A].visible^=1);return g},st.prototype.clearWindows=function(g,v){var T=this.current708Packet.data,S=T[++g],x=this.getPts(g);this.flushDisplayed(x,v);for(var A=0;A<8;A++)S&1<<A&&v.windows[A].clearText();return g},st.prototype.deleteWindows=function(g,v){var T=this.current708Packet.data,S=T[++g],x=this.getPts(g);this.flushDisplayed(x,v);for(var A=0;A<8;A++)S&1<<A&&v.windows[A].reset();return g},st.prototype.setPenAttributes=function(g,v){var T=this.current708Packet.data,S=T[g],x=v.currentWindow.penAttr;return S=T[++g],x.textTag=(S&240)>>4,x.offset=(S&12)>>2,x.penSize=S&3,S=T[++g],x.italics=(S&128)>>7,x.underline=(S&64)>>6,x.edgeType=(S&56)>>3,x.fontStyle=S&7,g},st.prototype.setPenColor=function(g,v){var T=this.current708Packet.data,S=T[g],x=v.currentWindow.penColor;return S=T[++g],x.fgOpacity=(S&192)>>6,x.fgRed=(S&48)>>4,x.fgGreen=(S&12)>>2,x.fgBlue=S&3,S=T[++g],x.bgOpacity=(S&192)>>6,x.bgRed=(S&48)>>4,x.bgGreen=(S&12)>>2,x.bgBlue=S&3,S=T[++g],x.edgeRed=(S&48)>>4,x.edgeGreen=(S&12)>>2,x.edgeBlue=S&3,g},st.prototype.setPenLocation=function(g,v){var T=this.current708Packet.data,S=T[g],x=v.currentWindow.penLoc;return v.currentWindow.pendingNewLine=!0,S=T[++g],x.row=S&15,S=T[++g],x.column=S&63,g},st.prototype.reset=function(g,v){var T=this.getPts(g);return this.flushDisplayed(T,v),this.initService(v.serviceNum,g)};var Dt={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},br=function(g){return g===null?"":(g=Dt[g]||g,String.fromCharCode(g))},zt=14,Av=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],vr=function(){for(var g=[],v=zt+1;v--;)g.push({text:"",indent:0,offset:0});return g},Et=function(g,v){Et.prototype.init.call(this),this.field_=g||0,this.dataChannel_=v||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(T){var S,x,A,j,q;if(S=T.ccData&32639,S===this.lastControlCode_){this.lastControlCode_=null;return}if((S&61440)===4096?this.lastControlCode_=S:S!==this.PADDING_&&(this.lastControlCode_=null),A=S>>>8,j=S&255,S!==this.PADDING_)if(S===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(S===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(T.pts),this.flushDisplayed(T.pts),x=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=x,this.startPts_=T.pts;else if(S===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(T.pts);else if(S===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(T.pts);else if(S===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(T.pts);else if(S===this.CARRIAGE_RETURN_)this.clearFormatting(T.pts),this.flushDisplayed(T.pts),this.shiftRowsUp_(),this.startPts_=T.pts;else if(S===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(S===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(T.pts),this.displayed_=vr();else if(S===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=vr();else if(S===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(T.pts),this.displayed_=vr()),this.mode_="paintOn",this.startPts_=T.pts;else if(this.isSpecialCharacter(A,j))A=(A&3)<<8,q=br(A|j),this[this.mode_](T.pts,q),this.column_++;else if(this.isExtCharacter(A,j))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),A=(A&3)<<8,q=br(A|j),this[this.mode_](T.pts,q),this.column_++;else if(this.isMidRowCode(A,j))this.clearFormatting(T.pts),this[this.mode_](T.pts," "),this.column_++,(j&14)===14&&this.addFormatting(T.pts,["i"]),(j&1)===1&&this.addFormatting(T.pts,["u"]);else if(this.isOffsetControlCode(A,j)){const Q=j&3;this.nonDisplayed_[this.row_].offset=Q,this.column_+=Q}else if(this.isPAC(A,j)){var G=Av.indexOf(S&7968);if(this.mode_==="rollUp"&&(G-this.rollUpRows_+1<0&&(G=this.rollUpRows_-1),this.setRollUp(T.pts,G)),G!==this.row_&&(this.clearFormatting(T.pts),this.row_=G),j&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(T.pts,["u"]),(S&16)===16){const Q=(S&14)>>1;this.column_=Q*4,this.nonDisplayed_[this.row_].indent+=Q}this.isColorPAC(j)&&(j&14)===14&&this.addFormatting(T.pts,["i"])}else this.isNormalChar(A)&&(j===0&&(j=null),q=br(A),q+=br(j),this[this.mode_](T.pts,q),this.column_+=q.length)}};Et.prototype=new ns,Et.prototype.flushDisplayed=function(g){const v=S=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+S+"."})},T=[];this.displayed_.forEach((S,x)=>{if(S&&S.text&&S.text.length){try{S.text=S.text.trim()}catch{v(x)}S.text.length&&T.push({text:S.text,line:x+1,position:10+Math.min(70,S.indent*10)+S.offset*2.5})}else S==null&&v(x)}),T.length&&this.trigger("data",{startPts:this.startPts_,endPts:g,content:T,stream:this.name_})},Et.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=vr(),this.nonDisplayed_=vr(),this.lastControlCode_=null,this.column_=0,this.row_=zt,this.rollUpRows_=2,this.formatting_=[]},Et.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},Et.prototype.isSpecialCharacter=function(g,v){return g===this.EXT_&&v>=48&&v<=63},Et.prototype.isExtCharacter=function(g,v){return(g===this.EXT_+1||g===this.EXT_+2)&&v>=32&&v<=63},Et.prototype.isMidRowCode=function(g,v){return g===this.EXT_&&v>=32&&v<=47},Et.prototype.isOffsetControlCode=function(g,v){return g===this.OFFSET_&&v>=33&&v<=35},Et.prototype.isPAC=function(g,v){return g>=this.BASE_&&g<this.BASE_+8&&v>=64&&v<=127},Et.prototype.isColorPAC=function(g){return g>=64&&g<=79||g>=96&&g<=127},Et.prototype.isNormalChar=function(g){return g>=32&&g<=127},Et.prototype.setRollUp=function(g,v){if(this.mode_!=="rollUp"&&(this.row_=zt,this.mode_="rollUp",this.flushDisplayed(g),this.nonDisplayed_=vr(),this.displayed_=vr()),v!==void 0&&v!==this.row_)for(var T=0;T<this.rollUpRows_;T++)this.displayed_[v-T]=this.displayed_[this.row_-T],this.displayed_[this.row_-T]={text:"",indent:0,offset:0};v===void 0&&(v=this.row_),this.topRow_=v-this.rollUpRows_+1},Et.prototype.addFormatting=function(g,v){this.formatting_=this.formatting_.concat(v);var T=v.reduce(function(S,x){return S+"<"+x+">"},"");this[this.mode_](g,T)},Et.prototype.clearFormatting=function(g){if(this.formatting_.length){var v=this.formatting_.reverse().reduce(function(T,S){return T+"</"+S+">"},"");this.formatting_=[],this[this.mode_](g,v)}},Et.prototype.popOn=function(g,v){var T=this.nonDisplayed_[this.row_].text;T+=v,this.nonDisplayed_[this.row_].text=T},Et.prototype.rollUp=function(g,v){var T=this.displayed_[this.row_].text;T+=v,this.displayed_[this.row_].text=T},Et.prototype.shiftRowsUp_=function(){var g;for(g=0;g<this.topRow_;g++)this.displayed_[g]={text:"",indent:0,offset:0};for(g=this.row_+1;g<zt+1;g++)this.displayed_[g]={text:"",indent:0,offset:0};for(g=this.topRow_;g<this.row_;g++)this.displayed_[g]=this.displayed_[g+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},Et.prototype.paintOn=function(g,v){var T=this.displayed_[this.row_].text;T+=v,this.displayed_[this.row_].text=T};var tc={CaptionStream:oa,Cea608Stream:Et,Cea708Stream:st},Hs={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Nf=a,Af=8589934592,ac=4294967296,Pf="shared",rs=function(g,v){var T=1;for(g>v&&(T=-1);Math.abs(v-g)>ac;)g+=T*Af;return g},ic=function(g){var v,T;ic.prototype.init.call(this),this.type_=g||Pf,this.push=function(S){if(S.type==="metadata"){this.trigger("data",S);return}this.type_!==Pf&&S.type!==this.type_||(T===void 0&&(T=S.dts),S.dts=rs(S.dts,T),S.pts=rs(S.pts,T),v=S.dts,this.trigger("data",S))},this.flush=function(){T=v,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){T=void 0,v=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ic.prototype=new Nf;var qs={TimestampRolloverStream:ic,handleRollover:rs},Pv=(g,v,T)=>{if(!g)return-1;for(var S=T;S<g.length;S++)if(g[S]===v)return S;return-1},Ov={typedArrayIndexOf:Pv},Sr=Ov.typedArrayIndexOf,Vn={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},Ws=function(g,v,T){var S,x="";for(S=v;S<T;S++)x+="%"+("00"+g[S].toString(16)).slice(-2);return x},Mi=function(g,v,T){return decodeURIComponent(Ws(g,v,T))},wr=function(g,v,T){return unescape(Ws(g,v,T))},ss=function(g){return g[0]<<21|g[1]<<14|g[2]<<7|g[3]},Tr={APIC:function(g){var v=1,T,S,x="-->";g.data[0]===Vn.Utf8&&(T=Sr(g.data,0,v),!(T<0)&&(g.mimeType=wr(g.data,v,T),v=T+1,g.pictureType=g.data[v],v++,S=Sr(g.data,0,v),!(S<0)&&(g.description=Mi(g.data,v,S),v=S+1,g.mimeType===x?g.url=wr(g.data,v,g.data.length):g.pictureData=g.data.subarray(v,g.data.length))))},"T*":function(g){g.data[0]===Vn.Utf8&&(g.value=Mi(g.data,1,g.data.length).replace(/\0*$/,""),g.values=g.value.split("\0"))},TXXX:function(g){var v;g.data[0]===Vn.Utf8&&(v=Sr(g.data,0,1),v!==-1&&(g.description=Mi(g.data,1,v),g.value=Mi(g.data,v+1,g.data.length).replace(/\0*$/,""),g.data=g.value))},"W*":function(g){g.url=wr(g.data,0,g.data.length).replace(/\0.*$/,"")},WXXX:function(g){var v;g.data[0]===Vn.Utf8&&(v=Sr(g.data,0,1),v!==-1&&(g.description=Mi(g.data,1,v),g.url=wr(g.data,v+1,g.data.length).replace(/\0.*$/,"")))},PRIV:function(g){var v;for(v=0;v<g.data.length;v++)if(g.data[v]===0){g.owner=wr(g.data,0,v);break}g.privateData=g.data.subarray(v+1),g.data=g.privateData}},en=function(g){var v,T,S=10,x=0,A=[];if(!(g.length<10||g[0]!==73||g[1]!==68||g[2]!==51)){x=ss(g.subarray(6,10)),x+=10;var j=g[5]&64;j&&(S+=4,S+=ss(g.subarray(10,14)),x-=ss(g.subarray(16,20)));do{if(v=ss(g.subarray(S+4,S+8)),v<1)break;T=String.fromCharCode(g[S],g[S+1],g[S+2],g[S+3]);var q={id:T,data:g.subarray(S+10,S+v+10)};q.key=q.id,Tr[q.id]?Tr[q.id](q):q.id[0]==="T"?Tr["T*"](q):q.id[0]==="W"&&Tr["W*"](q),A.push(q),S+=10,S+=v}while(S<x);return A}},Of={parseId3Frames:en,parseSyncSafeInteger:ss,frameParsers:Tr},nc=a,Bf=Hs,tn=Of,Gs;Gs=function(g){var v={descriptor:g&&g.descriptor},T=0,S=[],x=0,A;if(Gs.prototype.init.call(this),this.dispatchType=Bf.METADATA_STREAM_TYPE.toString(16),v.descriptor)for(A=0;A<v.descriptor.length;A++)this.dispatchType+=("00"+v.descriptor[A].toString(16)).slice(-2);this.push=function(j){var q,G,Q,se,_e,Ve;if(j.type==="timed-metadata"){if(j.dataAlignmentIndicator&&(x=0,S.length=0),S.length===0&&(j.data.length<10||j.data[0]!==73||j.data[1]!==68||j.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(S.push(j),x+=j.data.byteLength,S.length===1&&(T=tn.parseSyncSafeInteger(j.data.subarray(6,10)),T+=10),!(x<T)){for(q={data:new Uint8Array(T),frames:[],pts:S[0].pts,dts:S[0].dts},_e=0;_e<T;)q.data.set(S[0].data.subarray(0,T-_e),_e),_e+=S[0].data.byteLength,x-=S[0].data.byteLength,S.shift();G=10,q.data[5]&64&&(G+=4,G+=tn.parseSyncSafeInteger(q.data.subarray(10,14)),T-=tn.parseSyncSafeInteger(q.data.subarray(16,20)));do{if(Q=tn.parseSyncSafeInteger(q.data.subarray(G+4,G+8)),Q<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(Ve=String.fromCharCode(q.data[G],q.data[G+1],q.data[G+2],q.data[G+3]),se={id:Ve,data:q.data.subarray(G+10,G+Q+10)},se.key=se.id,tn.frameParsers[se.id]?tn.frameParsers[se.id](se):se.id[0]==="T"?tn.frameParsers["T*"](se):se.id[0]==="W"&&tn.frameParsers["W*"](se),se.owner==="com.apple.streaming.transportStreamTimestamp"){var Ae=se.data,Qe=(Ae[3]&1)<<30|Ae[4]<<22|Ae[5]<<14|Ae[6]<<6|Ae[7]>>>2;Qe*=4,Qe+=Ae[7]&3,se.timeStamp=Qe,q.pts===void 0&&q.dts===void 0&&(q.pts=se.timeStamp,q.dts=se.timeStamp),this.trigger("timestamp",se)}q.frames.push(se),G+=10,G+=Q}while(G<T);this.trigger("data",q)}}}},Gs.prototype=new nc;var Bv=Gs,os=a,Cr=tc,ii=Hs,Dv=qs.TimestampRolloverStream,rc,ls,sc,cs=188,oc=71;rc=function(){var g=new Uint8Array(cs),v=0;rc.prototype.init.call(this),this.push=function(T){var S=0,x=cs,A;for(v?(A=new Uint8Array(T.byteLength+v),A.set(g.subarray(0,v)),A.set(T,v),v=0):A=T;x<A.byteLength;){if(A[S]===oc&&A[x]===oc){this.trigger("data",A.subarray(S,x)),S+=cs,x+=cs;continue}S++,x++}S<A.byteLength&&(g.set(A.subarray(S),0),v=A.byteLength-S)},this.flush=function(){v===cs&&g[0]===oc&&(this.trigger("data",g),v=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){v=0,this.trigger("reset")}},rc.prototype=new os,ls=function(){var g,v,T,S;ls.prototype.init.call(this),S=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,g=function(x,A){var j=0;A.payloadUnitStartIndicator&&(j+=x[j]+1),A.type==="pat"?v(x.subarray(j),A):T(x.subarray(j),A)},v=function(x,A){A.section_number=x[7],A.last_section_number=x[8],S.pmtPid=(x[10]&31)<<8|x[11],A.pmtPid=S.pmtPid},T=function(x,A){var j,q,G,Q;if(x[5]&1){for(S.programMapTable={video:null,audio:null,"timed-metadata":{}},j=(x[1]&15)<<8|x[2],q=3+j-4,G=(x[10]&15)<<8|x[11],Q=12+G;Q<q;){var se=x[Q],_e=(x[Q+1]&31)<<8|x[Q+2];se===ii.H264_STREAM_TYPE&&S.programMapTable.video===null?S.programMapTable.video=_e:se===ii.ADTS_STREAM_TYPE&&S.programMapTable.audio===null?S.programMapTable.audio=_e:se===ii.METADATA_STREAM_TYPE&&(S.programMapTable["timed-metadata"][_e]=se),Q+=((x[Q+3]&15)<<8|x[Q+4])+5}A.programMapTable=S.programMapTable}},this.push=function(x){var A={},j=4;if(A.payloadUnitStartIndicator=!!(x[1]&64),A.pid=x[1]&31,A.pid<<=8,A.pid|=x[2],(x[3]&48)>>>4>1&&(j+=x[j]+1),A.pid===0)A.type="pat",g(x.subarray(j),A),this.trigger("data",A);else if(A.pid===this.pmtPid)for(A.type="pmt",g(x.subarray(j),A),this.trigger("data",A);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([x,j,A]):this.processPes_(x,j,A)},this.processPes_=function(x,A,j){j.pid===this.programMapTable.video?j.streamType=ii.H264_STREAM_TYPE:j.pid===this.programMapTable.audio?j.streamType=ii.ADTS_STREAM_TYPE:j.streamType=this.programMapTable["timed-metadata"][j.pid],j.type="pes",j.data=x.subarray(A),this.trigger("data",j)}},ls.prototype=new os,ls.STREAM_TYPES={h264:27,adts:15},sc=function(){var g=this,v=!1,T={data:[],size:0},S={data:[],size:0},x={data:[],size:0},A,j=function(G,Q){var se;const _e=G[0]<<16|G[1]<<8|G[2];Q.data=new Uint8Array,_e===1&&(Q.packetLength=6+(G[4]<<8|G[5]),Q.dataAlignmentIndicator=(G[6]&4)!==0,se=G[7],se&192&&(Q.pts=(G[9]&14)<<27|(G[10]&255)<<20|(G[11]&254)<<12|(G[12]&255)<<5|(G[13]&254)>>>3,Q.pts*=4,Q.pts+=(G[13]&6)>>>1,Q.dts=Q.pts,se&64&&(Q.dts=(G[14]&14)<<27|(G[15]&255)<<20|(G[16]&254)<<12|(G[17]&255)<<5|(G[18]&254)>>>3,Q.dts*=4,Q.dts+=(G[18]&6)>>>1)),Q.data=G.subarray(9+G[8]))},q=function(G,Q,se){var _e=new Uint8Array(G.size),Ve={type:Q},Ae=0,Qe=0,et=!1,la;if(!(!G.data.length||G.size<9)){for(Ve.trackId=G.data[0].pid,Ae=0;Ae<G.data.length;Ae++)la=G.data[Ae],_e.set(la.data,Qe),Qe+=la.data.byteLength;j(_e,Ve),et=Q==="video"||Ve.packetLength<=G.size,(se||et)&&(G.size=0,G.data.length=0),et&&g.trigger("data",Ve)}};sc.prototype.init.call(this),this.push=function(G){({pat:function(){},pes:function(){var Q,se;switch(G.streamType){case ii.H264_STREAM_TYPE:Q=T,se="video";break;case ii.ADTS_STREAM_TYPE:Q=S,se="audio";break;case ii.METADATA_STREAM_TYPE:Q=x,se="timed-metadata";break;default:return}G.payloadUnitStartIndicator&&q(Q,se,!0),Q.data.push(G),Q.size+=G.data.byteLength},pmt:function(){var Q={type:"metadata",tracks:[]};A=G.programMapTable,A.video!==null&&Q.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.video,codec:"avc",type:"video"}),A.audio!==null&&Q.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.audio,codec:"adts",type:"audio"}),v=!0,g.trigger("data",Q)}})[G.type]()},this.reset=function(){T.size=0,T.data.length=0,S.size=0,S.data.length=0,this.trigger("reset")},this.flushStreams_=function(){q(T,"video"),q(S,"audio"),q(x,"timed-metadata")},this.flush=function(){if(!v&&A){var G={type:"metadata",tracks:[]};A.video!==null&&G.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.video,codec:"avc",type:"video"}),A.audio!==null&&G.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.audio,codec:"adts",type:"audio"}),g.trigger("data",G)}v=!1,this.flushStreams_(),this.trigger("done")}},sc.prototype=new os;var Df={PAT_PID:0,MP2T_PACKET_LENGTH:cs,TransportPacketStream:rc,TransportParseStream:ls,ElementaryStream:sc,TimestampRolloverStream:Dv,CaptionStream:Cr.CaptionStream,Cea608Stream:Cr.Cea608Stream,Cea708Stream:Cr.Cea708Stream,MetadataStream:Bv};for(var Cu in ii)ii.hasOwnProperty(Cu)&&(Df[Cu]=ii[Cu]);var Mv=Df,Lv=a,Rv=kt.ONE_SECOND_IN_TS,lc,Ks=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];lc=function(g){var v,T=0;lc.prototype.init.call(this),this.skipWarn_=function(S,x){this.trigger("log",{level:"warn",message:`adts skiping bytes ${S} to ${x} in frame ${T} outside syncword`})},this.push=function(S){var x=0,A,j,q,G,Q;if(g||(T=0),S.type==="audio"){v&&v.length?(q=v,v=new Uint8Array(q.byteLength+S.data.byteLength),v.set(q),v.set(S.data,q.byteLength)):v=S.data;for(var se;x+7<v.length;){if(v[x]!==255||(v[x+1]&246)!==240){typeof se!="number"&&(se=x),x++;continue}if(typeof se=="number"&&(this.skipWarn_(se,x),se=null),j=(~v[x+1]&1)*2,A=(v[x+3]&3)<<11|v[x+4]<<3|(v[x+5]&224)>>5,G=((v[x+6]&3)+1)*1024,Q=G*Rv/Ks[(v[x+2]&60)>>>2],v.byteLength-x<A)break;this.trigger("data",{pts:S.pts+T*Q,dts:S.dts+T*Q,sampleCount:G,audioobjecttype:(v[x+2]>>>6&3)+1,channelcount:(v[x+2]&1)<<2|(v[x+3]&192)>>>6,samplerate:Ks[(v[x+2]&60)>>>2],samplingfrequencyindex:(v[x+2]&60)>>>2,samplesize:16,data:v.subarray(x+7+j,x+A)}),T++,x+=A}typeof se=="number"&&(this.skipWarn_(se,x),se=null),v=v.subarray(x)}},this.flush=function(){T=0,this.trigger("done")},this.reset=function(){v=void 0,this.trigger("reset")},this.endTimeline=function(){v=void 0,this.trigger("endedtimeline")}},lc.prototype=new Lv;var cc=lc,Mf;Mf=function(g){var v=g.byteLength,T=0,S=0;this.length=function(){return 8*v},this.bitsAvailable=function(){return 8*v+S},this.loadWord=function(){var x=g.byteLength-v,A=new Uint8Array(4),j=Math.min(4,v);if(j===0)throw new Error("no bytes available");A.set(g.subarray(x,x+j)),T=new DataView(A.buffer).getUint32(0),S=j*8,v-=j},this.skipBits=function(x){var A;S>x?(T<<=x,S-=x):(x-=S,A=Math.floor(x/8),x-=A*8,v-=A,this.loadWord(),T<<=x,S-=x)},this.readBits=function(x){var A=Math.min(S,x),j=T>>>32-A;return S-=A,S>0?T<<=A:v>0&&this.loadWord(),A=x-A,A>0?j<<A|this.readBits(A):j},this.skipLeadingZeros=function(){var x;for(x=0;x<S;++x)if(T&2147483648>>>x)return T<<=x,S-=x,x;return this.loadWord(),x+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var x=this.skipLeadingZeros();return this.readBits(x+1)-1},this.readExpGolomb=function(){var x=this.readUnsignedExpGolomb();return 1&x?1+x>>>1:-1*(x>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Fv=Mf,dc=a,Vv=Fv,ds,Xs,Lf;Xs=function(){var g=0,v,T;Xs.prototype.init.call(this),this.push=function(S){var x;T?(x=new Uint8Array(T.byteLength+S.data.byteLength),x.set(T),x.set(S.data,T.byteLength),T=x):T=S.data;for(var A=T.byteLength;g<A-3;g++)if(T[g+2]===1){v=g+5;break}for(;v<A;)switch(T[v]){case 0:if(T[v-1]!==0){v+=2;break}else if(T[v-2]!==0){v++;break}g+3!==v-2&&this.trigger("data",T.subarray(g+3,v-2));do v++;while(T[v]!==1&&v<A);g=v-2,v+=3;break;case 1:if(T[v-1]!==0||T[v-2]!==0){v+=3;break}this.trigger("data",T.subarray(g+3,v-2)),g=v-2,v+=3;break;default:v+=3;break}T=T.subarray(g),v-=g,g=0},this.reset=function(){T=null,g=0,this.trigger("reset")},this.flush=function(){T&&T.byteLength>3&&this.trigger("data",T.subarray(g+3)),T=null,g=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Xs.prototype=new dc,Lf={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},ds=function(){var g=new Xs,v,T,S,x,A,j,q;ds.prototype.init.call(this),v=this,this.push=function(G){G.type==="video"&&(T=G.trackId,S=G.pts,x=G.dts,g.push(G))},g.on("data",function(G){var Q={trackId:T,pts:S,dts:x,data:G,nalUnitTypeCode:G[0]&31};switch(Q.nalUnitTypeCode){case 5:Q.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:Q.nalUnitType="sei_rbsp",Q.escapedRBSP=A(G.subarray(1));break;case 7:Q.nalUnitType="seq_parameter_set_rbsp",Q.escapedRBSP=A(G.subarray(1)),Q.config=j(Q.escapedRBSP);break;case 8:Q.nalUnitType="pic_parameter_set_rbsp";break;case 9:Q.nalUnitType="access_unit_delimiter_rbsp";break}v.trigger("data",Q)}),g.on("done",function(){v.trigger("done")}),g.on("partialdone",function(){v.trigger("partialdone")}),g.on("reset",function(){v.trigger("reset")}),g.on("endedtimeline",function(){v.trigger("endedtimeline")}),this.flush=function(){g.flush()},this.partialFlush=function(){g.partialFlush()},this.reset=function(){g.reset()},this.endTimeline=function(){g.endTimeline()},q=function(G,Q){var se=8,_e=8,Ve,Ae;for(Ve=0;Ve<G;Ve++)_e!==0&&(Ae=Q.readExpGolomb(),_e=(se+Ae+256)%256),se=_e===0?se:_e},A=function(G){for(var Q=G.byteLength,se=[],_e=1,Ve,Ae;_e<Q-2;)G[_e]===0&&G[_e+1]===0&&G[_e+2]===3?(se.push(_e+2),_e+=2):_e++;if(se.length===0)return G;Ve=Q-se.length,Ae=new Uint8Array(Ve);var Qe=0;for(_e=0;_e<Ve;Qe++,_e++)Qe===se[0]&&(Qe++,se.shift()),Ae[_e]=G[Qe];return Ae},j=function(G){var Q=0,se=0,_e=0,Ve=0,Ae,Qe,et,la,Li,co,vP,SP,wP,mS,TP,Xt=[1,1],CP,uo;if(Ae=new Vv(G),Qe=Ae.readUnsignedByte(),la=Ae.readUnsignedByte(),et=Ae.readUnsignedByte(),Ae.skipUnsignedExpGolomb(),Lf[Qe]&&(Li=Ae.readUnsignedExpGolomb(),Li===3&&Ae.skipBits(1),Ae.skipUnsignedExpGolomb(),Ae.skipUnsignedExpGolomb(),Ae.skipBits(1),Ae.readBoolean()))for(TP=Li!==3?8:12,uo=0;uo<TP;uo++)Ae.readBoolean()&&(uo<6?q(16,Ae):q(64,Ae));if(Ae.skipUnsignedExpGolomb(),co=Ae.readUnsignedExpGolomb(),co===0)Ae.readUnsignedExpGolomb();else if(co===1)for(Ae.skipBits(1),Ae.skipExpGolomb(),Ae.skipExpGolomb(),vP=Ae.readUnsignedExpGolomb(),uo=0;uo<vP;uo++)Ae.skipExpGolomb();if(Ae.skipUnsignedExpGolomb(),Ae.skipBits(1),SP=Ae.readUnsignedExpGolomb(),wP=Ae.readUnsignedExpGolomb(),mS=Ae.readBits(1),mS===0&&Ae.skipBits(1),Ae.skipBits(1),Ae.readBoolean()&&(Q=Ae.readUnsignedExpGolomb(),se=Ae.readUnsignedExpGolomb(),_e=Ae.readUnsignedExpGolomb(),Ve=Ae.readUnsignedExpGolomb()),Ae.readBoolean()&&Ae.readBoolean()){switch(CP=Ae.readUnsignedByte(),CP){case 1:Xt=[1,1];break;case 2:Xt=[12,11];break;case 3:Xt=[10,11];break;case 4:Xt=[16,11];break;case 5:Xt=[40,33];break;case 6:Xt=[24,11];break;case 7:Xt=[20,11];break;case 8:Xt=[32,11];break;case 9:Xt=[80,33];break;case 10:Xt=[18,11];break;case 11:Xt=[15,11];break;case 12:Xt=[64,33];break;case 13:Xt=[160,99];break;case 14:Xt=[4,3];break;case 15:Xt=[3,2];break;case 16:Xt=[2,1];break;case 255:{Xt=[Ae.readUnsignedByte()<<8|Ae.readUnsignedByte(),Ae.readUnsignedByte()<<8|Ae.readUnsignedByte()];break}}Xt&&Xt[0]/Xt[1]}return{profileIdc:Qe,levelIdc:et,profileCompatibility:la,width:(SP+1)*16-Q*2-se*2,height:(2-mS)*(wP+1)*16-_e*2-Ve*2,sarRatio:Xt}}},ds.prototype=new dc;var Uv={H264Stream:ds,NalByteStream:Xs},Js=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],kr=function(g,v){var T=g[v+6]<<21|g[v+7]<<14|g[v+8]<<7|g[v+9],S=g[v+5],x=(S&16)>>4;return T=T>=0?T:0,x?T+20:T+10},Ys=function(g,v){return g.length-v<10||g[v]!==73||g[v+1]!==68||g[v+2]!==51?v:(v+=kr(g,v),Ys(g,v))},Er=function(g){var v=Ys(g,0);return g.length>=v+2&&(g[v]&255)===255&&(g[v+1]&240)===240&&(g[v+1]&22)===16},Rf=function(g){return g[0]<<21|g[1]<<14|g[2]<<7|g[3]},Ff=function(g,v,T){var S,x="";for(S=v;S<T;S++)x+="%"+("00"+g[S].toString(16)).slice(-2);return x},Vf=function(g,v,T){return unescape(Ff(g,v,T))},ku=function(g,v){var T=(g[v+5]&224)>>5,S=g[v+4]<<3,x=g[v+3]&6144;return x|S|T},jv=function(g,v){return g[v]===73&&g[v+1]===68&&g[v+2]===51?"timed-metadata":g[v]&!0&&(g[v+1]&240)===240?"audio":null},zv=function(g){for(var v=0;v+5<g.length;){if(g[v]!==255||(g[v+1]&246)!==240){v++;continue}return Js[(g[v+2]&60)>>>2]}return null},Hv=function(g){var v,T,S,x;v=10,g[5]&64&&(v+=4,v+=Rf(g.subarray(10,14)));do{if(T=Rf(g.subarray(v+4,v+8)),T<1)return null;if(x=String.fromCharCode(g[v],g[v+1],g[v+2],g[v+3]),x==="PRIV"){S=g.subarray(v+10,v+T+10);for(var A=0;A<S.byteLength;A++)if(S[A]===0){var j=Vf(S,0,A);if(j==="com.apple.streaming.transportStreamTimestamp"){var q=S.subarray(A+1),G=(q[3]&1)<<30|q[4]<<22|q[5]<<14|q[6]<<6|q[7]>>>2;return G*=4,G+=q[7]&3,G}break}}v+=10,v+=T}while(v<g.byteLength);return null},us={isLikelyAacData:Er,parseId3TagSize:kr,parseAdtsSize:ku,parseType:jv,parseSampleRate:zv,parseAacTimestamp:Hv},qv=a,Un=us,uc;uc=function(){var g=new Uint8Array,v=0;uc.prototype.init.call(this),this.setTimestamp=function(T){v=T},this.push=function(T){var S=0,x=0,A,j,q,G;for(g.length?(G=g.length,g=new Uint8Array(T.byteLength+G),g.set(g.subarray(0,G)),g.set(T,G)):g=T;g.length-x>=3;){if(g[x]===73&&g[x+1]===68&&g[x+2]===51){if(g.length-x<10||(S=Un.parseId3TagSize(g,x),x+S>g.length))break;j={type:"timed-metadata",data:g.subarray(x,x+S)},this.trigger("data",j),x+=S;continue}else if((g[x]&255)===255&&(g[x+1]&240)===240){if(g.length-x<7||(S=Un.parseAdtsSize(g,x),x+S>g.length))break;q={type:"audio",data:g.subarray(x,x+S),pts:v,dts:v},this.trigger("data",q),x+=S;continue}x++}A=g.length-x,A>0?g=g.subarray(x):g=new Uint8Array},this.reset=function(){g=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){g=new Uint8Array,this.trigger("endedtimeline")}},uc.prototype=new qv;var Wv=uc,It=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Gv=It,Kv=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Xv=Kv,Qs=a,Zs=X,hs=We,hc=wv,ni=kv,an=Mv,$s=kt,Eu=cc,eo=Uv.H264Stream,to=Wv,Jv=us.isLikelyAacData,Yv=kt.ONE_SECOND_IN_TS,Iu=Gv,xu=Xv,ao,ps,pc,Ir,Qv=function(g,v){v.stream=g,this.trigger("log",v)},io=function(g,v){for(var T=Object.keys(v),S=0;S<T.length;S++){var x=T[S];x==="headOfPipeline"||!v[x].on||v[x].on("log",Qv.bind(g,x))}},ms=function(g,v){var T;if(g.length!==v.length)return!1;for(T=0;T<g.length;T++)if(g[T]!==v[T])return!1;return!0},Nu=function(g,v,T,S,x,A){var j=T-v,q=S-v,G=x-T;return{start:{dts:g,pts:g+j},end:{dts:g+q,pts:g+G},prependedContentDuration:A,baseMediaDecodeTime:g}};ps=function(g,v){var T=[],S,x=0,A=0,j=1/0;v=v||{},S=v.firstSequenceNumber||0,ps.prototype.init.call(this),this.push=function(q){ni.collectDtsInfo(g,q),g&&Iu.forEach(function(G){g[G]=q[G]}),T.push(q)},this.setEarliestDts=function(q){x=q},this.setVideoBaseMediaDecodeTime=function(q){j=q},this.setAudioAppendStart=function(q){A=q},this.flush=function(){var q,G,Q,se,_e,Ve,Ae;if(T.length===0){this.trigger("done","AudioSegmentStream");return}q=hc.trimAdtsFramesByEarliestDts(T,g,x),g.baseMediaDecodeTime=ni.calculateTrackBaseMediaDecodeTime(g,v.keepOriginalTimestamps),Ae=hc.prefixWithSilence(g,q,A,j),g.samples=hc.generateSampleTable(q),Q=Zs.mdat(hc.concatenateFrameData(q)),T=[],G=Zs.moof(S,[g]),se=new Uint8Array(G.byteLength+Q.byteLength),S++,se.set(G),se.set(Q,G.byteLength),ni.clearDtsInfo(g),_e=Math.ceil(Yv*1024/g.samplerate),q.length&&(Ve=q.length*_e,this.trigger("segmentTimingInfo",Nu($s.audioTsToVideoTs(g.baseMediaDecodeTime,g.samplerate),q[0].dts,q[0].pts,q[0].dts+Ve,q[0].pts+Ve,Ae||0)),this.trigger("timingInfo",{start:q[0].pts,end:q[0].pts+Ve})),this.trigger("data",{track:g,boxes:se}),this.trigger("done","AudioSegmentStream")},this.reset=function(){ni.clearDtsInfo(g),T=[],this.trigger("reset")}},ps.prototype=new Qs,ao=function(g,v){var T,S=[],x=[],A,j;v=v||{},T=v.firstSequenceNumber||0,ao.prototype.init.call(this),delete g.minPTS,this.gopCache_=[],this.push=function(q){ni.collectDtsInfo(g,q),q.nalUnitType==="seq_parameter_set_rbsp"&&!A&&(A=q.config,g.sps=[q.data],xu.forEach(function(G){g[G]=A[G]},this)),q.nalUnitType==="pic_parameter_set_rbsp"&&!j&&(j=q.data,g.pps=[q.data]),S.push(q)},this.flush=function(){for(var q,G,Q,se,_e,Ve,Ae=0,Qe,et;S.length&&S[0].nalUnitType!=="access_unit_delimiter_rbsp";)S.shift();if(S.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(q=hs.groupNalsIntoFrames(S),Q=hs.groupFramesIntoGops(q),Q[0][0].keyFrame||(G=this.getGopForFusion_(S[0],g),G?(Ae=G.duration,Q.unshift(G),Q.byteLength+=G.byteLength,Q.nalCount+=G.nalCount,Q.pts=G.pts,Q.dts=G.dts,Q.duration+=G.duration):Q=hs.extendFirstKeyFrame(Q)),x.length){var la;if(v.alignGopsAtEnd?la=this.alignGopsAtEnd_(Q):la=this.alignGopsAtStart_(Q),!la){this.gopCache_.unshift({gop:Q.pop(),pps:g.pps,sps:g.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),S=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}ni.clearDtsInfo(g),Q=la}ni.collectDtsInfo(g,Q),g.samples=hs.generateSampleTable(Q),_e=Zs.mdat(hs.concatenateNalData(Q)),g.baseMediaDecodeTime=ni.calculateTrackBaseMediaDecodeTime(g,v.keepOriginalTimestamps),this.trigger("processedGopsInfo",Q.map(function(Li){return{pts:Li.pts,dts:Li.dts,byteLength:Li.byteLength}})),Qe=Q[0],et=Q[Q.length-1],this.trigger("segmentTimingInfo",Nu(g.baseMediaDecodeTime,Qe.dts,Qe.pts,et.dts+et.duration,et.pts+et.duration,Ae)),this.trigger("timingInfo",{start:Q[0].pts,end:Q[Q.length-1].pts+Q[Q.length-1].duration}),this.gopCache_.unshift({gop:Q.pop(),pps:g.pps,sps:g.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),S=[],this.trigger("baseMediaDecodeTime",g.baseMediaDecodeTime),this.trigger("timelineStartInfo",g.timelineStartInfo),se=Zs.moof(T,[g]),Ve=new Uint8Array(se.byteLength+_e.byteLength),T++,Ve.set(se),Ve.set(_e,se.byteLength),this.trigger("data",{track:g,boxes:Ve}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),S=[],this.gopCache_.length=0,x.length=0,this.trigger("reset")},this.resetStream_=function(){ni.clearDtsInfo(g),A=void 0,j=void 0},this.getGopForFusion_=function(q){var G=45e3,Q=1e4,se=1/0,_e,Ve,Ae,Qe,et;for(et=0;et<this.gopCache_.length;et++)Qe=this.gopCache_[et],Ae=Qe.gop,!(!(g.pps&&ms(g.pps[0],Qe.pps[0]))||!(g.sps&&ms(g.sps[0],Qe.sps[0])))&&(Ae.dts<g.timelineStartInfo.dts||(_e=q.dts-Ae.dts-Ae.duration,_e>=-Q&&_e<=G&&(!Ve||se>_e)&&(Ve=Qe,se=_e)));return Ve?Ve.gop:null},this.alignGopsAtStart_=function(q){var G,Q,se,_e,Ve,Ae,Qe,et;for(Ve=q.byteLength,Ae=q.nalCount,Qe=q.duration,G=Q=0;G<x.length&&Q<q.length&&(se=x[G],_e=q[Q],se.pts!==_e.pts);){if(_e.pts>se.pts){G++;continue}Q++,Ve-=_e.byteLength,Ae-=_e.nalCount,Qe-=_e.duration}return Q===0?q:Q===q.length?null:(et=q.slice(Q),et.byteLength=Ve,et.duration=Qe,et.nalCount=Ae,et.pts=et[0].pts,et.dts=et[0].dts,et)},this.alignGopsAtEnd_=function(q){var G,Q,se,_e,Ve,Ae;for(G=x.length-1,Q=q.length-1,Ve=null,Ae=!1;G>=0&&Q>=0;){if(se=x[G],_e=q[Q],se.pts===_e.pts){Ae=!0;break}if(se.pts>_e.pts){G--;continue}G===x.length-1&&(Ve=Q),Q--}if(!Ae&&Ve===null)return null;var Qe;if(Ae?Qe=Q:Qe=Ve,Qe===0)return q;var et=q.slice(Qe),la=et.reduce(function(Li,co){return Li.byteLength+=co.byteLength,Li.duration+=co.duration,Li.nalCount+=co.nalCount,Li},{byteLength:0,duration:0,nalCount:0});return et.byteLength=la.byteLength,et.duration=la.duration,et.nalCount=la.nalCount,et.pts=et[0].pts,et.dts=et[0].dts,et},this.alignGopsWith=function(q){x=q}},ao.prototype=new Qs,Ir=function(g,v){this.numberOfTracks=0,this.metadataStream=v,g=g||{},typeof g.remux<"u"?this.remuxTracks=!!g.remux:this.remuxTracks=!0,typeof g.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=g.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Ir.prototype.init.call(this),this.push=function(T){if(T.content||T.text)return this.pendingCaptions.push(T);if(T.frames)return this.pendingMetadata.push(T);this.pendingTracks.push(T.track),this.pendingBytes+=T.boxes.byteLength,T.track.type==="video"&&(this.videoTrack=T.track,this.pendingBoxes.push(T.boxes)),T.track.type==="audio"&&(this.audioTrack=T.track,this.pendingBoxes.unshift(T.boxes))}},Ir.prototype=new Qs,Ir.prototype.flush=function(g){var v=0,T={captions:[],captionStreams:{},metadata:[],info:{}},S,x,A,j=0,q;if(this.pendingTracks.length<this.numberOfTracks){if(g!=="VideoSegmentStream"&&g!=="AudioSegmentStream"||this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(j=this.videoTrack.timelineStartInfo.pts,xu.forEach(function(G){T.info[G]=this.videoTrack[G]},this)):this.audioTrack&&(j=this.audioTrack.timelineStartInfo.pts,Iu.forEach(function(G){T.info[G]=this.audioTrack[G]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?T.type=this.pendingTracks[0].type:T.type="combined",this.emittedTracks+=this.pendingTracks.length,A=Zs.initSegment(this.pendingTracks),T.initSegment=new Uint8Array(A.byteLength),T.initSegment.set(A),T.data=new Uint8Array(this.pendingBytes),q=0;q<this.pendingBoxes.length;q++)T.data.set(this.pendingBoxes[q],v),v+=this.pendingBoxes[q].byteLength;for(q=0;q<this.pendingCaptions.length;q++)S=this.pendingCaptions[q],S.startTime=$s.metadataTsToSeconds(S.startPts,j,this.keepOriginalTimestamps),S.endTime=$s.metadataTsToSeconds(S.endPts,j,this.keepOriginalTimestamps),T.captionStreams[S.stream]=!0,T.captions.push(S);for(q=0;q<this.pendingMetadata.length;q++)x=this.pendingMetadata[q],x.cueTime=$s.metadataTsToSeconds(x.pts,j,this.keepOriginalTimestamps),T.metadata.push(x);for(T.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",T),q=0;q<T.captions.length;q++)S=T.captions[q],this.trigger("caption",S);for(q=0;q<T.metadata.length;q++)x=T.metadata[q],this.trigger("id3Frame",x)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Ir.prototype.setRemux=function(g){this.remuxTracks=g},pc=function(g){var v=this,T=!0,S,x;pc.prototype.init.call(this),g=g||{},this.baseMediaDecodeTime=g.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var A={};this.transmuxPipeline_=A,A.type="aac",A.metadataStream=new an.MetadataStream,A.aacStream=new to,A.audioTimestampRolloverStream=new an.TimestampRolloverStream("audio"),A.timedMetadataTimestampRolloverStream=new an.TimestampRolloverStream("timed-metadata"),A.adtsStream=new Eu,A.coalesceStream=new Ir(g,A.metadataStream),A.headOfPipeline=A.aacStream,A.aacStream.pipe(A.audioTimestampRolloverStream).pipe(A.adtsStream),A.aacStream.pipe(A.timedMetadataTimestampRolloverStream).pipe(A.metadataStream).pipe(A.coalesceStream),A.metadataStream.on("timestamp",function(j){A.aacStream.setTimestamp(j.timeStamp)}),A.aacStream.on("data",function(j){j.type!=="timed-metadata"&&j.type!=="audio"||A.audioSegmentStream||(x=x||{timelineStartInfo:{baseMediaDecodeTime:v.baseMediaDecodeTime},codec:"adts",type:"audio"},A.coalesceStream.numberOfTracks++,A.audioSegmentStream=new ps(x,g),A.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),A.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),A.adtsStream.pipe(A.audioSegmentStream).pipe(A.coalesceStream),v.trigger("trackinfo",{hasAudio:!!x,hasVideo:!!S}))}),A.coalesceStream.on("data",this.trigger.bind(this,"data")),A.coalesceStream.on("done",this.trigger.bind(this,"done")),io(this,A)},this.setupTsPipeline=function(){var A={};this.transmuxPipeline_=A,A.type="ts",A.metadataStream=new an.MetadataStream,A.packetStream=new an.TransportPacketStream,A.parseStream=new an.TransportParseStream,A.elementaryStream=new an.ElementaryStream,A.timestampRolloverStream=new an.TimestampRolloverStream,A.adtsStream=new Eu,A.h264Stream=new eo,A.captionStream=new an.CaptionStream(g),A.coalesceStream=new Ir(g,A.metadataStream),A.headOfPipeline=A.packetStream,A.packetStream.pipe(A.parseStream).pipe(A.elementaryStream).pipe(A.timestampRolloverStream),A.timestampRolloverStream.pipe(A.h264Stream),A.timestampRolloverStream.pipe(A.adtsStream),A.timestampRolloverStream.pipe(A.metadataStream).pipe(A.coalesceStream),A.h264Stream.pipe(A.captionStream).pipe(A.coalesceStream),A.elementaryStream.on("data",function(j){var q;if(j.type==="metadata"){for(q=j.tracks.length;q--;)!S&&j.tracks[q].type==="video"?(S=j.tracks[q],S.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime):!x&&j.tracks[q].type==="audio"&&(x=j.tracks[q],x.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime);S&&!A.videoSegmentStream&&(A.coalesceStream.numberOfTracks++,A.videoSegmentStream=new ao(S,g),A.videoSegmentStream.on("log",v.getLogTrigger_("videoSegmentStream")),A.videoSegmentStream.on("timelineStartInfo",function(G){x&&!g.keepOriginalTimestamps&&(x.timelineStartInfo=G,A.audioSegmentStream.setEarliestDts(G.dts-v.baseMediaDecodeTime))}),A.videoSegmentStream.on("processedGopsInfo",v.trigger.bind(v,"gopInfo")),A.videoSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"videoSegmentTimingInfo")),A.videoSegmentStream.on("baseMediaDecodeTime",function(G){x&&A.audioSegmentStream.setVideoBaseMediaDecodeTime(G)}),A.videoSegmentStream.on("timingInfo",v.trigger.bind(v,"videoTimingInfo")),A.h264Stream.pipe(A.videoSegmentStream).pipe(A.coalesceStream)),x&&!A.audioSegmentStream&&(A.coalesceStream.numberOfTracks++,A.audioSegmentStream=new ps(x,g),A.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),A.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),A.audioSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"audioSegmentTimingInfo")),A.adtsStream.pipe(A.audioSegmentStream).pipe(A.coalesceStream)),v.trigger("trackinfo",{hasAudio:!!x,hasVideo:!!S})}}),A.coalesceStream.on("data",this.trigger.bind(this,"data")),A.coalesceStream.on("id3Frame",function(j){j.dispatchType=A.metadataStream.dispatchType,v.trigger("id3Frame",j)}),A.coalesceStream.on("caption",this.trigger.bind(this,"caption")),A.coalesceStream.on("done",this.trigger.bind(this,"done")),io(this,A)},this.setBaseMediaDecodeTime=function(A){var j=this.transmuxPipeline_;g.keepOriginalTimestamps||(this.baseMediaDecodeTime=A),x&&(x.timelineStartInfo.dts=void 0,x.timelineStartInfo.pts=void 0,ni.clearDtsInfo(x),j.audioTimestampRolloverStream&&j.audioTimestampRolloverStream.discontinuity()),S&&(j.videoSegmentStream&&(j.videoSegmentStream.gopCache_=[]),S.timelineStartInfo.dts=void 0,S.timelineStartInfo.pts=void 0,ni.clearDtsInfo(S),j.captionStream.reset()),j.timestampRolloverStream&&j.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(A){x&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(A)},this.setRemux=function(A){var j=this.transmuxPipeline_;g.remux=A,j&&j.coalesceStream&&j.coalesceStream.setRemux(A)},this.alignGopsWith=function(A){S&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(A)},this.getLogTrigger_=function(A){var j=this;return function(q){q.stream=A,j.trigger("log",q)}},this.push=function(A){if(T){var j=Jv(A);j&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!j&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),T=!1}this.transmuxPipeline_.headOfPipeline.push(A)},this.flush=function(){T=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},pc.prototype=new Qs;var Uf={Transmuxer:pc,VideoSegmentStream:ao,AudioSegmentStream:ps,AUDIO_PROPERTIES:Iu,VIDEO_PROPERTIES:xu,generateSegmentTimingInfo:Nu},jf=function(g){return g>>>0},zf=function(g){return("00"+g.toString(16)).slice(-2)},no={toUnsigned:jf,toHexString:zf},Hf=function(g){var v="";return v+=String.fromCharCode(g[0]),v+=String.fromCharCode(g[1]),v+=String.fromCharCode(g[2]),v+=String.fromCharCode(g[3]),v},mc=Hf,qf=no.toUnsigned,Wf=mc,ro=function(g,v){var T=[],S,x,A,j,q;if(!v.length)return null;for(S=0;S<g.byteLength;)x=qf(g[S]<<24|g[S+1]<<16|g[S+2]<<8|g[S+3]),A=Wf(g.subarray(S+4,S+8)),j=x>1?S+x:g.byteLength,A===v[0]&&(v.length===1?T.push(g.subarray(S+8,j)):(q=ro(g.subarray(S+8,j),v.slice(1)),q.length&&(T=T.concat(q)))),S=j;return T},so=ro,Zv=no.toUnsigned,$v=r.getUint64,eS=function(g){var v={version:g[0],flags:new Uint8Array(g.subarray(1,4))};return v.version===1?v.baseMediaDecodeTime=$v(g.subarray(4)):v.baseMediaDecodeTime=Zv(g[4]<<24|g[5]<<16|g[6]<<8|g[7]),v},Gf=eS,tS=function(g){return{isLeading:(g[0]&12)>>>2,dependsOn:g[0]&3,isDependedOn:(g[1]&192)>>>6,hasRedundancy:(g[1]&48)>>>4,paddingValue:(g[1]&14)>>>1,isNonSyncSample:g[1]&1,degradationPriority:g[2]<<8|g[3]}},Au=tS,Kf=Au,aS=function(g){var v={version:g[0],flags:new Uint8Array(g.subarray(1,4)),samples:[]},T=new DataView(g.buffer,g.byteOffset,g.byteLength),S=v.flags[2]&1,x=v.flags[2]&4,A=v.flags[1]&1,j=v.flags[1]&2,q=v.flags[1]&4,G=v.flags[1]&8,Q=T.getUint32(4),se=8,_e;for(S&&(v.dataOffset=T.getInt32(se),se+=4),x&&Q&&(_e={flags:Kf(g.subarray(se,se+4))},se+=4,A&&(_e.duration=T.getUint32(se),se+=4),j&&(_e.size=T.getUint32(se),se+=4),G&&(v.version===1?_e.compositionTimeOffset=T.getInt32(se):_e.compositionTimeOffset=T.getUint32(se),se+=4),v.samples.push(_e),Q--);Q--;)_e={},A&&(_e.duration=T.getUint32(se),se+=4),j&&(_e.size=T.getUint32(se),se+=4),q&&(_e.flags=Kf(g.subarray(se,se+4)),se+=4),G&&(v.version===1?_e.compositionTimeOffset=T.getInt32(se):_e.compositionTimeOffset=T.getUint32(se),se+=4),v.samples.push(_e);return v},xr=aS,yt=function(g){var v=new DataView(g.buffer,g.byteOffset,g.byteLength),T={version:g[0],flags:new Uint8Array(g.subarray(1,4)),trackId:v.getUint32(4)},S=T.flags[2]&1,x=T.flags[2]&2,A=T.flags[2]&8,j=T.flags[2]&16,q=T.flags[2]&32,G=T.flags[0]&65536,Q=T.flags[0]&131072,se;return se=8,S&&(se+=4,T.baseDataOffset=v.getUint32(12),se+=4),x&&(T.sampleDescriptionIndex=v.getUint32(se),se+=4),A&&(T.defaultSampleDuration=v.getUint32(se),se+=4),j&&(T.defaultSampleSize=v.getUint32(se),se+=4),q&&(T.defaultSampleFlags=v.getUint32(se)),G&&(T.durationIsEmpty=!0),!S&&Q&&(T.baseDataOffsetIsMoof=!0),T},jn=yt,Kt;typeof window<"u"?Kt=window:typeof e<"u"?Kt=e:typeof self<"u"?Kt=self:Kt={};var _i=Kt,iS=xf.discardEmulationPreventionBytes,Xf=tc.CaptionStream,oo=so,nS=Gf,rS=xr,sS=jn,Jf=_i,oS=function(g,v){for(var T=g,S=0;S<v.length;S++){var x=v[S];if(T<x.size)return x;T-=x.size}return null},lS=function(g,v,T){var S=new DataView(g.buffer,g.byteOffset,g.byteLength),x={logs:[],seiNals:[]},A,j,q,G;for(j=0;j+4<g.length;j+=q)if(q=S.getUint32(j),j+=4,!(q<=0))switch(g[j]&31){case 6:var Q=g.subarray(j+1,j+1+q),se=oS(j,v);if(A={nalUnitType:"sei_rbsp",size:q,data:Q,escapedRBSP:iS(Q),trackId:T},se)A.pts=se.pts,A.dts=se.dts,G=se;else if(G)A.pts=G.pts,A.dts=G.dts;else{x.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+j+" for trackId "+T+". See mux.js#223."});break}x.seiNals.push(A);break}return x},Yf=function(g,v,T){var S=v,x=T.defaultSampleDuration||0,A=T.defaultSampleSize||0,j=T.trackId,q=[];return g.forEach(function(G){var Q=rS(G),se=Q.samples;se.forEach(function(_e){_e.duration===void 0&&(_e.duration=x),_e.size===void 0&&(_e.size=A),_e.trackId=j,_e.dts=S,_e.compositionTimeOffset===void 0&&(_e.compositionTimeOffset=0),typeof S=="bigint"?(_e.pts=S+Jf.BigInt(_e.compositionTimeOffset),S+=Jf.BigInt(_e.duration)):(_e.pts=S+_e.compositionTimeOffset,S+=_e.duration)}),q=q.concat(se)}),q},_=function(g,v){var T=oo(g,["moof","traf"]),S=oo(g,["mdat"]),x={},A=[];return S.forEach(function(j,q){var G=T[q];A.push({mdat:j,traf:G})}),A.forEach(function(j){var q=j.mdat,G=j.traf,Q=oo(G,["tfhd"]),se=sS(Q[0]),_e=se.trackId,Ve=oo(G,["tfdt"]),Ae=Ve.length>0?nS(Ve[0]).baseMediaDecodeTime:0,Qe=oo(G,["trun"]),et,la;v===_e&&Qe.length>0&&(et=Yf(Qe,Ae,se),la=lS(q,et,_e),x[_e]||(x[_e]={seiNals:[],logs:[]}),x[_e].seiNals=x[_e].seiNals.concat(la.seiNals),x[_e].logs=x[_e].logs.concat(la.logs))}),x},w=function(g,v,T){var S;if(v===null)return null;S=_(g,v);var x=S[v]||{};return{seiNals:x.seiNals,logs:x.logs,timescale:T}},k=function(){var g=!1,v,T,S,x,A,j;this.isInitialized=function(){return g},this.init=function(q){v=new Xf,g=!0,j=q?q.isPartial:!1,v.on("data",function(G){G.startTime=G.startPts/x,G.endTime=G.endPts/x,A.captions.push(G),A.captionStreams[G.stream]=!0}),v.on("log",function(G){A.logs.push(G)})},this.isNewInit=function(q,G){return q&&q.length===0||G&&typeof G=="object"&&Object.keys(G).length===0?!1:S!==q[0]||x!==G[S]},this.parse=function(q,G,Q){var se;if(this.isInitialized()){if(!G||!Q)return null;if(this.isNewInit(G,Q))S=G[0],x=Q[S];else if(S===null||!x)return T.push(q),null}else return null;for(;T.length>0;){var _e=T.shift();this.parse(_e,G,Q)}return se=w(q,S,x),se&&se.logs&&(A.logs=A.logs.concat(se.logs)),se===null||!se.seiNals?A.logs.length?{logs:A.logs,captions:[],captionStreams:[]}:null:(this.pushNals(se.seiNals),this.flushStream(),A)},this.pushNals=function(q){if(!this.isInitialized()||!q||q.length===0)return null;q.forEach(function(G){v.push(G)})},this.flushStream=function(){if(!this.isInitialized())return null;j?v.partialFlush():v.flush()},this.clearParsedCaptions=function(){A.captions=[],A.captionStreams={},A.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;v.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){T=[],S=null,x=null,A?this.clearParsedCaptions():A={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},C=k,I=function(g){for(var v=0,T=String.fromCharCode(g[v]),S="";T!=="\0";)S+=T,v++,T=String.fromCharCode(g[v]);return S+=T,S},B={uint8ToCString:I},F=B.uint8ToCString,H=r.getUint64,W=function(g){var v=4,T=g[0],S,x,A,j,q,G,Q,se;if(T===0){S=F(g.subarray(v)),v+=S.length,x=F(g.subarray(v)),v+=x.length;var _e=new DataView(g.buffer);A=_e.getUint32(v),v+=4,q=_e.getUint32(v),v+=4,G=_e.getUint32(v),v+=4,Q=_e.getUint32(v),v+=4}else if(T===1){var _e=new DataView(g.buffer);A=_e.getUint32(v),v+=4,j=H(g.subarray(v)),v+=8,G=_e.getUint32(v),v+=4,Q=_e.getUint32(v),v+=4,S=F(g.subarray(v)),v+=S.length,x=F(g.subarray(v)),v+=x.length}se=new Uint8Array(g.subarray(v,g.byteLength));var Ve={scheme_id_uri:S,value:x,timescale:A||1,presentation_time:j,presentation_time_delta:q,event_duration:G,id:Q,message_data:se};return ce(T,Ve)?Ve:void 0},Z=function(g,v,T,S){return g||g===0?g/v:S+T/v},ce=function(g,v){var T=v.scheme_id_uri!=="\0",S=g===0&&be(v.presentation_time_delta)&&T,x=g===1&&be(v.presentation_time)&&T;return!(g>1)&&S||x},be=function(g){return g!==void 0||g!==null},Ue={parseEmsgBox:W,scaleTime:Z},Ne=no.toUnsigned,Ke=no.toHexString,ze=so,At=mc,Ia=Ue,Nr=jn,Qf=xr,Zf=Gf,$f=r.getUint64,fc,Pu,Ft,Ou,zn,cS,fP,dS=_i,eIe=Of.parseId3Frames;fc=function(g){var v={},T=ze(g,["moov","trak"]);return T.reduce(function(S,x){var A,j,q,G,Q;return A=ze(x,["tkhd"])[0],!A||(j=A[0],q=j===0?12:20,G=Ne(A[q]<<24|A[q+1]<<16|A[q+2]<<8|A[q+3]),Q=ze(x,["mdia","mdhd"])[0],!Q)?null:(j=Q[0],q=j===0?12:20,S[G]=Ne(Q[q]<<24|Q[q+1]<<16|Q[q+2]<<8|Q[q+3]),S)},v)},Pu=function(g,v){var T;T=ze(v,["moof","traf"]);var S=T.reduce(function(x,A){var j=ze(A,["tfhd"])[0],q=Ne(j[4]<<24|j[5]<<16|j[6]<<8|j[7]),G=g[q]||9e4,Q=ze(A,["tfdt"])[0],se=new DataView(Q.buffer,Q.byteOffset,Q.byteLength),_e;Q[0]===1?_e=$f(Q.subarray(4,12)):_e=se.getUint32(4);let Ve;return typeof _e=="bigint"?Ve=_e/dS.BigInt(G):typeof _e=="number"&&!isNaN(_e)&&(Ve=_e/G),Ve<Number.MAX_SAFE_INTEGER&&(Ve=Number(Ve)),Ve<x&&(x=Ve),x},1/0);return typeof S=="bigint"||isFinite(S)?S:0},Ft=function(g,v){var T=ze(v,["moof","traf"]),S=0,x=0,A;if(T&&T.length){var j=ze(T[0],["tfhd"])[0],q=ze(T[0],["trun"])[0],G=ze(T[0],["tfdt"])[0];if(j){var Q=Nr(j);A=Q.trackId}if(G){var se=Zf(G);S=se.baseMediaDecodeTime}if(q){var _e=Qf(q);_e.samples&&_e.samples.length&&(x=_e.samples[0].compositionTimeOffset||0)}}var Ve=g[A]||9e4;typeof S=="bigint"&&(x=dS.BigInt(x),Ve=dS.BigInt(Ve));var Ae=(S+x)/Ve;return typeof Ae=="bigint"&&Ae<Number.MAX_SAFE_INTEGER&&(Ae=Number(Ae)),Ae},Ou=function(g){var v=ze(g,["moov","trak"]),T=[];return v.forEach(function(S){var x=ze(S,["mdia","hdlr"]),A=ze(S,["tkhd"]);x.forEach(function(j,q){var G=At(j.subarray(8,12)),Q=A[q],se,_e,Ve;G==="vide"&&(se=new DataView(Q.buffer,Q.byteOffset,Q.byteLength),_e=se.getUint8(0),Ve=_e===0?se.getUint32(12):se.getUint32(20),T.push(Ve))})}),T},cS=function(g){var v=g[0],T=v===0?12:20;return Ne(g[T]<<24|g[T+1]<<16|g[T+2]<<8|g[T+3])},zn=function(g){var v=ze(g,["moov","trak"]),T=[];return v.forEach(function(S){var x={},A=ze(S,["tkhd"])[0],j,q;A&&(j=new DataView(A.buffer,A.byteOffset,A.byteLength),q=j.getUint8(0),x.id=q===0?j.getUint32(12):j.getUint32(20));var G=ze(S,["mdia","hdlr"])[0];if(G){var Q=At(G.subarray(8,12));Q==="vide"?x.type="video":Q==="soun"?x.type="audio":x.type=Q}var se=ze(S,["mdia","minf","stbl","stsd"])[0];if(se){var _e=se.subarray(8);x.codec=At(_e.subarray(4,8));var Ve=ze(_e,[x.codec])[0],Ae,Qe;Ve&&(/^[asm]vc[1-9]$/i.test(x.codec)?(Ae=Ve.subarray(78),Qe=At(Ae.subarray(4,8)),Qe==="avcC"&&Ae.length>11?(x.codec+=".",x.codec+=Ke(Ae[9]),x.codec+=Ke(Ae[10]),x.codec+=Ke(Ae[11])):x.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(x.codec)?(Ae=Ve.subarray(28),Qe=At(Ae.subarray(4,8)),Qe==="esds"&&Ae.length>20&&Ae[19]!==0?(x.codec+="."+Ke(Ae[19]),x.codec+="."+Ke(Ae[20]>>>2&63).replace(/^0/,"")):x.codec="mp4a.40.2"):x.codec=x.codec.toLowerCase())}var et=ze(S,["mdia","mdhd"])[0];et&&(x.timescale=cS(et)),T.push(x)}),T},fP=function(g,v=0){var T=ze(g,["emsg"]);return T.map(S=>{var x=Ia.parseEmsgBox(new Uint8Array(S)),A=eIe(x.message_data);return{cueTime:Ia.scaleTime(x.presentation_time,x.timescale,x.presentation_time_delta,v),duration:Ia.scaleTime(x.event_duration,x.timescale),frames:A}})};var uS={findBox:ze,parseType:At,timescale:fc,startTime:Pu,compositionStartTime:Ft,videoTrackIds:Ou,tracks:zn,getTimescaleFromMediaHeader:cS,getEmsgID3:fP},hS=Hs,gP=function(g){var v=g[1]&31;return v<<=8,v|=g[2],v},eg=function(g){return!!(g[1]&64)},tg=function(g){var v=0;return(g[3]&48)>>>4>1&&(v+=g[4]+1),v},tIe=function(g,v){var T=gP(g);return T===0?"pat":T===v?"pmt":v?"pes":null},aIe=function(g){var v=eg(g),T=4+tg(g);return v&&(T+=g[T]+1),(g[T+10]&31)<<8|g[T+11]},iIe=function(g){var v={},T=eg(g),S=4+tg(g);if(T&&(S+=g[S]+1),!!(g[S+5]&1)){var x,A,j;x=(g[S+1]&15)<<8|g[S+2],A=3+x-4,j=(g[S+10]&15)<<8|g[S+11];for(var q=12+j;q<A;){var G=S+q;v[(g[G+1]&31)<<8|g[G+2]]=g[G],q+=((g[G+3]&15)<<8|g[G+4])+5}return v}},nIe=function(g,v){var T=gP(g),S=v[T];switch(S){case hS.H264_STREAM_TYPE:return"video";case hS.ADTS_STREAM_TYPE:return"audio";case hS.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},rIe=function(g){var v=eg(g);if(!v)return null;var T=4+tg(g);if(T>=g.byteLength)return null;var S=null,x;return x=g[T+7],x&192&&(S={},S.pts=(g[T+9]&14)<<27|(g[T+10]&255)<<20|(g[T+11]&254)<<12|(g[T+12]&255)<<5|(g[T+13]&254)>>>3,S.pts*=4,S.pts+=(g[T+13]&6)>>>1,S.dts=S.pts,x&64&&(S.dts=(g[T+14]&14)<<27|(g[T+15]&255)<<20|(g[T+16]&254)<<12|(g[T+17]&255)<<5|(g[T+18]&254)>>>3,S.dts*=4,S.dts+=(g[T+18]&6)>>>1)),S},pS=function(g){switch(g){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},sIe=function(g){for(var v=4+tg(g),T=g.subarray(v),S=0,x=0,A=!1,j;x<T.byteLength-3;x++)if(T[x+2]===1){S=x+5;break}for(;S<T.byteLength;)switch(T[S]){case 0:if(T[S-1]!==0){S+=2;break}else if(T[S-2]!==0){S++;break}x+3!==S-2&&(j=pS(T[x+3]&31),j==="slice_layer_without_partitioning_rbsp_idr"&&(A=!0));do S++;while(T[S]!==1&&S<T.length);x=S-2,S+=3;break;case 1:if(T[S-1]!==0||T[S-2]!==0){S+=3;break}j=pS(T[x+3]&31),j==="slice_layer_without_partitioning_rbsp_idr"&&(A=!0),x=S-2,S+=3;break;default:S+=3;break}return T=T.subarray(x),S-=x,x=0,T&&T.byteLength>3&&(j=pS(T[x+3]&31),j==="slice_layer_without_partitioning_rbsp_idr"&&(A=!0)),A},oIe={parseType:tIe,parsePat:aIe,parsePmt:iIe,parsePayloadUnitStartIndicator:eg,parsePesType:nIe,parsePesTime:rIe,videoPacketContainsKeyFrame:sIe},yP=Hs,gc=qs.handleRollover,St={};St.ts=oIe,St.aac=us;var lo=kt.ONE_SECOND_IN_TS,za=188,Hn=71,lIe=function(g,v){for(var T=0,S=za,x,A;S<g.byteLength;){if(g[T]===Hn&&g[S]===Hn){switch(x=g.subarray(T,S),A=St.ts.parseType(x,v.pid),A){case"pat":v.pid=St.ts.parsePat(x);break;case"pmt":var j=St.ts.parsePmt(x);v.table=v.table||{},Object.keys(j).forEach(function(q){v.table[q]=j[q]});break}T+=za,S+=za;continue}T++,S++}},_P=function(g,v,T){for(var S=0,x=za,A,j,q,G,Q,se=!1;x<=g.byteLength;){if(g[S]===Hn&&(g[x]===Hn||x===g.byteLength)){switch(A=g.subarray(S,x),j=St.ts.parseType(A,v.pid),j){case"pes":q=St.ts.parsePesType(A,v.table),G=St.ts.parsePayloadUnitStartIndicator(A),q==="audio"&&G&&(Q=St.ts.parsePesTime(A),Q&&(Q.type="audio",T.audio.push(Q),se=!0));break}if(se)break;S+=za,x+=za;continue}S++,x++}for(x=g.byteLength,S=x-za,se=!1;S>=0;){if(g[S]===Hn&&(g[x]===Hn||x===g.byteLength)){switch(A=g.subarray(S,x),j=St.ts.parseType(A,v.pid),j){case"pes":q=St.ts.parsePesType(A,v.table),G=St.ts.parsePayloadUnitStartIndicator(A),q==="audio"&&G&&(Q=St.ts.parsePesTime(A),Q&&(Q.type="audio",T.audio.push(Q),se=!0));break}if(se)break;S-=za,x-=za;continue}S--,x--}},cIe=function(g,v,T){for(var S=0,x=za,A,j,q,G,Q,se,_e,Ve,Ae=!1,Qe={data:[],size:0};x<g.byteLength;){if(g[S]===Hn&&g[x]===Hn){switch(A=g.subarray(S,x),j=St.ts.parseType(A,v.pid),j){case"pes":if(q=St.ts.parsePesType(A,v.table),G=St.ts.parsePayloadUnitStartIndicator(A),q==="video"&&(G&&!Ae&&(Q=St.ts.parsePesTime(A),Q&&(Q.type="video",T.video.push(Q),Ae=!0)),!T.firstKeyFrame)){if(G&&Qe.size!==0){for(se=new Uint8Array(Qe.size),_e=0;Qe.data.length;)Ve=Qe.data.shift(),se.set(Ve,_e),_e+=Ve.byteLength;if(St.ts.videoPacketContainsKeyFrame(se)){var et=St.ts.parsePesTime(se);et?(T.firstKeyFrame=et,T.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}Qe.size=0}Qe.data.push(A),Qe.size+=A.byteLength}break}if(Ae&&T.firstKeyFrame)break;S+=za,x+=za;continue}S++,x++}for(x=g.byteLength,S=x-za,Ae=!1;S>=0;){if(g[S]===Hn&&g[x]===Hn){switch(A=g.subarray(S,x),j=St.ts.parseType(A,v.pid),j){case"pes":q=St.ts.parsePesType(A,v.table),G=St.ts.parsePayloadUnitStartIndicator(A),q==="video"&&G&&(Q=St.ts.parsePesTime(A),Q&&(Q.type="video",T.video.push(Q),Ae=!0));break}if(Ae)break;S-=za,x-=za;continue}S--,x--}},dIe=function(g,v){if(g.audio&&g.audio.length){var T=v;(typeof T>"u"||isNaN(T))&&(T=g.audio[0].dts),g.audio.forEach(function(A){A.dts=gc(A.dts,T),A.pts=gc(A.pts,T),A.dtsTime=A.dts/lo,A.ptsTime=A.pts/lo})}if(g.video&&g.video.length){var S=v;if((typeof S>"u"||isNaN(S))&&(S=g.video[0].dts),g.video.forEach(function(A){A.dts=gc(A.dts,S),A.pts=gc(A.pts,S),A.dtsTime=A.dts/lo,A.ptsTime=A.pts/lo}),g.firstKeyFrame){var x=g.firstKeyFrame;x.dts=gc(x.dts,S),x.pts=gc(x.pts,S),x.dtsTime=x.dts/lo,x.ptsTime=x.pts/lo}}},uIe=function(g){for(var v=!1,T=0,S=null,x=null,A=0,j=0,q;g.length-j>=3;){var G=St.aac.parseType(g,j);switch(G){case"timed-metadata":if(g.length-j<10){v=!0;break}if(A=St.aac.parseId3TagSize(g,j),A>g.length){v=!0;break}x===null&&(q=g.subarray(j,j+A),x=St.aac.parseAacTimestamp(q)),j+=A;break;case"audio":if(g.length-j<7){v=!0;break}if(A=St.aac.parseAdtsSize(g,j),A>g.length){v=!0;break}S===null&&(q=g.subarray(j,j+A),S=St.aac.parseSampleRate(q)),T++,j+=A;break;default:j++;break}if(v)return null}if(S===null||x===null)return null;var Q=lo/S,se={audio:[{type:"audio",dts:x,pts:x},{type:"audio",dts:x+T*1024*Q,pts:x+T*1024*Q}]};return se},hIe=function(g){var v={pid:null,table:null},T={};lIe(g,v);for(var S in v.table)if(v.table.hasOwnProperty(S)){var x=v.table[S];switch(x){case yP.H264_STREAM_TYPE:T.video=[],cIe(g,v,T),T.video.length===0&&delete T.video;break;case yP.ADTS_STREAM_TYPE:T.audio=[],_P(g,v,T),T.audio.length===0&&delete T.audio;break}}return T},pIe=function(g,v){var T=St.aac.isLikelyAacData(g),S;return T?S=uIe(g):S=hIe(g),!S||!S.audio&&!S.video?null:(dIe(S,v),S)},mIe={inspect:pIe,parseAudioPes_:_P};const fIe=function(g,v){v.on("data",function(T){const S=T.initSegment;T.initSegment={data:S.buffer,byteOffset:S.byteOffset,byteLength:S.byteLength};const x=T.data;T.data=x.buffer,g.postMessage({action:"data",segment:T,byteOffset:x.byteOffset,byteLength:x.byteLength},[T.data])}),v.on("done",function(T){g.postMessage({action:"done"})}),v.on("gopInfo",function(T){g.postMessage({action:"gopInfo",gopInfo:T})}),v.on("videoSegmentTimingInfo",function(T){const S={start:{decode:kt.videoTsToSeconds(T.start.dts),presentation:kt.videoTsToSeconds(T.start.pts)},end:{decode:kt.videoTsToSeconds(T.end.dts),presentation:kt.videoTsToSeconds(T.end.pts)},baseMediaDecodeTime:kt.videoTsToSeconds(T.baseMediaDecodeTime)};T.prependedContentDuration&&(S.prependedContentDuration=kt.videoTsToSeconds(T.prependedContentDuration)),g.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:S})}),v.on("audioSegmentTimingInfo",function(T){const S={start:{decode:kt.videoTsToSeconds(T.start.dts),presentation:kt.videoTsToSeconds(T.start.pts)},end:{decode:kt.videoTsToSeconds(T.end.dts),presentation:kt.videoTsToSeconds(T.end.pts)},baseMediaDecodeTime:kt.videoTsToSeconds(T.baseMediaDecodeTime)};T.prependedContentDuration&&(S.prependedContentDuration=kt.videoTsToSeconds(T.prependedContentDuration)),g.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:S})}),v.on("id3Frame",function(T){g.postMessage({action:"id3Frame",id3Frame:T})}),v.on("caption",function(T){g.postMessage({action:"caption",caption:T})}),v.on("trackinfo",function(T){g.postMessage({action:"trackinfo",trackInfo:T})}),v.on("audioTimingInfo",function(T){g.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:kt.videoTsToSeconds(T.start),end:kt.videoTsToSeconds(T.end)}})}),v.on("videoTimingInfo",function(T){g.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:kt.videoTsToSeconds(T.start),end:kt.videoTsToSeconds(T.end)}})}),v.on("log",function(T){g.postMessage({action:"log",log:T})})};class bP{constructor(v,T){this.options=T||{},this.self=v,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Uf.Transmuxer(this.options),fIe(this.self,this.transmuxer)}pushMp4Captions(v){this.captionParser||(this.captionParser=new C,this.captionParser.init());const T=new Uint8Array(v.data,v.byteOffset,v.byteLength),S=this.captionParser.parse(T,v.trackIds,v.timescales);this.self.postMessage({action:"mp4Captions",captions:S&&S.captions||[],logs:S&&S.logs||[],data:T.buffer},[T.buffer])}probeMp4StartTime({timescales:v,data:T}){const S=uS.startTime(v,T);this.self.postMessage({action:"probeMp4StartTime",startTime:S,data:T},[T.buffer])}probeMp4Tracks({data:v}){const T=uS.tracks(v);this.self.postMessage({action:"probeMp4Tracks",tracks:T,data:v},[v.buffer])}probeEmsgID3({data:v,offset:T}){const S=uS.getEmsgID3(v,T);this.self.postMessage({action:"probeEmsgID3",id3Frames:S,emsgData:v},[v.buffer])}probeTs({data:v,baseStartTime:T}){const S=typeof T=="number"&&!isNaN(T)?T*kt.ONE_SECOND_IN_TS:void 0,x=mIe.inspect(v,S);let A=null;x&&(A={hasVideo:x.video&&x.video.length===2||!1,hasAudio:x.audio&&x.audio.length===2||!1},A.hasVideo&&(A.videoStart=x.video[0].ptsTime),A.hasAudio&&(A.audioStart=x.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:A,data:v},[v.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(v){const T=new Uint8Array(v.data,v.byteOffset,v.byteLength);this.transmuxer.push(T)}reset(){this.transmuxer.reset()}setTimestampOffset(v){const T=v.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(kt.secondsToVideoTs(T)))}setAudioAppendStart(v){this.transmuxer.setAudioAppendStart(Math.ceil(kt.secondsToVideoTs(v.appendStart)))}setRemux(v){this.transmuxer.setRemux(v.remux)}flush(v){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(v){this.transmuxer.alignGopsWith(v.gopsToAlignWith.slice())}}self.onmessage=function(g){if(g.data.action==="init"&&g.data.options){this.messageHandlers=new bP(self,g.data.options);return}this.messageHandlers||(this.messageHandlers=new bP(self)),g.data&&g.data.action&&g.data.action!=="init"&&this.messageHandlers[g.data.action]&&this.messageHandlers[g.data.action](g.data)}}));var Dge=Ax(Bge);const Mge=(e,t,a)=>{const{type:i,initSegment:n,captions:r,captionStreams:o,metadata:l,videoFrameDtsTime:c,videoFramePtsTime:d}=e.data.segment;t.buffer.push({captions:r,captionStreams:o,metadata:l});const u=e.data.segment.boxes||{data:e.data.segment.data},h={type:i,data:new Uint8Array(u.data,u.data.byteOffset,u.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};typeof c<"u"&&(h.videoFrameDtsTime=c),typeof d<"u"&&(h.videoFramePtsTime=d),a(h)},Lge=({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)},Rge=(e,t)=>{t.gopInfo=e.data.gopInfo},Bx=e=>{const{transmuxer:t,bytes:a,audioAppendStart:i,gopsToAlignWith:n,remux:r,onData:o,onTrackInfo:l,onAudioTimingInfo:c,onVideoTimingInfo:d,onVideoSegmentTimingInfo:u,onAudioSegmentTimingInfo:h,onId3:m,onCaptions:p,onDone:f,onEndedTimeline:y,onTransmuxerLog:b,isEndOfTimeline:E}=e,D={buffer:[]};let M=E;const N=P=>{t.currentTransmux===e&&(P.data.action==="data"&&Mge(P,D,o),P.data.action==="trackinfo"&&l(P.data.trackInfo),P.data.action==="gopInfo"&&Rge(P,D),P.data.action==="audioTimingInfo"&&c(P.data.audioTimingInfo),P.data.action==="videoTimingInfo"&&d(P.data.videoTimingInfo),P.data.action==="videoSegmentTimingInfo"&&u(P.data.videoSegmentTimingInfo),P.data.action==="audioSegmentTimingInfo"&&h(P.data.audioSegmentTimingInfo),P.data.action==="id3Frame"&&m([P.data.id3Frame],P.data.id3Frame.dispatchType),P.data.action==="caption"&&p(P.data.caption),P.data.action==="endedtimeline"&&(M=!1,y()),P.data.action==="log"&&b(P.data.log),P.data.type==="transmuxed"&&(M||(t.onmessage=null,Lge({transmuxedData:D,callback:f}),Dx(t))))};if(t.onmessage=N,i&&t.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(n)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),typeof r<"u"&&t.postMessage({action:"setRemux",remux:r}),a.byteLength){const P=a instanceof ArrayBuffer?a:a.buffer,L=a instanceof ArrayBuffer?0:a.byteOffset;t.postMessage({action:"push",data:P,byteOffset:L,byteLength:a.byteLength},[P])}E&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Dx=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),typeof e.currentTransmux=="function"?e.currentTransmux():Bx(e.currentTransmux))},Mx=(e,t)=>{e.postMessage({action:t}),Dx(e)},Lx=(e,t)=>{if(!t.currentTransmux){t.currentTransmux=e,Mx(t,e);return}t.transmuxQueue.push(Mx.bind(null,t,e))},Fge=e=>{Lx("reset",e)},Vge=e=>{Lx("endTimeline",e)},Rx=e=>{if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,Bx(e);return}e.transmuxer.transmuxQueue.push(e)};var a2={reset:Fge,endTimeline:Vge,transmux:Rx,createTransmuxer:e=>{const t=new Dge;t.currentTransmux=null,t.transmuxQueue=[];const a=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,a.call(t)),t.postMessage({action:"init",options:e}),t}};const zd=function(e){const t=e.transmuxer,a=e.endAction||e.action,i=e.callback,n=Ht({},e,{endAction:null,transmuxer:null,callback:null}),r=o=>{o.data.action===a&&(t.removeEventListener("message",r),o.data.data&&(o.data.data=new Uint8Array(o.data.data,e.byteOffset||0,e.byteLength||o.data.data.byteLength),e.data&&(e.data=o.data.data)),i(o.data))};if(t.addEventListener("message",r),e.data){const o=e.data instanceof ArrayBuffer;n.byteOffset=o?0:e.data.byteOffset,n.byteLength=e.data.byteLength;const l=[o?e.data:e.data.buffer];t.postMessage(n,l)}else t.postMessage(n)},An={FAILURE:2,TIMEOUT:-101,ABORTED:-102},i2=e=>{e.forEach(t=>{t.abort()})},Uge=e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}),jge=e=>{const t=e.target,a={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return a.bytesReceived=e.loaded,a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3),a},n2=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:An.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:An.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:An.FAILURE,xhr:t}:t.responseType==="arraybuffer"&&t.response.byteLength===0?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:An.FAILURE,xhr:t}:null,Fx=(e,t,a)=>(i,n)=>{const r=n.response,o=n2(i,n);if(o)return a(o,e);if(r.byteLength!==16)return a({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:An.FAILURE,xhr:n},e);const l=new DataView(r),c=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let d=0;d<t.length;d++)t[d].bytes=c;return a(null,e)},Vx=(e,t)=>{const a=q_(e.map.bytes);if(a!=="mp4"){const i=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:`Found unsupported ${a||"unknown"} container for initialization segment at URL: ${i}`,code:An.FAILURE})}zd({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:n})=>(e.map.bytes=n,i.forEach(function(r){e.map.tracks=e.map.tracks||{},!e.map.tracks[r.type]&&(e.map.tracks[r.type]=r,typeof r.id=="number"&&r.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[r.id]=r.timescale))}),t(null))})},zge=({segment:e,finishProcessingFn:t})=>(a,i)=>{const n=n2(a,i);if(n)return t(n,e);const r=new Uint8Array(i.response);if(e.map.key)return e.map.encryptedBytes=r,t(null,e);e.map.bytes=r,Vx(e,function(o){if(o)return o.xhr=i,o.status=i.status,t(o,e);t(null,e)})},Hge=({segment:e,finishProcessingFn:t,responseType:a})=>(i,n)=>{const r=n2(i,n);if(r)return t(r,e);const o=a==="arraybuffer"||!n.responseText?n.response:Pge(n.responseText.substring(e.lastReachedChar||0));return e.stats=Uge(n),e.key?e.encryptedBytes=new Uint8Array(o):e.bytes=new Uint8Array(o),t(null,e)},qge=({segment:e,bytes:t,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})=>{const p=e.map&&e.map.tracks||{},f=!!(p.audio&&p.video);let y=i.bind(null,e,"audio","start");const b=i.bind(null,e,"audio","end");let E=i.bind(null,e,"video","start");const D=i.bind(null,e,"video","end"),M=()=>Rx({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:f,onData:N=>{N.type=N.type==="combined"?"video":N.type,u(e,N)},onTrackInfo:N=>{a&&(f&&(N.isMuxed=!0),a(e,N))},onAudioTimingInfo:N=>{y&&typeof N.start<"u"&&(y(N.start),y=null),b&&typeof N.end<"u"&&b(N.end)},onVideoTimingInfo:N=>{E&&typeof N.start<"u"&&(E(N.start),E=null),D&&typeof N.end<"u"&&D(N.end)},onVideoSegmentTimingInfo:N=>{n(N)},onAudioSegmentTimingInfo:N=>{r(N)},onId3:(N,P)=>{o(e,N,P)},onCaptions:N=>{l(e,[N])},isEndOfTimeline:c,onEndedTimeline:()=>{d()},onTransmuxerLog:m,onDone:N=>{h&&(N.type=N.type==="combined"?"video":N.type,h(null,e,N))}});zd({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:N=>{e.bytes=t=N.data;const P=N.result;P&&(a(e,{hasAudio:P.hasAudio,hasVideo:P.hasVideo,isMuxed:f}),a=null),M()}})},Ux=({segment:e,bytes:t,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})=>{let p=new Uint8Array(t);if(Tme(p)){e.isFmp4=!0;const{tracks:f}=e.map,y={isFmp4:!0,hasVideo:!!f.video,hasAudio:!!f.audio};f.audio&&f.audio.codec&&f.audio.codec!=="enca"&&(y.audioCodec=f.audio.codec),f.video&&f.video.codec&&f.video.codec!=="encv"&&(y.videoCodec=f.video.codec),f.video&&f.audio&&(y.isMuxed=!0),a(e,y);const b=(E,D)=>{u(e,{data:p,type:y.hasAudio&&!y.isMuxed?"audio":"video"}),D&&D.length&&o(e,D),E&&E.length&&l(e,E),h(null,e,{})};zd({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback:({data:E,startTime:D})=>{t=E.buffer,e.bytes=p=E,y.hasAudio&&!y.isMuxed&&i(e,"audio","start",D),y.hasVideo&&i(e,"video","start",D),zd({action:"probeEmsgID3",data:p,transmuxer:e.transmuxer,offset:D,callback:({emsgData:M,id3Frames:N})=>{if(t=M.buffer,e.bytes=p=M,!f.video||!M.byteLength||!e.transmuxer){b(void 0,N);return}zd({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[f.video.id],callback:P=>{t=P.data.buffer,e.bytes=p=P.data,P.logs.forEach(function(L){m(_t(L,{stream:"mp4CaptionParser"}))}),b(P.captions,N)}})}})}});return}if(!e.transmuxer){h(null,e,{});return}if(typeof e.container>"u"&&(e.container=q_(p)),e.container!=="ts"&&e.container!=="aac"){a(e,{hasAudio:!1,hasVideo:!1}),h(null,e,{});return}qge({segment:e,bytes:t,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})},jx=function({id:e,key:t,encryptedBytes:a,decryptionWorker:i},n){const r=l=>{if(l.data.source===e){i.removeEventListener("message",r);const c=l.data.decrypted;n(new Uint8Array(c.bytes,c.byteOffset,c.byteLength))}};i.addEventListener("message",r);let o;t.bytes.slice?o=t.bytes.slice():o=new Uint32Array(Array.prototype.slice.call(t.bytes)),i.postMessage(wx({source:e,encrypted:a,key:o,iv:t.iv}),[a.buffer,o.buffer])},Wge=({decryptionWorker:e,segment:t,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})=>{jx({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},p=>{t.bytes=p,Ux({segment:t,bytes:t.bytes,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})})},Gge=({activeXhrs:e,decryptionWorker:t,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})=>{let p=0,f=!1;return(y,b)=>{if(!f){if(y)return f=!0,i2(e),h(y,b);if(p+=1,p===e.length){const E=function(){if(b.encryptedBytes)return Wge({decryptionWorker:t,segment:b,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m});Ux({segment:b,bytes:b.bytes,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})};if(b.endOfAllRequests=Date.now(),b.map&&b.map.encryptedBytes&&!b.map.bytes)return jx({decryptionWorker:t,id:b.requestId+"-init",encryptedBytes:b.map.encryptedBytes,key:b.map.key},D=>{b.map.bytes=D,Vx(b,M=>{if(M)return i2(e),h(M,b);E()})});E()}}}},Kge=({loadendState:e,abortFn:t})=>a=>{a.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)},Xge=({segment:e,progressFn:t,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u})=>h=>{if(!h.target.aborted)return e.stats=_t(e.stats,jge(h)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(h,e)},Jge=({xhr:e,xhrOptions:t,decryptionWorker:a,segment:i,abortFn:n,progressFn:r,trackInfoFn:o,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:d,id3Fn:u,captionsFn:h,isEndOfTimeline:m,endedTimelineFn:p,dataFn:f,doneFn:y,onTransmuxerLog:b})=>{const E=[],D=Gge({activeXhrs:E,decryptionWorker:a,trackInfoFn:o,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:d,id3Fn:u,captionsFn:h,isEndOfTimeline:m,endedTimelineFn:p,dataFn:f,doneFn:y,onTransmuxerLog:b});if(i.key&&!i.key.bytes){const V=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&V.push(i.map.key);const $=_t(t,{uri:i.key.resolvedUri,responseType:"arraybuffer"}),U=Fx(i,V,D),ae=e($,U);E.push(ae)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const ae=_t(t,{uri:i.map.key.resolvedUri,responseType:"arraybuffer"}),oe=Fx(i,[i.map.key],D),Y=e(ae,oe);E.push(Y)}const V=_t(t,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:$b(i.map)}),$=zge({segment:i,finishProcessingFn:D}),U=e(V,$);E.push(U)}const M=_t(t,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:$b(i)}),N=Hge({segment:i,finishProcessingFn:D,responseType:M.responseType}),P=e(M,N);P.addEventListener("progress",Xge({segment:i,progressFn:r,trackInfoFn:o,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:d,id3Fn:u,captionsFn:h,isEndOfTimeline:m,endedTimelineFn:p,dataFn:f})),E.push(P);const L={};return E.forEach(V=>{V.addEventListener("loadend",Kge({loadendState:L,abortFn:n}))}),()=>i2(E)},Yge=Oi("CodecUtils"),Qge=function(e){const t=e.attributes||{};if(t.CODECS)return bn(t.CODECS)},zx=(e,t)=>{const a=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&a.AUDIO&&e.mediaGroups.AUDIO[a.AUDIO]},Zge=(e,t)=>{if(!zx(e,t))return!0;const a=t.attributes||{},i=e.mediaGroups.AUDIO[a.AUDIO];for(const n in i)if(!i[n].uri&&!i[n].playlists)return!0;return!1},mm=function(e){const t={};return e.forEach(({mediaType:a,type:i,details:n})=>{t[a]=t[a]||[],t[a].push(Y5(`${i}${n}`))}),Object.keys(t).forEach(function(a){if(t[a].length>1){Yge(`multiple ${a} codecs found as attributes: ${t[a].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),t[a]=null;return}t[a]=t[a][0]}),t},Hx=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},Hd=function(e,t){const a=t.attributes||{},i=mm(Qge(t)||[]);if(zx(e,t)&&!i.audio&&!Zge(e,t)){const n=mm(Che(e,a.AUDIO)||[]);n.audio&&(i.audio=n.audio)}return i},fm=Oi("PlaylistSelector"),qx=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},gm=function(e,t){if(!e)return"";const a=O.getComputedStyle(e);return a?a[t]:""},yl=function(e,t){const a=e.slice();e.sort(function(i,n){const r=t(i,n);return r===0?a.indexOf(i)-a.indexOf(n):r})},r2=function(e,t){let a,i;return e.attributes.BANDWIDTH&&(a=e.attributes.BANDWIDTH),a=a||O.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),i=i||O.Number.MAX_VALUE,a-i},$ge=function(e,t){let a,i;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(a=e.attributes.RESOLUTION.width),a=a||O.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),i=i||O.Number.MAX_VALUE,a===i&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:a-i};let Wx=function(e,t,a,i,n,r){if(!e)return;const o={bandwidth:t,width:a,height:i,limitRenditionByPlayerDimensions:n};let l=e.playlists;Qa.isAudioOnly(e)&&(l=r.getAudioTrackPlaylists_(),o.audioOnly=!0);let c=l.map(P=>{let L;const V=P.attributes&&P.attributes.RESOLUTION&&P.attributes.RESOLUTION.width,$=P.attributes&&P.attributes.RESOLUTION&&P.attributes.RESOLUTION.height;return L=P.attributes&&P.attributes.BANDWIDTH,L=L||O.Number.MAX_VALUE,{bandwidth:L,width:V,height:$,playlist:P}});yl(c,(P,L)=>P.bandwidth-L.bandwidth),c=c.filter(P=>!Qa.isIncompatible(P.playlist));let d=c.filter(P=>Qa.isEnabled(P.playlist));d.length||(d=c.filter(P=>!Qa.isDisabled(P.playlist)));const u=d.filter(P=>P.bandwidth*ua.BANDWIDTH_VARIANCE<t);let h=u[u.length-1];const m=u.filter(P=>P.bandwidth===h.bandwidth)[0];if(n===!1){const P=m||d[0]||c[0];if(P&&P.playlist){let L="sortedPlaylistReps";return m&&(L="bandwidthBestRep"),d[0]&&(L="enabledPlaylistReps"),fm(`choosing ${qx(P)} using ${L} with options`,o),P.playlist}return fm("could not choose a playlist with options",o),null}const p=u.filter(P=>P.width&&P.height);yl(p,(P,L)=>P.width-L.width);const f=p.filter(P=>P.width===a&&P.height===i);h=f[f.length-1];const y=f.filter(P=>P.bandwidth===h.bandwidth)[0];let b,E,D;y||(b=p.filter(P=>P.width>a||P.height>i),E=b.filter(P=>P.width===b[0].width&&P.height===b[0].height),h=E[E.length-1],D=E.filter(P=>P.bandwidth===h.bandwidth)[0]);let M;if(r.leastPixelDiffSelector){const P=p.map(L=>(L.pixelDiff=Math.abs(L.width-a)+Math.abs(L.height-i),L));yl(P,(L,V)=>L.pixelDiff===V.pixelDiff?V.bandwidth-L.bandwidth:L.pixelDiff-V.pixelDiff),M=P[0]}const N=M||D||y||m||d[0]||c[0];if(N&&N.playlist){let P="sortedPlaylistReps";return M?P="leastPixelDiffRep":D?P="resolutionPlusOneRep":y?P="resolutionBestRep":m?P="bandwidthBestRep":d[0]&&(P="enabledPlaylistReps"),fm(`choosing ${qx(N)} using ${P} with options`,o),N.playlist}return fm("could not choose a playlist with options",o),null};const Gx=function(){const e=this.useDevicePixelRatio&&O.devicePixelRatio||1;return Wx(this.playlists.main,this.systemBandwidth,parseInt(gm(this.tech_.el(),"width"),10)*e,parseInt(gm(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)},eye=function(e){let t=-1,a=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){const i=this.useDevicePixelRatio&&O.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,a=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==a&&(t=e*this.systemBandwidth+(1-e)*t,a=this.systemBandwidth),Wx(this.playlists.main,t,parseInt(gm(this.tech_.el(),"width"),10)*i,parseInt(gm(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)}},tye=function(e){const{main:t,currentTime:a,bandwidth:i,duration:n,segmentDuration:r,timeUntilRebuffer:o,currentTimeline:l,syncController:c}=e,d=t.playlists.filter(p=>!Qa.isIncompatible(p));let u=d.filter(Qa.isEnabled);u.length||(u=d.filter(p=>!Qa.isDisabled(p)));const h=u.filter(Qa.hasAttribute.bind(null,"BANDWIDTH")).map(p=>{const f=c.getSyncPoint(p,n,l,a)?1:2,y=Qa.estimateSegmentRequestTime(r,i,p)*f-o;return{playlist:p,rebufferingImpact:y}}),m=h.filter(p=>p.rebufferingImpact<=0);return yl(m,(p,f)=>r2(f.playlist,p.playlist)),m.length?m[0]:(yl(h,(p,f)=>p.rebufferingImpact-f.rebufferingImpact),h[0]||null)},aye=function(){const e=this.playlists.main.playlists.filter(Qa.isEnabled);return yl(e,(t,a)=>r2(t,a)),e.filter(t=>!!Hd(this.playlists.main,t).video)[0]||null},iye=e=>{let t=0,a;return e.bytes&&(a=new Uint8Array(e.bytes),e.segments.forEach(i=>{a.set(i,t),t+=i.byteLength})),a},nye=function(e,t,a){if(!e[a]){t.trigger({type:"usage",name:"vhs-608"});let i=a;/^cc708_/.test(a)&&(i="SERVICE"+a.split("_")[1]);const n=t.textTracks().getTrackById(i);if(n)e[a]=n;else{const r=t.options_.vhs&&t.options_.vhs.captionServices||{};let o=a,l=a,c=!1;const d=r[i];d&&(o=d.label,l=d.language,c=d.default),e[a]=t.addRemoteTextTrack({kind:"captions",id:i,default:c,label:o,language:l},!1).track}}},rye=function({inbandTextTracks:e,captionArray:t,timestampOffset:a}){if(!t)return;const i=O.WebKitDataCue||O.VTTCue;t.forEach(n=>{const r=n.stream;n.content?n.content.forEach(o=>{const l=new i(n.startTime+a,n.endTime+a,o.text);l.line=o.line,l.align="left",l.position=o.position,l.positionAlign="line-left",e[r].addCue(l)}):e[r].addCue(new i(n.startTime+a,n.endTime+a,n.text))})},sye=function(e){Object.defineProperties(e.frame,{id:{get(){return ge.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get(){return ge.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get(){return ge.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},oye=({inbandTextTracks:e,metadataArray:t,timestampOffset:a,videoDuration:i})=>{if(!t)return;const n=O.WebKitDataCue||O.VTTCue,r=e.metadataTrack_;if(!r||(t.forEach(u=>{const h=u.cueTime+a;typeof h!="number"||O.isNaN(h)||h<0||!(h<1/0)||!u.frames||!u.frames.length||u.frames.forEach(m=>{const p=new n(h,h,m.value||m.url||m.data||"");p.frame=m,p.value=m,sye(p),r.addCue(p)})}),!r.cues||!r.cues.length))return;const o=r.cues,l=[];for(let u=0;u<o.length;u++)o[u]&&l.push(o[u]);const c=l.reduce((u,h)=>{const m=u[h.startTime]||[];return m.push(h),u[h.startTime]=m,u},{}),d=Object.keys(c).sort((u,h)=>Number(u)-Number(h));d.forEach((u,h)=>{const m=c[u],p=isFinite(i)?i:u,f=Number(d[h+1])||p;m.forEach(y=>{y.endTime=f})})},lye={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},cye=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),dye=({inbandTextTracks:e,dateRanges:t})=>{const a=e.metadataTrack_;if(!a)return;const i=O.WebKitDataCue||O.VTTCue;t.forEach(n=>{for(const r of Object.keys(n)){if(cye.has(r))continue;const o=new i(n.startTime,n.endTime,"");o.id=n.id,o.type="com.apple.quicktime.HLS",o.value={key:lye[r],data:n[r]},(r==="scte35Out"||r==="scte35In")&&(o.value.data=new Uint8Array(o.value.data.match(/[\da-f]{2}/gi)).buffer),a.addCue(o)}n.processDateRange()})},Kx=(e,t,a)=>{e.metadataTrack_||(e.metadataTrack_=a.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,ge.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},qd=function(e,t,a){let i,n;if(a&&a.cues)for(i=a.cues.length;i--;)n=a.cues[i],n.startTime>=e&&n.endTime<=t&&a.removeCue(n)},uye=function(e){const t=e.cues;if(!t)return;const a={};for(let i=t.length-1;i>=0;i--){const n=t[i],r=`${n.startTime}-${n.endTime}-${n.text}`;a[r]?e.removeCue(n):a[r]=n}},hye=(e,t,a)=>{if(typeof t>"u"||t===null||!e.length)return[];const i=Math.ceil((t-a+3)*ws.ONE_SECOND_IN_TS);let n;for(n=0;n<e.length&&!(e[n].pts>i);n++);return e.slice(n)},pye=(e,t,a)=>{if(!t.length)return e;if(a)return t.slice();const i=t[0].pts;let n=0;for(n;n<e.length&&!(e[n].pts>=i);n++);return e.slice(0,n).concat(t)},mye=(e,t,a,i)=>{const n=Math.ceil((t-i)*ws.ONE_SECOND_IN_TS),r=Math.ceil((a-i)*ws.ONE_SECOND_IN_TS),o=e.slice();let l=e.length;for(;l--&&!(e[l].pts<=r););if(l===-1)return o;let c=l+1;for(;c--&&!(e[c].pts<=n););return c=Math.max(c,0),o.splice(c,l-c+1),o},fye=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const a=Object.keys(e).sort(),i=Object.keys(t).sort();if(a.length!==i.length)return!1;for(let n=0;n<a.length;n++){const r=a[n];if(r!==i[n]||e[r]!==t[r])return!1}return!0},Xx=22,gye=function(e,t,a){t=t||[];const i=[];let n=0;for(let r=0;r<t.length;r++){const o=t[r];if(e===o.timeline&&(i.push(r),n+=o.duration,n>a))return r}return i.length===0?0:i[i.length-1]},Wd=1,yye=500,Jx=e=>typeof e=="number"&&isFinite(e),ym=1/60,_ye=(e,t,a)=>e!=="main"||!t||!a?null:!a.hasAudio&&!a.hasVideo?"Neither audio nor video found in segment.":t.hasVideo&&!a.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&a.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,bye=(e,t,a)=>{let i=t-ua.BACK_BUFFER_LENGTH;e.length&&(i=Math.max(i,e.start(0)));const n=t-a;return Math.min(n,i)},_l=e=>{const{startOfSegment:t,duration:a,segment:i,part:n,playlist:{mediaSequence:r,id:o,segments:l=[]},mediaIndex:c,partIndex:d,timeline:u}=e,h=l.length-1;let m="mediaIndex/partIndex increment";e.getMediaInfoForTime?m=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(m="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(m+=` with independent ${e.independent}`);const p=typeof d=="number",f=e.segment.uri?"segment":"pre-segment",y=p?rx({preloadSegment:i})-1:0;return`${f} [${r+c}/${r+h}]`+(p?` part [${d}/${y}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(p?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${t}] duration [${a}] timeline [${u}] selected by [${m}] playlist [${o}]`},Yx=e=>`${e}TimingInfo`,vye=({segmentTimeline:e,currentTimeline:t,startOfSegment:a,buffered:i,overrideCheck:n})=>!n&&e===t?null:e<t?a:i.length?i.end(i.length-1):a,Qx=({timelineChangeController:e,currentTimeline:t,segmentTimeline:a,loaderType:i,audioDisabled:n})=>{if(t===a)return!1;if(i==="audio"){const r=e.lastTimelineChange({type:"main"});return!r||r.to!==a}if(i==="main"&&n){const r=e.pendingTimelineChange({type:"audio"});return!(r&&r.to===a)}return!1},Sye=e=>{let t=0;return["video","audio"].forEach(function(a){const i=e[`${a}TimingInfo`];if(!i)return;const{start:n,end:r}=i;let o;typeof n=="bigint"||typeof r=="bigint"?o=O.BigInt(r)-O.BigInt(n):typeof n=="number"&&typeof r=="number"&&(o=r-n),typeof o<"u"&&o>t&&(t=o)}),typeof t=="bigint"&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t},Zx=({segmentDuration:e,maxDuration:t})=>e?Math.round(e)>t+xn:!1,wye=(e,t)=>{if(t!=="hls")return null;const a=Sye({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!a)return null;const i=e.playlist.targetDuration,n=Zx({segmentDuration:a,maxDuration:i*2}),r=Zx({segmentDuration:a,maxDuration:i}),o=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${a} when the reported duration is ${e.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return n||r?{severity:n?"warn":"info",message:o}:null};let s2=class extends ge.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=Oi(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(a){a!==this.state_&&(this.logger_(`${this.state_} -> ${a}`),this.state_=a,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})}createTransmuxer_(){return a2.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,O.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&a2.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Ya();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:a,isMuxed:i}=e;if(a&&t&&!this.audioDisabled_&&!i)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const a=pm(e);let i=this.initSegments_[a];return t&&!i&&e.bytes&&(this.initSegments_[a]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),i||e}segmentKey(e,t=!1){if(!e)return null;const a=Tx(e);let i=this.keyCache_[a];this.cacheEncryptionKeys_&&t&&!i&&e.bytes&&(this.keyCache_[a]=i={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(i||e).resolvedUri};return i&&(n.bytes=i.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const a=this.playlist_,i=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(a&&(a.id?n=a.id:a.uri&&(n=a.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.syncController_.updateMediaSequenceMap(e,this.currentTime_(),this.loaderType_),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const r=e.mediaSequence-a.mediaSequence;if(this.logger_(`live window shift [${r}]`),this.mediaIndex!==null)if(this.mediaIndex-=r,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=l}}i&&(i.mediaIndex-=r,i.mediaIndex<0?(i.mediaIndex=null,i.partIndex=null):(i.mediaIndex>=0&&(i.segment=e.segments[i.mediaIndex]),i.partIndex>=0&&i.segment.parts&&(i.part=i.segment.parts[i.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,e)}pause(){this.checkBufferTimeout_&&(O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.resyncLoader()}resyncLoader(){this.transmuxer_&&a2.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.shouldForceTimestampOffsetAfterResync_=!0,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,a=()=>{},i=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const r=()=>{n--,n===0&&a()};(i||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,r)),(i||this.loaderType_==="main")&&(this.gopBuffer_=mye(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,r));for(const o in this.inbandTextTracks_)qd(e,t,this.inbandTextTracks_[o]);qd(e,t,this.segmentMetadataTrack_),r()}monitorBuffer_(){this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O.setTimeout(this.monitorBufferTick_.bind(this),yye)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&(typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,a=this.partIndex){if(!t||!this.mediaSource_)return!1;const i=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,r=!i||!i.parts||a+1===i.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&r}chooseNextRequest_(){const e=this.buffered_(),t=ix(e)||0,a=qb(e,this.currentTime_()),i=!this.hasPlayed_()&&a>=1,n=a>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||i||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=gye(this.currentTimeline_,r,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const h=r[this.mediaIndex],m=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=h.end?h.end:t,h.parts&&h.parts[m+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=m+1):o.mediaIndex=this.mediaIndex+1}else{const{segmentIndex:h,startTime:m,partIndex:p}=Qa.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${t}`:`currentTime ${this.currentTime_()}`,o.mediaIndex=h,o.startOfSegment=m,o.partIndex=p,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const l=r[o.mediaIndex];let c=l&&typeof o.partIndex=="number"&&l.parts&&l.parts[o.partIndex];if(!l||typeof o.partIndex=="number"&&!c)return null;typeof o.partIndex!="number"&&l.parts&&(o.partIndex=0,c=l.parts[0]);const d=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!a&&c&&!d&&!c.independent)if(o.partIndex===0){const h=r[o.mediaIndex-1],m=h.parts&&h.parts.length&&h.parts[h.parts.length-1];m&&m.independent&&(o.mediaIndex-=1,o.partIndex=h.parts.length-1,o.independent="previous segment")}else l.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const u=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=r.length-1&&u&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}generateSegmentInfo_(e){const{independent:t,playlist:a,mediaIndex:i,startOfSegment:n,isSyncRequest:r,partIndex:o,forceTimestampOffset:l,getMediaInfoForTime:c}=e,d=a.segments[i],u=typeof o=="number"&&d.parts[o],h={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||d.resolvedUri,mediaIndex:i,partIndex:u?o:null,isSyncRequest:r,startOfSegment:n,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:d.timeline,duration:u&&u.duration||d.duration,segment:d,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:c,independent:t},m=typeof l<"u"?l:this.isPendingTimestampOffset_;h.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:d.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:m});const p=ix(this.sourceUpdater_.audioBuffered());return typeof p=="number"&&(h.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(h.gopsToAlignWith=hye(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),h}timestampOffsetForSegment_(e){return vye(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),a=e.bandwidth,i=this.pendingSegment_.duration,n=Qa.estimateSegmentRequestTime(i,a,this.playlist_,e.bytesReceived),r=Wfe(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=r)return;const o=tye({main:this.vhs_.playlists.main,currentTime:t,bandwidth:a,duration:this.duration_(),segmentDuration:i,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const l=n-r-o.rebufferingImpact;let c=.5;r<=xn&&(c=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||l<c)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*ua.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${_l(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},fye(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))}handleTimingInfo_(e,t,a,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,r=Yx(t);n[r]=n[r]||{},n[r][a]=i,this.logger_(`timinginfo: ${t} - ${a} - ${i}`),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const a=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),i={};t.forEach(n=>{i[n.stream]=i[n.stream]||{startTime:1/0,captions:[],endTime:0};const r=i[n.stream];r.startTime=Math.min(r.startTime,n.startTime+a),r.endTime=Math.max(r.endTime,n.endTime+a),r.captions.push(n)}),Object.keys(i).forEach(n=>{const{startTime:r,endTime:o,captions:l}=i[n],c=this.inbandTextTracks_;this.logger_(`adding cues from ${r} -> ${o} for ${n}`),nye(c,this.vhs_.tech_,n),qd(r,o,c[n]),rye({captionArray:l,inbandTextTracks:c,timestampOffset:a})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,a){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,a));return}this.addMetadataToTextTrack(a,t,this.duration_())}}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Qx({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:a,hasVideo:i,isMuxed:n}=t;return!(i&&!e.videoTimingInfo||a&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Qx({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}const a=this.pendingSegment_;if(this.setTimeMapping_(a.timeline),this.updateMediaSecondsLoaded_(a.part||a.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),a.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),a.isFmp4=e.isFmp4,a.timingInfo=a.timingInfo||{},a.isFmp4)this.trigger("fmp4"),a.timingInfo.start=a[Yx(t.type)].start;else{const i=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&i&&i.hasVideo;let r;n&&(r=a.videoTimingInfo.start),a.timingInfo.start=this.trueSegmentStart_({currentStart:a.timingInfo.start,playlist:a.playlist,mediaIndex:a.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:r,videoTimingInfo:a.videoTimingInfo,audioTimingInfo:a.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(a,t.type),this.updateSourceBufferTimestampOffset_(a),a.isSyncRequest){this.updateTimingInfoEnd_(a),this.syncController_.saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:this.loaderType_==="main"});const i=this.chooseNextRequest_();if(i.mediaIndex!==a.mediaIndex||i.partIndex!==a.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}a.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(a,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:a,playlist:i}){if(a){const n=pm(a);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(a,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=i,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:a},i){const n=this.sourceUpdater_.audioBuffered(),r=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ns(n).join(", ")),r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ns(r).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,c=r.length?r.start(0):0,d=r.length?r.end(r.length-1):0;if(l-o<=Wd&&d-c<=Wd){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${a.byteLength}, audio buffer: ${Ns(n).join(", ")}, video buffer: ${Ns(r).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:a}));const u=this.currentTime_()-Wd;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${u}`),this.remove(0,u,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Wd}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=O.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Wd*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:a},i){if(i){if(i.code===Xx){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:a});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",i),this.error(`${t} append of ${a.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:a,data:i,bytes:n}){if(!n){const r=[i];let o=i.byteLength;a&&(r.unshift(a),o+=a.byteLength),n=iye({bytes:o,segments:r})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,a){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const i=this.pendingSegment_.segment,n=`${e}TimingInfo`;i[n]||(i[n]={}),i[n].transmuxerPrependedSeconds=a.prependedContentDuration||0,i[n].transmuxedPresentationStart=a.start.presentation,i[n].transmuxedDecodeStart=a.start.decode,i[n].transmuxedPresentationEnd=a.end.presentation,i[n].transmuxedDecodeEnd=a.end.decode,i[n].baseMediaDecodeTime=a.baseMediaDecodeTime}appendData_(e,t){const{type:a,data:i}=t;if(!i||!i.byteLength||a==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:a,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:a,initSegment:n,data:i})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(()=>{const t=Ht({},e,{forceTimestampOffset:!0});Ht(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),a=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),i=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,r=a||i&&n;this.logger_(`Requesting ${_l(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Jge({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:l,stream:c})=>{this.logger_(`${_l(e)} logged from transmuxer stream ${c} as a ${l}: ${o}`)}})}trimBackBuffer_(e){const t=bye(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,a=e.part,i={resolvedUri:a?a.resolvedUri:t.resolvedUri,byterange:a?a.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},n=e.playlist.segments[e.mediaIndex-1];if(n&&n.timeline===t.timeline&&(n.videoTimingInfo?i.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd:n.audioTimingInfo&&(i.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd)),t.key){const r=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);i.key=this.segmentKey(t.key),i.key.iv=r}return t.map&&(i.map=this.initSegmentForMap(t.map)),i}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<ym){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${ym}`);return}this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,a){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,a));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===An.ABORTED)return;if(this.pause(),e.code===An.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const i=this.pendingSegment_;this.saveBandwidthRelatedStats_(i.duration,t.stats),i.endOfAllRequests=t.endOfAllRequests,a.gopInfo&&(this.gopBuffer_=pye(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(i)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:a,firstVideoFrameTimeForData:i,currentVideoTimestampOffset:n,useVideoTimingInfo:r,videoTimingInfo:o,audioTimingInfo:l}){if(typeof e<"u")return e;if(!r)return l.start;const c=t.segments[a-1];return a===0||!c||typeof c.start>"u"||c.end!==i+n?i:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:a,hasVideo:i,isMuxed:n}=t,r=this.loaderType_==="main"&&i,o=!this.audioDisabled_&&a&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}r&&e.waitingOnAppends++,o&&e.waitingOnAppends++,r&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=_ye(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:a}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:a.start:a.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),a=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;a&&(e.timingInfo.end=typeof a.end=="number"?a.end:a.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=wye(e,this.sourceType_);if(t&&(t.severity==="warn"?ge.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${_l(e)}`);return}this.logger_(`Appended ${_l(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const a=e.segment,i=e.part,n=a.end&&this.currentTime_()-a.end>e.playlist.targetDuration*3,r=i&&i.end&&this.currentTime_()-i.end>e.playlist.partTargetDuration*3;if(n||r){this.logger_(`bad ${n?"segment":"part"} ${_l(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<ym){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${ym}`);return}const t=this.throughput.rate,a=Date.now()-e.endOfAllRequests+1,i=Math.floor(e.byteLength/a*8*1e3);this.throughput.rate+=(i-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,a=t.start,i=t.end;if(!Jx(a)||!Jx(i))return;qd(a,i,this.segmentMetadataTrack_);const n=O.WebKitDataCue||O.VTTCue,r={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:a,end:i},o=JSON.stringify(r),l=new n(a,i,o);l.value=r,this.segmentMetadataTrack_.addCue(l)}};function nr(){}const $x=function(e){return typeof e!="string"?e:e.replace(/./,t=>t.toUpperCase())},Tye=["video","audio"],o2=(e,t)=>{const a=t[`${e}Buffer`];return a&&a.updating||t.queuePending[e]},Cye=(e,t)=>{for(let a=0;a<t.length;a++){const i=t[a];if(i.type==="mediaSource")return null;if(i.type===e)return a}return null},bl=(e,t)=>{if(t.queue.length===0)return;let a=0,i=t.queue[a];if(i.type==="mediaSource"){!t.updating()&&t.mediaSource.readyState!=="closed"&&(t.queue.shift(),i.action(t),i.doneFn&&i.doneFn(),bl("audio",t),bl("video",t));return}if(e!=="mediaSource"&&!(!t.ready()||t.mediaSource.readyState==="closed"||o2(e,t))){if(i.type!==e){if(a=Cye(e,t.queue),a===null)return;i=t.queue[a]}if(t.queue.splice(a,1),t.queuePending[e]=i,i.action(e,t),!i.doneFn){t.queuePending[e]=null,bl(e,t);return}}},e6=(e,t)=>{const a=t[`${e}Buffer`],i=$x(e);a&&(a.removeEventListener("updateend",t[`on${i}UpdateEnd_`]),a.removeEventListener("error",t[`on${i}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},Pn=(e,t)=>e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1,hi={appendBuffer:(e,t,a)=>(i,n)=>{const r=n[`${i}Buffer`];if(Pn(n.mediaSource,r)){n.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${i}Buffer`);try{r.appendBuffer(e)}catch(o){n.logger_(`Error with code ${o.code} `+(o.code===Xx?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${i}Buffer`),n.queuePending[i]=null,a(o)}}},remove:(e,t)=>(a,i)=>{const n=i[`${a}Buffer`];if(Pn(i.mediaSource,n)){i.logger_(`Removing ${e} to ${t} from ${a}Buffer`);try{n.remove(e,t)}catch{i.logger_(`Remove ${e} to ${t} from ${a}Buffer failed`)}}},timestampOffset:e=>(t,a)=>{const i=a[`${t}Buffer`];Pn(a.mediaSource,i)&&(a.logger_(`Setting ${t}timestampOffset to ${e}`),i.timestampOffset=e)},callback:e=>(t,a)=>{e()},endOfStream:e=>t=>{if(t.mediaSource.readyState==="open"){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(a){ge.log.warn("Failed to call media source endOfStream",a)}}},duration:e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(a){ge.log.warn("Failed to set media source duration",a)}},abort:()=>(e,t)=>{if(t.mediaSource.readyState!=="open")return;const a=t[`${e}Buffer`];if(Pn(t.mediaSource,a)){t.logger_(`calling abort on ${e}Buffer`);try{a.abort()}catch(i){ge.log.warn(`Failed to abort on ${e}Buffer`,i)}}},addSourceBuffer:(e,t)=>a=>{const i=$x(e),n=hd(t);a.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const r=a.mediaSource.addSourceBuffer(n);r.addEventListener("updateend",a[`on${i}UpdateEnd_`]),r.addEventListener("error",a[`on${i}Error_`]),a.codecs[e]=t,a[`${e}Buffer`]=r},removeSourceBuffer:e=>t=>{const a=t[`${e}Buffer`];if(e6(e,t),!!Pn(t.mediaSource,a)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(a)}catch(i){ge.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,i)}}},changeType:e=>(t,a)=>{const i=a[`${t}Buffer`],n=hd(e);if(Pn(a.mediaSource,i)&&a.codecs[t]!==e){a.logger_(`changing ${t}Buffer codec from ${a.codecs[t]} to ${e}`);try{i.changeType(n),a.codecs[t]=e}catch(r){ge.log.warn(`Failed to changeType on ${t}Buffer`,r)}}}},pi=({type:e,sourceUpdater:t,action:a,doneFn:i,name:n})=>{t.queue.push({type:e,action:a,doneFn:i,name:n}),bl(e,t)},t6=(e,t)=>a=>{if(t.queuePending[e]){const i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`])}bl(e,t)};let a6=class extends ge.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>bl("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Oi("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=t6("video",this),this.onAudioUpdateEnd_=t6("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){pi({type:"mediaSource",sourceUpdater:this,action:hi.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){pi({type:e,sourceUpdater:this,action:hi.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){ge.log.error("removeSourceBuffer is not supported!");return}pi({type:"mediaSource",sourceUpdater:this,action:hi.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!ge.browser.IS_FIREFOX&&O.MediaSource&&O.MediaSource.prototype&&typeof O.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return O.SourceBuffer&&O.SourceBuffer.prototype&&typeof O.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){ge.log.error("changeType is not supported!");return}pi({type:e,sourceUpdater:this,action:hi.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const a=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,a);this.canChangeType()&&this.changeType(t,a)})}appendBuffer(e,t){const{segmentInfo:a,type:i,bytes:n}=e;if(this.processedAppend_=!0,i==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const r=t;if(pi({type:i,sourceUpdater:this,action:hi.appendBuffer(n,a||{mediaIndex:-1},r),doneFn:t,name:"appendBuffer"}),i==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(l=>{this.appendBuffer.apply(this,l)})}}audioBuffered(){return Pn(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Ya()}videoBuffered(){return Pn(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Ya()}buffered(){const e=Pn(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Pn(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():qfe(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=nr){pi({type:"mediaSource",sourceUpdater:this,action:hi.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=nr){typeof e!="string"&&(e=void 0),pi({type:"mediaSource",sourceUpdater:this,action:hi.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,a=nr){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){a();return}pi({type:"audio",sourceUpdater:this,action:hi.remove(e,t),doneFn:a,name:"remove"})}removeVideo(e,t,a=nr){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){a();return}pi({type:"video",sourceUpdater:this,action:hi.remove(e,t),doneFn:a,name:"remove"})}updating(){return!!(o2("audio",this)||o2("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(pi({type:"audio",sourceUpdater:this,action:hi.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset!==e&&(pi({type:"video",sourceUpdater:this,action:hi.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&pi({type:"audio",sourceUpdater:this,action:hi.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&pi({type:"video",sourceUpdater:this,action:hi.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),Tye.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>e6(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}};const i6=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),kye=e=>{const t=new Uint8Array(e);return Array.from(t).map(a=>a.toString(16).padStart(2,"0")).join("")},n6=new Uint8Array(`
251
+ `),this.pushCaption(v),v.startPts=g},st.prototype.pushCaption=function(g){g.text!==""&&(this.trigger("data",{startPts:g.startPts,endPts:g.endPts,text:g.text,stream:"cc708_"+g.serviceNum}),g.text="",g.startPts=g.endPts)},st.prototype.displayWindows=function(g,v){var T=this.current708Packet.data,S=T[++g],x=this.getPts(g);this.flushDisplayed(x,v);for(var A=0;A<8;A++)S&1<<A&&(v.windows[A].visible=1);return g},st.prototype.hideWindows=function(g,v){var T=this.current708Packet.data,S=T[++g],x=this.getPts(g);this.flushDisplayed(x,v);for(var A=0;A<8;A++)S&1<<A&&(v.windows[A].visible=0);return g},st.prototype.toggleWindows=function(g,v){var T=this.current708Packet.data,S=T[++g],x=this.getPts(g);this.flushDisplayed(x,v);for(var A=0;A<8;A++)S&1<<A&&(v.windows[A].visible^=1);return g},st.prototype.clearWindows=function(g,v){var T=this.current708Packet.data,S=T[++g],x=this.getPts(g);this.flushDisplayed(x,v);for(var A=0;A<8;A++)S&1<<A&&v.windows[A].clearText();return g},st.prototype.deleteWindows=function(g,v){var T=this.current708Packet.data,S=T[++g],x=this.getPts(g);this.flushDisplayed(x,v);for(var A=0;A<8;A++)S&1<<A&&v.windows[A].reset();return g},st.prototype.setPenAttributes=function(g,v){var T=this.current708Packet.data,S=T[g],x=v.currentWindow.penAttr;return S=T[++g],x.textTag=(S&240)>>4,x.offset=(S&12)>>2,x.penSize=S&3,S=T[++g],x.italics=(S&128)>>7,x.underline=(S&64)>>6,x.edgeType=(S&56)>>3,x.fontStyle=S&7,g},st.prototype.setPenColor=function(g,v){var T=this.current708Packet.data,S=T[g],x=v.currentWindow.penColor;return S=T[++g],x.fgOpacity=(S&192)>>6,x.fgRed=(S&48)>>4,x.fgGreen=(S&12)>>2,x.fgBlue=S&3,S=T[++g],x.bgOpacity=(S&192)>>6,x.bgRed=(S&48)>>4,x.bgGreen=(S&12)>>2,x.bgBlue=S&3,S=T[++g],x.edgeRed=(S&48)>>4,x.edgeGreen=(S&12)>>2,x.edgeBlue=S&3,g},st.prototype.setPenLocation=function(g,v){var T=this.current708Packet.data,S=T[g],x=v.currentWindow.penLoc;return v.currentWindow.pendingNewLine=!0,S=T[++g],x.row=S&15,S=T[++g],x.column=S&63,g},st.prototype.reset=function(g,v){var T=this.getPts(g);return this.flushDisplayed(T,v),this.initService(v.serviceNum,g)};var Dt={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},br=function(g){return g===null?"":(g=Dt[g]||g,String.fromCharCode(g))},zt=14,Av=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],vr=function(){for(var g=[],v=zt+1;v--;)g.push({text:"",indent:0,offset:0});return g},Et=function(g,v){Et.prototype.init.call(this),this.field_=g||0,this.dataChannel_=v||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(T){var S,x,A,j,q;if(S=T.ccData&32639,S===this.lastControlCode_){this.lastControlCode_=null;return}if((S&61440)===4096?this.lastControlCode_=S:S!==this.PADDING_&&(this.lastControlCode_=null),A=S>>>8,j=S&255,S!==this.PADDING_)if(S===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(S===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(T.pts),this.flushDisplayed(T.pts),x=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=x,this.startPts_=T.pts;else if(S===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(T.pts);else if(S===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(T.pts);else if(S===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(T.pts);else if(S===this.CARRIAGE_RETURN_)this.clearFormatting(T.pts),this.flushDisplayed(T.pts),this.shiftRowsUp_(),this.startPts_=T.pts;else if(S===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(S===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(T.pts),this.displayed_=vr();else if(S===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=vr();else if(S===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(T.pts),this.displayed_=vr()),this.mode_="paintOn",this.startPts_=T.pts;else if(this.isSpecialCharacter(A,j))A=(A&3)<<8,q=br(A|j),this[this.mode_](T.pts,q),this.column_++;else if(this.isExtCharacter(A,j))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),A=(A&3)<<8,q=br(A|j),this[this.mode_](T.pts,q),this.column_++;else if(this.isMidRowCode(A,j))this.clearFormatting(T.pts),this[this.mode_](T.pts," "),this.column_++,(j&14)===14&&this.addFormatting(T.pts,["i"]),(j&1)===1&&this.addFormatting(T.pts,["u"]);else if(this.isOffsetControlCode(A,j)){const Q=j&3;this.nonDisplayed_[this.row_].offset=Q,this.column_+=Q}else if(this.isPAC(A,j)){var G=Av.indexOf(S&7968);if(this.mode_==="rollUp"&&(G-this.rollUpRows_+1<0&&(G=this.rollUpRows_-1),this.setRollUp(T.pts,G)),G!==this.row_&&(this.clearFormatting(T.pts),this.row_=G),j&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(T.pts,["u"]),(S&16)===16){const Q=(S&14)>>1;this.column_=Q*4,this.nonDisplayed_[this.row_].indent+=Q}this.isColorPAC(j)&&(j&14)===14&&this.addFormatting(T.pts,["i"])}else this.isNormalChar(A)&&(j===0&&(j=null),q=br(A),q+=br(j),this[this.mode_](T.pts,q),this.column_+=q.length)}};Et.prototype=new ns,Et.prototype.flushDisplayed=function(g){const v=S=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+S+"."})},T=[];this.displayed_.forEach((S,x)=>{if(S&&S.text&&S.text.length){try{S.text=S.text.trim()}catch{v(x)}S.text.length&&T.push({text:S.text,line:x+1,position:10+Math.min(70,S.indent*10)+S.offset*2.5})}else S==null&&v(x)}),T.length&&this.trigger("data",{startPts:this.startPts_,endPts:g,content:T,stream:this.name_})},Et.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=vr(),this.nonDisplayed_=vr(),this.lastControlCode_=null,this.column_=0,this.row_=zt,this.rollUpRows_=2,this.formatting_=[]},Et.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},Et.prototype.isSpecialCharacter=function(g,v){return g===this.EXT_&&v>=48&&v<=63},Et.prototype.isExtCharacter=function(g,v){return(g===this.EXT_+1||g===this.EXT_+2)&&v>=32&&v<=63},Et.prototype.isMidRowCode=function(g,v){return g===this.EXT_&&v>=32&&v<=47},Et.prototype.isOffsetControlCode=function(g,v){return g===this.OFFSET_&&v>=33&&v<=35},Et.prototype.isPAC=function(g,v){return g>=this.BASE_&&g<this.BASE_+8&&v>=64&&v<=127},Et.prototype.isColorPAC=function(g){return g>=64&&g<=79||g>=96&&g<=127},Et.prototype.isNormalChar=function(g){return g>=32&&g<=127},Et.prototype.setRollUp=function(g,v){if(this.mode_!=="rollUp"&&(this.row_=zt,this.mode_="rollUp",this.flushDisplayed(g),this.nonDisplayed_=vr(),this.displayed_=vr()),v!==void 0&&v!==this.row_)for(var T=0;T<this.rollUpRows_;T++)this.displayed_[v-T]=this.displayed_[this.row_-T],this.displayed_[this.row_-T]={text:"",indent:0,offset:0};v===void 0&&(v=this.row_),this.topRow_=v-this.rollUpRows_+1},Et.prototype.addFormatting=function(g,v){this.formatting_=this.formatting_.concat(v);var T=v.reduce(function(S,x){return S+"<"+x+">"},"");this[this.mode_](g,T)},Et.prototype.clearFormatting=function(g){if(this.formatting_.length){var v=this.formatting_.reverse().reduce(function(T,S){return T+"</"+S+">"},"");this.formatting_=[],this[this.mode_](g,v)}},Et.prototype.popOn=function(g,v){var T=this.nonDisplayed_[this.row_].text;T+=v,this.nonDisplayed_[this.row_].text=T},Et.prototype.rollUp=function(g,v){var T=this.displayed_[this.row_].text;T+=v,this.displayed_[this.row_].text=T},Et.prototype.shiftRowsUp_=function(){var g;for(g=0;g<this.topRow_;g++)this.displayed_[g]={text:"",indent:0,offset:0};for(g=this.row_+1;g<zt+1;g++)this.displayed_[g]={text:"",indent:0,offset:0};for(g=this.topRow_;g<this.row_;g++)this.displayed_[g]=this.displayed_[g+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},Et.prototype.paintOn=function(g,v){var T=this.displayed_[this.row_].text;T+=v,this.displayed_[this.row_].text=T};var tc={CaptionStream:oa,Cea608Stream:Et,Cea708Stream:st},Hs={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Nf=a,Af=8589934592,ac=4294967296,Pf="shared",rs=function(g,v){var T=1;for(g>v&&(T=-1);Math.abs(v-g)>ac;)g+=T*Af;return g},ic=function(g){var v,T;ic.prototype.init.call(this),this.type_=g||Pf,this.push=function(S){if(S.type==="metadata"){this.trigger("data",S);return}this.type_!==Pf&&S.type!==this.type_||(T===void 0&&(T=S.dts),S.dts=rs(S.dts,T),S.pts=rs(S.pts,T),v=S.dts,this.trigger("data",S))},this.flush=function(){T=v,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){T=void 0,v=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ic.prototype=new Nf;var qs={TimestampRolloverStream:ic,handleRollover:rs},Pv=(g,v,T)=>{if(!g)return-1;for(var S=T;S<g.length;S++)if(g[S]===v)return S;return-1},Ov={typedArrayIndexOf:Pv},Sr=Ov.typedArrayIndexOf,Vn={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},Ws=function(g,v,T){var S,x="";for(S=v;S<T;S++)x+="%"+("00"+g[S].toString(16)).slice(-2);return x},Mi=function(g,v,T){return decodeURIComponent(Ws(g,v,T))},wr=function(g,v,T){return unescape(Ws(g,v,T))},ss=function(g){return g[0]<<21|g[1]<<14|g[2]<<7|g[3]},Tr={APIC:function(g){var v=1,T,S,x="-->";g.data[0]===Vn.Utf8&&(T=Sr(g.data,0,v),!(T<0)&&(g.mimeType=wr(g.data,v,T),v=T+1,g.pictureType=g.data[v],v++,S=Sr(g.data,0,v),!(S<0)&&(g.description=Mi(g.data,v,S),v=S+1,g.mimeType===x?g.url=wr(g.data,v,g.data.length):g.pictureData=g.data.subarray(v,g.data.length))))},"T*":function(g){g.data[0]===Vn.Utf8&&(g.value=Mi(g.data,1,g.data.length).replace(/\0*$/,""),g.values=g.value.split("\0"))},TXXX:function(g){var v;g.data[0]===Vn.Utf8&&(v=Sr(g.data,0,1),v!==-1&&(g.description=Mi(g.data,1,v),g.value=Mi(g.data,v+1,g.data.length).replace(/\0*$/,""),g.data=g.value))},"W*":function(g){g.url=wr(g.data,0,g.data.length).replace(/\0.*$/,"")},WXXX:function(g){var v;g.data[0]===Vn.Utf8&&(v=Sr(g.data,0,1),v!==-1&&(g.description=Mi(g.data,1,v),g.url=wr(g.data,v+1,g.data.length).replace(/\0.*$/,"")))},PRIV:function(g){var v;for(v=0;v<g.data.length;v++)if(g.data[v]===0){g.owner=wr(g.data,0,v);break}g.privateData=g.data.subarray(v+1),g.data=g.privateData}},en=function(g){var v,T,S=10,x=0,A=[];if(!(g.length<10||g[0]!==73||g[1]!==68||g[2]!==51)){x=ss(g.subarray(6,10)),x+=10;var j=g[5]&64;j&&(S+=4,S+=ss(g.subarray(10,14)),x-=ss(g.subarray(16,20)));do{if(v=ss(g.subarray(S+4,S+8)),v<1)break;T=String.fromCharCode(g[S],g[S+1],g[S+2],g[S+3]);var q={id:T,data:g.subarray(S+10,S+v+10)};q.key=q.id,Tr[q.id]?Tr[q.id](q):q.id[0]==="T"?Tr["T*"](q):q.id[0]==="W"&&Tr["W*"](q),A.push(q),S+=10,S+=v}while(S<x);return A}},Of={parseId3Frames:en,parseSyncSafeInteger:ss,frameParsers:Tr},nc=a,Bf=Hs,tn=Of,Gs;Gs=function(g){var v={descriptor:g&&g.descriptor},T=0,S=[],x=0,A;if(Gs.prototype.init.call(this),this.dispatchType=Bf.METADATA_STREAM_TYPE.toString(16),v.descriptor)for(A=0;A<v.descriptor.length;A++)this.dispatchType+=("00"+v.descriptor[A].toString(16)).slice(-2);this.push=function(j){var q,G,Q,se,_e,Ve;if(j.type==="timed-metadata"){if(j.dataAlignmentIndicator&&(x=0,S.length=0),S.length===0&&(j.data.length<10||j.data[0]!==73||j.data[1]!==68||j.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(S.push(j),x+=j.data.byteLength,S.length===1&&(T=tn.parseSyncSafeInteger(j.data.subarray(6,10)),T+=10),!(x<T)){for(q={data:new Uint8Array(T),frames:[],pts:S[0].pts,dts:S[0].dts},_e=0;_e<T;)q.data.set(S[0].data.subarray(0,T-_e),_e),_e+=S[0].data.byteLength,x-=S[0].data.byteLength,S.shift();G=10,q.data[5]&64&&(G+=4,G+=tn.parseSyncSafeInteger(q.data.subarray(10,14)),T-=tn.parseSyncSafeInteger(q.data.subarray(16,20)));do{if(Q=tn.parseSyncSafeInteger(q.data.subarray(G+4,G+8)),Q<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(Ve=String.fromCharCode(q.data[G],q.data[G+1],q.data[G+2],q.data[G+3]),se={id:Ve,data:q.data.subarray(G+10,G+Q+10)},se.key=se.id,tn.frameParsers[se.id]?tn.frameParsers[se.id](se):se.id[0]==="T"?tn.frameParsers["T*"](se):se.id[0]==="W"&&tn.frameParsers["W*"](se),se.owner==="com.apple.streaming.transportStreamTimestamp"){var Ae=se.data,Qe=(Ae[3]&1)<<30|Ae[4]<<22|Ae[5]<<14|Ae[6]<<6|Ae[7]>>>2;Qe*=4,Qe+=Ae[7]&3,se.timeStamp=Qe,q.pts===void 0&&q.dts===void 0&&(q.pts=se.timeStamp,q.dts=se.timeStamp),this.trigger("timestamp",se)}q.frames.push(se),G+=10,G+=Q}while(G<T);this.trigger("data",q)}}}},Gs.prototype=new nc;var Bv=Gs,os=a,Cr=tc,ii=Hs,Dv=qs.TimestampRolloverStream,rc,ls,sc,cs=188,oc=71;rc=function(){var g=new Uint8Array(cs),v=0;rc.prototype.init.call(this),this.push=function(T){var S=0,x=cs,A;for(v?(A=new Uint8Array(T.byteLength+v),A.set(g.subarray(0,v)),A.set(T,v),v=0):A=T;x<A.byteLength;){if(A[S]===oc&&A[x]===oc){this.trigger("data",A.subarray(S,x)),S+=cs,x+=cs;continue}S++,x++}S<A.byteLength&&(g.set(A.subarray(S),0),v=A.byteLength-S)},this.flush=function(){v===cs&&g[0]===oc&&(this.trigger("data",g),v=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){v=0,this.trigger("reset")}},rc.prototype=new os,ls=function(){var g,v,T,S;ls.prototype.init.call(this),S=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,g=function(x,A){var j=0;A.payloadUnitStartIndicator&&(j+=x[j]+1),A.type==="pat"?v(x.subarray(j),A):T(x.subarray(j),A)},v=function(x,A){A.section_number=x[7],A.last_section_number=x[8],S.pmtPid=(x[10]&31)<<8|x[11],A.pmtPid=S.pmtPid},T=function(x,A){var j,q,G,Q;if(x[5]&1){for(S.programMapTable={video:null,audio:null,"timed-metadata":{}},j=(x[1]&15)<<8|x[2],q=3+j-4,G=(x[10]&15)<<8|x[11],Q=12+G;Q<q;){var se=x[Q],_e=(x[Q+1]&31)<<8|x[Q+2];se===ii.H264_STREAM_TYPE&&S.programMapTable.video===null?S.programMapTable.video=_e:se===ii.ADTS_STREAM_TYPE&&S.programMapTable.audio===null?S.programMapTable.audio=_e:se===ii.METADATA_STREAM_TYPE&&(S.programMapTable["timed-metadata"][_e]=se),Q+=((x[Q+3]&15)<<8|x[Q+4])+5}A.programMapTable=S.programMapTable}},this.push=function(x){var A={},j=4;if(A.payloadUnitStartIndicator=!!(x[1]&64),A.pid=x[1]&31,A.pid<<=8,A.pid|=x[2],(x[3]&48)>>>4>1&&(j+=x[j]+1),A.pid===0)A.type="pat",g(x.subarray(j),A),this.trigger("data",A);else if(A.pid===this.pmtPid)for(A.type="pmt",g(x.subarray(j),A),this.trigger("data",A);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([x,j,A]):this.processPes_(x,j,A)},this.processPes_=function(x,A,j){j.pid===this.programMapTable.video?j.streamType=ii.H264_STREAM_TYPE:j.pid===this.programMapTable.audio?j.streamType=ii.ADTS_STREAM_TYPE:j.streamType=this.programMapTable["timed-metadata"][j.pid],j.type="pes",j.data=x.subarray(A),this.trigger("data",j)}},ls.prototype=new os,ls.STREAM_TYPES={h264:27,adts:15},sc=function(){var g=this,v=!1,T={data:[],size:0},S={data:[],size:0},x={data:[],size:0},A,j=function(G,Q){var se;const _e=G[0]<<16|G[1]<<8|G[2];Q.data=new Uint8Array,_e===1&&(Q.packetLength=6+(G[4]<<8|G[5]),Q.dataAlignmentIndicator=(G[6]&4)!==0,se=G[7],se&192&&(Q.pts=(G[9]&14)<<27|(G[10]&255)<<20|(G[11]&254)<<12|(G[12]&255)<<5|(G[13]&254)>>>3,Q.pts*=4,Q.pts+=(G[13]&6)>>>1,Q.dts=Q.pts,se&64&&(Q.dts=(G[14]&14)<<27|(G[15]&255)<<20|(G[16]&254)<<12|(G[17]&255)<<5|(G[18]&254)>>>3,Q.dts*=4,Q.dts+=(G[18]&6)>>>1)),Q.data=G.subarray(9+G[8]))},q=function(G,Q,se){var _e=new Uint8Array(G.size),Ve={type:Q},Ae=0,Qe=0,et=!1,la;if(!(!G.data.length||G.size<9)){for(Ve.trackId=G.data[0].pid,Ae=0;Ae<G.data.length;Ae++)la=G.data[Ae],_e.set(la.data,Qe),Qe+=la.data.byteLength;j(_e,Ve),et=Q==="video"||Ve.packetLength<=G.size,(se||et)&&(G.size=0,G.data.length=0),et&&g.trigger("data",Ve)}};sc.prototype.init.call(this),this.push=function(G){({pat:function(){},pes:function(){var Q,se;switch(G.streamType){case ii.H264_STREAM_TYPE:Q=T,se="video";break;case ii.ADTS_STREAM_TYPE:Q=S,se="audio";break;case ii.METADATA_STREAM_TYPE:Q=x,se="timed-metadata";break;default:return}G.payloadUnitStartIndicator&&q(Q,se,!0),Q.data.push(G),Q.size+=G.data.byteLength},pmt:function(){var Q={type:"metadata",tracks:[]};A=G.programMapTable,A.video!==null&&Q.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.video,codec:"avc",type:"video"}),A.audio!==null&&Q.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.audio,codec:"adts",type:"audio"}),v=!0,g.trigger("data",Q)}})[G.type]()},this.reset=function(){T.size=0,T.data.length=0,S.size=0,S.data.length=0,this.trigger("reset")},this.flushStreams_=function(){q(T,"video"),q(S,"audio"),q(x,"timed-metadata")},this.flush=function(){if(!v&&A){var G={type:"metadata",tracks:[]};A.video!==null&&G.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.video,codec:"avc",type:"video"}),A.audio!==null&&G.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+A.audio,codec:"adts",type:"audio"}),g.trigger("data",G)}v=!1,this.flushStreams_(),this.trigger("done")}},sc.prototype=new os;var Df={PAT_PID:0,MP2T_PACKET_LENGTH:cs,TransportPacketStream:rc,TransportParseStream:ls,ElementaryStream:sc,TimestampRolloverStream:Dv,CaptionStream:Cr.CaptionStream,Cea608Stream:Cr.Cea608Stream,Cea708Stream:Cr.Cea708Stream,MetadataStream:Bv};for(var Cu in ii)ii.hasOwnProperty(Cu)&&(Df[Cu]=ii[Cu]);var Mv=Df,Lv=a,Rv=kt.ONE_SECOND_IN_TS,lc,Ks=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];lc=function(g){var v,T=0;lc.prototype.init.call(this),this.skipWarn_=function(S,x){this.trigger("log",{level:"warn",message:`adts skiping bytes ${S} to ${x} in frame ${T} outside syncword`})},this.push=function(S){var x=0,A,j,q,G,Q;if(g||(T=0),S.type==="audio"){v&&v.length?(q=v,v=new Uint8Array(q.byteLength+S.data.byteLength),v.set(q),v.set(S.data,q.byteLength)):v=S.data;for(var se;x+7<v.length;){if(v[x]!==255||(v[x+1]&246)!==240){typeof se!="number"&&(se=x),x++;continue}if(typeof se=="number"&&(this.skipWarn_(se,x),se=null),j=(~v[x+1]&1)*2,A=(v[x+3]&3)<<11|v[x+4]<<3|(v[x+5]&224)>>5,G=((v[x+6]&3)+1)*1024,Q=G*Rv/Ks[(v[x+2]&60)>>>2],v.byteLength-x<A)break;this.trigger("data",{pts:S.pts+T*Q,dts:S.dts+T*Q,sampleCount:G,audioobjecttype:(v[x+2]>>>6&3)+1,channelcount:(v[x+2]&1)<<2|(v[x+3]&192)>>>6,samplerate:Ks[(v[x+2]&60)>>>2],samplingfrequencyindex:(v[x+2]&60)>>>2,samplesize:16,data:v.subarray(x+7+j,x+A)}),T++,x+=A}typeof se=="number"&&(this.skipWarn_(se,x),se=null),v=v.subarray(x)}},this.flush=function(){T=0,this.trigger("done")},this.reset=function(){v=void 0,this.trigger("reset")},this.endTimeline=function(){v=void 0,this.trigger("endedtimeline")}},lc.prototype=new Lv;var cc=lc,Mf;Mf=function(g){var v=g.byteLength,T=0,S=0;this.length=function(){return 8*v},this.bitsAvailable=function(){return 8*v+S},this.loadWord=function(){var x=g.byteLength-v,A=new Uint8Array(4),j=Math.min(4,v);if(j===0)throw new Error("no bytes available");A.set(g.subarray(x,x+j)),T=new DataView(A.buffer).getUint32(0),S=j*8,v-=j},this.skipBits=function(x){var A;S>x?(T<<=x,S-=x):(x-=S,A=Math.floor(x/8),x-=A*8,v-=A,this.loadWord(),T<<=x,S-=x)},this.readBits=function(x){var A=Math.min(S,x),j=T>>>32-A;return S-=A,S>0?T<<=A:v>0&&this.loadWord(),A=x-A,A>0?j<<A|this.readBits(A):j},this.skipLeadingZeros=function(){var x;for(x=0;x<S;++x)if(T&2147483648>>>x)return T<<=x,S-=x,x;return this.loadWord(),x+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var x=this.skipLeadingZeros();return this.readBits(x+1)-1},this.readExpGolomb=function(){var x=this.readUnsignedExpGolomb();return 1&x?1+x>>>1:-1*(x>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Fv=Mf,dc=a,Vv=Fv,ds,Xs,Lf;Xs=function(){var g=0,v,T;Xs.prototype.init.call(this),this.push=function(S){var x;T?(x=new Uint8Array(T.byteLength+S.data.byteLength),x.set(T),x.set(S.data,T.byteLength),T=x):T=S.data;for(var A=T.byteLength;g<A-3;g++)if(T[g+2]===1){v=g+5;break}for(;v<A;)switch(T[v]){case 0:if(T[v-1]!==0){v+=2;break}else if(T[v-2]!==0){v++;break}g+3!==v-2&&this.trigger("data",T.subarray(g+3,v-2));do v++;while(T[v]!==1&&v<A);g=v-2,v+=3;break;case 1:if(T[v-1]!==0||T[v-2]!==0){v+=3;break}this.trigger("data",T.subarray(g+3,v-2)),g=v-2,v+=3;break;default:v+=3;break}T=T.subarray(g),v-=g,g=0},this.reset=function(){T=null,g=0,this.trigger("reset")},this.flush=function(){T&&T.byteLength>3&&this.trigger("data",T.subarray(g+3)),T=null,g=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Xs.prototype=new dc,Lf={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},ds=function(){var g=new Xs,v,T,S,x,A,j,q;ds.prototype.init.call(this),v=this,this.push=function(G){G.type==="video"&&(T=G.trackId,S=G.pts,x=G.dts,g.push(G))},g.on("data",function(G){var Q={trackId:T,pts:S,dts:x,data:G,nalUnitTypeCode:G[0]&31};switch(Q.nalUnitTypeCode){case 5:Q.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:Q.nalUnitType="sei_rbsp",Q.escapedRBSP=A(G.subarray(1));break;case 7:Q.nalUnitType="seq_parameter_set_rbsp",Q.escapedRBSP=A(G.subarray(1)),Q.config=j(Q.escapedRBSP);break;case 8:Q.nalUnitType="pic_parameter_set_rbsp";break;case 9:Q.nalUnitType="access_unit_delimiter_rbsp";break}v.trigger("data",Q)}),g.on("done",function(){v.trigger("done")}),g.on("partialdone",function(){v.trigger("partialdone")}),g.on("reset",function(){v.trigger("reset")}),g.on("endedtimeline",function(){v.trigger("endedtimeline")}),this.flush=function(){g.flush()},this.partialFlush=function(){g.partialFlush()},this.reset=function(){g.reset()},this.endTimeline=function(){g.endTimeline()},q=function(G,Q){var se=8,_e=8,Ve,Ae;for(Ve=0;Ve<G;Ve++)_e!==0&&(Ae=Q.readExpGolomb(),_e=(se+Ae+256)%256),se=_e===0?se:_e},A=function(G){for(var Q=G.byteLength,se=[],_e=1,Ve,Ae;_e<Q-2;)G[_e]===0&&G[_e+1]===0&&G[_e+2]===3?(se.push(_e+2),_e+=2):_e++;if(se.length===0)return G;Ve=Q-se.length,Ae=new Uint8Array(Ve);var Qe=0;for(_e=0;_e<Ve;Qe++,_e++)Qe===se[0]&&(Qe++,se.shift()),Ae[_e]=G[Qe];return Ae},j=function(G){var Q=0,se=0,_e=0,Ve=0,Ae,Qe,et,la,Li,co,vP,SP,wP,mS,TP,Xt=[1,1],CP,uo;if(Ae=new Vv(G),Qe=Ae.readUnsignedByte(),la=Ae.readUnsignedByte(),et=Ae.readUnsignedByte(),Ae.skipUnsignedExpGolomb(),Lf[Qe]&&(Li=Ae.readUnsignedExpGolomb(),Li===3&&Ae.skipBits(1),Ae.skipUnsignedExpGolomb(),Ae.skipUnsignedExpGolomb(),Ae.skipBits(1),Ae.readBoolean()))for(TP=Li!==3?8:12,uo=0;uo<TP;uo++)Ae.readBoolean()&&(uo<6?q(16,Ae):q(64,Ae));if(Ae.skipUnsignedExpGolomb(),co=Ae.readUnsignedExpGolomb(),co===0)Ae.readUnsignedExpGolomb();else if(co===1)for(Ae.skipBits(1),Ae.skipExpGolomb(),Ae.skipExpGolomb(),vP=Ae.readUnsignedExpGolomb(),uo=0;uo<vP;uo++)Ae.skipExpGolomb();if(Ae.skipUnsignedExpGolomb(),Ae.skipBits(1),SP=Ae.readUnsignedExpGolomb(),wP=Ae.readUnsignedExpGolomb(),mS=Ae.readBits(1),mS===0&&Ae.skipBits(1),Ae.skipBits(1),Ae.readBoolean()&&(Q=Ae.readUnsignedExpGolomb(),se=Ae.readUnsignedExpGolomb(),_e=Ae.readUnsignedExpGolomb(),Ve=Ae.readUnsignedExpGolomb()),Ae.readBoolean()&&Ae.readBoolean()){switch(CP=Ae.readUnsignedByte(),CP){case 1:Xt=[1,1];break;case 2:Xt=[12,11];break;case 3:Xt=[10,11];break;case 4:Xt=[16,11];break;case 5:Xt=[40,33];break;case 6:Xt=[24,11];break;case 7:Xt=[20,11];break;case 8:Xt=[32,11];break;case 9:Xt=[80,33];break;case 10:Xt=[18,11];break;case 11:Xt=[15,11];break;case 12:Xt=[64,33];break;case 13:Xt=[160,99];break;case 14:Xt=[4,3];break;case 15:Xt=[3,2];break;case 16:Xt=[2,1];break;case 255:{Xt=[Ae.readUnsignedByte()<<8|Ae.readUnsignedByte(),Ae.readUnsignedByte()<<8|Ae.readUnsignedByte()];break}}Xt&&Xt[0]/Xt[1]}return{profileIdc:Qe,levelIdc:et,profileCompatibility:la,width:(SP+1)*16-Q*2-se*2,height:(2-mS)*(wP+1)*16-_e*2-Ve*2,sarRatio:Xt}}},ds.prototype=new dc;var Uv={H264Stream:ds,NalByteStream:Xs},Js=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],kr=function(g,v){var T=g[v+6]<<21|g[v+7]<<14|g[v+8]<<7|g[v+9],S=g[v+5],x=(S&16)>>4;return T=T>=0?T:0,x?T+20:T+10},Ys=function(g,v){return g.length-v<10||g[v]!==73||g[v+1]!==68||g[v+2]!==51?v:(v+=kr(g,v),Ys(g,v))},Er=function(g){var v=Ys(g,0);return g.length>=v+2&&(g[v]&255)===255&&(g[v+1]&240)===240&&(g[v+1]&22)===16},Rf=function(g){return g[0]<<21|g[1]<<14|g[2]<<7|g[3]},Ff=function(g,v,T){var S,x="";for(S=v;S<T;S++)x+="%"+("00"+g[S].toString(16)).slice(-2);return x},Vf=function(g,v,T){return unescape(Ff(g,v,T))},ku=function(g,v){var T=(g[v+5]&224)>>5,S=g[v+4]<<3,x=g[v+3]&6144;return x|S|T},jv=function(g,v){return g[v]===73&&g[v+1]===68&&g[v+2]===51?"timed-metadata":g[v]&!0&&(g[v+1]&240)===240?"audio":null},zv=function(g){for(var v=0;v+5<g.length;){if(g[v]!==255||(g[v+1]&246)!==240){v++;continue}return Js[(g[v+2]&60)>>>2]}return null},Hv=function(g){var v,T,S,x;v=10,g[5]&64&&(v+=4,v+=Rf(g.subarray(10,14)));do{if(T=Rf(g.subarray(v+4,v+8)),T<1)return null;if(x=String.fromCharCode(g[v],g[v+1],g[v+2],g[v+3]),x==="PRIV"){S=g.subarray(v+10,v+T+10);for(var A=0;A<S.byteLength;A++)if(S[A]===0){var j=Vf(S,0,A);if(j==="com.apple.streaming.transportStreamTimestamp"){var q=S.subarray(A+1),G=(q[3]&1)<<30|q[4]<<22|q[5]<<14|q[6]<<6|q[7]>>>2;return G*=4,G+=q[7]&3,G}break}}v+=10,v+=T}while(v<g.byteLength);return null},us={isLikelyAacData:Er,parseId3TagSize:kr,parseAdtsSize:ku,parseType:jv,parseSampleRate:zv,parseAacTimestamp:Hv},qv=a,Un=us,uc;uc=function(){var g=new Uint8Array,v=0;uc.prototype.init.call(this),this.setTimestamp=function(T){v=T},this.push=function(T){var S=0,x=0,A,j,q,G;for(g.length?(G=g.length,g=new Uint8Array(T.byteLength+G),g.set(g.subarray(0,G)),g.set(T,G)):g=T;g.length-x>=3;){if(g[x]===73&&g[x+1]===68&&g[x+2]===51){if(g.length-x<10||(S=Un.parseId3TagSize(g,x),x+S>g.length))break;j={type:"timed-metadata",data:g.subarray(x,x+S)},this.trigger("data",j),x+=S;continue}else if((g[x]&255)===255&&(g[x+1]&240)===240){if(g.length-x<7||(S=Un.parseAdtsSize(g,x),x+S>g.length))break;q={type:"audio",data:g.subarray(x,x+S),pts:v,dts:v},this.trigger("data",q),x+=S;continue}x++}A=g.length-x,A>0?g=g.subarray(x):g=new Uint8Array},this.reset=function(){g=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){g=new Uint8Array,this.trigger("endedtimeline")}},uc.prototype=new qv;var Wv=uc,It=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Gv=It,Kv=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Xv=Kv,Qs=a,Zs=X,hs=We,hc=wv,ni=kv,an=Mv,$s=kt,Eu=cc,eo=Uv.H264Stream,to=Wv,Jv=us.isLikelyAacData,Yv=kt.ONE_SECOND_IN_TS,Iu=Gv,xu=Xv,ao,ps,pc,Ir,Qv=function(g,v){v.stream=g,this.trigger("log",v)},io=function(g,v){for(var T=Object.keys(v),S=0;S<T.length;S++){var x=T[S];x==="headOfPipeline"||!v[x].on||v[x].on("log",Qv.bind(g,x))}},ms=function(g,v){var T;if(g.length!==v.length)return!1;for(T=0;T<g.length;T++)if(g[T]!==v[T])return!1;return!0},Nu=function(g,v,T,S,x,A){var j=T-v,q=S-v,G=x-T;return{start:{dts:g,pts:g+j},end:{dts:g+q,pts:g+G},prependedContentDuration:A,baseMediaDecodeTime:g}};ps=function(g,v){var T=[],S,x=0,A=0,j=1/0;v=v||{},S=v.firstSequenceNumber||0,ps.prototype.init.call(this),this.push=function(q){ni.collectDtsInfo(g,q),g&&Iu.forEach(function(G){g[G]=q[G]}),T.push(q)},this.setEarliestDts=function(q){x=q},this.setVideoBaseMediaDecodeTime=function(q){j=q},this.setAudioAppendStart=function(q){A=q},this.flush=function(){var q,G,Q,se,_e,Ve,Ae;if(T.length===0){this.trigger("done","AudioSegmentStream");return}q=hc.trimAdtsFramesByEarliestDts(T,g,x),g.baseMediaDecodeTime=ni.calculateTrackBaseMediaDecodeTime(g,v.keepOriginalTimestamps),Ae=hc.prefixWithSilence(g,q,A,j),g.samples=hc.generateSampleTable(q),Q=Zs.mdat(hc.concatenateFrameData(q)),T=[],G=Zs.moof(S,[g]),se=new Uint8Array(G.byteLength+Q.byteLength),S++,se.set(G),se.set(Q,G.byteLength),ni.clearDtsInfo(g),_e=Math.ceil(Yv*1024/g.samplerate),q.length&&(Ve=q.length*_e,this.trigger("segmentTimingInfo",Nu($s.audioTsToVideoTs(g.baseMediaDecodeTime,g.samplerate),q[0].dts,q[0].pts,q[0].dts+Ve,q[0].pts+Ve,Ae||0)),this.trigger("timingInfo",{start:q[0].pts,end:q[0].pts+Ve})),this.trigger("data",{track:g,boxes:se}),this.trigger("done","AudioSegmentStream")},this.reset=function(){ni.clearDtsInfo(g),T=[],this.trigger("reset")}},ps.prototype=new Qs,ao=function(g,v){var T,S=[],x=[],A,j;v=v||{},T=v.firstSequenceNumber||0,ao.prototype.init.call(this),delete g.minPTS,this.gopCache_=[],this.push=function(q){ni.collectDtsInfo(g,q),q.nalUnitType==="seq_parameter_set_rbsp"&&!A&&(A=q.config,g.sps=[q.data],xu.forEach(function(G){g[G]=A[G]},this)),q.nalUnitType==="pic_parameter_set_rbsp"&&!j&&(j=q.data,g.pps=[q.data]),S.push(q)},this.flush=function(){for(var q,G,Q,se,_e,Ve,Ae=0,Qe,et;S.length&&S[0].nalUnitType!=="access_unit_delimiter_rbsp";)S.shift();if(S.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(q=hs.groupNalsIntoFrames(S),Q=hs.groupFramesIntoGops(q),Q[0][0].keyFrame||(G=this.getGopForFusion_(S[0],g),G?(Ae=G.duration,Q.unshift(G),Q.byteLength+=G.byteLength,Q.nalCount+=G.nalCount,Q.pts=G.pts,Q.dts=G.dts,Q.duration+=G.duration):Q=hs.extendFirstKeyFrame(Q)),x.length){var la;if(v.alignGopsAtEnd?la=this.alignGopsAtEnd_(Q):la=this.alignGopsAtStart_(Q),!la){this.gopCache_.unshift({gop:Q.pop(),pps:g.pps,sps:g.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),S=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}ni.clearDtsInfo(g),Q=la}ni.collectDtsInfo(g,Q),g.samples=hs.generateSampleTable(Q),_e=Zs.mdat(hs.concatenateNalData(Q)),g.baseMediaDecodeTime=ni.calculateTrackBaseMediaDecodeTime(g,v.keepOriginalTimestamps),this.trigger("processedGopsInfo",Q.map(function(Li){return{pts:Li.pts,dts:Li.dts,byteLength:Li.byteLength}})),Qe=Q[0],et=Q[Q.length-1],this.trigger("segmentTimingInfo",Nu(g.baseMediaDecodeTime,Qe.dts,Qe.pts,et.dts+et.duration,et.pts+et.duration,Ae)),this.trigger("timingInfo",{start:Q[0].pts,end:Q[Q.length-1].pts+Q[Q.length-1].duration}),this.gopCache_.unshift({gop:Q.pop(),pps:g.pps,sps:g.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),S=[],this.trigger("baseMediaDecodeTime",g.baseMediaDecodeTime),this.trigger("timelineStartInfo",g.timelineStartInfo),se=Zs.moof(T,[g]),Ve=new Uint8Array(se.byteLength+_e.byteLength),T++,Ve.set(se),Ve.set(_e,se.byteLength),this.trigger("data",{track:g,boxes:Ve}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),S=[],this.gopCache_.length=0,x.length=0,this.trigger("reset")},this.resetStream_=function(){ni.clearDtsInfo(g),A=void 0,j=void 0},this.getGopForFusion_=function(q){var G=45e3,Q=1e4,se=1/0,_e,Ve,Ae,Qe,et;for(et=0;et<this.gopCache_.length;et++)Qe=this.gopCache_[et],Ae=Qe.gop,!(!(g.pps&&ms(g.pps[0],Qe.pps[0]))||!(g.sps&&ms(g.sps[0],Qe.sps[0])))&&(Ae.dts<g.timelineStartInfo.dts||(_e=q.dts-Ae.dts-Ae.duration,_e>=-Q&&_e<=G&&(!Ve||se>_e)&&(Ve=Qe,se=_e)));return Ve?Ve.gop:null},this.alignGopsAtStart_=function(q){var G,Q,se,_e,Ve,Ae,Qe,et;for(Ve=q.byteLength,Ae=q.nalCount,Qe=q.duration,G=Q=0;G<x.length&&Q<q.length&&(se=x[G],_e=q[Q],se.pts!==_e.pts);){if(_e.pts>se.pts){G++;continue}Q++,Ve-=_e.byteLength,Ae-=_e.nalCount,Qe-=_e.duration}return Q===0?q:Q===q.length?null:(et=q.slice(Q),et.byteLength=Ve,et.duration=Qe,et.nalCount=Ae,et.pts=et[0].pts,et.dts=et[0].dts,et)},this.alignGopsAtEnd_=function(q){var G,Q,se,_e,Ve,Ae;for(G=x.length-1,Q=q.length-1,Ve=null,Ae=!1;G>=0&&Q>=0;){if(se=x[G],_e=q[Q],se.pts===_e.pts){Ae=!0;break}if(se.pts>_e.pts){G--;continue}G===x.length-1&&(Ve=Q),Q--}if(!Ae&&Ve===null)return null;var Qe;if(Ae?Qe=Q:Qe=Ve,Qe===0)return q;var et=q.slice(Qe),la=et.reduce(function(Li,co){return Li.byteLength+=co.byteLength,Li.duration+=co.duration,Li.nalCount+=co.nalCount,Li},{byteLength:0,duration:0,nalCount:0});return et.byteLength=la.byteLength,et.duration=la.duration,et.nalCount=la.nalCount,et.pts=et[0].pts,et.dts=et[0].dts,et},this.alignGopsWith=function(q){x=q}},ao.prototype=new Qs,Ir=function(g,v){this.numberOfTracks=0,this.metadataStream=v,g=g||{},typeof g.remux<"u"?this.remuxTracks=!!g.remux:this.remuxTracks=!0,typeof g.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=g.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Ir.prototype.init.call(this),this.push=function(T){if(T.content||T.text)return this.pendingCaptions.push(T);if(T.frames)return this.pendingMetadata.push(T);this.pendingTracks.push(T.track),this.pendingBytes+=T.boxes.byteLength,T.track.type==="video"&&(this.videoTrack=T.track,this.pendingBoxes.push(T.boxes)),T.track.type==="audio"&&(this.audioTrack=T.track,this.pendingBoxes.unshift(T.boxes))}},Ir.prototype=new Qs,Ir.prototype.flush=function(g){var v=0,T={captions:[],captionStreams:{},metadata:[],info:{}},S,x,A,j=0,q;if(this.pendingTracks.length<this.numberOfTracks){if(g!=="VideoSegmentStream"&&g!=="AudioSegmentStream"||this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(j=this.videoTrack.timelineStartInfo.pts,xu.forEach(function(G){T.info[G]=this.videoTrack[G]},this)):this.audioTrack&&(j=this.audioTrack.timelineStartInfo.pts,Iu.forEach(function(G){T.info[G]=this.audioTrack[G]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?T.type=this.pendingTracks[0].type:T.type="combined",this.emittedTracks+=this.pendingTracks.length,A=Zs.initSegment(this.pendingTracks),T.initSegment=new Uint8Array(A.byteLength),T.initSegment.set(A),T.data=new Uint8Array(this.pendingBytes),q=0;q<this.pendingBoxes.length;q++)T.data.set(this.pendingBoxes[q],v),v+=this.pendingBoxes[q].byteLength;for(q=0;q<this.pendingCaptions.length;q++)S=this.pendingCaptions[q],S.startTime=$s.metadataTsToSeconds(S.startPts,j,this.keepOriginalTimestamps),S.endTime=$s.metadataTsToSeconds(S.endPts,j,this.keepOriginalTimestamps),T.captionStreams[S.stream]=!0,T.captions.push(S);for(q=0;q<this.pendingMetadata.length;q++)x=this.pendingMetadata[q],x.cueTime=$s.metadataTsToSeconds(x.pts,j,this.keepOriginalTimestamps),T.metadata.push(x);for(T.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",T),q=0;q<T.captions.length;q++)S=T.captions[q],this.trigger("caption",S);for(q=0;q<T.metadata.length;q++)x=T.metadata[q],this.trigger("id3Frame",x)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Ir.prototype.setRemux=function(g){this.remuxTracks=g},pc=function(g){var v=this,T=!0,S,x;pc.prototype.init.call(this),g=g||{},this.baseMediaDecodeTime=g.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var A={};this.transmuxPipeline_=A,A.type="aac",A.metadataStream=new an.MetadataStream,A.aacStream=new to,A.audioTimestampRolloverStream=new an.TimestampRolloverStream("audio"),A.timedMetadataTimestampRolloverStream=new an.TimestampRolloverStream("timed-metadata"),A.adtsStream=new Eu,A.coalesceStream=new Ir(g,A.metadataStream),A.headOfPipeline=A.aacStream,A.aacStream.pipe(A.audioTimestampRolloverStream).pipe(A.adtsStream),A.aacStream.pipe(A.timedMetadataTimestampRolloverStream).pipe(A.metadataStream).pipe(A.coalesceStream),A.metadataStream.on("timestamp",function(j){A.aacStream.setTimestamp(j.timeStamp)}),A.aacStream.on("data",function(j){j.type!=="timed-metadata"&&j.type!=="audio"||A.audioSegmentStream||(x=x||{timelineStartInfo:{baseMediaDecodeTime:v.baseMediaDecodeTime},codec:"adts",type:"audio"},A.coalesceStream.numberOfTracks++,A.audioSegmentStream=new ps(x,g),A.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),A.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),A.adtsStream.pipe(A.audioSegmentStream).pipe(A.coalesceStream),v.trigger("trackinfo",{hasAudio:!!x,hasVideo:!!S}))}),A.coalesceStream.on("data",this.trigger.bind(this,"data")),A.coalesceStream.on("done",this.trigger.bind(this,"done")),io(this,A)},this.setupTsPipeline=function(){var A={};this.transmuxPipeline_=A,A.type="ts",A.metadataStream=new an.MetadataStream,A.packetStream=new an.TransportPacketStream,A.parseStream=new an.TransportParseStream,A.elementaryStream=new an.ElementaryStream,A.timestampRolloverStream=new an.TimestampRolloverStream,A.adtsStream=new Eu,A.h264Stream=new eo,A.captionStream=new an.CaptionStream(g),A.coalesceStream=new Ir(g,A.metadataStream),A.headOfPipeline=A.packetStream,A.packetStream.pipe(A.parseStream).pipe(A.elementaryStream).pipe(A.timestampRolloverStream),A.timestampRolloverStream.pipe(A.h264Stream),A.timestampRolloverStream.pipe(A.adtsStream),A.timestampRolloverStream.pipe(A.metadataStream).pipe(A.coalesceStream),A.h264Stream.pipe(A.captionStream).pipe(A.coalesceStream),A.elementaryStream.on("data",function(j){var q;if(j.type==="metadata"){for(q=j.tracks.length;q--;)!S&&j.tracks[q].type==="video"?(S=j.tracks[q],S.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime):!x&&j.tracks[q].type==="audio"&&(x=j.tracks[q],x.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime);S&&!A.videoSegmentStream&&(A.coalesceStream.numberOfTracks++,A.videoSegmentStream=new ao(S,g),A.videoSegmentStream.on("log",v.getLogTrigger_("videoSegmentStream")),A.videoSegmentStream.on("timelineStartInfo",function(G){x&&!g.keepOriginalTimestamps&&(x.timelineStartInfo=G,A.audioSegmentStream.setEarliestDts(G.dts-v.baseMediaDecodeTime))}),A.videoSegmentStream.on("processedGopsInfo",v.trigger.bind(v,"gopInfo")),A.videoSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"videoSegmentTimingInfo")),A.videoSegmentStream.on("baseMediaDecodeTime",function(G){x&&A.audioSegmentStream.setVideoBaseMediaDecodeTime(G)}),A.videoSegmentStream.on("timingInfo",v.trigger.bind(v,"videoTimingInfo")),A.h264Stream.pipe(A.videoSegmentStream).pipe(A.coalesceStream)),x&&!A.audioSegmentStream&&(A.coalesceStream.numberOfTracks++,A.audioSegmentStream=new ps(x,g),A.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),A.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),A.audioSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"audioSegmentTimingInfo")),A.adtsStream.pipe(A.audioSegmentStream).pipe(A.coalesceStream)),v.trigger("trackinfo",{hasAudio:!!x,hasVideo:!!S})}}),A.coalesceStream.on("data",this.trigger.bind(this,"data")),A.coalesceStream.on("id3Frame",function(j){j.dispatchType=A.metadataStream.dispatchType,v.trigger("id3Frame",j)}),A.coalesceStream.on("caption",this.trigger.bind(this,"caption")),A.coalesceStream.on("done",this.trigger.bind(this,"done")),io(this,A)},this.setBaseMediaDecodeTime=function(A){var j=this.transmuxPipeline_;g.keepOriginalTimestamps||(this.baseMediaDecodeTime=A),x&&(x.timelineStartInfo.dts=void 0,x.timelineStartInfo.pts=void 0,ni.clearDtsInfo(x),j.audioTimestampRolloverStream&&j.audioTimestampRolloverStream.discontinuity()),S&&(j.videoSegmentStream&&(j.videoSegmentStream.gopCache_=[]),S.timelineStartInfo.dts=void 0,S.timelineStartInfo.pts=void 0,ni.clearDtsInfo(S),j.captionStream.reset()),j.timestampRolloverStream&&j.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(A){x&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(A)},this.setRemux=function(A){var j=this.transmuxPipeline_;g.remux=A,j&&j.coalesceStream&&j.coalesceStream.setRemux(A)},this.alignGopsWith=function(A){S&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(A)},this.getLogTrigger_=function(A){var j=this;return function(q){q.stream=A,j.trigger("log",q)}},this.push=function(A){if(T){var j=Jv(A);j&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!j&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),T=!1}this.transmuxPipeline_.headOfPipeline.push(A)},this.flush=function(){T=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},pc.prototype=new Qs;var Uf={Transmuxer:pc,VideoSegmentStream:ao,AudioSegmentStream:ps,AUDIO_PROPERTIES:Iu,VIDEO_PROPERTIES:xu,generateSegmentTimingInfo:Nu},jf=function(g){return g>>>0},zf=function(g){return("00"+g.toString(16)).slice(-2)},no={toUnsigned:jf,toHexString:zf},Hf=function(g){var v="";return v+=String.fromCharCode(g[0]),v+=String.fromCharCode(g[1]),v+=String.fromCharCode(g[2]),v+=String.fromCharCode(g[3]),v},mc=Hf,qf=no.toUnsigned,Wf=mc,ro=function(g,v){var T=[],S,x,A,j,q;if(!v.length)return null;for(S=0;S<g.byteLength;)x=qf(g[S]<<24|g[S+1]<<16|g[S+2]<<8|g[S+3]),A=Wf(g.subarray(S+4,S+8)),j=x>1?S+x:g.byteLength,A===v[0]&&(v.length===1?T.push(g.subarray(S+8,j)):(q=ro(g.subarray(S+8,j),v.slice(1)),q.length&&(T=T.concat(q)))),S=j;return T},so=ro,Zv=no.toUnsigned,$v=r.getUint64,eS=function(g){var v={version:g[0],flags:new Uint8Array(g.subarray(1,4))};return v.version===1?v.baseMediaDecodeTime=$v(g.subarray(4)):v.baseMediaDecodeTime=Zv(g[4]<<24|g[5]<<16|g[6]<<8|g[7]),v},Gf=eS,tS=function(g){return{isLeading:(g[0]&12)>>>2,dependsOn:g[0]&3,isDependedOn:(g[1]&192)>>>6,hasRedundancy:(g[1]&48)>>>4,paddingValue:(g[1]&14)>>>1,isNonSyncSample:g[1]&1,degradationPriority:g[2]<<8|g[3]}},Au=tS,Kf=Au,aS=function(g){var v={version:g[0],flags:new Uint8Array(g.subarray(1,4)),samples:[]},T=new DataView(g.buffer,g.byteOffset,g.byteLength),S=v.flags[2]&1,x=v.flags[2]&4,A=v.flags[1]&1,j=v.flags[1]&2,q=v.flags[1]&4,G=v.flags[1]&8,Q=T.getUint32(4),se=8,_e;for(S&&(v.dataOffset=T.getInt32(se),se+=4),x&&Q&&(_e={flags:Kf(g.subarray(se,se+4))},se+=4,A&&(_e.duration=T.getUint32(se),se+=4),j&&(_e.size=T.getUint32(se),se+=4),G&&(v.version===1?_e.compositionTimeOffset=T.getInt32(se):_e.compositionTimeOffset=T.getUint32(se),se+=4),v.samples.push(_e),Q--);Q--;)_e={},A&&(_e.duration=T.getUint32(se),se+=4),j&&(_e.size=T.getUint32(se),se+=4),q&&(_e.flags=Kf(g.subarray(se,se+4)),se+=4),G&&(v.version===1?_e.compositionTimeOffset=T.getInt32(se):_e.compositionTimeOffset=T.getUint32(se),se+=4),v.samples.push(_e);return v},xr=aS,yt=function(g){var v=new DataView(g.buffer,g.byteOffset,g.byteLength),T={version:g[0],flags:new Uint8Array(g.subarray(1,4)),trackId:v.getUint32(4)},S=T.flags[2]&1,x=T.flags[2]&2,A=T.flags[2]&8,j=T.flags[2]&16,q=T.flags[2]&32,G=T.flags[0]&65536,Q=T.flags[0]&131072,se;return se=8,S&&(se+=4,T.baseDataOffset=v.getUint32(12),se+=4),x&&(T.sampleDescriptionIndex=v.getUint32(se),se+=4),A&&(T.defaultSampleDuration=v.getUint32(se),se+=4),j&&(T.defaultSampleSize=v.getUint32(se),se+=4),q&&(T.defaultSampleFlags=v.getUint32(se)),G&&(T.durationIsEmpty=!0),!S&&Q&&(T.baseDataOffsetIsMoof=!0),T},jn=yt,Kt;typeof window<"u"?Kt=window:typeof e<"u"?Kt=e:typeof self<"u"?Kt=self:Kt={};var _i=Kt,iS=xf.discardEmulationPreventionBytes,Xf=tc.CaptionStream,oo=so,nS=Gf,rS=xr,sS=jn,Jf=_i,oS=function(g,v){for(var T=g,S=0;S<v.length;S++){var x=v[S];if(T<x.size)return x;T-=x.size}return null},lS=function(g,v,T){var S=new DataView(g.buffer,g.byteOffset,g.byteLength),x={logs:[],seiNals:[]},A,j,q,G;for(j=0;j+4<g.length;j+=q)if(q=S.getUint32(j),j+=4,!(q<=0))switch(g[j]&31){case 6:var Q=g.subarray(j+1,j+1+q),se=oS(j,v);if(A={nalUnitType:"sei_rbsp",size:q,data:Q,escapedRBSP:iS(Q),trackId:T},se)A.pts=se.pts,A.dts=se.dts,G=se;else if(G)A.pts=G.pts,A.dts=G.dts;else{x.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+j+" for trackId "+T+". See mux.js#223."});break}x.seiNals.push(A);break}return x},Yf=function(g,v,T){var S=v,x=T.defaultSampleDuration||0,A=T.defaultSampleSize||0,j=T.trackId,q=[];return g.forEach(function(G){var Q=rS(G),se=Q.samples;se.forEach(function(_e){_e.duration===void 0&&(_e.duration=x),_e.size===void 0&&(_e.size=A),_e.trackId=j,_e.dts=S,_e.compositionTimeOffset===void 0&&(_e.compositionTimeOffset=0),typeof S=="bigint"?(_e.pts=S+Jf.BigInt(_e.compositionTimeOffset),S+=Jf.BigInt(_e.duration)):(_e.pts=S+_e.compositionTimeOffset,S+=_e.duration)}),q=q.concat(se)}),q},_=function(g,v){var T=oo(g,["moof","traf"]),S=oo(g,["mdat"]),x={},A=[];return S.forEach(function(j,q){var G=T[q];A.push({mdat:j,traf:G})}),A.forEach(function(j){var q=j.mdat,G=j.traf,Q=oo(G,["tfhd"]),se=sS(Q[0]),_e=se.trackId,Ve=oo(G,["tfdt"]),Ae=Ve.length>0?nS(Ve[0]).baseMediaDecodeTime:0,Qe=oo(G,["trun"]),et,la;v===_e&&Qe.length>0&&(et=Yf(Qe,Ae,se),la=lS(q,et,_e),x[_e]||(x[_e]={seiNals:[],logs:[]}),x[_e].seiNals=x[_e].seiNals.concat(la.seiNals),x[_e].logs=x[_e].logs.concat(la.logs))}),x},w=function(g,v,T){var S;if(v===null)return null;S=_(g,v);var x=S[v]||{};return{seiNals:x.seiNals,logs:x.logs,timescale:T}},k=function(){var g=!1,v,T,S,x,A,j;this.isInitialized=function(){return g},this.init=function(q){v=new Xf,g=!0,j=q?q.isPartial:!1,v.on("data",function(G){G.startTime=G.startPts/x,G.endTime=G.endPts/x,A.captions.push(G),A.captionStreams[G.stream]=!0}),v.on("log",function(G){A.logs.push(G)})},this.isNewInit=function(q,G){return q&&q.length===0||G&&typeof G=="object"&&Object.keys(G).length===0?!1:S!==q[0]||x!==G[S]},this.parse=function(q,G,Q){var se;if(this.isInitialized()){if(!G||!Q)return null;if(this.isNewInit(G,Q))S=G[0],x=Q[S];else if(S===null||!x)return T.push(q),null}else return null;for(;T.length>0;){var _e=T.shift();this.parse(_e,G,Q)}return se=w(q,S,x),se&&se.logs&&(A.logs=A.logs.concat(se.logs)),se===null||!se.seiNals?A.logs.length?{logs:A.logs,captions:[],captionStreams:[]}:null:(this.pushNals(se.seiNals),this.flushStream(),A)},this.pushNals=function(q){if(!this.isInitialized()||!q||q.length===0)return null;q.forEach(function(G){v.push(G)})},this.flushStream=function(){if(!this.isInitialized())return null;j?v.partialFlush():v.flush()},this.clearParsedCaptions=function(){A.captions=[],A.captionStreams={},A.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;v.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){T=[],S=null,x=null,A?this.clearParsedCaptions():A={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},C=k,I=function(g){for(var v=0,T=String.fromCharCode(g[v]),S="";T!=="\0";)S+=T,v++,T=String.fromCharCode(g[v]);return S+=T,S},B={uint8ToCString:I},F=B.uint8ToCString,H=r.getUint64,W=function(g){var v=4,T=g[0],S,x,A,j,q,G,Q,se;if(T===0){S=F(g.subarray(v)),v+=S.length,x=F(g.subarray(v)),v+=x.length;var _e=new DataView(g.buffer);A=_e.getUint32(v),v+=4,q=_e.getUint32(v),v+=4,G=_e.getUint32(v),v+=4,Q=_e.getUint32(v),v+=4}else if(T===1){var _e=new DataView(g.buffer);A=_e.getUint32(v),v+=4,j=H(g.subarray(v)),v+=8,G=_e.getUint32(v),v+=4,Q=_e.getUint32(v),v+=4,S=F(g.subarray(v)),v+=S.length,x=F(g.subarray(v)),v+=x.length}se=new Uint8Array(g.subarray(v,g.byteLength));var Ve={scheme_id_uri:S,value:x,timescale:A||1,presentation_time:j,presentation_time_delta:q,event_duration:G,id:Q,message_data:se};return ce(T,Ve)?Ve:void 0},Z=function(g,v,T,S){return g||g===0?g/v:S+T/v},ce=function(g,v){var T=v.scheme_id_uri!=="\0",S=g===0&&be(v.presentation_time_delta)&&T,x=g===1&&be(v.presentation_time)&&T;return!(g>1)&&S||x},be=function(g){return g!==void 0||g!==null},Ue={parseEmsgBox:W,scaleTime:Z},Ne=no.toUnsigned,Ke=no.toHexString,ze=so,At=mc,Ia=Ue,Nr=jn,Qf=xr,Zf=Gf,$f=r.getUint64,fc,Pu,Ft,Ou,zn,cS,fP,dS=_i,$3e=Of.parseId3Frames;fc=function(g){var v={},T=ze(g,["moov","trak"]);return T.reduce(function(S,x){var A,j,q,G,Q;return A=ze(x,["tkhd"])[0],!A||(j=A[0],q=j===0?12:20,G=Ne(A[q]<<24|A[q+1]<<16|A[q+2]<<8|A[q+3]),Q=ze(x,["mdia","mdhd"])[0],!Q)?null:(j=Q[0],q=j===0?12:20,S[G]=Ne(Q[q]<<24|Q[q+1]<<16|Q[q+2]<<8|Q[q+3]),S)},v)},Pu=function(g,v){var T;T=ze(v,["moof","traf"]);var S=T.reduce(function(x,A){var j=ze(A,["tfhd"])[0],q=Ne(j[4]<<24|j[5]<<16|j[6]<<8|j[7]),G=g[q]||9e4,Q=ze(A,["tfdt"])[0],se=new DataView(Q.buffer,Q.byteOffset,Q.byteLength),_e;Q[0]===1?_e=$f(Q.subarray(4,12)):_e=se.getUint32(4);let Ve;return typeof _e=="bigint"?Ve=_e/dS.BigInt(G):typeof _e=="number"&&!isNaN(_e)&&(Ve=_e/G),Ve<Number.MAX_SAFE_INTEGER&&(Ve=Number(Ve)),Ve<x&&(x=Ve),x},1/0);return typeof S=="bigint"||isFinite(S)?S:0},Ft=function(g,v){var T=ze(v,["moof","traf"]),S=0,x=0,A;if(T&&T.length){var j=ze(T[0],["tfhd"])[0],q=ze(T[0],["trun"])[0],G=ze(T[0],["tfdt"])[0];if(j){var Q=Nr(j);A=Q.trackId}if(G){var se=Zf(G);S=se.baseMediaDecodeTime}if(q){var _e=Qf(q);_e.samples&&_e.samples.length&&(x=_e.samples[0].compositionTimeOffset||0)}}var Ve=g[A]||9e4;typeof S=="bigint"&&(x=dS.BigInt(x),Ve=dS.BigInt(Ve));var Ae=(S+x)/Ve;return typeof Ae=="bigint"&&Ae<Number.MAX_SAFE_INTEGER&&(Ae=Number(Ae)),Ae},Ou=function(g){var v=ze(g,["moov","trak"]),T=[];return v.forEach(function(S){var x=ze(S,["mdia","hdlr"]),A=ze(S,["tkhd"]);x.forEach(function(j,q){var G=At(j.subarray(8,12)),Q=A[q],se,_e,Ve;G==="vide"&&(se=new DataView(Q.buffer,Q.byteOffset,Q.byteLength),_e=se.getUint8(0),Ve=_e===0?se.getUint32(12):se.getUint32(20),T.push(Ve))})}),T},cS=function(g){var v=g[0],T=v===0?12:20;return Ne(g[T]<<24|g[T+1]<<16|g[T+2]<<8|g[T+3])},zn=function(g){var v=ze(g,["moov","trak"]),T=[];return v.forEach(function(S){var x={},A=ze(S,["tkhd"])[0],j,q;A&&(j=new DataView(A.buffer,A.byteOffset,A.byteLength),q=j.getUint8(0),x.id=q===0?j.getUint32(12):j.getUint32(20));var G=ze(S,["mdia","hdlr"])[0];if(G){var Q=At(G.subarray(8,12));Q==="vide"?x.type="video":Q==="soun"?x.type="audio":x.type=Q}var se=ze(S,["mdia","minf","stbl","stsd"])[0];if(se){var _e=se.subarray(8);x.codec=At(_e.subarray(4,8));var Ve=ze(_e,[x.codec])[0],Ae,Qe;Ve&&(/^[asm]vc[1-9]$/i.test(x.codec)?(Ae=Ve.subarray(78),Qe=At(Ae.subarray(4,8)),Qe==="avcC"&&Ae.length>11?(x.codec+=".",x.codec+=Ke(Ae[9]),x.codec+=Ke(Ae[10]),x.codec+=Ke(Ae[11])):x.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(x.codec)?(Ae=Ve.subarray(28),Qe=At(Ae.subarray(4,8)),Qe==="esds"&&Ae.length>20&&Ae[19]!==0?(x.codec+="."+Ke(Ae[19]),x.codec+="."+Ke(Ae[20]>>>2&63).replace(/^0/,"")):x.codec="mp4a.40.2"):x.codec=x.codec.toLowerCase())}var et=ze(S,["mdia","mdhd"])[0];et&&(x.timescale=cS(et)),T.push(x)}),T},fP=function(g,v=0){var T=ze(g,["emsg"]);return T.map(S=>{var x=Ia.parseEmsgBox(new Uint8Array(S)),A=$3e(x.message_data);return{cueTime:Ia.scaleTime(x.presentation_time,x.timescale,x.presentation_time_delta,v),duration:Ia.scaleTime(x.event_duration,x.timescale),frames:A}})};var uS={findBox:ze,parseType:At,timescale:fc,startTime:Pu,compositionStartTime:Ft,videoTrackIds:Ou,tracks:zn,getTimescaleFromMediaHeader:cS,getEmsgID3:fP},hS=Hs,gP=function(g){var v=g[1]&31;return v<<=8,v|=g[2],v},eg=function(g){return!!(g[1]&64)},tg=function(g){var v=0;return(g[3]&48)>>>4>1&&(v+=g[4]+1),v},eIe=function(g,v){var T=gP(g);return T===0?"pat":T===v?"pmt":v?"pes":null},tIe=function(g){var v=eg(g),T=4+tg(g);return v&&(T+=g[T]+1),(g[T+10]&31)<<8|g[T+11]},aIe=function(g){var v={},T=eg(g),S=4+tg(g);if(T&&(S+=g[S]+1),!!(g[S+5]&1)){var x,A,j;x=(g[S+1]&15)<<8|g[S+2],A=3+x-4,j=(g[S+10]&15)<<8|g[S+11];for(var q=12+j;q<A;){var G=S+q;v[(g[G+1]&31)<<8|g[G+2]]=g[G],q+=((g[G+3]&15)<<8|g[G+4])+5}return v}},iIe=function(g,v){var T=gP(g),S=v[T];switch(S){case hS.H264_STREAM_TYPE:return"video";case hS.ADTS_STREAM_TYPE:return"audio";case hS.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},nIe=function(g){var v=eg(g);if(!v)return null;var T=4+tg(g);if(T>=g.byteLength)return null;var S=null,x;return x=g[T+7],x&192&&(S={},S.pts=(g[T+9]&14)<<27|(g[T+10]&255)<<20|(g[T+11]&254)<<12|(g[T+12]&255)<<5|(g[T+13]&254)>>>3,S.pts*=4,S.pts+=(g[T+13]&6)>>>1,S.dts=S.pts,x&64&&(S.dts=(g[T+14]&14)<<27|(g[T+15]&255)<<20|(g[T+16]&254)<<12|(g[T+17]&255)<<5|(g[T+18]&254)>>>3,S.dts*=4,S.dts+=(g[T+18]&6)>>>1)),S},pS=function(g){switch(g){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},rIe=function(g){for(var v=4+tg(g),T=g.subarray(v),S=0,x=0,A=!1,j;x<T.byteLength-3;x++)if(T[x+2]===1){S=x+5;break}for(;S<T.byteLength;)switch(T[S]){case 0:if(T[S-1]!==0){S+=2;break}else if(T[S-2]!==0){S++;break}x+3!==S-2&&(j=pS(T[x+3]&31),j==="slice_layer_without_partitioning_rbsp_idr"&&(A=!0));do S++;while(T[S]!==1&&S<T.length);x=S-2,S+=3;break;case 1:if(T[S-1]!==0||T[S-2]!==0){S+=3;break}j=pS(T[x+3]&31),j==="slice_layer_without_partitioning_rbsp_idr"&&(A=!0),x=S-2,S+=3;break;default:S+=3;break}return T=T.subarray(x),S-=x,x=0,T&&T.byteLength>3&&(j=pS(T[x+3]&31),j==="slice_layer_without_partitioning_rbsp_idr"&&(A=!0)),A},sIe={parseType:eIe,parsePat:tIe,parsePmt:aIe,parsePayloadUnitStartIndicator:eg,parsePesType:iIe,parsePesTime:nIe,videoPacketContainsKeyFrame:rIe},yP=Hs,gc=qs.handleRollover,St={};St.ts=sIe,St.aac=us;var lo=kt.ONE_SECOND_IN_TS,za=188,Hn=71,oIe=function(g,v){for(var T=0,S=za,x,A;S<g.byteLength;){if(g[T]===Hn&&g[S]===Hn){switch(x=g.subarray(T,S),A=St.ts.parseType(x,v.pid),A){case"pat":v.pid=St.ts.parsePat(x);break;case"pmt":var j=St.ts.parsePmt(x);v.table=v.table||{},Object.keys(j).forEach(function(q){v.table[q]=j[q]});break}T+=za,S+=za;continue}T++,S++}},_P=function(g,v,T){for(var S=0,x=za,A,j,q,G,Q,se=!1;x<=g.byteLength;){if(g[S]===Hn&&(g[x]===Hn||x===g.byteLength)){switch(A=g.subarray(S,x),j=St.ts.parseType(A,v.pid),j){case"pes":q=St.ts.parsePesType(A,v.table),G=St.ts.parsePayloadUnitStartIndicator(A),q==="audio"&&G&&(Q=St.ts.parsePesTime(A),Q&&(Q.type="audio",T.audio.push(Q),se=!0));break}if(se)break;S+=za,x+=za;continue}S++,x++}for(x=g.byteLength,S=x-za,se=!1;S>=0;){if(g[S]===Hn&&(g[x]===Hn||x===g.byteLength)){switch(A=g.subarray(S,x),j=St.ts.parseType(A,v.pid),j){case"pes":q=St.ts.parsePesType(A,v.table),G=St.ts.parsePayloadUnitStartIndicator(A),q==="audio"&&G&&(Q=St.ts.parsePesTime(A),Q&&(Q.type="audio",T.audio.push(Q),se=!0));break}if(se)break;S-=za,x-=za;continue}S--,x--}},lIe=function(g,v,T){for(var S=0,x=za,A,j,q,G,Q,se,_e,Ve,Ae=!1,Qe={data:[],size:0};x<g.byteLength;){if(g[S]===Hn&&g[x]===Hn){switch(A=g.subarray(S,x),j=St.ts.parseType(A,v.pid),j){case"pes":if(q=St.ts.parsePesType(A,v.table),G=St.ts.parsePayloadUnitStartIndicator(A),q==="video"&&(G&&!Ae&&(Q=St.ts.parsePesTime(A),Q&&(Q.type="video",T.video.push(Q),Ae=!0)),!T.firstKeyFrame)){if(G&&Qe.size!==0){for(se=new Uint8Array(Qe.size),_e=0;Qe.data.length;)Ve=Qe.data.shift(),se.set(Ve,_e),_e+=Ve.byteLength;if(St.ts.videoPacketContainsKeyFrame(se)){var et=St.ts.parsePesTime(se);et?(T.firstKeyFrame=et,T.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}Qe.size=0}Qe.data.push(A),Qe.size+=A.byteLength}break}if(Ae&&T.firstKeyFrame)break;S+=za,x+=za;continue}S++,x++}for(x=g.byteLength,S=x-za,Ae=!1;S>=0;){if(g[S]===Hn&&g[x]===Hn){switch(A=g.subarray(S,x),j=St.ts.parseType(A,v.pid),j){case"pes":q=St.ts.parsePesType(A,v.table),G=St.ts.parsePayloadUnitStartIndicator(A),q==="video"&&G&&(Q=St.ts.parsePesTime(A),Q&&(Q.type="video",T.video.push(Q),Ae=!0));break}if(Ae)break;S-=za,x-=za;continue}S--,x--}},cIe=function(g,v){if(g.audio&&g.audio.length){var T=v;(typeof T>"u"||isNaN(T))&&(T=g.audio[0].dts),g.audio.forEach(function(A){A.dts=gc(A.dts,T),A.pts=gc(A.pts,T),A.dtsTime=A.dts/lo,A.ptsTime=A.pts/lo})}if(g.video&&g.video.length){var S=v;if((typeof S>"u"||isNaN(S))&&(S=g.video[0].dts),g.video.forEach(function(A){A.dts=gc(A.dts,S),A.pts=gc(A.pts,S),A.dtsTime=A.dts/lo,A.ptsTime=A.pts/lo}),g.firstKeyFrame){var x=g.firstKeyFrame;x.dts=gc(x.dts,S),x.pts=gc(x.pts,S),x.dtsTime=x.dts/lo,x.ptsTime=x.pts/lo}}},dIe=function(g){for(var v=!1,T=0,S=null,x=null,A=0,j=0,q;g.length-j>=3;){var G=St.aac.parseType(g,j);switch(G){case"timed-metadata":if(g.length-j<10){v=!0;break}if(A=St.aac.parseId3TagSize(g,j),A>g.length){v=!0;break}x===null&&(q=g.subarray(j,j+A),x=St.aac.parseAacTimestamp(q)),j+=A;break;case"audio":if(g.length-j<7){v=!0;break}if(A=St.aac.parseAdtsSize(g,j),A>g.length){v=!0;break}S===null&&(q=g.subarray(j,j+A),S=St.aac.parseSampleRate(q)),T++,j+=A;break;default:j++;break}if(v)return null}if(S===null||x===null)return null;var Q=lo/S,se={audio:[{type:"audio",dts:x,pts:x},{type:"audio",dts:x+T*1024*Q,pts:x+T*1024*Q}]};return se},uIe=function(g){var v={pid:null,table:null},T={};oIe(g,v);for(var S in v.table)if(v.table.hasOwnProperty(S)){var x=v.table[S];switch(x){case yP.H264_STREAM_TYPE:T.video=[],lIe(g,v,T),T.video.length===0&&delete T.video;break;case yP.ADTS_STREAM_TYPE:T.audio=[],_P(g,v,T),T.audio.length===0&&delete T.audio;break}}return T},hIe=function(g,v){var T=St.aac.isLikelyAacData(g),S;return T?S=dIe(g):S=uIe(g),!S||!S.audio&&!S.video?null:(cIe(S,v),S)},pIe={inspect:hIe,parseAudioPes_:_P};const mIe=function(g,v){v.on("data",function(T){const S=T.initSegment;T.initSegment={data:S.buffer,byteOffset:S.byteOffset,byteLength:S.byteLength};const x=T.data;T.data=x.buffer,g.postMessage({action:"data",segment:T,byteOffset:x.byteOffset,byteLength:x.byteLength},[T.data])}),v.on("done",function(T){g.postMessage({action:"done"})}),v.on("gopInfo",function(T){g.postMessage({action:"gopInfo",gopInfo:T})}),v.on("videoSegmentTimingInfo",function(T){const S={start:{decode:kt.videoTsToSeconds(T.start.dts),presentation:kt.videoTsToSeconds(T.start.pts)},end:{decode:kt.videoTsToSeconds(T.end.dts),presentation:kt.videoTsToSeconds(T.end.pts)},baseMediaDecodeTime:kt.videoTsToSeconds(T.baseMediaDecodeTime)};T.prependedContentDuration&&(S.prependedContentDuration=kt.videoTsToSeconds(T.prependedContentDuration)),g.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:S})}),v.on("audioSegmentTimingInfo",function(T){const S={start:{decode:kt.videoTsToSeconds(T.start.dts),presentation:kt.videoTsToSeconds(T.start.pts)},end:{decode:kt.videoTsToSeconds(T.end.dts),presentation:kt.videoTsToSeconds(T.end.pts)},baseMediaDecodeTime:kt.videoTsToSeconds(T.baseMediaDecodeTime)};T.prependedContentDuration&&(S.prependedContentDuration=kt.videoTsToSeconds(T.prependedContentDuration)),g.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:S})}),v.on("id3Frame",function(T){g.postMessage({action:"id3Frame",id3Frame:T})}),v.on("caption",function(T){g.postMessage({action:"caption",caption:T})}),v.on("trackinfo",function(T){g.postMessage({action:"trackinfo",trackInfo:T})}),v.on("audioTimingInfo",function(T){g.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:kt.videoTsToSeconds(T.start),end:kt.videoTsToSeconds(T.end)}})}),v.on("videoTimingInfo",function(T){g.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:kt.videoTsToSeconds(T.start),end:kt.videoTsToSeconds(T.end)}})}),v.on("log",function(T){g.postMessage({action:"log",log:T})})};class bP{constructor(v,T){this.options=T||{},this.self=v,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Uf.Transmuxer(this.options),mIe(this.self,this.transmuxer)}pushMp4Captions(v){this.captionParser||(this.captionParser=new C,this.captionParser.init());const T=new Uint8Array(v.data,v.byteOffset,v.byteLength),S=this.captionParser.parse(T,v.trackIds,v.timescales);this.self.postMessage({action:"mp4Captions",captions:S&&S.captions||[],logs:S&&S.logs||[],data:T.buffer},[T.buffer])}probeMp4StartTime({timescales:v,data:T}){const S=uS.startTime(v,T);this.self.postMessage({action:"probeMp4StartTime",startTime:S,data:T},[T.buffer])}probeMp4Tracks({data:v}){const T=uS.tracks(v);this.self.postMessage({action:"probeMp4Tracks",tracks:T,data:v},[v.buffer])}probeEmsgID3({data:v,offset:T}){const S=uS.getEmsgID3(v,T);this.self.postMessage({action:"probeEmsgID3",id3Frames:S,emsgData:v},[v.buffer])}probeTs({data:v,baseStartTime:T}){const S=typeof T=="number"&&!isNaN(T)?T*kt.ONE_SECOND_IN_TS:void 0,x=pIe.inspect(v,S);let A=null;x&&(A={hasVideo:x.video&&x.video.length===2||!1,hasAudio:x.audio&&x.audio.length===2||!1},A.hasVideo&&(A.videoStart=x.video[0].ptsTime),A.hasAudio&&(A.audioStart=x.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:A,data:v},[v.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(v){const T=new Uint8Array(v.data,v.byteOffset,v.byteLength);this.transmuxer.push(T)}reset(){this.transmuxer.reset()}setTimestampOffset(v){const T=v.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(kt.secondsToVideoTs(T)))}setAudioAppendStart(v){this.transmuxer.setAudioAppendStart(Math.ceil(kt.secondsToVideoTs(v.appendStart)))}setRemux(v){this.transmuxer.setRemux(v.remux)}flush(v){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(v){this.transmuxer.alignGopsWith(v.gopsToAlignWith.slice())}}self.onmessage=function(g){if(g.data.action==="init"&&g.data.options){this.messageHandlers=new bP(self,g.data.options);return}this.messageHandlers||(this.messageHandlers=new bP(self)),g.data&&g.data.action&&g.data.action!=="init"&&this.messageHandlers[g.data.action]&&this.messageHandlers[g.data.action](g.data)}}));var Dge=Ax(Bge);const Mge=(e,t,a)=>{const{type:i,initSegment:n,captions:r,captionStreams:o,metadata:l,videoFrameDtsTime:c,videoFramePtsTime:d}=e.data.segment;t.buffer.push({captions:r,captionStreams:o,metadata:l});const u=e.data.segment.boxes||{data:e.data.segment.data},h={type:i,data:new Uint8Array(u.data,u.data.byteOffset,u.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};typeof c<"u"&&(h.videoFrameDtsTime=c),typeof d<"u"&&(h.videoFramePtsTime=d),a(h)},Lge=({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)},Rge=(e,t)=>{t.gopInfo=e.data.gopInfo},Bx=e=>{const{transmuxer:t,bytes:a,audioAppendStart:i,gopsToAlignWith:n,remux:r,onData:o,onTrackInfo:l,onAudioTimingInfo:c,onVideoTimingInfo:d,onVideoSegmentTimingInfo:u,onAudioSegmentTimingInfo:h,onId3:m,onCaptions:p,onDone:f,onEndedTimeline:y,onTransmuxerLog:b,isEndOfTimeline:E}=e,D={buffer:[]};let M=E;const N=P=>{t.currentTransmux===e&&(P.data.action==="data"&&Mge(P,D,o),P.data.action==="trackinfo"&&l(P.data.trackInfo),P.data.action==="gopInfo"&&Rge(P,D),P.data.action==="audioTimingInfo"&&c(P.data.audioTimingInfo),P.data.action==="videoTimingInfo"&&d(P.data.videoTimingInfo),P.data.action==="videoSegmentTimingInfo"&&u(P.data.videoSegmentTimingInfo),P.data.action==="audioSegmentTimingInfo"&&h(P.data.audioSegmentTimingInfo),P.data.action==="id3Frame"&&m([P.data.id3Frame],P.data.id3Frame.dispatchType),P.data.action==="caption"&&p(P.data.caption),P.data.action==="endedtimeline"&&(M=!1,y()),P.data.action==="log"&&b(P.data.log),P.data.type==="transmuxed"&&(M||(t.onmessage=null,Lge({transmuxedData:D,callback:f}),Dx(t))))};if(t.onmessage=N,i&&t.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(n)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),typeof r<"u"&&t.postMessage({action:"setRemux",remux:r}),a.byteLength){const P=a instanceof ArrayBuffer?a:a.buffer,L=a instanceof ArrayBuffer?0:a.byteOffset;t.postMessage({action:"push",data:P,byteOffset:L,byteLength:a.byteLength},[P])}E&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Dx=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),typeof e.currentTransmux=="function"?e.currentTransmux():Bx(e.currentTransmux))},Mx=(e,t)=>{e.postMessage({action:t}),Dx(e)},Lx=(e,t)=>{if(!t.currentTransmux){t.currentTransmux=e,Mx(t,e);return}t.transmuxQueue.push(Mx.bind(null,t,e))},Fge=e=>{Lx("reset",e)},Vge=e=>{Lx("endTimeline",e)},Rx=e=>{if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,Bx(e);return}e.transmuxer.transmuxQueue.push(e)};var a2={reset:Fge,endTimeline:Vge,transmux:Rx,createTransmuxer:e=>{const t=new Dge;t.currentTransmux=null,t.transmuxQueue=[];const a=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,a.call(t)),t.postMessage({action:"init",options:e}),t}};const zd=function(e){const t=e.transmuxer,a=e.endAction||e.action,i=e.callback,n=Ht({},e,{endAction:null,transmuxer:null,callback:null}),r=o=>{o.data.action===a&&(t.removeEventListener("message",r),o.data.data&&(o.data.data=new Uint8Array(o.data.data,e.byteOffset||0,e.byteLength||o.data.data.byteLength),e.data&&(e.data=o.data.data)),i(o.data))};if(t.addEventListener("message",r),e.data){const o=e.data instanceof ArrayBuffer;n.byteOffset=o?0:e.data.byteOffset,n.byteLength=e.data.byteLength;const l=[o?e.data:e.data.buffer];t.postMessage(n,l)}else t.postMessage(n)},An={FAILURE:2,TIMEOUT:-101,ABORTED:-102},i2=e=>{e.forEach(t=>{t.abort()})},Uge=e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}),jge=e=>{const t=e.target,a={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return a.bytesReceived=e.loaded,a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3),a},n2=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:An.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:An.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:An.FAILURE,xhr:t}:t.responseType==="arraybuffer"&&t.response.byteLength===0?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:An.FAILURE,xhr:t}:null,Fx=(e,t,a)=>(i,n)=>{const r=n.response,o=n2(i,n);if(o)return a(o,e);if(r.byteLength!==16)return a({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:An.FAILURE,xhr:n},e);const l=new DataView(r),c=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let d=0;d<t.length;d++)t[d].bytes=c;return a(null,e)},Vx=(e,t)=>{const a=q_(e.map.bytes);if(a!=="mp4"){const i=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:`Found unsupported ${a||"unknown"} container for initialization segment at URL: ${i}`,code:An.FAILURE})}zd({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:n})=>(e.map.bytes=n,i.forEach(function(r){e.map.tracks=e.map.tracks||{},!e.map.tracks[r.type]&&(e.map.tracks[r.type]=r,typeof r.id=="number"&&r.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[r.id]=r.timescale))}),t(null))})},zge=({segment:e,finishProcessingFn:t})=>(a,i)=>{const n=n2(a,i);if(n)return t(n,e);const r=new Uint8Array(i.response);if(e.map.key)return e.map.encryptedBytes=r,t(null,e);e.map.bytes=r,Vx(e,function(o){if(o)return o.xhr=i,o.status=i.status,t(o,e);t(null,e)})},Hge=({segment:e,finishProcessingFn:t,responseType:a})=>(i,n)=>{const r=n2(i,n);if(r)return t(r,e);const o=a==="arraybuffer"||!n.responseText?n.response:Pge(n.responseText.substring(e.lastReachedChar||0));return e.stats=Uge(n),e.key?e.encryptedBytes=new Uint8Array(o):e.bytes=new Uint8Array(o),t(null,e)},qge=({segment:e,bytes:t,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})=>{const p=e.map&&e.map.tracks||{},f=!!(p.audio&&p.video);let y=i.bind(null,e,"audio","start");const b=i.bind(null,e,"audio","end");let E=i.bind(null,e,"video","start");const D=i.bind(null,e,"video","end"),M=()=>Rx({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:f,onData:N=>{N.type=N.type==="combined"?"video":N.type,u(e,N)},onTrackInfo:N=>{a&&(f&&(N.isMuxed=!0),a(e,N))},onAudioTimingInfo:N=>{y&&typeof N.start<"u"&&(y(N.start),y=null),b&&typeof N.end<"u"&&b(N.end)},onVideoTimingInfo:N=>{E&&typeof N.start<"u"&&(E(N.start),E=null),D&&typeof N.end<"u"&&D(N.end)},onVideoSegmentTimingInfo:N=>{n(N)},onAudioSegmentTimingInfo:N=>{r(N)},onId3:(N,P)=>{o(e,N,P)},onCaptions:N=>{l(e,[N])},isEndOfTimeline:c,onEndedTimeline:()=>{d()},onTransmuxerLog:m,onDone:N=>{h&&(N.type=N.type==="combined"?"video":N.type,h(null,e,N))}});zd({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:N=>{e.bytes=t=N.data;const P=N.result;P&&(a(e,{hasAudio:P.hasAudio,hasVideo:P.hasVideo,isMuxed:f}),a=null),M()}})},Ux=({segment:e,bytes:t,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})=>{let p=new Uint8Array(t);if(Tme(p)){e.isFmp4=!0;const{tracks:f}=e.map,y={isFmp4:!0,hasVideo:!!f.video,hasAudio:!!f.audio};f.audio&&f.audio.codec&&f.audio.codec!=="enca"&&(y.audioCodec=f.audio.codec),f.video&&f.video.codec&&f.video.codec!=="encv"&&(y.videoCodec=f.video.codec),f.video&&f.audio&&(y.isMuxed=!0),a(e,y);const b=(E,D)=>{u(e,{data:p,type:y.hasAudio&&!y.isMuxed?"audio":"video"}),D&&D.length&&o(e,D),E&&E.length&&l(e,E),h(null,e,{})};zd({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback:({data:E,startTime:D})=>{t=E.buffer,e.bytes=p=E,y.hasAudio&&!y.isMuxed&&i(e,"audio","start",D),y.hasVideo&&i(e,"video","start",D),zd({action:"probeEmsgID3",data:p,transmuxer:e.transmuxer,offset:D,callback:({emsgData:M,id3Frames:N})=>{if(t=M.buffer,e.bytes=p=M,!f.video||!M.byteLength||!e.transmuxer){b(void 0,N);return}zd({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[f.video.id],callback:P=>{t=P.data.buffer,e.bytes=p=P.data,P.logs.forEach(function(L){m(_t(L,{stream:"mp4CaptionParser"}))}),b(P.captions,N)}})}})}});return}if(!e.transmuxer){h(null,e,{});return}if(typeof e.container>"u"&&(e.container=q_(p)),e.container!=="ts"&&e.container!=="aac"){a(e,{hasAudio:!1,hasVideo:!1}),h(null,e,{});return}qge({segment:e,bytes:t,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})},jx=function({id:e,key:t,encryptedBytes:a,decryptionWorker:i},n){const r=l=>{if(l.data.source===e){i.removeEventListener("message",r);const c=l.data.decrypted;n(new Uint8Array(c.bytes,c.byteOffset,c.byteLength))}};i.addEventListener("message",r);let o;t.bytes.slice?o=t.bytes.slice():o=new Uint32Array(Array.prototype.slice.call(t.bytes)),i.postMessage(wx({source:e,encrypted:a,key:o,iv:t.iv}),[a.buffer,o.buffer])},Wge=({decryptionWorker:e,segment:t,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})=>{jx({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},p=>{t.bytes=p,Ux({segment:t,bytes:t.bytes,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})})},Gge=({activeXhrs:e,decryptionWorker:t,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})=>{let p=0,f=!1;return(y,b)=>{if(!f){if(y)return f=!0,i2(e),h(y,b);if(p+=1,p===e.length){const E=function(){if(b.encryptedBytes)return Wge({decryptionWorker:t,segment:b,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m});Ux({segment:b,bytes:b.bytes,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u,doneFn:h,onTransmuxerLog:m})};if(b.endOfAllRequests=Date.now(),b.map&&b.map.encryptedBytes&&!b.map.bytes)return jx({decryptionWorker:t,id:b.requestId+"-init",encryptedBytes:b.map.encryptedBytes,key:b.map.key},D=>{b.map.bytes=D,Vx(b,M=>{if(M)return i2(e),h(M,b);E()})});E()}}}},Kge=({loadendState:e,abortFn:t})=>a=>{a.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)},Xge=({segment:e,progressFn:t,trackInfoFn:a,timingInfoFn:i,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:d,dataFn:u})=>h=>{if(!h.target.aborted)return e.stats=_t(e.stats,jge(h)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(h,e)},Jge=({xhr:e,xhrOptions:t,decryptionWorker:a,segment:i,abortFn:n,progressFn:r,trackInfoFn:o,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:d,id3Fn:u,captionsFn:h,isEndOfTimeline:m,endedTimelineFn:p,dataFn:f,doneFn:y,onTransmuxerLog:b})=>{const E=[],D=Gge({activeXhrs:E,decryptionWorker:a,trackInfoFn:o,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:d,id3Fn:u,captionsFn:h,isEndOfTimeline:m,endedTimelineFn:p,dataFn:f,doneFn:y,onTransmuxerLog:b});if(i.key&&!i.key.bytes){const V=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&V.push(i.map.key);const $=_t(t,{uri:i.key.resolvedUri,responseType:"arraybuffer"}),U=Fx(i,V,D),ae=e($,U);E.push(ae)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const ae=_t(t,{uri:i.map.key.resolvedUri,responseType:"arraybuffer"}),oe=Fx(i,[i.map.key],D),Y=e(ae,oe);E.push(Y)}const V=_t(t,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:$b(i.map)}),$=zge({segment:i,finishProcessingFn:D}),U=e(V,$);E.push(U)}const M=_t(t,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:$b(i)}),N=Hge({segment:i,finishProcessingFn:D,responseType:M.responseType}),P=e(M,N);P.addEventListener("progress",Xge({segment:i,progressFn:r,trackInfoFn:o,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:d,id3Fn:u,captionsFn:h,isEndOfTimeline:m,endedTimelineFn:p,dataFn:f})),E.push(P);const L={};return E.forEach(V=>{V.addEventListener("loadend",Kge({loadendState:L,abortFn:n}))}),()=>i2(E)},Yge=Oi("CodecUtils"),Qge=function(e){const t=e.attributes||{};if(t.CODECS)return bn(t.CODECS)},zx=(e,t)=>{const a=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&a.AUDIO&&e.mediaGroups.AUDIO[a.AUDIO]},Zge=(e,t)=>{if(!zx(e,t))return!0;const a=t.attributes||{},i=e.mediaGroups.AUDIO[a.AUDIO];for(const n in i)if(!i[n].uri&&!i[n].playlists)return!0;return!1},mm=function(e){const t={};return e.forEach(({mediaType:a,type:i,details:n})=>{t[a]=t[a]||[],t[a].push(Y5(`${i}${n}`))}),Object.keys(t).forEach(function(a){if(t[a].length>1){Yge(`multiple ${a} codecs found as attributes: ${t[a].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),t[a]=null;return}t[a]=t[a][0]}),t},Hx=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},Hd=function(e,t){const a=t.attributes||{},i=mm(Qge(t)||[]);if(zx(e,t)&&!i.audio&&!Zge(e,t)){const n=mm(Che(e,a.AUDIO)||[]);n.audio&&(i.audio=n.audio)}return i},fm=Oi("PlaylistSelector"),qx=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},gm=function(e,t){if(!e)return"";const a=O.getComputedStyle(e);return a?a[t]:""},yl=function(e,t){const a=e.slice();e.sort(function(i,n){const r=t(i,n);return r===0?a.indexOf(i)-a.indexOf(n):r})},r2=function(e,t){let a,i;return e.attributes.BANDWIDTH&&(a=e.attributes.BANDWIDTH),a=a||O.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),i=i||O.Number.MAX_VALUE,a-i},$ge=function(e,t){let a,i;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(a=e.attributes.RESOLUTION.width),a=a||O.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),i=i||O.Number.MAX_VALUE,a===i&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:a-i};let Wx=function(e,t,a,i,n,r){if(!e)return;const o={bandwidth:t,width:a,height:i,limitRenditionByPlayerDimensions:n};let l=e.playlists;Qa.isAudioOnly(e)&&(l=r.getAudioTrackPlaylists_(),o.audioOnly=!0);let c=l.map(P=>{let L;const V=P.attributes&&P.attributes.RESOLUTION&&P.attributes.RESOLUTION.width,$=P.attributes&&P.attributes.RESOLUTION&&P.attributes.RESOLUTION.height;return L=P.attributes&&P.attributes.BANDWIDTH,L=L||O.Number.MAX_VALUE,{bandwidth:L,width:V,height:$,playlist:P}});yl(c,(P,L)=>P.bandwidth-L.bandwidth),c=c.filter(P=>!Qa.isIncompatible(P.playlist));let d=c.filter(P=>Qa.isEnabled(P.playlist));d.length||(d=c.filter(P=>!Qa.isDisabled(P.playlist)));const u=d.filter(P=>P.bandwidth*ua.BANDWIDTH_VARIANCE<t);let h=u[u.length-1];const m=u.filter(P=>P.bandwidth===h.bandwidth)[0];if(n===!1){const P=m||d[0]||c[0];if(P&&P.playlist){let L="sortedPlaylistReps";return m&&(L="bandwidthBestRep"),d[0]&&(L="enabledPlaylistReps"),fm(`choosing ${qx(P)} using ${L} with options`,o),P.playlist}return fm("could not choose a playlist with options",o),null}const p=u.filter(P=>P.width&&P.height);yl(p,(P,L)=>P.width-L.width);const f=p.filter(P=>P.width===a&&P.height===i);h=f[f.length-1];const y=f.filter(P=>P.bandwidth===h.bandwidth)[0];let b,E,D;y||(b=p.filter(P=>P.width>a||P.height>i),E=b.filter(P=>P.width===b[0].width&&P.height===b[0].height),h=E[E.length-1],D=E.filter(P=>P.bandwidth===h.bandwidth)[0]);let M;if(r.leastPixelDiffSelector){const P=p.map(L=>(L.pixelDiff=Math.abs(L.width-a)+Math.abs(L.height-i),L));yl(P,(L,V)=>L.pixelDiff===V.pixelDiff?V.bandwidth-L.bandwidth:L.pixelDiff-V.pixelDiff),M=P[0]}const N=M||D||y||m||d[0]||c[0];if(N&&N.playlist){let P="sortedPlaylistReps";return M?P="leastPixelDiffRep":D?P="resolutionPlusOneRep":y?P="resolutionBestRep":m?P="bandwidthBestRep":d[0]&&(P="enabledPlaylistReps"),fm(`choosing ${qx(N)} using ${P} with options`,o),N.playlist}return fm("could not choose a playlist with options",o),null};const Gx=function(){const e=this.useDevicePixelRatio&&O.devicePixelRatio||1;return Wx(this.playlists.main,this.systemBandwidth,parseInt(gm(this.tech_.el(),"width"),10)*e,parseInt(gm(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)},eye=function(e){let t=-1,a=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){const i=this.useDevicePixelRatio&&O.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,a=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==a&&(t=e*this.systemBandwidth+(1-e)*t,a=this.systemBandwidth),Wx(this.playlists.main,t,parseInt(gm(this.tech_.el(),"width"),10)*i,parseInt(gm(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)}},tye=function(e){const{main:t,currentTime:a,bandwidth:i,duration:n,segmentDuration:r,timeUntilRebuffer:o,currentTimeline:l,syncController:c}=e,d=t.playlists.filter(p=>!Qa.isIncompatible(p));let u=d.filter(Qa.isEnabled);u.length||(u=d.filter(p=>!Qa.isDisabled(p)));const h=u.filter(Qa.hasAttribute.bind(null,"BANDWIDTH")).map(p=>{const f=c.getSyncPoint(p,n,l,a)?1:2,y=Qa.estimateSegmentRequestTime(r,i,p)*f-o;return{playlist:p,rebufferingImpact:y}}),m=h.filter(p=>p.rebufferingImpact<=0);return yl(m,(p,f)=>r2(f.playlist,p.playlist)),m.length?m[0]:(yl(h,(p,f)=>p.rebufferingImpact-f.rebufferingImpact),h[0]||null)},aye=function(){const e=this.playlists.main.playlists.filter(Qa.isEnabled);return yl(e,(t,a)=>r2(t,a)),e.filter(t=>!!Hd(this.playlists.main,t).video)[0]||null},iye=e=>{let t=0,a;return e.bytes&&(a=new Uint8Array(e.bytes),e.segments.forEach(i=>{a.set(i,t),t+=i.byteLength})),a},nye=function(e,t,a){if(!e[a]){t.trigger({type:"usage",name:"vhs-608"});let i=a;/^cc708_/.test(a)&&(i="SERVICE"+a.split("_")[1]);const n=t.textTracks().getTrackById(i);if(n)e[a]=n;else{const r=t.options_.vhs&&t.options_.vhs.captionServices||{};let o=a,l=a,c=!1;const d=r[i];d&&(o=d.label,l=d.language,c=d.default),e[a]=t.addRemoteTextTrack({kind:"captions",id:i,default:c,label:o,language:l},!1).track}}},rye=function({inbandTextTracks:e,captionArray:t,timestampOffset:a}){if(!t)return;const i=O.WebKitDataCue||O.VTTCue;t.forEach(n=>{const r=n.stream;n.content?n.content.forEach(o=>{const l=new i(n.startTime+a,n.endTime+a,o.text);l.line=o.line,l.align="left",l.position=o.position,l.positionAlign="line-left",e[r].addCue(l)}):e[r].addCue(new i(n.startTime+a,n.endTime+a,n.text))})},sye=function(e){Object.defineProperties(e.frame,{id:{get(){return ge.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get(){return ge.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get(){return ge.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},oye=({inbandTextTracks:e,metadataArray:t,timestampOffset:a,videoDuration:i})=>{if(!t)return;const n=O.WebKitDataCue||O.VTTCue,r=e.metadataTrack_;if(!r||(t.forEach(u=>{const h=u.cueTime+a;typeof h!="number"||O.isNaN(h)||h<0||!(h<1/0)||!u.frames||!u.frames.length||u.frames.forEach(m=>{const p=new n(h,h,m.value||m.url||m.data||"");p.frame=m,p.value=m,sye(p),r.addCue(p)})}),!r.cues||!r.cues.length))return;const o=r.cues,l=[];for(let u=0;u<o.length;u++)o[u]&&l.push(o[u]);const c=l.reduce((u,h)=>{const m=u[h.startTime]||[];return m.push(h),u[h.startTime]=m,u},{}),d=Object.keys(c).sort((u,h)=>Number(u)-Number(h));d.forEach((u,h)=>{const m=c[u],p=isFinite(i)?i:u,f=Number(d[h+1])||p;m.forEach(y=>{y.endTime=f})})},lye={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},cye=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),dye=({inbandTextTracks:e,dateRanges:t})=>{const a=e.metadataTrack_;if(!a)return;const i=O.WebKitDataCue||O.VTTCue;t.forEach(n=>{for(const r of Object.keys(n)){if(cye.has(r))continue;const o=new i(n.startTime,n.endTime,"");o.id=n.id,o.type="com.apple.quicktime.HLS",o.value={key:lye[r],data:n[r]},(r==="scte35Out"||r==="scte35In")&&(o.value.data=new Uint8Array(o.value.data.match(/[\da-f]{2}/gi)).buffer),a.addCue(o)}n.processDateRange()})},Kx=(e,t,a)=>{e.metadataTrack_||(e.metadataTrack_=a.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,ge.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},qd=function(e,t,a){let i,n;if(a&&a.cues)for(i=a.cues.length;i--;)n=a.cues[i],n.startTime>=e&&n.endTime<=t&&a.removeCue(n)},uye=function(e){const t=e.cues;if(!t)return;const a={};for(let i=t.length-1;i>=0;i--){const n=t[i],r=`${n.startTime}-${n.endTime}-${n.text}`;a[r]?e.removeCue(n):a[r]=n}},hye=(e,t,a)=>{if(typeof t>"u"||t===null||!e.length)return[];const i=Math.ceil((t-a+3)*ws.ONE_SECOND_IN_TS);let n;for(n=0;n<e.length&&!(e[n].pts>i);n++);return e.slice(n)},pye=(e,t,a)=>{if(!t.length)return e;if(a)return t.slice();const i=t[0].pts;let n=0;for(n;n<e.length&&!(e[n].pts>=i);n++);return e.slice(0,n).concat(t)},mye=(e,t,a,i)=>{const n=Math.ceil((t-i)*ws.ONE_SECOND_IN_TS),r=Math.ceil((a-i)*ws.ONE_SECOND_IN_TS),o=e.slice();let l=e.length;for(;l--&&!(e[l].pts<=r););if(l===-1)return o;let c=l+1;for(;c--&&!(e[c].pts<=n););return c=Math.max(c,0),o.splice(c,l-c+1),o},fye=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const a=Object.keys(e).sort(),i=Object.keys(t).sort();if(a.length!==i.length)return!1;for(let n=0;n<a.length;n++){const r=a[n];if(r!==i[n]||e[r]!==t[r])return!1}return!0},Xx=22,gye=function(e,t,a){t=t||[];const i=[];let n=0;for(let r=0;r<t.length;r++){const o=t[r];if(e===o.timeline&&(i.push(r),n+=o.duration,n>a))return r}return i.length===0?0:i[i.length-1]},Wd=1,yye=500,Jx=e=>typeof e=="number"&&isFinite(e),ym=1/60,_ye=(e,t,a)=>e!=="main"||!t||!a?null:!a.hasAudio&&!a.hasVideo?"Neither audio nor video found in segment.":t.hasVideo&&!a.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&a.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,bye=(e,t,a)=>{let i=t-ua.BACK_BUFFER_LENGTH;e.length&&(i=Math.max(i,e.start(0)));const n=t-a;return Math.min(n,i)},_l=e=>{const{startOfSegment:t,duration:a,segment:i,part:n,playlist:{mediaSequence:r,id:o,segments:l=[]},mediaIndex:c,partIndex:d,timeline:u}=e,h=l.length-1;let m="mediaIndex/partIndex increment";e.getMediaInfoForTime?m=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(m="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(m+=` with independent ${e.independent}`);const p=typeof d=="number",f=e.segment.uri?"segment":"pre-segment",y=p?rx({preloadSegment:i})-1:0;return`${f} [${r+c}/${r+h}]`+(p?` part [${d}/${y}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(p?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${t}] duration [${a}] timeline [${u}] selected by [${m}] playlist [${o}]`},Yx=e=>`${e}TimingInfo`,vye=({segmentTimeline:e,currentTimeline:t,startOfSegment:a,buffered:i,overrideCheck:n})=>!n&&e===t?null:e<t?a:i.length?i.end(i.length-1):a,Qx=({timelineChangeController:e,currentTimeline:t,segmentTimeline:a,loaderType:i,audioDisabled:n})=>{if(t===a)return!1;if(i==="audio"){const r=e.lastTimelineChange({type:"main"});return!r||r.to!==a}if(i==="main"&&n){const r=e.pendingTimelineChange({type:"audio"});return!(r&&r.to===a)}return!1},Sye=e=>{let t=0;return["video","audio"].forEach(function(a){const i=e[`${a}TimingInfo`];if(!i)return;const{start:n,end:r}=i;let o;typeof n=="bigint"||typeof r=="bigint"?o=O.BigInt(r)-O.BigInt(n):typeof n=="number"&&typeof r=="number"&&(o=r-n),typeof o<"u"&&o>t&&(t=o)}),typeof t=="bigint"&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t},Zx=({segmentDuration:e,maxDuration:t})=>e?Math.round(e)>t+xn:!1,wye=(e,t)=>{if(t!=="hls")return null;const a=Sye({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!a)return null;const i=e.playlist.targetDuration,n=Zx({segmentDuration:a,maxDuration:i*2}),r=Zx({segmentDuration:a,maxDuration:i}),o=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${a} when the reported duration is ${e.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return n||r?{severity:n?"warn":"info",message:o}:null};let s2=class extends ge.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=Oi(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(a){a!==this.state_&&(this.logger_(`${this.state_} -> ${a}`),this.state_=a,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})}createTransmuxer_(){return a2.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,O.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&a2.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Ya();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:a,isMuxed:i}=e;if(a&&t&&!this.audioDisabled_&&!i)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const a=pm(e);let i=this.initSegments_[a];return t&&!i&&e.bytes&&(this.initSegments_[a]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),i||e}segmentKey(e,t=!1){if(!e)return null;const a=Tx(e);let i=this.keyCache_[a];this.cacheEncryptionKeys_&&t&&!i&&e.bytes&&(this.keyCache_[a]=i={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(i||e).resolvedUri};return i&&(n.bytes=i.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const a=this.playlist_,i=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(a&&(a.id?n=a.id:a.uri&&(n=a.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.syncController_.updateMediaSequenceMap(e,this.currentTime_(),this.loaderType_),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const r=e.mediaSequence-a.mediaSequence;if(this.logger_(`live window shift [${r}]`),this.mediaIndex!==null)if(this.mediaIndex-=r,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=l}}i&&(i.mediaIndex-=r,i.mediaIndex<0?(i.mediaIndex=null,i.partIndex=null):(i.mediaIndex>=0&&(i.segment=e.segments[i.mediaIndex]),i.partIndex>=0&&i.segment.parts&&(i.part=i.segment.parts[i.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,e)}pause(){this.checkBufferTimeout_&&(O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.resyncLoader()}resyncLoader(){this.transmuxer_&&a2.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.shouldForceTimestampOffsetAfterResync_=!0,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,a=()=>{},i=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const r=()=>{n--,n===0&&a()};(i||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,r)),(i||this.loaderType_==="main")&&(this.gopBuffer_=mye(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,r));for(const o in this.inbandTextTracks_)qd(e,t,this.inbandTextTracks_[o]);qd(e,t,this.segmentMetadataTrack_),r()}monitorBuffer_(){this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O.setTimeout(this.monitorBufferTick_.bind(this),yye)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&(typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,a=this.partIndex){if(!t||!this.mediaSource_)return!1;const i=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,r=!i||!i.parts||a+1===i.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&r}chooseNextRequest_(){const e=this.buffered_(),t=ix(e)||0,a=qb(e,this.currentTime_()),i=!this.hasPlayed_()&&a>=1,n=a>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||i||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=gye(this.currentTimeline_,r,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const h=r[this.mediaIndex],m=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=h.end?h.end:t,h.parts&&h.parts[m+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=m+1):o.mediaIndex=this.mediaIndex+1}else{const{segmentIndex:h,startTime:m,partIndex:p}=Qa.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${t}`:`currentTime ${this.currentTime_()}`,o.mediaIndex=h,o.startOfSegment=m,o.partIndex=p,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const l=r[o.mediaIndex];let c=l&&typeof o.partIndex=="number"&&l.parts&&l.parts[o.partIndex];if(!l||typeof o.partIndex=="number"&&!c)return null;typeof o.partIndex!="number"&&l.parts&&(o.partIndex=0,c=l.parts[0]);const d=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!a&&c&&!d&&!c.independent)if(o.partIndex===0){const h=r[o.mediaIndex-1],m=h.parts&&h.parts.length&&h.parts[h.parts.length-1];m&&m.independent&&(o.mediaIndex-=1,o.partIndex=h.parts.length-1,o.independent="previous segment")}else l.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const u=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=r.length-1&&u&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}generateSegmentInfo_(e){const{independent:t,playlist:a,mediaIndex:i,startOfSegment:n,isSyncRequest:r,partIndex:o,forceTimestampOffset:l,getMediaInfoForTime:c}=e,d=a.segments[i],u=typeof o=="number"&&d.parts[o],h={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||d.resolvedUri,mediaIndex:i,partIndex:u?o:null,isSyncRequest:r,startOfSegment:n,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:d.timeline,duration:u&&u.duration||d.duration,segment:d,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:c,independent:t},m=typeof l<"u"?l:this.isPendingTimestampOffset_;h.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:d.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:m});const p=ix(this.sourceUpdater_.audioBuffered());return typeof p=="number"&&(h.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(h.gopsToAlignWith=hye(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),h}timestampOffsetForSegment_(e){return vye(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),a=e.bandwidth,i=this.pendingSegment_.duration,n=Qa.estimateSegmentRequestTime(i,a,this.playlist_,e.bytesReceived),r=Wfe(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=r)return;const o=tye({main:this.vhs_.playlists.main,currentTime:t,bandwidth:a,duration:this.duration_(),segmentDuration:i,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const l=n-r-o.rebufferingImpact;let c=.5;r<=xn&&(c=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||l<c)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*ua.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${_l(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},fye(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))}handleTimingInfo_(e,t,a,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,r=Yx(t);n[r]=n[r]||{},n[r][a]=i,this.logger_(`timinginfo: ${t} - ${a} - ${i}`),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const a=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),i={};t.forEach(n=>{i[n.stream]=i[n.stream]||{startTime:1/0,captions:[],endTime:0};const r=i[n.stream];r.startTime=Math.min(r.startTime,n.startTime+a),r.endTime=Math.max(r.endTime,n.endTime+a),r.captions.push(n)}),Object.keys(i).forEach(n=>{const{startTime:r,endTime:o,captions:l}=i[n],c=this.inbandTextTracks_;this.logger_(`adding cues from ${r} -> ${o} for ${n}`),nye(c,this.vhs_.tech_,n),qd(r,o,c[n]),rye({captionArray:l,inbandTextTracks:c,timestampOffset:a})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,a){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,a));return}this.addMetadataToTextTrack(a,t,this.duration_())}}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Qx({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:a,hasVideo:i,isMuxed:n}=t;return!(i&&!e.videoTimingInfo||a&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Qx({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}const a=this.pendingSegment_;if(this.setTimeMapping_(a.timeline),this.updateMediaSecondsLoaded_(a.part||a.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),a.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),a.isFmp4=e.isFmp4,a.timingInfo=a.timingInfo||{},a.isFmp4)this.trigger("fmp4"),a.timingInfo.start=a[Yx(t.type)].start;else{const i=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&i&&i.hasVideo;let r;n&&(r=a.videoTimingInfo.start),a.timingInfo.start=this.trueSegmentStart_({currentStart:a.timingInfo.start,playlist:a.playlist,mediaIndex:a.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:r,videoTimingInfo:a.videoTimingInfo,audioTimingInfo:a.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(a,t.type),this.updateSourceBufferTimestampOffset_(a),a.isSyncRequest){this.updateTimingInfoEnd_(a),this.syncController_.saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:this.loaderType_==="main"});const i=this.chooseNextRequest_();if(i.mediaIndex!==a.mediaIndex||i.partIndex!==a.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}a.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(a,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:a,playlist:i}){if(a){const n=pm(a);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(a,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=i,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:a},i){const n=this.sourceUpdater_.audioBuffered(),r=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ns(n).join(", ")),r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ns(r).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,c=r.length?r.start(0):0,d=r.length?r.end(r.length-1):0;if(l-o<=Wd&&d-c<=Wd){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${a.byteLength}, audio buffer: ${Ns(n).join(", ")}, video buffer: ${Ns(r).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:a}));const u=this.currentTime_()-Wd;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${u}`),this.remove(0,u,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Wd}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=O.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Wd*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:a},i){if(i){if(i.code===Xx){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:a});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",i),this.error(`${t} append of ${a.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:a,data:i,bytes:n}){if(!n){const r=[i];let o=i.byteLength;a&&(r.unshift(a),o+=a.byteLength),n=iye({bytes:o,segments:r})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,a){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const i=this.pendingSegment_.segment,n=`${e}TimingInfo`;i[n]||(i[n]={}),i[n].transmuxerPrependedSeconds=a.prependedContentDuration||0,i[n].transmuxedPresentationStart=a.start.presentation,i[n].transmuxedDecodeStart=a.start.decode,i[n].transmuxedPresentationEnd=a.end.presentation,i[n].transmuxedDecodeEnd=a.end.decode,i[n].baseMediaDecodeTime=a.baseMediaDecodeTime}appendData_(e,t){const{type:a,data:i}=t;if(!i||!i.byteLength||a==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:a,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:a,initSegment:n,data:i})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(()=>{const t=Ht({},e,{forceTimestampOffset:!0});Ht(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),a=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),i=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,r=a||i&&n;this.logger_(`Requesting ${_l(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Jge({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:l,stream:c})=>{this.logger_(`${_l(e)} logged from transmuxer stream ${c} as a ${l}: ${o}`)}})}trimBackBuffer_(e){const t=bye(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,a=e.part,i={resolvedUri:a?a.resolvedUri:t.resolvedUri,byterange:a?a.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},n=e.playlist.segments[e.mediaIndex-1];if(n&&n.timeline===t.timeline&&(n.videoTimingInfo?i.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd:n.audioTimingInfo&&(i.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd)),t.key){const r=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);i.key=this.segmentKey(t.key),i.key.iv=r}return t.map&&(i.map=this.initSegmentForMap(t.map)),i}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<ym){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${ym}`);return}this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,a){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,a));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===An.ABORTED)return;if(this.pause(),e.code===An.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const i=this.pendingSegment_;this.saveBandwidthRelatedStats_(i.duration,t.stats),i.endOfAllRequests=t.endOfAllRequests,a.gopInfo&&(this.gopBuffer_=pye(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(i)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:a,firstVideoFrameTimeForData:i,currentVideoTimestampOffset:n,useVideoTimingInfo:r,videoTimingInfo:o,audioTimingInfo:l}){if(typeof e<"u")return e;if(!r)return l.start;const c=t.segments[a-1];return a===0||!c||typeof c.start>"u"||c.end!==i+n?i:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:a,hasVideo:i,isMuxed:n}=t,r=this.loaderType_==="main"&&i,o=!this.audioDisabled_&&a&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}r&&e.waitingOnAppends++,o&&e.waitingOnAppends++,r&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=_ye(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:a}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:a.start:a.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),a=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;a&&(e.timingInfo.end=typeof a.end=="number"?a.end:a.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=wye(e,this.sourceType_);if(t&&(t.severity==="warn"?ge.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${_l(e)}`);return}this.logger_(`Appended ${_l(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const a=e.segment,i=e.part,n=a.end&&this.currentTime_()-a.end>e.playlist.targetDuration*3,r=i&&i.end&&this.currentTime_()-i.end>e.playlist.partTargetDuration*3;if(n||r){this.logger_(`bad ${n?"segment":"part"} ${_l(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<ym){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${ym}`);return}const t=this.throughput.rate,a=Date.now()-e.endOfAllRequests+1,i=Math.floor(e.byteLength/a*8*1e3);this.throughput.rate+=(i-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,a=t.start,i=t.end;if(!Jx(a)||!Jx(i))return;qd(a,i,this.segmentMetadataTrack_);const n=O.WebKitDataCue||O.VTTCue,r={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:a,end:i},o=JSON.stringify(r),l=new n(a,i,o);l.value=r,this.segmentMetadataTrack_.addCue(l)}};function nr(){}const $x=function(e){return typeof e!="string"?e:e.replace(/./,t=>t.toUpperCase())},Tye=["video","audio"],o2=(e,t)=>{const a=t[`${e}Buffer`];return a&&a.updating||t.queuePending[e]},Cye=(e,t)=>{for(let a=0;a<t.length;a++){const i=t[a];if(i.type==="mediaSource")return null;if(i.type===e)return a}return null},bl=(e,t)=>{if(t.queue.length===0)return;let a=0,i=t.queue[a];if(i.type==="mediaSource"){!t.updating()&&t.mediaSource.readyState!=="closed"&&(t.queue.shift(),i.action(t),i.doneFn&&i.doneFn(),bl("audio",t),bl("video",t));return}if(e!=="mediaSource"&&!(!t.ready()||t.mediaSource.readyState==="closed"||o2(e,t))){if(i.type!==e){if(a=Cye(e,t.queue),a===null)return;i=t.queue[a]}if(t.queue.splice(a,1),t.queuePending[e]=i,i.action(e,t),!i.doneFn){t.queuePending[e]=null,bl(e,t);return}}},e6=(e,t)=>{const a=t[`${e}Buffer`],i=$x(e);a&&(a.removeEventListener("updateend",t[`on${i}UpdateEnd_`]),a.removeEventListener("error",t[`on${i}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},Pn=(e,t)=>e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1,hi={appendBuffer:(e,t,a)=>(i,n)=>{const r=n[`${i}Buffer`];if(Pn(n.mediaSource,r)){n.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${i}Buffer`);try{r.appendBuffer(e)}catch(o){n.logger_(`Error with code ${o.code} `+(o.code===Xx?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${i}Buffer`),n.queuePending[i]=null,a(o)}}},remove:(e,t)=>(a,i)=>{const n=i[`${a}Buffer`];if(Pn(i.mediaSource,n)){i.logger_(`Removing ${e} to ${t} from ${a}Buffer`);try{n.remove(e,t)}catch{i.logger_(`Remove ${e} to ${t} from ${a}Buffer failed`)}}},timestampOffset:e=>(t,a)=>{const i=a[`${t}Buffer`];Pn(a.mediaSource,i)&&(a.logger_(`Setting ${t}timestampOffset to ${e}`),i.timestampOffset=e)},callback:e=>(t,a)=>{e()},endOfStream:e=>t=>{if(t.mediaSource.readyState==="open"){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(a){ge.log.warn("Failed to call media source endOfStream",a)}}},duration:e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(a){ge.log.warn("Failed to set media source duration",a)}},abort:()=>(e,t)=>{if(t.mediaSource.readyState!=="open")return;const a=t[`${e}Buffer`];if(Pn(t.mediaSource,a)){t.logger_(`calling abort on ${e}Buffer`);try{a.abort()}catch(i){ge.log.warn(`Failed to abort on ${e}Buffer`,i)}}},addSourceBuffer:(e,t)=>a=>{const i=$x(e),n=hd(t);a.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const r=a.mediaSource.addSourceBuffer(n);r.addEventListener("updateend",a[`on${i}UpdateEnd_`]),r.addEventListener("error",a[`on${i}Error_`]),a.codecs[e]=t,a[`${e}Buffer`]=r},removeSourceBuffer:e=>t=>{const a=t[`${e}Buffer`];if(e6(e,t),!!Pn(t.mediaSource,a)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(a)}catch(i){ge.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,i)}}},changeType:e=>(t,a)=>{const i=a[`${t}Buffer`],n=hd(e);if(Pn(a.mediaSource,i)&&a.codecs[t]!==e){a.logger_(`changing ${t}Buffer codec from ${a.codecs[t]} to ${e}`);try{i.changeType(n),a.codecs[t]=e}catch(r){ge.log.warn(`Failed to changeType on ${t}Buffer`,r)}}}},pi=({type:e,sourceUpdater:t,action:a,doneFn:i,name:n})=>{t.queue.push({type:e,action:a,doneFn:i,name:n}),bl(e,t)},t6=(e,t)=>a=>{if(t.queuePending[e]){const i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`])}bl(e,t)};let a6=class extends ge.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>bl("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Oi("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=t6("video",this),this.onAudioUpdateEnd_=t6("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){pi({type:"mediaSource",sourceUpdater:this,action:hi.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){pi({type:e,sourceUpdater:this,action:hi.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){ge.log.error("removeSourceBuffer is not supported!");return}pi({type:"mediaSource",sourceUpdater:this,action:hi.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!ge.browser.IS_FIREFOX&&O.MediaSource&&O.MediaSource.prototype&&typeof O.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return O.SourceBuffer&&O.SourceBuffer.prototype&&typeof O.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){ge.log.error("changeType is not supported!");return}pi({type:e,sourceUpdater:this,action:hi.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const a=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,a);this.canChangeType()&&this.changeType(t,a)})}appendBuffer(e,t){const{segmentInfo:a,type:i,bytes:n}=e;if(this.processedAppend_=!0,i==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const r=t;if(pi({type:i,sourceUpdater:this,action:hi.appendBuffer(n,a||{mediaIndex:-1},r),doneFn:t,name:"appendBuffer"}),i==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(l=>{this.appendBuffer.apply(this,l)})}}audioBuffered(){return Pn(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Ya()}videoBuffered(){return Pn(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Ya()}buffered(){const e=Pn(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Pn(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():qfe(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=nr){pi({type:"mediaSource",sourceUpdater:this,action:hi.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=nr){typeof e!="string"&&(e=void 0),pi({type:"mediaSource",sourceUpdater:this,action:hi.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,a=nr){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){a();return}pi({type:"audio",sourceUpdater:this,action:hi.remove(e,t),doneFn:a,name:"remove"})}removeVideo(e,t,a=nr){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){a();return}pi({type:"video",sourceUpdater:this,action:hi.remove(e,t),doneFn:a,name:"remove"})}updating(){return!!(o2("audio",this)||o2("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(pi({type:"audio",sourceUpdater:this,action:hi.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset!==e&&(pi({type:"video",sourceUpdater:this,action:hi.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&pi({type:"audio",sourceUpdater:this,action:hi.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&pi({type:"video",sourceUpdater:this,action:hi.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),Tye.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>e6(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}};const i6=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),kye=e=>{const t=new Uint8Array(e);return Array.from(t).map(a=>a.toString(16).padStart(2,"0")).join("")},n6=new Uint8Array(`
252
252
 
253
253
  `.split("").map(e=>e.charCodeAt(0)));let Eye=class extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}},Iye=class extends s2{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.loaderType_="subtitle",this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Ya();const e=this.subtitlesTrack_.cues,t=e[0].startTime,a=e[e.length-1].startTime;return Ya([[t,a]])}initSegmentForMap(e,t=!1){if(!e)return null;const a=pm(e);let i=this.initSegments_[a];if(t&&!i&&e.bytes){const n=n6.byteLength+e.bytes.byteLength,r=new Uint8Array(n);r.set(e.bytes),r.set(n6,e.bytes.byteLength),this.initSegments_[a]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:r}}return i||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){qd(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,a){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===An.TIMEOUT&&this.handleTimeout_(),e.code===An.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const i=this.pendingSegment_;this.saveBandwidthRelatedStats_(i.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=i.segment;if(n.map&&(n.map.bytes=t.map.bytes),i.bytes=t.bytes,typeof O.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,a),()=>this.stopForError({message:"Error loading vtt.js"}));return}n.requested=!0;try{this.parseVTTCues_(i)}catch(r){this.stopForError({message:r.message});return}if(this.updateTimeMapping_(i,this.syncController_.timelines[i.timeline],this.playlist_),i.cues.length?i.timingInfo={start:i.cues[0].startTime,end:i.cues[i.cues.length-1].endTime}:i.timingInfo={start:i.startOfSegment,end:i.startOfSegment+i.duration},i.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}i.byteLength=i.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,i.cues.forEach(r=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new O.VTTCue(r.startTime,r.endTime,r.text):r)}),uye(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,a=!1;if(typeof O.WebVTT!="function")throw new Eye;typeof O.TextDecoder=="function"?t=new O.TextDecoder("utf8"):(t=O.WebVTT.StringDecoder(),a=!0);const i=new O.WebVTT.Parser(O,O.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},i.oncue=e.cues.push.bind(e.cues),i.ontimestampmap=r=>{e.timestampmap=r},i.onparsingerror=r=>{ge.log.warn("Error encountered when parsing cues: "+r.message)},e.segment.map){let r=e.segment.map.bytes;a&&(r=i6(r)),i.parse(r)}let n=e.bytes;a&&(n=i6(n)),i.parse(n),i.flush()}updateTimeMapping_(e,t,a){const i=e.segment;if(!t)return;if(!e.cues.length){i.empty=!0;return}const{MPEGTS:n,LOCAL:r}=e.timestampmap,o=n/ws.ONE_SECOND_IN_TS-r+t.mapping;if(e.cues.forEach(l=>{const c=l.endTime-l.startTime,d=n===0?l.startTime+o:this.handleRollover_(l.startTime+o,t.time);l.startTime=Math.max(d,0),l.endTime=Math.max(d+c,0)}),!a.syncInfo){const l=e.cues[0].startTime,c=e.cues[e.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+e.mediaIndex,time:Math.min(l,c-i.duration)}}}handleRollover_(e,t){if(t===null)return e;let a=e*ws.ONE_SECOND_IN_TS;const i=t*ws.ONE_SECOND_IN_TS;let n;for(i<a?n=-8589934592:n=8589934592;Math.abs(a-i)>4294967296;)a+=n;return a/ws.ONE_SECOND_IN_TS}};const xye=function(e,t){const a=e.cues;for(let i=0;i<a.length;i++){const n=a[i];if(t>=n.adStartTime&&t<=n.adEndTime)return n}return null},Nye=function(e,t,a=0){if(!e.segments)return;let i=a,n;for(let r=0;r<e.segments.length;r++){const o=e.segments[r];if(n||(n=xye(t,i+o.duration/2)),n){if("cueIn"in o){n.endTime=i,n.adEndTime=i,i+=o.duration,n=null;continue}if(i<n.endTime){i+=o.duration;continue}n.endTime+=o.duration}else if("cueOut"in o&&(n=new O.VTTCue(i,i+o.duration,o.cueOut),n.adStartTime=i,n.adEndTime=i+parseFloat(o.cueOut),t.addCue(n)),"cueOutCont"in o){const[l,c]=o.cueOutCont.split("/").map(parseFloat);n=new O.VTTCue(i,i+o.duration,""),n.adStartTime=i-l,n.adEndTime=n.adStartTime+c,t.addCue(n)}i+=o.duration}},Aye=86400,l2=[{name:"VOD",run:(e,t,a,i,n)=>a!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(e,t,a,i,n,r)=>{if(!r)return null;const o=e.getMediaSequenceMap(r);if(!o||o.size===0||t.mediaSequence===void 0||!Array.isArray(t.segments)||!t.segments.length)return null;let l=t.mediaSequence,c=0;for(const d of t.segments){const u=o.get(l);if(!u)break;if(n>=u.start&&n<u.end){if(Array.isArray(d.parts)&&d.parts.length){let h=u.start,m=0;for(const p of d.parts){const f=h,y=f+p.duration;if(n>=f&&n<y)return{time:u.start,segmentIndex:c,partIndex:m};m++,h=y}}return{time:u.start,segmentIndex:c,partIndex:null}}c++,l++}return null}},{name:"ProgramDateTime",run:(e,t,a,i,n)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let r=null,o=null;const l=Gb(t);n=n||0;for(let c=0;c<l.length;c++){const d=t.endList||n===0?c:l.length-(c+1),u=l[d],h=u.segment,m=e.timelineToDatetimeMappings[h.timeline];if(!m||!h.dateTimeObject)continue;let p=h.dateTimeObject.getTime()/1e3+m;if(h.parts&&typeof u.partIndex=="number")for(let y=0;y<u.partIndex;y++)p+=h.parts[y].duration;const f=Math.abs(n-p);if(o!==null&&(f===0||o<f))break;o=f,r={time:p,segmentIndex:u.segmentIndex,partIndex:u.partIndex}}return r}},{name:"Segment",run:(e,t,a,i,n)=>{let r=null,o=null;n=n||0;const l=Gb(t);for(let c=0;c<l.length;c++){const d=t.endList||n===0?c:l.length-(c+1),u=l[d],h=u.segment,m=u.part&&u.part.start||h&&h.start;if(h.timeline===i&&typeof m<"u"){const p=Math.abs(n-m);if(o!==null&&o<p)break;(!r||o===null||o>=p)&&(o=p,r={time:m,segmentIndex:u.segmentIndex,partIndex:u.partIndex})}}return r}},{name:"Discontinuity",run:(e,t,a,i,n)=>{let r=null;if(n=n||0,t.discontinuityStarts&&t.discontinuityStarts.length){let o=null;for(let l=0;l<t.discontinuityStarts.length;l++){const c=t.discontinuityStarts[l],d=t.discontinuitySequence+l+1,u=e.discontinuities[d];if(u){const h=Math.abs(n-u.time);if(o!==null&&o<h)break;(!r||o===null||o>=h)&&(o=h,r={time:u.time,segmentIndex:c,partIndex:null})}}}return r}},{name:"Playlist",run:(e,t,a,i,n)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];let Pye=class extends ge.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.mediaSequenceStorage_=new Map,this.logger_=Oi("SyncController")}getMediaSequenceMap(e){return this.mediaSequenceStorage_.get(e)}updateMediaSequenceMap(e,t,a){if(e.mediaSequence===void 0||!Array.isArray(e.segments)||!e.segments.length)return;const i=this.getMediaSequenceMap(a),n=new Map;let r=e.mediaSequence,o;i?i.has(e.mediaSequence)?o=i.get(e.mediaSequence).start:(this.logger_(`MediaSequence sync for ${a} segment loader - received a gap between playlists.
254
254
  Fallback base time to: ${t}.
@@ -301,8 +301,8 @@ browserWorkerPolyFill(self);
301
301
  `),this.pushCaption(w),w.startPts=_},wt.prototype.pushCaption=function(_){_.text!==""&&(this.trigger("data",{startPts:_.startPts,endPts:_.endPts,text:_.text,stream:"cc708_"+_.serviceNum}),_.text="",_.startPts=_.endPts)},wt.prototype.displayWindows=function(_,w){var k=this.current708Packet.data,C=k[++_],I=this.getPts(_);this.flushDisplayed(I,w);for(var B=0;B<8;B++)C&1<<B&&(w.windows[B].visible=1);return _},wt.prototype.hideWindows=function(_,w){var k=this.current708Packet.data,C=k[++_],I=this.getPts(_);this.flushDisplayed(I,w);for(var B=0;B<8;B++)C&1<<B&&(w.windows[B].visible=0);return _},wt.prototype.toggleWindows=function(_,w){var k=this.current708Packet.data,C=k[++_],I=this.getPts(_);this.flushDisplayed(I,w);for(var B=0;B<8;B++)C&1<<B&&(w.windows[B].visible^=1);return _},wt.prototype.clearWindows=function(_,w){var k=this.current708Packet.data,C=k[++_],I=this.getPts(_);this.flushDisplayed(I,w);for(var B=0;B<8;B++)C&1<<B&&w.windows[B].clearText();return _},wt.prototype.deleteWindows=function(_,w){var k=this.current708Packet.data,C=k[++_],I=this.getPts(_);this.flushDisplayed(I,w);for(var B=0;B<8;B++)C&1<<B&&w.windows[B].reset();return _},wt.prototype.setPenAttributes=function(_,w){var k=this.current708Packet.data,C=k[_],I=w.currentWindow.penAttr;return C=k[++_],I.textTag=(C&240)>>4,I.offset=(C&12)>>2,I.penSize=C&3,C=k[++_],I.italics=(C&128)>>7,I.underline=(C&64)>>6,I.edgeType=(C&56)>>3,I.fontStyle=C&7,_},wt.prototype.setPenColor=function(_,w){var k=this.current708Packet.data,C=k[_],I=w.currentWindow.penColor;return C=k[++_],I.fgOpacity=(C&192)>>6,I.fgRed=(C&48)>>4,I.fgGreen=(C&12)>>2,I.fgBlue=C&3,C=k[++_],I.bgOpacity=(C&192)>>6,I.bgRed=(C&48)>>4,I.bgGreen=(C&12)>>2,I.bgBlue=C&3,C=k[++_],I.edgeRed=(C&48)>>4,I.edgeGreen=(C&12)>>2,I.edgeBlue=C&3,_},wt.prototype.setPenLocation=function(_,w){var k=this.current708Packet.data,C=k[_],I=w.currentWindow.penLoc;return w.currentWindow.pendingNewLine=!0,C=k[++_],I.row=C&15,C=k[++_],I.column=C&63,_},wt.prototype.reset=function(_,w){var k=this.getPts(_);return this.flushDisplayed(k,w),this.initService(w.serviceNum,_)};var Nv={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},_r=function(_){return _===null?"":(_=Nv[_]||_,String.fromCharCode(_))},ai=14,ec=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],st=function(){for(var _=[],w=ai+1;w--;)_.push("");return _},Dt=function _(w,k){_.prototype.init.call(this),this.field_=w||0,this.dataChannel_=k||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(C){var I,B,F,H,W;if(I=C.ccData&32639,I===this.lastControlCode_){this.lastControlCode_=null;return}if((I&61440)===4096?this.lastControlCode_=I:I!==this.PADDING_&&(this.lastControlCode_=null),F=I>>>8,H=I&255,I!==this.PADDING_)if(I===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(I===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(C.pts),this.flushDisplayed(C.pts),B=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=B,this.startPts_=C.pts;else if(I===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(C.pts);else if(I===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(C.pts);else if(I===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(C.pts);else if(I===this.CARRIAGE_RETURN_)this.clearFormatting(C.pts),this.flushDisplayed(C.pts),this.shiftRowsUp_(),this.startPts_=C.pts;else if(I===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(I===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(C.pts),this.displayed_=st();else if(I===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=st();else if(I===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(C.pts),this.displayed_=st()),this.mode_="paintOn",this.startPts_=C.pts;else if(this.isSpecialCharacter(F,H))F=(F&3)<<8,W=_r(F|H),this[this.mode_](C.pts,W),this.column_++;else if(this.isExtCharacter(F,H))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),F=(F&3)<<8,W=_r(F|H),this[this.mode_](C.pts,W),this.column_++;else if(this.isMidRowCode(F,H))this.clearFormatting(C.pts),this[this.mode_](C.pts," "),this.column_++,(H&14)===14&&this.addFormatting(C.pts,["i"]),(H&1)===1&&this.addFormatting(C.pts,["u"]);else if(this.isOffsetControlCode(F,H))this.column_+=H&3;else if(this.isPAC(F,H)){var Z=ec.indexOf(I&7968);this.mode_==="rollUp"&&(Z-this.rollUpRows_+1<0&&(Z=this.rollUpRows_-1),this.setRollUp(C.pts,Z)),Z!==this.row_&&(this.clearFormatting(C.pts),this.row_=Z),H&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(C.pts,["u"]),(I&16)===16&&(this.column_=((I&14)>>1)*4),this.isColorPAC(H)&&(H&14)===14&&this.addFormatting(C.pts,["i"])}else this.isNormalChar(F)&&(H===0&&(H=null),W=_r(F),W+=_r(H),this[this.mode_](C.pts,W),this.column_+=W.length)}};Dt.prototype=new t,Dt.prototype.flushDisplayed=function(_){var w=this.displayed_.map(function(k,C){try{return k.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+C+"."}),""}},this).join(`
302
302
  `).replace(/^\n+|\n+$/g,"");w.length&&this.trigger("data",{startPts:this.startPts_,endPts:_,text:w,stream:this.name_})},Dt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=st(),this.nonDisplayed_=st(),this.lastControlCode_=null,this.column_=0,this.row_=ai,this.rollUpRows_=2,this.formatting_=[]},Dt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},Dt.prototype.isSpecialCharacter=function(_,w){return _===this.EXT_&&w>=48&&w<=63},Dt.prototype.isExtCharacter=function(_,w){return(_===this.EXT_+1||_===this.EXT_+2)&&w>=32&&w<=63},Dt.prototype.isMidRowCode=function(_,w){return _===this.EXT_&&w>=32&&w<=47},Dt.prototype.isOffsetControlCode=function(_,w){return _===this.OFFSET_&&w>=33&&w<=35},Dt.prototype.isPAC=function(_,w){return _>=this.BASE_&&_<this.BASE_+8&&w>=64&&w<=127},Dt.prototype.isColorPAC=function(_){return _>=64&&_<=79||_>=96&&_<=127},Dt.prototype.isNormalChar=function(_){return _>=32&&_<=127},Dt.prototype.setRollUp=function(_,w){if(this.mode_!=="rollUp"&&(this.row_=ai,this.mode_="rollUp",this.flushDisplayed(_),this.nonDisplayed_=st(),this.displayed_=st()),w!==void 0&&w!==this.row_)for(var k=0;k<this.rollUpRows_;k++)this.displayed_[w-k]=this.displayed_[this.row_-k],this.displayed_[this.row_-k]="";w===void 0&&(w=this.row_),this.topRow_=w-this.rollUpRows_+1},Dt.prototype.addFormatting=function(_,w){this.formatting_=this.formatting_.concat(w);var k=w.reduce(function(C,I){return C+"<"+I+">"},"");this[this.mode_](_,k)},Dt.prototype.clearFormatting=function(_){if(this.formatting_.length){var w=this.formatting_.reverse().reduce(function(k,C){return k+"</"+C+">"},"");this.formatting_=[],this[this.mode_](_,w)}},Dt.prototype.popOn=function(_,w){var k=this.nonDisplayed_[this.row_];k+=w,this.nonDisplayed_[this.row_]=k},Dt.prototype.rollUp=function(_,w){var k=this.displayed_[this.row_];k+=w,this.displayed_[this.row_]=k},Dt.prototype.shiftRowsUp_=function(){var _;for(_=0;_<this.topRow_;_++)this.displayed_[_]="";for(_=this.row_+1;_<ai+1;_++)this.displayed_[_]="";for(_=this.topRow_;_<this.row_;_++)this.displayed_[_]=this.displayed_[_+1];this.displayed_[this.row_]=""},Dt.prototype.paintOn=function(_,w){var k=this.displayed_[this.row_];k+=w,this.displayed_[this.row_]=k};var br={CaptionStream:ja,Cea608Stream:Dt,Cea708Stream:wt},zt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Av=8589934592,vr=4294967296,Et="shared",tc=function(_,w){var k=1;for(_>w&&(k=-1);Math.abs(w-_)>vr;)_+=k*Av;return _},Hs=function _(w){var k,C;_.prototype.init.call(this),this.type_=w||Et,this.push=function(I){this.type_!==Et&&I.type!==this.type_||(C===void 0&&(C=I.dts),I.dts=tc(I.dts,C),I.pts=tc(I.pts,C),k=I.dts,this.trigger("data",I))},this.flush=function(){C=k,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){C=void 0,k=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Hs.prototype=new t;var Nf={TimestampRolloverStream:Hs,handleRollover:tc},Af=function(_,w,k){var C,I="";for(C=w;C<k;C++)I+="%"+("00"+_[C].toString(16)).slice(-2);return I},ac=function(_,w,k){return decodeURIComponent(Af(_,w,k))},Pf=function(_,w,k){return unescape(Af(_,w,k))},rs=function(_){return _[0]<<21|_[1]<<14|_[2]<<7|_[3]},ic={TXXX:function(_){var w;if(_.data[0]===3){for(w=1;w<_.data.length;w++)if(_.data[w]===0){_.description=ac(_.data,1,w),_.value=ac(_.data,w+1,_.data.length).replace(/\0*$/,"");break}_.data=_.value}},WXXX:function(_){var w;if(_.data[0]===3){for(w=1;w<_.data.length;w++)if(_.data[w]===0){_.description=ac(_.data,1,w),_.url=ac(_.data,w+1,_.data.length);break}}},PRIV:function(_){var w;for(w=0;w<_.data.length;w++)if(_.data[w]===0){_.owner=Pf(_.data,0,w);break}_.privateData=_.data.subarray(w+1),_.data=_.privateData}},qs;qs=function(_){var w={descriptor:_&&_.descriptor},k=0,C=[],I=0,B;if(qs.prototype.init.call(this),this.dispatchType=zt.METADATA_STREAM_TYPE.toString(16),w.descriptor)for(B=0;B<w.descriptor.length;B++)this.dispatchType+=("00"+w.descriptor[B].toString(16)).slice(-2);this.push=function(F){var H,W,Z,ce,be,Ue;if(F.type==="timed-metadata"){if(F.dataAlignmentIndicator&&(I=0,C.length=0),C.length===0&&(F.data.length<10||F.data[0]!==73||F.data[1]!==68||F.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(C.push(F),I+=F.data.byteLength,C.length===1&&(k=rs(F.data.subarray(6,10)),k+=10),!(I<k)){for(H={data:new Uint8Array(k),frames:[],pts:C[0].pts,dts:C[0].dts},be=0;be<k;)H.data.set(C[0].data.subarray(0,k-be),be),be+=C[0].data.byteLength,I-=C[0].data.byteLength,C.shift();W=10,H.data[5]&64&&(W+=4,W+=rs(H.data.subarray(10,14)),k-=rs(H.data.subarray(16,20)));do{if(Z=rs(H.data.subarray(W+4,W+8)),Z<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});return}if(Ue=String.fromCharCode(H.data[W],H.data[W+1],H.data[W+2],H.data[W+3]),ce={id:Ue,data:H.data.subarray(W+10,W+Z+10)},ce.key=ce.id,ic[ce.id]&&(ic[ce.id](ce),ce.owner==="com.apple.streaming.transportStreamTimestamp")){var Ne=ce.data,Ke=(Ne[3]&1)<<30|Ne[4]<<22|Ne[5]<<14|Ne[6]<<6|Ne[7]>>>2;Ke*=4,Ke+=Ne[7]&3,ce.timeStamp=Ke,H.pts===void 0&&H.dts===void 0&&(H.pts=ce.timeStamp,H.dts=ce.timeStamp),this.trigger("timestamp",ce)}H.frames.push(ce),W+=10,W+=Z}while(W<k);this.trigger("data",H)}}}},qs.prototype=new t;var Pv=qs,Ov=Nf.TimestampRolloverStream,Sr,Vn,Ws,Mi=188,wr=71;Sr=function(){var _=new Uint8Array(Mi),w=0;Sr.prototype.init.call(this),this.push=function(k){var C=0,I=Mi,B;for(w?(B=new Uint8Array(k.byteLength+w),B.set(_.subarray(0,w)),B.set(k,w),w=0):B=k;I<B.byteLength;){if(B[C]===wr&&B[I]===wr){this.trigger("data",B.subarray(C,I)),C+=Mi,I+=Mi;continue}C++,I++}C<B.byteLength&&(_.set(B.subarray(C),0),w=B.byteLength-C)},this.flush=function(){w===Mi&&_[0]===wr&&(this.trigger("data",_),w=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){w=0,this.trigger("reset")}},Sr.prototype=new t,Vn=function(){var _,w,k,C;Vn.prototype.init.call(this),C=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,_=function(I,B){var F=0;B.payloadUnitStartIndicator&&(F+=I[F]+1),B.type==="pat"?w(I.subarray(F),B):k(I.subarray(F),B)},w=function(I,B){B.section_number=I[7],B.last_section_number=I[8],C.pmtPid=(I[10]&31)<<8|I[11],B.pmtPid=C.pmtPid},k=function(I,B){var F,H,W,Z;if(I[5]&1){for(C.programMapTable={video:null,audio:null,"timed-metadata":{}},F=(I[1]&15)<<8|I[2],H=3+F-4,W=(I[10]&15)<<8|I[11],Z=12+W;Z<H;){var ce=I[Z],be=(I[Z+1]&31)<<8|I[Z+2];ce===zt.H264_STREAM_TYPE&&C.programMapTable.video===null?C.programMapTable.video=be:ce===zt.ADTS_STREAM_TYPE&&C.programMapTable.audio===null?C.programMapTable.audio=be:ce===zt.METADATA_STREAM_TYPE&&(C.programMapTable["timed-metadata"][be]=ce),Z+=((I[Z+3]&15)<<8|I[Z+4])+5}B.programMapTable=C.programMapTable}},this.push=function(I){var B={},F=4;if(B.payloadUnitStartIndicator=!!(I[1]&64),B.pid=I[1]&31,B.pid<<=8,B.pid|=I[2],(I[3]&48)>>>4>1&&(F+=I[F]+1),B.pid===0)B.type="pat",_(I.subarray(F),B),this.trigger("data",B);else if(B.pid===this.pmtPid)for(B.type="pmt",_(I.subarray(F),B),this.trigger("data",B);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([I,F,B]):this.processPes_(I,F,B)},this.processPes_=function(I,B,F){F.pid===this.programMapTable.video?F.streamType=zt.H264_STREAM_TYPE:F.pid===this.programMapTable.audio?F.streamType=zt.ADTS_STREAM_TYPE:F.streamType=this.programMapTable["timed-metadata"][F.pid],F.type="pes",F.data=I.subarray(B),this.trigger("data",F)}},Vn.prototype=new t,Vn.STREAM_TYPES={h264:27,adts:15},Ws=function(){var _=this,w=!1,k={data:[],size:0},C={data:[],size:0},I={data:[],size:0},B,F=function(W,Z){var ce,be=W[0]<<16|W[1]<<8|W[2];Z.data=new Uint8Array,be===1&&(Z.packetLength=6+(W[4]<<8|W[5]),Z.dataAlignmentIndicator=(W[6]&4)!==0,ce=W[7],ce&192&&(Z.pts=(W[9]&14)<<27|(W[10]&255)<<20|(W[11]&254)<<12|(W[12]&255)<<5|(W[13]&254)>>>3,Z.pts*=4,Z.pts+=(W[13]&6)>>>1,Z.dts=Z.pts,ce&64&&(Z.dts=(W[14]&14)<<27|(W[15]&255)<<20|(W[16]&254)<<12|(W[17]&255)<<5|(W[18]&254)>>>3,Z.dts*=4,Z.dts+=(W[18]&6)>>>1)),Z.data=W.subarray(9+W[8]))},H=function(W,Z,ce){var be=new Uint8Array(W.size),Ue={type:Z},Ne=0,Ke=0,ze=!1,At;if(!(!W.data.length||W.size<9)){for(Ue.trackId=W.data[0].pid,Ne=0;Ne<W.data.length;Ne++)At=W.data[Ne],be.set(At.data,Ke),Ke+=At.data.byteLength;F(be,Ue),ze=Z==="video"||Ue.packetLength<=W.size,(ce||ze)&&(W.size=0,W.data.length=0),ze&&_.trigger("data",Ue)}};Ws.prototype.init.call(this),this.push=function(W){({pat:function(){},pes:function(){var Z,ce;switch(W.streamType){case zt.H264_STREAM_TYPE:Z=k,ce="video";break;case zt.ADTS_STREAM_TYPE:Z=C,ce="audio";break;case zt.METADATA_STREAM_TYPE:Z=I,ce="timed-metadata";break;default:return}W.payloadUnitStartIndicator&&H(Z,ce,!0),Z.data.push(W),Z.size+=W.data.byteLength},pmt:function(){var Z={type:"metadata",tracks:[]};B=W.programMapTable,B.video!==null&&Z.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+B.video,codec:"avc",type:"video"}),B.audio!==null&&Z.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+B.audio,codec:"adts",type:"audio"}),w=!0,_.trigger("data",Z)}})[W.type]()},this.reset=function(){k.size=0,k.data.length=0,C.size=0,C.data.length=0,this.trigger("reset")},this.flushStreams_=function(){H(k,"video"),H(C,"audio"),H(I,"timed-metadata")},this.flush=function(){if(!w&&B){var W={type:"metadata",tracks:[]};B.video!==null&&W.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+B.video,codec:"avc",type:"video"}),B.audio!==null&&W.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+B.audio,codec:"adts",type:"audio"}),_.trigger("data",W)}w=!1,this.flushStreams_(),this.trigger("done")}},Ws.prototype=new t;var ss={PAT_PID:0,MP2T_PACKET_LENGTH:Mi,TransportPacketStream:Sr,TransportParseStream:Vn,ElementaryStream:Ws,TimestampRolloverStream:Ov,CaptionStream:br.CaptionStream,Cea608Stream:br.Cea608Stream,Cea708Stream:br.Cea708Stream,MetadataStream:Pv};for(var Tr in zt)zt.hasOwnProperty(Tr)&&(ss[Tr]=zt[Tr]);var en=ss,Of=mt.ONE_SECOND_IN_TS,nc,Bf=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];nc=function(_){var w,k=0;nc.prototype.init.call(this),this.skipWarn_=function(C,I){this.trigger("log",{level:"warn",message:"adts skiping bytes "+C+" to "+I+" in frame "+k+" outside syncword"})},this.push=function(C){var I=0,B,F,H,W,Z;if(_||(k=0),C.type==="audio"){w&&w.length?(H=w,w=new Uint8Array(H.byteLength+C.data.byteLength),w.set(H),w.set(C.data,H.byteLength)):w=C.data;for(var ce;I+7<w.length;){if(w[I]!==255||(w[I+1]&246)!==240){typeof ce!="number"&&(ce=I),I++;continue}if(typeof ce=="number"&&(this.skipWarn_(ce,I),ce=null),F=(~w[I+1]&1)*2,B=(w[I+3]&3)<<11|w[I+4]<<3|(w[I+5]&224)>>5,W=((w[I+6]&3)+1)*1024,Z=W*Of/Bf[(w[I+2]&60)>>>2],w.byteLength-I<B)break;this.trigger("data",{pts:C.pts+k*Z,dts:C.dts+k*Z,sampleCount:W,audioobjecttype:(w[I+2]>>>6&3)+1,channelcount:(w[I+2]&1)<<2|(w[I+3]&192)>>>6,samplerate:Bf[(w[I+2]&60)>>>2],samplingfrequencyindex:(w[I+2]&60)>>>2,samplesize:16,data:w.subarray(I+7+F,I+B)}),k++,I+=B}typeof ce=="number"&&(this.skipWarn_(ce,I),ce=null),w=w.subarray(I)}},this.flush=function(){k=0,this.trigger("done")},this.reset=function(){w=void 0,this.trigger("reset")},this.endTimeline=function(){w=void 0,this.trigger("endedtimeline")}},nc.prototype=new t;var tn=nc,Gs;Gs=function(_){var w=_.byteLength,k=0,C=0;this.length=function(){return 8*w},this.bitsAvailable=function(){return 8*w+C},this.loadWord=function(){var I=_.byteLength-w,B=new Uint8Array(4),F=Math.min(4,w);if(F===0)throw new Error("no bytes available");B.set(_.subarray(I,I+F)),k=new DataView(B.buffer).getUint32(0),C=F*8,w-=F},this.skipBits=function(I){var B;C>I?(k<<=I,C-=I):(I-=C,B=Math.floor(I/8),I-=B*8,w-=B,this.loadWord(),k<<=I,C-=I)},this.readBits=function(I){var B=Math.min(C,I),F=k>>>32-B;return C-=B,C>0?k<<=B:w>0&&this.loadWord(),B=I-B,B>0?F<<B|this.readBits(B):F},this.skipLeadingZeros=function(){var I;for(I=0;I<C;++I)if(k&2147483648>>>I)return k<<=I,C-=I,I;return this.loadWord(),I+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var I=this.skipLeadingZeros();return this.readBits(I+1)-1},this.readExpGolomb=function(){var I=this.readUnsignedExpGolomb();return 1&I?1+I>>>1:-1*(I>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Bv=Gs,os,Cr,ii;Cr=function(){var _=0,w,k;Cr.prototype.init.call(this),this.push=function(C){var I;k?(I=new Uint8Array(k.byteLength+C.data.byteLength),I.set(k),I.set(C.data,k.byteLength),k=I):k=C.data;for(var B=k.byteLength;_<B-3;_++)if(k[_+2]===1){w=_+5;break}for(;w<B;)switch(k[w]){case 0:if(k[w-1]!==0){w+=2;break}else if(k[w-2]!==0){w++;break}_+3!==w-2&&this.trigger("data",k.subarray(_+3,w-2));do w++;while(k[w]!==1&&w<B);_=w-2,w+=3;break;case 1:if(k[w-1]!==0||k[w-2]!==0){w+=3;break}this.trigger("data",k.subarray(_+3,w-2)),_=w-2,w+=3;break;default:w+=3;break}k=k.subarray(_),w-=_,_=0},this.reset=function(){k=null,_=0,this.trigger("reset")},this.flush=function(){k&&k.byteLength>3&&this.trigger("data",k.subarray(_+3)),k=null,_=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Cr.prototype=new t,ii={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},os=function(){var _=new Cr,w,k,C,I,B,F,H;os.prototype.init.call(this),w=this,this.push=function(W){W.type==="video"&&(k=W.trackId,C=W.pts,I=W.dts,_.push(W))},_.on("data",function(W){var Z={trackId:k,pts:C,dts:I,data:W,nalUnitTypeCode:W[0]&31};switch(Z.nalUnitTypeCode){case 5:Z.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:Z.nalUnitType="sei_rbsp",Z.escapedRBSP=B(W.subarray(1));break;case 7:Z.nalUnitType="seq_parameter_set_rbsp",Z.escapedRBSP=B(W.subarray(1)),Z.config=F(Z.escapedRBSP);break;case 8:Z.nalUnitType="pic_parameter_set_rbsp";break;case 9:Z.nalUnitType="access_unit_delimiter_rbsp";break}w.trigger("data",Z)}),_.on("done",function(){w.trigger("done")}),_.on("partialdone",function(){w.trigger("partialdone")}),_.on("reset",function(){w.trigger("reset")}),_.on("endedtimeline",function(){w.trigger("endedtimeline")}),this.flush=function(){_.flush()},this.partialFlush=function(){_.partialFlush()},this.reset=function(){_.reset()},this.endTimeline=function(){_.endTimeline()},H=function(W,Z){var ce=8,be=8,Ue,Ne;for(Ue=0;Ue<W;Ue++)be!==0&&(Ne=Z.readExpGolomb(),be=(ce+Ne+256)%256),ce=be===0?ce:be},B=function(W){for(var Z=W.byteLength,ce=[],be=1,Ue,Ne;be<Z-2;)W[be]===0&&W[be+1]===0&&W[be+2]===3?(ce.push(be+2),be+=2):be++;if(ce.length===0)return W;Ue=Z-ce.length,Ne=new Uint8Array(Ue);var Ke=0;for(be=0;be<Ue;Ke++,be++)Ke===ce[0]&&(Ke++,ce.shift()),Ne[be]=W[Ke];return Ne},F=function(W){var Z=0,ce=0,be=0,Ue=0,Ne,Ke,ze,At,Ia,Nr,Qf,Zf,$f,fc,Pu,Ft=[1,1],Ou,zn;if(Ne=new Bv(W),Ke=Ne.readUnsignedByte(),At=Ne.readUnsignedByte(),ze=Ne.readUnsignedByte(),Ne.skipUnsignedExpGolomb(),ii[Ke]&&(Ia=Ne.readUnsignedExpGolomb(),Ia===3&&Ne.skipBits(1),Ne.skipUnsignedExpGolomb(),Ne.skipUnsignedExpGolomb(),Ne.skipBits(1),Ne.readBoolean()))for(Pu=Ia!==3?8:12,zn=0;zn<Pu;zn++)Ne.readBoolean()&&(zn<6?H(16,Ne):H(64,Ne));if(Ne.skipUnsignedExpGolomb(),Nr=Ne.readUnsignedExpGolomb(),Nr===0)Ne.readUnsignedExpGolomb();else if(Nr===1)for(Ne.skipBits(1),Ne.skipExpGolomb(),Ne.skipExpGolomb(),Qf=Ne.readUnsignedExpGolomb(),zn=0;zn<Qf;zn++)Ne.skipExpGolomb();if(Ne.skipUnsignedExpGolomb(),Ne.skipBits(1),Zf=Ne.readUnsignedExpGolomb(),$f=Ne.readUnsignedExpGolomb(),fc=Ne.readBits(1),fc===0&&Ne.skipBits(1),Ne.skipBits(1),Ne.readBoolean()&&(Z=Ne.readUnsignedExpGolomb(),ce=Ne.readUnsignedExpGolomb(),be=Ne.readUnsignedExpGolomb(),Ue=Ne.readUnsignedExpGolomb()),Ne.readBoolean()&&Ne.readBoolean()){switch(Ou=Ne.readUnsignedByte(),Ou){case 1:Ft=[1,1];break;case 2:Ft=[12,11];break;case 3:Ft=[10,11];break;case 4:Ft=[16,11];break;case 5:Ft=[40,33];break;case 6:Ft=[24,11];break;case 7:Ft=[20,11];break;case 8:Ft=[32,11];break;case 9:Ft=[80,33];break;case 10:Ft=[18,11];break;case 11:Ft=[15,11];break;case 12:Ft=[64,33];break;case 13:Ft=[160,99];break;case 14:Ft=[4,3];break;case 15:Ft=[3,2];break;case 16:Ft=[2,1];break;case 255:{Ft=[Ne.readUnsignedByte()<<8|Ne.readUnsignedByte(),Ne.readUnsignedByte()<<8|Ne.readUnsignedByte()];break}}Ft&&Ft[0]/Ft[1]}return{profileIdc:Ke,levelIdc:ze,profileCompatibility:At,width:(Zf+1)*16-Z*2-ce*2,height:(2-fc)*($f+1)*16-be*2-Ue*2,sarRatio:Ft}}},os.prototype=new t;var Dv={H264Stream:os,NalByteStream:Cr},rc=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],ls=function(_,w){var k=_[w+6]<<21|_[w+7]<<14|_[w+8]<<7|_[w+9],C=_[w+5],I=(C&16)>>4;return k=k>=0?k:0,I?k+20:k+10},sc=function _(w,k){return w.length-k<10||w[k]!==73||w[k+1]!==68||w[k+2]!==51?k:(k+=ls(w,k),_(w,k))},cs=function(_){var w=sc(_,0);return _.length>=w+2&&(_[w]&255)===255&&(_[w+1]&240)===240&&(_[w+1]&22)===16},oc=function(_){return _[0]<<21|_[1]<<14|_[2]<<7|_[3]},Df=function(_,w,k){var C,I="";for(C=w;C<k;C++)I+="%"+("00"+_[C].toString(16)).slice(-2);return I},Cu=function(_,w,k){return unescape(Df(_,w,k))},Mv=function(_,w){var k=(_[w+5]&224)>>5,C=_[w+4]<<3,I=_[w+3]&6144;return I|C|k},Lv=function(_,w){return _[w]===73&&_[w+1]===68&&_[w+2]===51?"timed-metadata":_[w]&!0&&(_[w+1]&240)===240?"audio":null},Rv=function(_){for(var w=0;w+5<_.length;){if(_[w]!==255||(_[w+1]&246)!==240){w++;continue}return rc[(_[w+2]&60)>>>2]}return null},lc=function(_){var w,k,C,I;w=10,_[5]&64&&(w+=4,w+=oc(_.subarray(10,14)));do{if(k=oc(_.subarray(w+4,w+8)),k<1)return null;if(I=String.fromCharCode(_[w],_[w+1],_[w+2],_[w+3]),I==="PRIV"){C=_.subarray(w+10,w+k+10);for(var B=0;B<C.byteLength;B++)if(C[B]===0){var F=Cu(C,0,B);if(F==="com.apple.streaming.transportStreamTimestamp"){var H=C.subarray(B+1),W=(H[3]&1)<<30|H[4]<<22|H[5]<<14|H[6]<<6|H[7]>>>2;return W*=4,W+=H[7]&3,W}break}}w+=10,w+=k}while(w<_.byteLength);return null},Ks={isLikelyAacData:cs,parseId3TagSize:ls,parseAdtsSize:Mv,parseType:Lv,parseSampleRate:Rv,parseAacTimestamp:lc},cc;cc=function(){var _=new Uint8Array,w=0;cc.prototype.init.call(this),this.setTimestamp=function(k){w=k},this.push=function(k){var C=0,I=0,B,F,H,W;for(_.length?(W=_.length,_=new Uint8Array(k.byteLength+W),_.set(_.subarray(0,W)),_.set(k,W)):_=k;_.length-I>=3;){if(_[I]===73&&_[I+1]===68&&_[I+2]===51){if(_.length-I<10||(C=Ks.parseId3TagSize(_,I),I+C>_.length))break;F={type:"timed-metadata",data:_.subarray(I,I+C)},this.trigger("data",F),I+=C;continue}else if((_[I]&255)===255&&(_[I+1]&240)===240){if(_.length-I<7||(C=Ks.parseAdtsSize(_,I),I+C>_.length))break;H={type:"audio",data:_.subarray(I,I+C),pts:w,dts:w},this.trigger("data",H),I+=C;continue}I++}B=_.length-I,B>0?_=_.subarray(I):_=new Uint8Array},this.reset=function(){_=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){_=new Uint8Array,this.trigger("endedtimeline")}},cc.prototype=new t;var Mf=cc,Fv=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],dc=Fv,Vv=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],ds=Vv,Xs=Dv.H264Stream,Lf=Ks.isLikelyAacData,Uv=mt.ONE_SECOND_IN_TS,Js,kr,Ys,Er,Rf=function(_,w){w.stream=_,this.trigger("log",w)},Ff=function(_,w){for(var k=Object.keys(w),C=0;C<k.length;C++){var I=k[C];I==="headOfPipeline"||!w[I].on||w[I].on("log",Rf.bind(_,I))}},Vf=function(_,w){var k;if(_.length!==w.length)return!1;for(k=0;k<_.length;k++)if(_[k]!==w[k])return!1;return!0},ku=function(_,w,k,C,I,B){var F=k-w,H=C-w,W=I-k;return{start:{dts:_,pts:_+F},end:{dts:_+H,pts:_+W},prependedContentDuration:B,baseMediaDecodeTime:_}};kr=function(_,w){var k=[],C,I=0,B=0,F=1/0;w=w||{},C=w.firstSequenceNumber||0,kr.prototype.init.call(this),this.push=function(H){yi.collectDtsInfo(_,H),_&&dc.forEach(function(W){_[W]=H[W]}),k.push(H)},this.setEarliestDts=function(H){I=H},this.setVideoBaseMediaDecodeTime=function(H){F=H},this.setAudioAppendStart=function(H){B=H},this.flush=function(){var H,W,Z,ce,be,Ue,Ne;if(k.length===0){this.trigger("done","AudioSegmentStream");return}H=$l.trimAdtsFramesByEarliestDts(k,_,I),_.baseMediaDecodeTime=yi.calculateTrackBaseMediaDecodeTime(_,w.keepOriginalTimestamps),Ne=$l.prefixWithSilence(_,H,B,F),_.samples=$l.generateSampleTable(H),Z=re.mdat($l.concatenateFrameData(H)),k=[],W=re.moof(C,[_]),ce=new Uint8Array(W.byteLength+Z.byteLength),C++,ce.set(W),ce.set(Z,W.byteLength),yi.clearDtsInfo(_),be=Math.ceil(Uv*1024/_.samplerate),H.length&&(Ue=H.length*be,this.trigger("segmentTimingInfo",ku(mt.audioTsToVideoTs(_.baseMediaDecodeTime,_.samplerate),H[0].dts,H[0].pts,H[0].dts+Ue,H[0].pts+Ue,Ne||0)),this.trigger("timingInfo",{start:H[0].pts,end:H[0].pts+Ue})),this.trigger("data",{track:_,boxes:ce}),this.trigger("done","AudioSegmentStream")},this.reset=function(){yi.clearDtsInfo(_),k=[],this.trigger("reset")}},kr.prototype=new t,Js=function(_,w){var k,C=[],I=[],B,F;w=w||{},k=w.firstSequenceNumber||0,Js.prototype.init.call(this),delete _.minPTS,this.gopCache_=[],this.push=function(H){yi.collectDtsInfo(_,H),H.nalUnitType==="seq_parameter_set_rbsp"&&!B&&(B=H.config,_.sps=[H.data],ds.forEach(function(W){_[W]=B[W]},this)),H.nalUnitType==="pic_parameter_set_rbsp"&&!F&&(F=H.data,_.pps=[H.data]),C.push(H)},this.flush=function(){for(var H,W,Z,ce,be,Ue,Ne=0,Ke,ze;C.length&&C[0].nalUnitType!=="access_unit_delimiter_rbsp";)C.shift();if(C.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(H=Oe.groupNalsIntoFrames(C),Z=Oe.groupFramesIntoGops(H),Z[0][0].keyFrame||(W=this.getGopForFusion_(C[0],_),W?(Ne=W.duration,Z.unshift(W),Z.byteLength+=W.byteLength,Z.nalCount+=W.nalCount,Z.pts=W.pts,Z.dts=W.dts,Z.duration+=W.duration):Z=Oe.extendFirstKeyFrame(Z)),I.length){var At;if(w.alignGopsAtEnd?At=this.alignGopsAtEnd_(Z):At=this.alignGopsAtStart_(Z),!At){this.gopCache_.unshift({gop:Z.pop(),pps:_.pps,sps:_.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),C=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}yi.clearDtsInfo(_),Z=At}yi.collectDtsInfo(_,Z),_.samples=Oe.generateSampleTable(Z),be=re.mdat(Oe.concatenateNalData(Z)),_.baseMediaDecodeTime=yi.calculateTrackBaseMediaDecodeTime(_,w.keepOriginalTimestamps),this.trigger("processedGopsInfo",Z.map(function(Ia){return{pts:Ia.pts,dts:Ia.dts,byteLength:Ia.byteLength}})),Ke=Z[0],ze=Z[Z.length-1],this.trigger("segmentTimingInfo",ku(_.baseMediaDecodeTime,Ke.dts,Ke.pts,ze.dts+ze.duration,ze.pts+ze.duration,Ne)),this.trigger("timingInfo",{start:Z[0].pts,end:Z[Z.length-1].pts+Z[Z.length-1].duration}),this.gopCache_.unshift({gop:Z.pop(),pps:_.pps,sps:_.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),C=[],this.trigger("baseMediaDecodeTime",_.baseMediaDecodeTime),this.trigger("timelineStartInfo",_.timelineStartInfo),ce=re.moof(k,[_]),Ue=new Uint8Array(ce.byteLength+be.byteLength),k++,Ue.set(ce),Ue.set(be,ce.byteLength),this.trigger("data",{track:_,boxes:Ue}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),C=[],this.gopCache_.length=0,I.length=0,this.trigger("reset")},this.resetStream_=function(){yi.clearDtsInfo(_),B=void 0,F=void 0},this.getGopForFusion_=function(H){var W=45e3,Z=1e4,ce=1/0,be,Ue,Ne,Ke,ze;for(ze=0;ze<this.gopCache_.length;ze++)Ke=this.gopCache_[ze],Ne=Ke.gop,!(!(_.pps&&Vf(_.pps[0],Ke.pps[0]))||!(_.sps&&Vf(_.sps[0],Ke.sps[0])))&&(Ne.dts<_.timelineStartInfo.dts||(be=H.dts-Ne.dts-Ne.duration,be>=-Z&&be<=W&&(!Ue||ce>be)&&(Ue=Ke,ce=be)));return Ue?Ue.gop:null},this.alignGopsAtStart_=function(H){var W,Z,ce,be,Ue,Ne,Ke,ze;for(Ue=H.byteLength,Ne=H.nalCount,Ke=H.duration,W=Z=0;W<I.length&&Z<H.length&&(ce=I[W],be=H[Z],ce.pts!==be.pts);){if(be.pts>ce.pts){W++;continue}Z++,Ue-=be.byteLength,Ne-=be.nalCount,Ke-=be.duration}return Z===0?H:Z===H.length?null:(ze=H.slice(Z),ze.byteLength=Ue,ze.duration=Ke,ze.nalCount=Ne,ze.pts=ze[0].pts,ze.dts=ze[0].dts,ze)},this.alignGopsAtEnd_=function(H){var W,Z,ce,be,Ue,Ne;for(W=I.length-1,Z=H.length-1,Ue=null,Ne=!1;W>=0&&Z>=0;){if(ce=I[W],be=H[Z],ce.pts===be.pts){Ne=!0;break}if(ce.pts>be.pts){W--;continue}W===I.length-1&&(Ue=Z),Z--}if(!Ne&&Ue===null)return null;var Ke;if(Ne?Ke=Z:Ke=Ue,Ke===0)return H;var ze=H.slice(Ke),At=ze.reduce(function(Ia,Nr){return Ia.byteLength+=Nr.byteLength,Ia.duration+=Nr.duration,Ia.nalCount+=Nr.nalCount,Ia},{byteLength:0,duration:0,nalCount:0});return ze.byteLength=At.byteLength,ze.duration=At.duration,ze.nalCount=At.nalCount,ze.pts=ze[0].pts,ze.dts=ze[0].dts,ze},this.alignGopsWith=function(H){I=H}},Js.prototype=new t,Er=function(_,w){this.numberOfTracks=0,this.metadataStream=w,_=_||{},typeof _.remux<"u"?this.remuxTracks=!!_.remux:this.remuxTracks=!0,typeof _.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=_.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Er.prototype.init.call(this),this.push=function(k){if(k.text)return this.pendingCaptions.push(k);if(k.frames)return this.pendingMetadata.push(k);this.pendingTracks.push(k.track),this.pendingBytes+=k.boxes.byteLength,k.track.type==="video"&&(this.videoTrack=k.track,this.pendingBoxes.push(k.boxes)),k.track.type==="audio"&&(this.audioTrack=k.track,this.pendingBoxes.unshift(k.boxes))}},Er.prototype=new t,Er.prototype.flush=function(_){var w=0,k={captions:[],captionStreams:{},metadata:[],info:{}},C,I,B,F=0,H;if(this.pendingTracks.length<this.numberOfTracks){if(_!=="VideoSegmentStream"&&_!=="AudioSegmentStream"||this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(F=this.videoTrack.timelineStartInfo.pts,ds.forEach(function(W){k.info[W]=this.videoTrack[W]},this)):this.audioTrack&&(F=this.audioTrack.timelineStartInfo.pts,dc.forEach(function(W){k.info[W]=this.audioTrack[W]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?k.type=this.pendingTracks[0].type:k.type="combined",this.emittedTracks+=this.pendingTracks.length,B=re.initSegment(this.pendingTracks),k.initSegment=new Uint8Array(B.byteLength),k.initSegment.set(B),k.data=new Uint8Array(this.pendingBytes),H=0;H<this.pendingBoxes.length;H++)k.data.set(this.pendingBoxes[H],w),w+=this.pendingBoxes[H].byteLength;for(H=0;H<this.pendingCaptions.length;H++)C=this.pendingCaptions[H],C.startTime=mt.metadataTsToSeconds(C.startPts,F,this.keepOriginalTimestamps),C.endTime=mt.metadataTsToSeconds(C.endPts,F,this.keepOriginalTimestamps),k.captionStreams[C.stream]=!0,k.captions.push(C);for(H=0;H<this.pendingMetadata.length;H++)I=this.pendingMetadata[H],I.cueTime=mt.metadataTsToSeconds(I.pts,F,this.keepOriginalTimestamps),k.metadata.push(I);for(k.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",k),H=0;H<k.captions.length;H++)C=k.captions[H],this.trigger("caption",C);for(H=0;H<k.metadata.length;H++)I=k.metadata[H],this.trigger("id3Frame",I)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Er.prototype.setRemux=function(_){this.remuxTracks=_},Ys=function(_){var w=this,k=!0,C,I;Ys.prototype.init.call(this),_=_||{},this.baseMediaDecodeTime=_.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var B={};this.transmuxPipeline_=B,B.type="aac",B.metadataStream=new en.MetadataStream,B.aacStream=new Mf,B.audioTimestampRolloverStream=new en.TimestampRolloverStream("audio"),B.timedMetadataTimestampRolloverStream=new en.TimestampRolloverStream("timed-metadata"),B.adtsStream=new tn,B.coalesceStream=new Er(_,B.metadataStream),B.headOfPipeline=B.aacStream,B.aacStream.pipe(B.audioTimestampRolloverStream).pipe(B.adtsStream),B.aacStream.pipe(B.timedMetadataTimestampRolloverStream).pipe(B.metadataStream).pipe(B.coalesceStream),B.metadataStream.on("timestamp",function(F){B.aacStream.setTimestamp(F.timeStamp)}),B.aacStream.on("data",function(F){F.type!=="timed-metadata"&&F.type!=="audio"||B.audioSegmentStream||(I=I||{timelineStartInfo:{baseMediaDecodeTime:w.baseMediaDecodeTime},codec:"adts",type:"audio"},B.coalesceStream.numberOfTracks++,B.audioSegmentStream=new kr(I,_),B.audioSegmentStream.on("log",w.getLogTrigger_("audioSegmentStream")),B.audioSegmentStream.on("timingInfo",w.trigger.bind(w,"audioTimingInfo")),B.adtsStream.pipe(B.audioSegmentStream).pipe(B.coalesceStream),w.trigger("trackinfo",{hasAudio:!!I,hasVideo:!!C}))}),B.coalesceStream.on("data",this.trigger.bind(this,"data")),B.coalesceStream.on("done",this.trigger.bind(this,"done")),Ff(this,B)},this.setupTsPipeline=function(){var B={};this.transmuxPipeline_=B,B.type="ts",B.metadataStream=new en.MetadataStream,B.packetStream=new en.TransportPacketStream,B.parseStream=new en.TransportParseStream,B.elementaryStream=new en.ElementaryStream,B.timestampRolloverStream=new en.TimestampRolloverStream,B.adtsStream=new tn,B.h264Stream=new Xs,B.captionStream=new en.CaptionStream(_),B.coalesceStream=new Er(_,B.metadataStream),B.headOfPipeline=B.packetStream,B.packetStream.pipe(B.parseStream).pipe(B.elementaryStream).pipe(B.timestampRolloverStream),B.timestampRolloverStream.pipe(B.h264Stream),B.timestampRolloverStream.pipe(B.adtsStream),B.timestampRolloverStream.pipe(B.metadataStream).pipe(B.coalesceStream),B.h264Stream.pipe(B.captionStream).pipe(B.coalesceStream),B.elementaryStream.on("data",function(F){var H;if(F.type==="metadata"){for(H=F.tracks.length;H--;)!C&&F.tracks[H].type==="video"?(C=F.tracks[H],C.timelineStartInfo.baseMediaDecodeTime=w.baseMediaDecodeTime):!I&&F.tracks[H].type==="audio"&&(I=F.tracks[H],I.timelineStartInfo.baseMediaDecodeTime=w.baseMediaDecodeTime);C&&!B.videoSegmentStream&&(B.coalesceStream.numberOfTracks++,B.videoSegmentStream=new Js(C,_),B.videoSegmentStream.on("log",w.getLogTrigger_("videoSegmentStream")),B.videoSegmentStream.on("timelineStartInfo",function(W){I&&!_.keepOriginalTimestamps&&(I.timelineStartInfo=W,B.audioSegmentStream.setEarliestDts(W.dts-w.baseMediaDecodeTime))}),B.videoSegmentStream.on("processedGopsInfo",w.trigger.bind(w,"gopInfo")),B.videoSegmentStream.on("segmentTimingInfo",w.trigger.bind(w,"videoSegmentTimingInfo")),B.videoSegmentStream.on("baseMediaDecodeTime",function(W){I&&B.audioSegmentStream.setVideoBaseMediaDecodeTime(W)}),B.videoSegmentStream.on("timingInfo",w.trigger.bind(w,"videoTimingInfo")),B.h264Stream.pipe(B.videoSegmentStream).pipe(B.coalesceStream)),I&&!B.audioSegmentStream&&(B.coalesceStream.numberOfTracks++,B.audioSegmentStream=new kr(I,_),B.audioSegmentStream.on("log",w.getLogTrigger_("audioSegmentStream")),B.audioSegmentStream.on("timingInfo",w.trigger.bind(w,"audioTimingInfo")),B.audioSegmentStream.on("segmentTimingInfo",w.trigger.bind(w,"audioSegmentTimingInfo")),B.adtsStream.pipe(B.audioSegmentStream).pipe(B.coalesceStream)),w.trigger("trackinfo",{hasAudio:!!I,hasVideo:!!C})}}),B.coalesceStream.on("data",this.trigger.bind(this,"data")),B.coalesceStream.on("id3Frame",function(F){F.dispatchType=B.metadataStream.dispatchType,w.trigger("id3Frame",F)}),B.coalesceStream.on("caption",this.trigger.bind(this,"caption")),B.coalesceStream.on("done",this.trigger.bind(this,"done")),Ff(this,B)},this.setBaseMediaDecodeTime=function(B){var F=this.transmuxPipeline_;_.keepOriginalTimestamps||(this.baseMediaDecodeTime=B),I&&(I.timelineStartInfo.dts=void 0,I.timelineStartInfo.pts=void 0,yi.clearDtsInfo(I),F.audioTimestampRolloverStream&&F.audioTimestampRolloverStream.discontinuity()),C&&(F.videoSegmentStream&&(F.videoSegmentStream.gopCache_=[]),C.timelineStartInfo.dts=void 0,C.timelineStartInfo.pts=void 0,yi.clearDtsInfo(C),F.captionStream.reset()),F.timestampRolloverStream&&F.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(B){I&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(B)},this.setRemux=function(B){var F=this.transmuxPipeline_;_.remux=B,F&&F.coalesceStream&&F.coalesceStream.setRemux(B)},this.alignGopsWith=function(B){C&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(B)},this.getLogTrigger_=function(B){var F=this;return function(H){H.stream=B,F.trigger("log",H)}},this.push=function(B){if(k){var F=Lf(B);F&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!F&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),k=!1}this.transmuxPipeline_.headOfPipeline.push(B)},this.flush=function(){k=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Ys.prototype=new t;var jv={Transmuxer:Ys,VideoSegmentStream:Js,AudioSegmentStream:kr,AUDIO_PROPERTIES:dc,VIDEO_PROPERTIES:ds,generateSegmentTimingInfo:ku},zv=function(_){return _>>>0},Hv=function(_){return("00"+_.toString(16)).slice(-2)},us={toUnsigned:zv,toHexString:Hv},qv=function(_){var w="";return w+=String.fromCharCode(_[0]),w+=String.fromCharCode(_[1]),w+=String.fromCharCode(_[2]),w+=String.fromCharCode(_[3]),w},Un=qv,uc=us.toUnsigned,Wv=function _(w,k){var C=[],I,B,F,H,W;if(!k.length)return null;for(I=0;I<w.byteLength;)B=uc(w[I]<<24|w[I+1]<<16|w[I+2]<<8|w[I+3]),F=Un(w.subarray(I+4,I+8)),H=B>1?I+B:w.byteLength,F===k[0]&&(k.length===1?C.push(w.subarray(I+8,H)):(W=_(w.subarray(I+8,H),k.slice(1)),W.length&&(C=C.concat(W)))),I=H;return C},It=Wv,Gv=us.toUnsigned,Kv=n.getUint64,Xv=function(_){var w={version:_[0],flags:new Uint8Array(_.subarray(1,4))};return w.version===1?w.baseMediaDecodeTime=Kv(_.subarray(4)):w.baseMediaDecodeTime=Gv(_[4]<<24|_[5]<<16|_[6]<<8|_[7]),w},Qs=Xv,Zs=function(_){return{isLeading:(_[0]&12)>>>2,dependsOn:_[0]&3,isDependedOn:(_[1]&192)>>>6,hasRedundancy:(_[1]&48)>>>4,paddingValue:(_[1]&14)>>>1,isNonSyncSample:_[1]&1,degradationPriority:_[2]<<8|_[3]}},hs=Zs,hc=function(_){var w={version:_[0],flags:new Uint8Array(_.subarray(1,4)),samples:[]},k=new DataView(_.buffer,_.byteOffset,_.byteLength),C=w.flags[2]&1,I=w.flags[2]&4,B=w.flags[1]&1,F=w.flags[1]&2,H=w.flags[1]&4,W=w.flags[1]&8,Z=k.getUint32(4),ce=8,be;for(C&&(w.dataOffset=k.getInt32(ce),ce+=4),I&&Z&&(be={flags:hs(_.subarray(ce,ce+4))},ce+=4,B&&(be.duration=k.getUint32(ce),ce+=4),F&&(be.size=k.getUint32(ce),ce+=4),W&&(w.version===1?be.compositionTimeOffset=k.getInt32(ce):be.compositionTimeOffset=k.getUint32(ce),ce+=4),w.samples.push(be),Z--);Z--;)be={},B&&(be.duration=k.getUint32(ce),ce+=4),F&&(be.size=k.getUint32(ce),ce+=4),H&&(be.flags=hs(_.subarray(ce,ce+4)),ce+=4),W&&(w.version===1?be.compositionTimeOffset=k.getInt32(ce):be.compositionTimeOffset=k.getUint32(ce),ce+=4),w.samples.push(be);return w},ni=hc,an=function(_){var w=new DataView(_.buffer,_.byteOffset,_.byteLength),k={version:_[0],flags:new Uint8Array(_.subarray(1,4)),trackId:w.getUint32(4)},C=k.flags[2]&1,I=k.flags[2]&2,B=k.flags[2]&8,F=k.flags[2]&16,H=k.flags[2]&32,W=k.flags[0]&65536,Z=k.flags[0]&131072,ce;return ce=8,C&&(ce+=4,k.baseDataOffset=w.getUint32(12),ce+=4),I&&(k.sampleDescriptionIndex=w.getUint32(ce),ce+=4),B&&(k.defaultSampleDuration=w.getUint32(ce),ce+=4),F&&(k.defaultSampleSize=w.getUint32(ce),ce+=4),H&&(k.defaultSampleFlags=w.getUint32(ce)),W&&(k.durationIsEmpty=!0),!C&&Z&&(k.baseDataOffsetIsMoof=!0),k},$s=an,Eu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},eo;typeof window<"u"?eo=window:typeof Eu<"u"?eo=Eu:typeof self<"u"?eo=self:eo={};var to=eo,Jv=zs.discardEmulationPreventionBytes,Yv=br.CaptionStream,Iu=function(_,w){for(var k=_,C=0;C<w.length;C++){var I=w[C];if(k<I.size)return I;k-=I.size}return null},xu=function(_,w,k){var C=new DataView(_.buffer,_.byteOffset,_.byteLength),I={logs:[],seiNals:[]},B,F,H,W;for(F=0;F+4<_.length;F+=H)if(H=C.getUint32(F),F+=4,!(H<=0))switch(_[F]&31){case 6:var Z=_.subarray(F+1,F+1+H),ce=Iu(F,w);if(B={nalUnitType:"sei_rbsp",size:H,data:Z,escapedRBSP:Jv(Z),trackId:k},ce)B.pts=ce.pts,B.dts=ce.dts,W=ce;else if(W)B.pts=W.pts,B.dts=W.dts;else{I.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+F+" for trackId "+k+". See mux.js#223."});break}I.seiNals.push(B);break}return I},ao=function(_,w,k){var C=w,I=k.defaultSampleDuration||0,B=k.defaultSampleSize||0,F=k.trackId,H=[];return _.forEach(function(W){var Z=ni(W),ce=Z.samples;ce.forEach(function(be){be.duration===void 0&&(be.duration=I),be.size===void 0&&(be.size=B),be.trackId=F,be.dts=C,be.compositionTimeOffset===void 0&&(be.compositionTimeOffset=0),typeof C=="bigint"?(be.pts=C+to.BigInt(be.compositionTimeOffset),C+=to.BigInt(be.duration)):(be.pts=C+be.compositionTimeOffset,C+=be.duration)}),H=H.concat(ce)}),H},ps=function(_,w){var k=It(_,["moof","traf"]),C=It(_,["mdat"]),I={},B=[];return C.forEach(function(F,H){var W=k[H];B.push({mdat:F,traf:W})}),B.forEach(function(F){var H=F.mdat,W=F.traf,Z=It(W,["tfhd"]),ce=$s(Z[0]),be=ce.trackId,Ue=It(W,["tfdt"]),Ne=Ue.length>0?Qs(Ue[0]).baseMediaDecodeTime:0,Ke=It(W,["trun"]),ze,At;w===be&&Ke.length>0&&(ze=ao(Ke,Ne,ce),At=xu(H,ze,be),I[be]||(I[be]={seiNals:[],logs:[]}),I[be].seiNals=I[be].seiNals.concat(At.seiNals),I[be].logs=I[be].logs.concat(At.logs))}),I},pc=function(_,w,k){var C;if(w===null)return null;C=ps(_,w);var I=C[w]||{};return{seiNals:I.seiNals,logs:I.logs,timescale:k}},Ir=function(){var _=!1,w,k,C,I,B,F;this.isInitialized=function(){return _},this.init=function(H){w=new Yv,_=!0,F=H?H.isPartial:!1,w.on("data",function(W){W.startTime=W.startPts/I,W.endTime=W.endPts/I,B.captions.push(W),B.captionStreams[W.stream]=!0}),w.on("log",function(W){B.logs.push(W)})},this.isNewInit=function(H,W){return H&&H.length===0||W&&typeof W=="object"&&Object.keys(W).length===0?!1:C!==H[0]||I!==W[C]},this.parse=function(H,W,Z){var ce;if(this.isInitialized()){if(!W||!Z)return null;if(this.isNewInit(W,Z))C=W[0],I=Z[C];else if(C===null||!I)return k.push(H),null}else return null;for(;k.length>0;){var be=k.shift();this.parse(be,W,Z)}return ce=pc(H,C,I),ce&&ce.logs&&(B.logs=B.logs.concat(ce.logs)),ce===null||!ce.seiNals?B.logs.length?{logs:B.logs,captions:[],captionStreams:[]}:null:(this.pushNals(ce.seiNals),this.flushStream(),B)},this.pushNals=function(H){if(!this.isInitialized()||!H||H.length===0)return null;H.forEach(function(W){w.push(W)})},this.flushStream=function(){if(!this.isInitialized())return null;F?w.partialFlush():w.flush()},this.clearParsedCaptions=function(){B.captions=[],B.captionStreams={},B.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;w.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){k=[],C=null,I=null,B?this.clearParsedCaptions():B={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Qv=Ir,io=us.toUnsigned,ms=us.toHexString,Nu=n.getUint64,Uf,jf,zf,no,Hf,mc;Uf=function(_){var w={},k=It(_,["moov","trak"]);return k.reduce(function(C,I){var B,F,H,W,Z;return B=It(I,["tkhd"])[0],!B||(F=B[0],H=F===0?12:20,W=io(B[H]<<24|B[H+1]<<16|B[H+2]<<8|B[H+3]),Z=It(I,["mdia","mdhd"])[0],!Z)?null:(F=Z[0],H=F===0?12:20,C[W]=io(Z[H]<<24|Z[H+1]<<16|Z[H+2]<<8|Z[H+3]),C)},w)},jf=function(_,w){var k;k=It(w,["moof","traf"]);var C=k.reduce(function(I,B){var F=It(B,["tfhd"])[0],H=io(F[4]<<24|F[5]<<16|F[6]<<8|F[7]),W=_[H]||9e4,Z=It(B,["tfdt"])[0],ce=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),be;Z[0]===1?be=Nu(Z.subarray(4,12)):be=ce.getUint32(4);var Ue;return typeof be=="bigint"?Ue=be/to.BigInt(W):typeof be=="number"&&!isNaN(be)&&(Ue=be/W),Ue<Number.MAX_SAFE_INTEGER&&(Ue=Number(Ue)),Ue<I&&(I=Ue),I},1/0);return typeof C=="bigint"||isFinite(C)?C:0},zf=function(_,w){var k=It(w,["moof","traf"]),C=0,I=0,B;if(k&&k.length){var F=It(k[0],["tfhd"])[0],H=It(k[0],["trun"])[0],W=It(k[0],["tfdt"])[0];if(F){var Z=$s(F);B=Z.trackId}if(W){var ce=Qs(W);C=ce.baseMediaDecodeTime}if(H){var be=ni(H);be.samples&&be.samples.length&&(I=be.samples[0].compositionTimeOffset||0)}}var Ue=_[B]||9e4;typeof C=="bigint"&&(I=to.BigInt(I),Ue=to.BigInt(Ue));var Ne=(C+I)/Ue;return typeof Ne=="bigint"&&Ne<Number.MAX_SAFE_INTEGER&&(Ne=Number(Ne)),Ne},no=function(_){var w=It(_,["moov","trak"]),k=[];return w.forEach(function(C){var I=It(C,["mdia","hdlr"]),B=It(C,["tkhd"]);I.forEach(function(F,H){var W=Un(F.subarray(8,12)),Z=B[H],ce,be,Ue;W==="vide"&&(ce=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),be=ce.getUint8(0),Ue=be===0?ce.getUint32(12):ce.getUint32(20),k.push(Ue))})}),k},mc=function(_){var w=_[0],k=w===0?12:20;return io(_[k]<<24|_[k+1]<<16|_[k+2]<<8|_[k+3])},Hf=function(_){var w=It(_,["moov","trak"]),k=[];return w.forEach(function(C){var I={},B=It(C,["tkhd"])[0],F,H;B&&(F=new DataView(B.buffer,B.byteOffset,B.byteLength),H=F.getUint8(0),I.id=H===0?F.getUint32(12):F.getUint32(20));var W=It(C,["mdia","hdlr"])[0];if(W){var Z=Un(W.subarray(8,12));Z==="vide"?I.type="video":Z==="soun"?I.type="audio":I.type=Z}var ce=It(C,["mdia","minf","stbl","stsd"])[0];if(ce){var be=ce.subarray(8);I.codec=Un(be.subarray(4,8));var Ue=It(be,[I.codec])[0],Ne,Ke;Ue&&(/^[asm]vc[1-9]$/i.test(I.codec)?(Ne=Ue.subarray(78),Ke=Un(Ne.subarray(4,8)),Ke==="avcC"&&Ne.length>11?(I.codec+=".",I.codec+=ms(Ne[9]),I.codec+=ms(Ne[10]),I.codec+=ms(Ne[11])):I.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(I.codec)?(Ne=Ue.subarray(28),Ke=Un(Ne.subarray(4,8)),Ke==="esds"&&Ne.length>20&&Ne[19]!==0?(I.codec+="."+ms(Ne[19]),I.codec+="."+ms(Ne[20]>>>2&63).replace(/^0/,"")):I.codec="mp4a.40.2"):I.codec=I.codec.toLowerCase())}var ze=It(C,["mdia","mdhd"])[0];ze&&(I.timescale=mc(ze)),k.push(I)}),k};var qf={findBox:It,parseType:Un,timescale:Uf,startTime:jf,compositionStartTime:zf,videoTrackIds:no,tracks:Hf,getTimescaleFromMediaHeader:mc},Wf=function(_){var w=_[1]&31;return w<<=8,w|=_[2],w},ro=function(_){return!!(_[1]&64)},so=function(_){var w=0;return(_[3]&48)>>>4>1&&(w+=_[4]+1),w},Zv=function(_,w){var k=Wf(_);return k===0?"pat":k===w?"pmt":w?"pes":null},$v=function(_){var w=ro(_),k=4+so(_);return w&&(k+=_[k]+1),(_[k+10]&31)<<8|_[k+11]},eS=function(_){var w={},k=ro(_),C=4+so(_);if(k&&(C+=_[C]+1),!!(_[C+5]&1)){var I,B,F;I=(_[C+1]&15)<<8|_[C+2],B=3+I-4,F=(_[C+10]&15)<<8|_[C+11];for(var H=12+F;H<B;){var W=C+H;w[(_[W+1]&31)<<8|_[W+2]]=_[W],H+=((_[W+3]&15)<<8|_[W+4])+5}return w}},Gf=function(_,w){var k=Wf(_),C=w[k];switch(C){case zt.H264_STREAM_TYPE:return"video";case zt.ADTS_STREAM_TYPE:return"audio";case zt.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},tS=function(_){var w=ro(_);if(!w)return null;var k=4+so(_);if(k>=_.byteLength)return null;var C=null,I;return I=_[k+7],I&192&&(C={},C.pts=(_[k+9]&14)<<27|(_[k+10]&255)<<20|(_[k+11]&254)<<12|(_[k+12]&255)<<5|(_[k+13]&254)>>>3,C.pts*=4,C.pts+=(_[k+13]&6)>>>1,C.dts=C.pts,I&64&&(C.dts=(_[k+14]&14)<<27|(_[k+15]&255)<<20|(_[k+16]&254)<<12|(_[k+17]&255)<<5|(_[k+18]&254)>>>3,C.dts*=4,C.dts+=(_[k+18]&6)>>>1)),C},Au=function(_){switch(_){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Kf=function(_){for(var w=4+so(_),k=_.subarray(w),C=0,I=0,B=!1,F;I<k.byteLength-3;I++)if(k[I+2]===1){C=I+5;break}for(;C<k.byteLength;)switch(k[C]){case 0:if(k[C-1]!==0){C+=2;break}else if(k[C-2]!==0){C++;break}I+3!==C-2&&(F=Au(k[I+3]&31),F==="slice_layer_without_partitioning_rbsp_idr"&&(B=!0));do C++;while(k[C]!==1&&C<k.length);I=C-2,C+=3;break;case 1:if(k[C-1]!==0||k[C-2]!==0){C+=3;break}F=Au(k[I+3]&31),F==="slice_layer_without_partitioning_rbsp_idr"&&(B=!0),I=C-2,C+=3;break;default:C+=3;break}return k=k.subarray(I),C-=I,I=0,k&&k.byteLength>3&&(F=Au(k[I+3]&31),F==="slice_layer_without_partitioning_rbsp_idr"&&(B=!0)),B},aS={parseType:Zv,parsePat:$v,parsePmt:eS,parsePayloadUnitStartIndicator:ro,parsePesType:Gf,parsePesTime:tS,videoPacketContainsKeyFrame:Kf},xr=Nf.handleRollover,yt={};yt.ts=aS,yt.aac=Ks;var jn=mt.ONE_SECOND_IN_TS,Kt=188,_i=71,iS=function(_,w){for(var k=0,C=Kt,I,B;C<_.byteLength;){if(_[k]===_i&&_[C]===_i){switch(I=_.subarray(k,C),B=yt.ts.parseType(I,w.pid),B){case"pat":w.pid=yt.ts.parsePat(I);break;case"pmt":var F=yt.ts.parsePmt(I);w.table=w.table||{},Object.keys(F).forEach(function(H){w.table[H]=F[H]});break}k+=Kt,C+=Kt;continue}k++,C++}},Xf=function(_,w,k){for(var C=0,I=Kt,B,F,H,W,Z,ce=!1;I<=_.byteLength;){if(_[C]===_i&&(_[I]===_i||I===_.byteLength)){switch(B=_.subarray(C,I),F=yt.ts.parseType(B,w.pid),F){case"pes":H=yt.ts.parsePesType(B,w.table),W=yt.ts.parsePayloadUnitStartIndicator(B),H==="audio"&&W&&(Z=yt.ts.parsePesTime(B),Z&&(Z.type="audio",k.audio.push(Z),ce=!0));break}if(ce)break;C+=Kt,I+=Kt;continue}C++,I++}for(I=_.byteLength,C=I-Kt,ce=!1;C>=0;){if(_[C]===_i&&(_[I]===_i||I===_.byteLength)){switch(B=_.subarray(C,I),F=yt.ts.parseType(B,w.pid),F){case"pes":H=yt.ts.parsePesType(B,w.table),W=yt.ts.parsePayloadUnitStartIndicator(B),H==="audio"&&W&&(Z=yt.ts.parsePesTime(B),Z&&(Z.type="audio",k.audio.push(Z),ce=!0));break}if(ce)break;C-=Kt,I-=Kt;continue}C--,I--}},oo=function(_,w,k){for(var C=0,I=Kt,B,F,H,W,Z,ce,be,Ue,Ne=!1,Ke={data:[],size:0};I<_.byteLength;){if(_[C]===_i&&_[I]===_i){switch(B=_.subarray(C,I),F=yt.ts.parseType(B,w.pid),F){case"pes":if(H=yt.ts.parsePesType(B,w.table),W=yt.ts.parsePayloadUnitStartIndicator(B),H==="video"&&(W&&!Ne&&(Z=yt.ts.parsePesTime(B),Z&&(Z.type="video",k.video.push(Z),Ne=!0)),!k.firstKeyFrame)){if(W&&Ke.size!==0){for(ce=new Uint8Array(Ke.size),be=0;Ke.data.length;)Ue=Ke.data.shift(),ce.set(Ue,be),be+=Ue.byteLength;if(yt.ts.videoPacketContainsKeyFrame(ce)){var ze=yt.ts.parsePesTime(ce);ze?(k.firstKeyFrame=ze,k.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}Ke.size=0}Ke.data.push(B),Ke.size+=B.byteLength}break}if(Ne&&k.firstKeyFrame)break;C+=Kt,I+=Kt;continue}C++,I++}for(I=_.byteLength,C=I-Kt,Ne=!1;C>=0;){if(_[C]===_i&&_[I]===_i){switch(B=_.subarray(C,I),F=yt.ts.parseType(B,w.pid),F){case"pes":H=yt.ts.parsePesType(B,w.table),W=yt.ts.parsePayloadUnitStartIndicator(B),H==="video"&&W&&(Z=yt.ts.parsePesTime(B),Z&&(Z.type="video",k.video.push(Z),Ne=!0));break}if(Ne)break;C-=Kt,I-=Kt;continue}C--,I--}},nS=function(_,w){if(_.audio&&_.audio.length){var k=w;(typeof k>"u"||isNaN(k))&&(k=_.audio[0].dts),_.audio.forEach(function(B){B.dts=xr(B.dts,k),B.pts=xr(B.pts,k),B.dtsTime=B.dts/jn,B.ptsTime=B.pts/jn})}if(_.video&&_.video.length){var C=w;if((typeof C>"u"||isNaN(C))&&(C=_.video[0].dts),_.video.forEach(function(B){B.dts=xr(B.dts,C),B.pts=xr(B.pts,C),B.dtsTime=B.dts/jn,B.ptsTime=B.pts/jn}),_.firstKeyFrame){var I=_.firstKeyFrame;I.dts=xr(I.dts,C),I.pts=xr(I.pts,C),I.dtsTime=I.dts/jn,I.ptsTime=I.pts/jn}}},rS=function(_){for(var w=!1,k=0,C=null,I=null,B=0,F=0,H;_.length-F>=3;){var W=yt.aac.parseType(_,F);switch(W){case"timed-metadata":if(_.length-F<10){w=!0;break}if(B=yt.aac.parseId3TagSize(_,F),B>_.length){w=!0;break}I===null&&(H=_.subarray(F,F+B),I=yt.aac.parseAacTimestamp(H)),F+=B;break;case"audio":if(_.length-F<7){w=!0;break}if(B=yt.aac.parseAdtsSize(_,F),B>_.length){w=!0;break}C===null&&(H=_.subarray(F,F+B),C=yt.aac.parseSampleRate(H)),k++,F+=B;break;default:F++;break}if(w)return null}if(C===null||I===null)return null;var Z=jn/C,ce={audio:[{type:"audio",dts:I,pts:I},{type:"audio",dts:I+k*1024*Z,pts:I+k*1024*Z}]};return ce},sS=function(_){var w={pid:null,table:null},k={};iS(_,w);for(var C in w.table)if(w.table.hasOwnProperty(C)){var I=w.table[C];switch(I){case zt.H264_STREAM_TYPE:k.video=[],oo(_,w,k),k.video.length===0&&delete k.video;break;case zt.ADTS_STREAM_TYPE:k.audio=[],Xf(_,w,k),k.audio.length===0&&delete k.audio;break}}return k},Jf=function(_,w){var k=yt.aac.isLikelyAacData(_),C;return k?C=rS(_):C=sS(_),!C||!C.audio&&!C.video?null:(nS(C,w),C)},oS={inspect:Jf,parseAudioPes_:Xf},lS=function(_,w){w.on("data",function(k){var C=k.initSegment;k.initSegment={data:C.buffer,byteOffset:C.byteOffset,byteLength:C.byteLength};var I=k.data;k.data=I.buffer,_.postMessage({action:"data",segment:k,byteOffset:I.byteOffset,byteLength:I.byteLength},[k.data])}),w.on("done",function(k){_.postMessage({action:"done"})}),w.on("gopInfo",function(k){_.postMessage({action:"gopInfo",gopInfo:k})}),w.on("videoSegmentTimingInfo",function(k){var C={start:{decode:mt.videoTsToSeconds(k.start.dts),presentation:mt.videoTsToSeconds(k.start.pts)},end:{decode:mt.videoTsToSeconds(k.end.dts),presentation:mt.videoTsToSeconds(k.end.pts)},baseMediaDecodeTime:mt.videoTsToSeconds(k.baseMediaDecodeTime)};k.prependedContentDuration&&(C.prependedContentDuration=mt.videoTsToSeconds(k.prependedContentDuration)),_.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:C})}),w.on("audioSegmentTimingInfo",function(k){var C={start:{decode:mt.videoTsToSeconds(k.start.dts),presentation:mt.videoTsToSeconds(k.start.pts)},end:{decode:mt.videoTsToSeconds(k.end.dts),presentation:mt.videoTsToSeconds(k.end.pts)},baseMediaDecodeTime:mt.videoTsToSeconds(k.baseMediaDecodeTime)};k.prependedContentDuration&&(C.prependedContentDuration=mt.videoTsToSeconds(k.prependedContentDuration)),_.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:C})}),w.on("id3Frame",function(k){_.postMessage({action:"id3Frame",id3Frame:k})}),w.on("caption",function(k){_.postMessage({action:"caption",caption:k})}),w.on("trackinfo",function(k){_.postMessage({action:"trackinfo",trackInfo:k})}),w.on("audioTimingInfo",function(k){_.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:mt.videoTsToSeconds(k.start),end:mt.videoTsToSeconds(k.end)}})}),w.on("videoTimingInfo",function(k){_.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:mt.videoTsToSeconds(k.start),end:mt.videoTsToSeconds(k.end)}})}),w.on("log",function(k){_.postMessage({action:"log",log:k})})},Yf=function(){function _(k,C){this.options=C||{},this.self=k,this.init()}var w=_.prototype;return w.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new jv.Transmuxer(this.options),lS(this.self,this.transmuxer)},w.pushMp4Captions=function(k){this.captionParser||(this.captionParser=new Qv,this.captionParser.init());var C=new Uint8Array(k.data,k.byteOffset,k.byteLength),I=this.captionParser.parse(C,k.trackIds,k.timescales);this.self.postMessage({action:"mp4Captions",captions:I&&I.captions||[],logs:I&&I.logs||[],data:C.buffer},[C.buffer])},w.probeMp4StartTime=function(k){var C=k.timescales,I=k.data,B=qf.startTime(C,I);this.self.postMessage({action:"probeMp4StartTime",startTime:B,data:I},[I.buffer])},w.probeMp4Tracks=function(k){var C=k.data,I=qf.tracks(C);this.self.postMessage({action:"probeMp4Tracks",tracks:I,data:C},[C.buffer])},w.probeTs=function(k){var C=k.data,I=k.baseStartTime,B=typeof I=="number"&&!isNaN(I)?I*mt.ONE_SECOND_IN_TS:void 0,F=oS.inspect(C,B),H=null;F&&(H={hasVideo:F.video&&F.video.length===2||!1,hasAudio:F.audio&&F.audio.length===2||!1},H.hasVideo&&(H.videoStart=F.video[0].ptsTime),H.hasAudio&&(H.audioStart=F.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:H,data:C},[C.buffer])},w.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},w.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},w.push=function(k){var C=new Uint8Array(k.data,k.byteOffset,k.byteLength);this.transmuxer.push(C)},w.reset=function(){this.transmuxer.reset()},w.setTimestampOffset=function(k){var C=k.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(mt.secondsToVideoTs(C)))},w.setAudioAppendStart=function(k){this.transmuxer.setAudioAppendStart(Math.ceil(mt.secondsToVideoTs(k.appendStart)))},w.setRemux=function(k){this.transmuxer.setRemux(k.remux)},w.flush=function(k){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},w.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},w.alignGopsWith=function(k){this.transmuxer.alignGopsWith(k.gopsToAlignWith.slice())},_}();self.onmessage=function(_){if(_.data.action==="init"&&_.data.options){this.messageHandlers=new Yf(self,_.data.options);return}this.messageHandlers||(this.messageHandlers=new Yf(self)),_.data&&_.data.action&&_.data.action!=="init"&&this.messageHandlers[_.data.action]&&this.messageHandlers[_.data.action](_.data)}})),b1e=mA(_1e),v1e=function(e,t,a){var i=e.data.segment,n=i.type,r=i.initSegment,o=i.captions,l=i.captionStreams,c=i.metadata,d=i.videoFrameDtsTime,u=i.videoFramePtsTime;t.buffer.push({captions:o,captionStreams:l,metadata:c});var h=e.data.segment.boxes||{data:e.data.segment.data},m={type:n,data:new Uint8Array(h.data,h.data.byteOffset,h.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof d<"u"&&(m.videoFrameDtsTime=d),typeof u<"u"&&(m.videoFramePtsTime=u),a(m)},S1e=function(e){var t=e.transmuxedData,a=e.callback;t.buffer=[],a(t)},w1e=function(e,t){t.gopInfo=e.data.gopInfo},yA=function(e){var t=e.transmuxer,a=e.bytes,i=e.audioAppendStart,n=e.gopsToAlignWith,r=e.remux,o=e.onData,l=e.onTrackInfo,c=e.onAudioTimingInfo,d=e.onVideoTimingInfo,u=e.onVideoSegmentTimingInfo,h=e.onAudioSegmentTimingInfo,m=e.onId3,p=e.onCaptions,f=e.onDone,y=e.onEndedTimeline,b=e.onTransmuxerLog,E=e.isEndOfTimeline,D={buffer:[]},M=E,N=function(V){t.currentTransmux===e&&(V.data.action==="data"&&v1e(V,D,o),V.data.action==="trackinfo"&&l(V.data.trackInfo),V.data.action==="gopInfo"&&w1e(V,D),V.data.action==="audioTimingInfo"&&c(V.data.audioTimingInfo),V.data.action==="videoTimingInfo"&&d(V.data.videoTimingInfo),V.data.action==="videoSegmentTimingInfo"&&u(V.data.videoSegmentTimingInfo),V.data.action==="audioSegmentTimingInfo"&&h(V.data.audioSegmentTimingInfo),V.data.action==="id3Frame"&&m([V.data.id3Frame],V.data.id3Frame.dispatchType),V.data.action==="caption"&&p(V.data.caption),V.data.action==="endedtimeline"&&(M=!1,y()),V.data.action==="log"&&b(V.data.log),V.data.type==="transmuxed"&&(M||(t.onmessage=null,S1e({transmuxedData:D,callback:f}),_A(t))))};if(t.onmessage=N,i&&t.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(n)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),typeof r<"u"&&t.postMessage({action:"setRemux",remux:r}),a.byteLength){var P=a instanceof ArrayBuffer?a:a.buffer,L=a instanceof ArrayBuffer?0:a.byteOffset;t.postMessage({action:"push",data:P,byteOffset:L,byteLength:a.byteLength},[P])}E&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},_A=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),typeof e.currentTransmux=="function"?e.currentTransmux():yA(e.currentTransmux))},bA=function(e,t){e.postMessage({action:t}),_A(e)},vA=function(e,t){if(!t.currentTransmux){t.currentTransmux=e,bA(t,e);return}t.transmuxQueue.push(bA.bind(null,t,e))},T1e=function(e){vA("reset",e)},C1e=function(e){vA("endTimeline",e)},SA=function(e){if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,yA(e);return}e.transmuxer.transmuxQueue.push(e)},k1e=function(e){var t=new b1e;t.currentTransmux=null,t.transmuxQueue=[];var a=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,a.call(t)},t.postMessage({action:"init",options:e}),t},W1={reset:T1e,endTimeline:C1e,transmux:SA,createTransmuxer:k1e},mf=function(e){var t=e.transmuxer,a=e.endAction||e.action,i=e.callback,n=Ht({},e,{endAction:null,transmuxer:null,callback:null}),r=function c(d){d.data.action===a&&(t.removeEventListener("message",c),d.data.data&&(d.data.data=new Uint8Array(d.data.data,e.byteOffset||0,e.byteLength||d.data.data.byteLength),e.data&&(e.data=d.data.data)),i(d.data))};if(t.addEventListener("message",r),e.data){var o=e.data instanceof ArrayBuffer;n.byteOffset=o?0:e.data.byteOffset,n.byteLength=e.data.byteLength;var l=[o?e.data:e.data.buffer];t.postMessage(n,l)}else t.postMessage(n)},Ln={FAILURE:2,TIMEOUT:-101,ABORTED:-102},G1=function(e){e.forEach(function(t){t.abort()})},E1e=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},I1e=function(e){var t=e.target,a=Date.now()-t.requestTime,i={bandwidth:1/0,bytesReceived:0,roundTripTime:a||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i},K1=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Ln.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Ln.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Ln.FAILURE,xhr:t}:t.responseType==="arraybuffer"&&t.response.byteLength===0?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Ln.FAILURE,xhr:t}:null},wA=function(e,t,a){return function(i,n){var r=n.response,o=K1(i,n);if(o)return a(o,e);if(r.byteLength!==16)return a({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Ln.FAILURE,xhr:n},e);for(var l=new DataView(r),c=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]),d=0;d<t.length;d++)t[d].bytes=c;return a(null,e)}},TA=function(e,t){var a=I2(e.map.bytes);if(a!=="mp4"){var i=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(a||"unknown")+" container for initialization segment at URL: "+i,code:Ln.FAILURE})}mf({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(n){var r=n.tracks,o=n.data;return e.map.bytes=o,r.forEach(function(l){e.map.tracks=e.map.tracks||{},!e.map.tracks[l.type]&&(e.map.tracks[l.type]=l,typeof l.id=="number"&&l.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[l.id]=l.timescale))}),t(null)}})},x1e=function(e){var t=e.segment,a=e.finishProcessingFn;return function(i,n){var r=K1(i,n);if(r)return a(r,t);var o=new Uint8Array(n.response);if(t.map.key)return t.map.encryptedBytes=o,a(null,t);t.map.bytes=o,TA(t,function(l){if(l)return l.xhr=n,l.status=n.status,a(l,t);a(null,t)})}},N1e=function(e){var t=e.segment,a=e.finishProcessingFn,i=e.responseType;return function(n,r){var o=K1(n,r);if(o)return a(o,t);var l=i==="arraybuffer"||!r.responseText?r.response:g1e(r.responseText.substring(t.lastReachedChar||0));return t.stats=E1e(r),t.key?t.encryptedBytes=new Uint8Array(l):t.bytes=new Uint8Array(l),a(null,t)}},A1e=function(e){var t=e.segment,a=e.bytes,i=e.trackInfoFn,n=e.timingInfoFn,r=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,c=e.captionsFn,d=e.isEndOfTimeline,u=e.endedTimelineFn,h=e.dataFn,m=e.doneFn,p=e.onTransmuxerLog,f=t.map&&t.map.tracks||{},y=!!(f.audio&&f.video),b=n.bind(null,t,"audio","start"),E=n.bind(null,t,"audio","end"),D=n.bind(null,t,"video","start"),M=n.bind(null,t,"video","end"),N=function(){return SA({bytes:a,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:y,onData:function(P){P.type=P.type==="combined"?"video":P.type,h(t,P)},onTrackInfo:function(P){i&&(y&&(P.isMuxed=!0),i(t,P))},onAudioTimingInfo:function(P){b&&typeof P.start<"u"&&(b(P.start),b=null),E&&typeof P.end<"u"&&E(P.end)},onVideoTimingInfo:function(P){D&&typeof P.start<"u"&&(D(P.start),D=null),M&&typeof P.end<"u"&&M(P.end)},onVideoSegmentTimingInfo:function(P){r(P)},onAudioSegmentTimingInfo:function(P){o(P)},onId3:function(P,L){l(t,P,L)},onCaptions:function(P){c(t,[P])},isEndOfTimeline:d,onEndedTimeline:function(){u()},onTransmuxerLog:p,onDone:function(P){m&&(P.type=P.type==="combined"?"video":P.type,m(null,t,P))}})};mf({action:"probeTs",transmuxer:t.transmuxer,data:a,baseStartTime:t.baseStartTime,callback:function(P){t.bytes=a=P.data;var L=P.result;L&&(i(t,{hasAudio:L.hasAudio,hasVideo:L.hasVideo,isMuxed:y}),i=null,L.hasAudio&&!y&&b(L.audioStart),L.hasVideo&&D(L.videoStart),b=null,D=null),N()}})},CA=function(e){var t=e.segment,a=e.bytes,i=e.trackInfoFn,n=e.timingInfoFn,r=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,c=e.captionsFn,d=e.isEndOfTimeline,u=e.endedTimelineFn,h=e.dataFn,m=e.doneFn,p=e.onTransmuxerLog,f=new Uint8Array(a);if(J_e(f)){t.isFmp4=!0;var y=t.map.tracks,b={isFmp4:!0,hasVideo:!!y.video,hasAudio:!!y.audio};y.audio&&y.audio.codec&&y.audio.codec!=="enca"&&(b.audioCodec=y.audio.codec),y.video&&y.video.codec&&y.video.codec!=="encv"&&(b.videoCodec=y.video.codec),y.video&&y.audio&&(b.isMuxed=!0),i(t,b);var E=function(D){h(t,{data:f,type:b.hasAudio&&!b.isMuxed?"audio":"video"}),D&&D.length&&c(t,D),m(null,t,{})};mf({action:"probeMp4StartTime",timescales:t.map.timescales,data:f,transmuxer:t.transmuxer,callback:function(D){var M=D.data,N=D.startTime;if(a=M.buffer,t.bytes=f=M,b.hasAudio&&!b.isMuxed&&n(t,"audio","start",N),b.hasVideo&&n(t,"video","start",N),!y.video||!M.byteLength||!t.transmuxer){E();return}mf({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:f,timescales:t.map.timescales,trackIds:[y.video.id],callback:function(P){a=P.data.buffer,t.bytes=f=P.data,P.logs.forEach(function(L){p(te.mergeOptions(L,{stream:"mp4CaptionParser"}))}),E(P.captions)}})}});return}if(!t.transmuxer){m(null,t,{});return}if(typeof t.container>"u"&&(t.container=I2(f)),t.container!=="ts"&&t.container!=="aac"){i(t,{hasAudio:!1,hasVideo:!1}),m(null,t,{});return}A1e({segment:t,bytes:a,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:c,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h,doneFn:m,onTransmuxerLog:p})},kA=function(e,t){var a=e.id,i=e.key,n=e.encryptedBytes,r=e.decryptionWorker,o=function c(d){if(d.data.source===a){r.removeEventListener("message",c);var u=d.data.decrypted;t(new Uint8Array(u.bytes,u.byteOffset,u.byteLength))}};r.addEventListener("message",o);var l;i.bytes.slice?l=i.bytes.slice():l=new Uint32Array(Array.prototype.slice.call(i.bytes)),r.postMessage(sA({source:a,encrypted:n,key:l,iv:i.iv}),[n.buffer,l.buffer])},P1e=function(e){var t=e.decryptionWorker,a=e.segment,i=e.trackInfoFn,n=e.timingInfoFn,r=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,c=e.captionsFn,d=e.isEndOfTimeline,u=e.endedTimelineFn,h=e.dataFn,m=e.doneFn,p=e.onTransmuxerLog;kA({id:a.requestId,key:a.key,encryptedBytes:a.encryptedBytes,decryptionWorker:t},function(f){a.bytes=f,CA({segment:a,bytes:a.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:c,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h,doneFn:m,onTransmuxerLog:p})})},O1e=function(e){var t=e.activeXhrs,a=e.decryptionWorker,i=e.trackInfoFn,n=e.timingInfoFn,r=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,c=e.captionsFn,d=e.isEndOfTimeline,u=e.endedTimelineFn,h=e.dataFn,m=e.doneFn,p=e.onTransmuxerLog,f=0,y=!1;return function(b,E){if(!y){if(b)return y=!0,G1(t),m(b,E);if(f+=1,f===t.length){var D=function(){if(E.encryptedBytes)return P1e({decryptionWorker:a,segment:E,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:c,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h,doneFn:m,onTransmuxerLog:p});CA({segment:E,bytes:E.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:c,isEndOfTimeline:d,endedTimelineFn:u,dataFn:h,doneFn:m,onTransmuxerLog:p})};if(E.endOfAllRequests=Date.now(),E.map&&E.map.encryptedBytes&&!E.map.bytes)return kA({decryptionWorker:a,id:E.requestId+"-init",encryptedBytes:E.map.encryptedBytes,key:E.map.key},function(M){E.map.bytes=M,TA(E,function(N){if(N)return G1(t),m(N,E);D()})});D()}}}},B1e=function(e){var t=e.loadendState,a=e.abortFn;return function(i){var n=i.target;n.aborted&&a&&!t.calledAbortFn&&(a(),t.calledAbortFn=!0)}},D1e=function(e){var t=e.segment,a=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(i){var n=i.target;if(!n.aborted)return t.stats=te.mergeOptions(t.stats,I1e(i)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),a(i,t)}},M1e=function(e){var t=e.xhr,a=e.xhrOptions,i=e.decryptionWorker,n=e.segment,r=e.abortFn,o=e.progressFn,l=e.trackInfoFn,c=e.timingInfoFn,d=e.videoSegmentTimingInfoFn,u=e.audioSegmentTimingInfoFn,h=e.id3Fn,m=e.captionsFn,p=e.isEndOfTimeline,f=e.endedTimelineFn,y=e.dataFn,b=e.doneFn,E=e.onTransmuxerLog,D=[],M=O1e({activeXhrs:D,decryptionWorker:i,trackInfoFn:l,timingInfoFn:c,videoSegmentTimingInfoFn:d,audioSegmentTimingInfoFn:u,id3Fn:h,captionsFn:m,isEndOfTimeline:p,endedTimelineFn:f,dataFn:y,doneFn:b,onTransmuxerLog:E});if(n.key&&!n.key.bytes){var N=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&N.push(n.map.key);var P=te.mergeOptions(a,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),L=wA(n,N,M),V=t(P,L);D.push(V)}if(n.map&&!n.map.bytes){var $=n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri);if($){var U=te.mergeOptions(a,{uri:n.map.key.resolvedUri,responseType:"arraybuffer"}),ae=wA(n,[n.map.key],M),oe=t(U,ae);D.push(oe)}var Y=te.mergeOptions(a,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:z1(n.map)}),de=x1e({segment:n,finishProcessingFn:M}),we=t(Y,de);D.push(we)}var Se=te.mergeOptions(a,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:z1(n)}),pe=N1e({segment:n,finishProcessingFn:M,responseType:Se.responseType}),z=t(Se,pe);z.addEventListener("progress",D1e({segment:n,progressFn:o,trackInfoFn:l,timingInfoFn:c,videoSegmentTimingInfoFn:d,audioSegmentTimingInfoFn:u,id3Fn:h,captionsFn:m,isEndOfTimeline:p,endedTimelineFn:f,dataFn:y})),D.push(z);var K={};return D.forEach(function(ue){ue.addEventListener("loadend",B1e({loadendState:K,abortFn:r}))}),function(){return G1(D)}},L1e=Yi("CodecUtils"),R1e=function(e){var t=e.attributes||{};if(t.CODECS)return On(t.CODECS)},EA=function(e,t){var a=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&a.AUDIO&&e.mediaGroups.AUDIO[a.AUDIO]},F1e=function(e,t){if(!EA(e,t))return!0;var a=t.attributes||{},i=e.mediaGroups.AUDIO[a.AUDIO];for(var n in i)if(!i[n].uri&&!i[n].playlists)return!0;return!1},ff=function(e){var t={};return e.forEach(function(a){var i=a.mediaType,n=a.type,r=a.details;t[i]=t[i]||[],t[i].push(N6(""+n+r))}),Object.keys(t).forEach(function(a){if(t[a].length>1){L1e("multiple "+a+" codecs found as attributes: "+t[a].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),t[a]=null;return}t[a]=t[a][0]}),t},IA=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},pu=function(e,t){var a=t.attributes||{},i=ff(R1e(t)||[]);if(EA(e,t)&&!i.audio&&!F1e(e,t)){var n=ff(I0e(e,a.AUDIO)||[]);n.audio&&(i.audio=n.audio)}return i},gf=Yi("PlaylistSelector"),xA=function(e){if(!(!e||!e.playlist)){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},yf=function(e,t){if(!e)return"";var a=O.getComputedStyle(e);return a?a[t]:""},Gl=function(e,t){var a=e.slice();e.sort(function(i,n){var r=t(i,n);return r===0?a.indexOf(i)-a.indexOf(n):r})},X1=function(e,t){var a,i;return e.attributes.BANDWIDTH&&(a=e.attributes.BANDWIDTH),a=a||O.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),i=i||O.Number.MAX_VALUE,a-i},V1e=function(e,t){var a,i;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(a=e.attributes.RESOLUTION.width),a=a||O.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),i=i||O.Number.MAX_VALUE,a===i&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:a-i},NA=function(e,t,a,i,n,r){if(e){var o={bandwidth:t,width:a,height:i,limitRenditionByPlayerDimensions:n},l=e.playlists;$a.isAudioOnly(e)&&(l=r.getAudioTrackPlaylists_(),o.audioOnly=!0);var c=l.map(function(U){var ae,oe=U.attributes&&U.attributes.RESOLUTION&&U.attributes.RESOLUTION.width,Y=U.attributes&&U.attributes.RESOLUTION&&U.attributes.RESOLUTION.height;return ae=U.attributes&&U.attributes.BANDWIDTH,ae=ae||O.Number.MAX_VALUE,{bandwidth:ae,width:oe,height:Y,playlist:U}});Gl(c,function(U,ae){return U.bandwidth-ae.bandwidth}),c=c.filter(function(U){return!$a.isIncompatible(U.playlist)});var d=c.filter(function(U){return $a.isEnabled(U.playlist)});d.length||(d=c.filter(function(U){return!$a.isDisabled(U.playlist)}));var u=d.filter(function(U){return U.bandwidth*ma.BANDWIDTH_VARIANCE<t}),h=u[u.length-1],m=u.filter(function(U){return U.bandwidth===h.bandwidth})[0];if(n===!1){var p=m||d[0]||c[0];if(p&&p.playlist){var f="sortedPlaylistReps";return m&&(f="bandwidthBestRep"),d[0]&&(f="enabledPlaylistReps"),gf("choosing "+xA(p)+" using "+f+" with options",o),p.playlist}return gf("could not choose a playlist with options",o),null}var y=u.filter(function(U){return U.width&&U.height});Gl(y,function(U,ae){return U.width-ae.width});var b=y.filter(function(U){return U.width===a&&U.height===i});h=b[b.length-1];var E=b.filter(function(U){return U.bandwidth===h.bandwidth})[0],D,M,N;E||(D=y.filter(function(U){return U.width>a||U.height>i}),M=D.filter(function(U){return U.width===D[0].width&&U.height===D[0].height}),h=M[M.length-1],N=M.filter(function(U){return U.bandwidth===h.bandwidth})[0]);var P;if(r.experimentalLeastPixelDiffSelector){var L=y.map(function(U){return U.pixelDiff=Math.abs(U.width-a)+Math.abs(U.height-i),U});Gl(L,function(U,ae){return U.pixelDiff===ae.pixelDiff?ae.bandwidth-U.bandwidth:U.pixelDiff-ae.pixelDiff}),P=L[0]}var V=P||N||E||m||d[0]||c[0];if(V&&V.playlist){var $="sortedPlaylistReps";return P?$="leastPixelDiffRep":N?$="resolutionPlusOneRep":E?$="resolutionBestRep":m?$="bandwidthBestRep":d[0]&&($="enabledPlaylistReps"),gf("choosing "+xA(V)+" using "+$+" with options",o),V.playlist}return gf("could not choose a playlist with options",o),null}},AA=function(){var e=this.useDevicePixelRatio&&O.devicePixelRatio||1;return NA(this.playlists.master,this.systemBandwidth,parseInt(yf(this.tech_.el(),"width"),10)*e,parseInt(yf(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},U1e=function(e){var t=-1,a=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var i=this.useDevicePixelRatio&&O.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,a=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==a&&(t=e*this.systemBandwidth+(1-e)*t,a=this.systemBandwidth),NA(this.playlists.master,t,parseInt(yf(this.tech_.el(),"width"),10)*i,parseInt(yf(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},j1e=function(e){var t=e.master,a=e.currentTime,i=e.bandwidth,n=e.duration,r=e.segmentDuration,o=e.timeUntilRebuffer,l=e.currentTimeline,c=e.syncController,d=t.playlists.filter(function(f){return!$a.isIncompatible(f)}),u=d.filter($a.isEnabled);u.length||(u=d.filter(function(f){return!$a.isDisabled(f)}));var h=u.filter($a.hasAttribute.bind(null,"BANDWIDTH")),m=h.map(function(f){var y=c.getSyncPoint(f,n,l,a),b=y?1:2,E=$a.estimateSegmentRequestTime(r,i,f),D=E*b-o;return{playlist:f,rebufferingImpact:D}}),p=m.filter(function(f){return f.rebufferingImpact<=0});return Gl(p,function(f,y){return X1(y.playlist,f.playlist)}),p.length?p[0]:(Gl(m,function(f,y){return f.rebufferingImpact-y.rebufferingImpact}),m[0]||null)},z1e=function(){var e=this,t=this.playlists.master.playlists.filter($a.isEnabled);Gl(t,function(i,n){return X1(i,n)});var a=t.filter(function(i){return!!pu(e.playlists.master,i).video});return a[0]||null},H1e=function(e){var t=0,a;return e.bytes&&(a=new Uint8Array(e.bytes),e.segments.forEach(function(i){a.set(i,t),t+=i.byteLength})),a},q1e=function(e,t,a){if(!e[a]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var i=a;/^cc708_/.test(a)&&(i="SERVICE"+a.split("_")[1]);var n=t.textTracks().getTrackById(i);if(n)e[a]=n;else{var r=t.options_.vhs&&t.options_.vhs.captionServices||{},o=a,l=a,c=!1,d=r[i];d&&(o=d.label,l=d.language,c=d.default),e[a]=t.addRemoteTextTrack({kind:"captions",id:i,default:c,label:o,language:l},!1).track}}},W1e=function(e){var t=e.inbandTextTracks,a=e.captionArray,i=e.timestampOffset;if(a){var n=O.WebKitDataCue||O.VTTCue;a.forEach(function(r){var o=r.stream;t[o].addCue(new n(r.startTime+i,r.endTime+i,r.text))})}},G1e=function(e){Object.defineProperties(e.frame,{id:{get:function(){return te.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return te.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return te.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},K1e=function(e){var t=e.inbandTextTracks,a=e.metadataArray,i=e.timestampOffset,n=e.videoDuration;if(a){var r=O.WebKitDataCue||O.VTTCue,o=t.metadataTrack_;if(o&&(a.forEach(function(m){var p=m.cueTime+i;typeof p!="number"||O.isNaN(p)||p<0||!(p<1/0)||m.frames.forEach(function(f){var y=new r(p,p,f.value||f.url||f.data||"");y.frame=f,y.value=f,G1e(y),o.addCue(y)})}),!(!o.cues||!o.cues.length))){for(var l=o.cues,c=[],d=0;d<l.length;d++)l[d]&&c.push(l[d]);var u=c.reduce(function(m,p){var f=m[p.startTime]||[];return f.push(p),m[p.startTime]=f,m},{}),h=Object.keys(u).sort(function(m,p){return Number(m)-Number(p)});h.forEach(function(m,p){var f=u[m],y=Number(h[p+1])||n;f.forEach(function(b){b.endTime=y})})}}},X1e=function(e,t,a){e.metadataTrack_||(e.metadataTrack_=a.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)},mu=function(e,t,a){var i,n;if(a&&a.cues)for(i=a.cues.length;i--;)n=a.cues[i],n.startTime>=e&&n.endTime<=t&&a.removeCue(n)},J1e=function(e){var t=e.cues;if(t)for(var a=0;a<t.length;a++){for(var i=[],n=0,r=0;r<t.length;r++)t[a].startTime===t[r].startTime&&t[a].endTime===t[r].endTime&&t[a].text===t[r].text&&(n++,n>1&&i.push(t[r]));i.length&&i.forEach(function(o){return e.removeCue(o)})}},Y1e=function(e,t,a){if(typeof t>"u"||t===null||!e.length)return[];var i=Math.ceil((t-a+3)*Bm.ONE_SECOND_IN_TS),n;for(n=0;n<e.length&&!(e[n].pts>i);n++);return e.slice(n)},Q1e=function(e,t,a){if(!t.length)return e;if(a)return t.slice();var i=t[0].pts,n=0;for(n;n<e.length&&!(e[n].pts>=i);n++);return e.slice(0,n).concat(t)},Z1e=function(e,t,a,i){for(var n=Math.ceil((t-i)*Bm.ONE_SECOND_IN_TS),r=Math.ceil((a-i)*Bm.ONE_SECOND_IN_TS),o=e.slice(),l=e.length;l--&&!(e[l].pts<=r););if(l===-1)return o;for(var c=l+1;c--&&!(e[c].pts<=n););return c=Math.max(c,0),o.splice(c,l-c+1),o},$1e=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var a=Object.keys(e).sort(),i=Object.keys(t).sort();if(a.length!==i.length)return!1;for(var n=0;n<a.length;n++){var r=a[n];if(r!==i[n]||e[r]!==t[r])return!1}return!0},PA=22,eve=function(e,t,a){t=t||[];for(var i=[],n=0,r=0;r<t.length;r++){var o=t[r];if(e===o.timeline&&(i.push(r),n+=o.duration,n>a))return r}return i.length===0?0:i[i.length-1]},fu=1,tve=500,OA=function(e){return typeof e=="number"&&isFinite(e)},_f=1/60,ave=function(e,t,a){return e!=="main"||!t||!a?null:!a.hasAudio&&!a.hasVideo?"Neither audio nor video found in segment.":t.hasVideo&&!a.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&a.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null},ive=function(e,t,a){var i=t-ma.BACK_BUFFER_LENGTH;e.length&&(i=Math.max(i,e.start(0)));var n=t-a;return Math.min(n,i)},Kl=function(e){var t=e.startOfSegment,a=e.duration,i=e.segment,n=e.part,r=e.playlist,o=r.mediaSequence,l=r.id,c=r.segments,d=c===void 0?[]:c,u=e.mediaIndex,h=e.partIndex,m=e.timeline,p=d.length-1,f="mediaIndex/partIndex increment";e.getMediaInfoForTime?f="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(f+=" with independent "+e.independent);var y=typeof h=="number",b=e.segment.uri?"segment":"pre-segment",E=y?WN({preloadSegment:i})-1:0;return b+" ["+(o+u)+"/"+(o+p)+"]"+(y?" part ["+h+"/"+E+"]":"")+(" segment start/end ["+i.start+" => "+i.end+"]")+(y?" part start/end ["+n.start+" => "+n.end+"]":"")+(" startOfSegment ["+t+"]")+(" duration ["+a+"]")+(" timeline ["+m+"]")+(" selected by ["+f+"]")+(" playlist ["+l+"]")},BA=function(e){return e+"TimingInfo"},nve=function(e){var t=e.segmentTimeline,a=e.currentTimeline,i=e.startOfSegment,n=e.buffered,r=e.overrideCheck;return!r&&t===a?null:t<a?i:n.length?n.end(n.length-1):i},DA=function(e){var t=e.timelineChangeController,a=e.currentTimeline,i=e.segmentTimeline,n=e.loaderType,r=e.audioDisabled;if(a===i)return!1;if(n==="audio"){var o=t.lastTimelineChange({type:"main"});return!o||o.to!==i}if(n==="main"&&r){var l=t.pendingTimelineChange({type:"audio"});return!(l&&l.to===i)}return!1},rve=function(e){var t=0;return["video","audio"].forEach(function(a){var i=e[a+"TimingInfo"];if(i){var n=i.start,r=i.end,o;typeof n=="bigint"||typeof r=="bigint"?o=O.BigInt(r)-O.BigInt(n):typeof n=="number"&&typeof r=="number"&&(o=r-n),typeof o<"u"&&o>t&&(t=o)}}),typeof t=="bigint"&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t},MA=function(e){var t=e.segmentDuration,a=e.maxDuration;return t?Math.round(t)>a+ts:!1},sve=function(e,t){if(t!=="hls")return null;var a=rve({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!a)return null;var i=e.playlist.targetDuration,n=MA({segmentDuration:a,maxDuration:i*2}),r=MA({segmentDuration:a,maxDuration:i}),o="Segment with index "+e.mediaIndex+" "+("from playlist "+e.playlist.id+" ")+("has a duration of "+a+" ")+("when the reported duration is "+e.duration+" ")+("and the target duration is "+i+". ")+"For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return n||r?{severity:n?"warn":"info",message:o}:null},J1=function(e){Re(t,e);function t(i,n){var r;if(r=e.call(this)||this,!i)throw new TypeError("Initialization settings are required");if(typeof i.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!i.mediaSource)throw new TypeError("No MediaSource specified");return r.bandwidth=i.bandwidth,r.throughput={rate:0,count:0},r.roundTrip=NaN,r.resetStats_(),r.mediaIndex=null,r.partIndex=null,r.hasPlayed_=i.hasPlayed,r.currentTime_=i.currentTime,r.seekable_=i.seekable,r.seeking_=i.seeking,r.duration_=i.duration,r.mediaSource_=i.mediaSource,r.vhs_=i.vhs,r.loaderType_=i.loaderType,r.currentMediaInfo_=void 0,r.startingMediaInfo_=void 0,r.segmentMetadataTrack_=i.segmentMetadataTrack,r.goalBufferLength_=i.goalBufferLength,r.sourceType_=i.sourceType,r.sourceUpdater_=i.sourceUpdater,r.inbandTextTracks_=i.inbandTextTracks,r.state_="INIT",r.timelineChangeController_=i.timelineChangeController,r.shouldSaveSegmentTimingInfo_=!0,r.parse708captions_=i.parse708captions,r.useDtsForTimestampOffset_=i.useDtsForTimestampOffset,r.captionServices_=i.captionServices,r.experimentalExactManifestTimings=i.experimentalExactManifestTimings,r.checkBufferTimeout_=null,r.error_=void 0,r.currentTimeline_=-1,r.pendingSegment_=null,r.xhrOptions_=null,r.pendingSegments_=[],r.audioDisabled_=!1,r.isPendingTimestampOffset_=!1,r.gopBuffer_=[],r.timeMapping_=0,r.safeAppend_=te.browser.IE_VERSION>=11,r.appendInitSegment_={audio:!0,video:!0},r.playlistOfLastInitSegment_={audio:null,video:null},r.callQueue_=[],r.loadQueue_=[],r.metadataQueue_={id3:[],caption:[]},r.waitingOnRemove_=!1,r.quotaExceededErrorRetryTimeout_=null,r.activeInitSegmentId_=null,r.initSegments_={},r.cacheEncryptionKeys_=i.cacheEncryptionKeys,r.keyCache_={},r.decrypter_=i.decrypter,r.syncController_=i.syncController,r.syncPoint_={segmentIndex:0,time:0},r.transmuxer_=r.createTransmuxer_(),r.triggerSyncInfoUpdate_=function(){return r.trigger("syncinfoupdate")},r.syncController_.on("syncinfoupdate",r.triggerSyncInfoUpdate_),r.mediaSource_.addEventListener("sourceopen",function(){r.isEndOfStream_()||(r.ended_=!1)}),r.fetchAtBuffer_=!1,r.logger_=Yi("SegmentLoader["+r.loaderType_+"]"),Object.defineProperty($e(r),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),r.sourceUpdater_.on("ready",function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()}),r.loaderType_==="main"&&r.timelineChangeController_.on("pendingtimelinechange",function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()}),r.loaderType_==="audio"&&r.timelineChangeController_.on("timelinechange",function(){r.hasEnoughInfoToLoad_()&&r.processLoadQueue_(),r.hasEnoughInfoToAppend_()&&r.processCallQueue_()}),r}var a=t.prototype;return a.createTransmuxer_=function(){return W1.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},a.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},a.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},a.setAudio=function(i){this.audioDisabled_=!i,i?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},a.abort=function(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},a.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,O.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},a.checkForAbort_=function(i){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==i},a.error=function(i){return typeof i<"u"&&(this.logger_("error occurred:",i),this.error_=i),this.pendingSegment_=null,this.error_},a.endOfStream=function(){this.ended_=!0,this.transmuxer_&&W1.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},a.buffered_=function(){var i=this.getMediaInfo_();if(!this.sourceUpdater_||!i)return te.createTimeRanges();if(this.loaderType_==="main"){var n=i.hasAudio,r=i.hasVideo,o=i.isMuxed;if(r&&n&&!this.audioDisabled_&&!o)return this.sourceUpdater_.buffered();if(r)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},a.initSegmentForMap=function(i,n){if(n===void 0&&(n=!1),!i)return null;var r=pf(i),o=this.initSegments_[r];return n&&!o&&i.bytes&&(this.initSegments_[r]=o={resolvedUri:i.resolvedUri,byterange:i.byterange,bytes:i.bytes,tracks:i.tracks,timescales:i.timescales}),o||i},a.segmentKey=function(i,n){if(n===void 0&&(n=!1),!i)return null;var r=oA(i),o=this.keyCache_[r];this.cacheEncryptionKeys_&&n&&!o&&i.bytes&&(this.keyCache_[r]=o={resolvedUri:i.resolvedUri,bytes:i.bytes});var l={resolvedUri:(o||i).resolvedUri};return o&&(l.bytes=o.bytes),l},a.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},a.load=function(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}},a.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},a.playlist=function(i,n){if(n===void 0&&(n={}),!!i){var r=this.playlist_,o=this.pendingSegment_;this.playlist_=i,this.xhrOptions_=n,this.state==="INIT"&&(i.syncInfo={mediaSequence:i.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(i));var l=null;if(r&&(r.id?l=r.id:r.uri&&(l=r.uri)),this.logger_("playlist update ["+l+" => "+(i.id||i.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!r||r.uri!==i.uri){this.mediaIndex!==null&&(i.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}var c=i.mediaSequence-r.mediaSequence;if(this.logger_("live window shift ["+c+"]"),this.mediaIndex!==null)if(this.mediaIndex-=c,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var d=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!d.parts||!d.parts.length||!d.parts[this.partIndex])){var u=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=u}}o&&(o.mediaIndex-=c,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=i.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(r,i)}},a.pause=function(){this.checkBufferTimeout_&&(O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},a.paused=function(){return this.checkBufferTimeout_===null},a.resetEverything=function(i){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,i),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},a.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},a.resyncLoader=function(){this.transmuxer_&&W1.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},a.remove=function(i,n,r,o){if(r===void 0&&(r=function(){}),o===void 0&&(o=!1),n===1/0&&(n=this.duration_()),n<=i){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}var l=1,c=function(){l--,l===0&&r()};(o||!this.audioDisabled_)&&(l++,this.sourceUpdater_.removeAudio(i,n,c)),(o||this.loaderType_==="main")&&(this.gopBuffer_=Z1e(this.gopBuffer_,i,n,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(i,n,c));for(var d in this.inbandTextTracks_)mu(i,n,this.inbandTextTracks_[d]);mu(i,n,this.segmentMetadataTrack_),c()},a.monitorBuffer_=function(){this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O.setTimeout(this.monitorBufferTick_.bind(this),1)},a.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O.setTimeout(this.monitorBufferTick_.bind(this),tve)},a.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var i=this.chooseNextRequest_();i&&(typeof i.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:i.timeline})),this.loadSegment_(i))}},a.isEndOfStream_=function(i,n,r){if(i===void 0&&(i=this.mediaIndex),n===void 0&&(n=this.playlist_),r===void 0&&(r=this.partIndex),!n||!this.mediaSource_)return!1;var o=typeof i=="number"&&n.segments[i],l=i+1===n.segments.length,c=!o||!o.parts||r+1===o.parts.length;return n.endList&&this.mediaSource_.readyState==="open"&&l&&c},a.chooseNextRequest_=function(){var i=this.buffered_(),n=zN(i)||0,r=O1(i,this.currentTime_()),o=!this.hasPlayed_()&&r>=1,l=r>=this.goalBufferLength_(),c=this.playlist_.segments;if(!c.length||o||l)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var d={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(d.isSyncRequest)d.mediaIndex=eve(this.currentTimeline_,c,n);else if(this.mediaIndex!==null){var u=c[this.mediaIndex],h=typeof this.partIndex=="number"?this.partIndex:-1;d.startOfSegment=u.end?u.end:n,u.parts&&u.parts[h+1]?(d.mediaIndex=this.mediaIndex,d.partIndex=h+1):d.mediaIndex=this.mediaIndex+1}else{var m=$a.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?n:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),p=m.segmentIndex,f=m.startTime,y=m.partIndex;d.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+n:"currentTime "+this.currentTime_(),d.mediaIndex=p,d.startOfSegment=f,d.partIndex=y}var b=c[d.mediaIndex],E=b&&typeof d.partIndex=="number"&&b.parts&&b.parts[d.partIndex];if(!b||typeof d.partIndex=="number"&&!E)return null;if(typeof d.partIndex!="number"&&b.parts&&(d.partIndex=0,E=b.parts[0]),!r&&E&&!E.independent)if(d.partIndex===0){var D=c[d.mediaIndex-1],M=D.parts&&D.parts.length&&D.parts[D.parts.length-1];M&&M.independent&&(d.mediaIndex-=1,d.partIndex=D.parts.length-1,d.independent="previous segment")}else b.parts[d.partIndex-1].independent&&(d.partIndex-=1,d.independent="previous part");var N=this.mediaSource_&&this.mediaSource_.readyState==="ended";return d.mediaIndex>=c.length-1&&N&&!this.seeking_()?null:this.generateSegmentInfo_(d)},a.generateSegmentInfo_=function(i){var n=i.independent,r=i.playlist,o=i.mediaIndex,l=i.startOfSegment,c=i.isSyncRequest,d=i.partIndex,u=i.forceTimestampOffset,h=i.getMediaInfoForTime,m=r.segments[o],p=typeof d=="number"&&m.parts[d],f={requestId:"segment-loader-"+Math.random(),uri:p&&p.resolvedUri||m.resolvedUri,mediaIndex:o,partIndex:p?d:null,isSyncRequest:c,startOfSegment:l,playlist:r,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:m.timeline,duration:p&&p.duration||m.duration,segment:m,part:p,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:h,independent:n},y=typeof u<"u"?u:this.isPendingTimestampOffset_;f.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:m.timeline,currentTimeline:this.currentTimeline_,startOfSegment:l,buffered:this.buffered_(),overrideCheck:y});var b=zN(this.sourceUpdater_.audioBuffered());return typeof b=="number"&&(f.audioAppendStart=b-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(f.gopsToAlignWith=Y1e(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),f},a.timestampOffsetForSegment_=function(i){return nve(i)},a.earlyAbortWhenNeeded_=function(i){if(!(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)&&!(Date.now()-(i.firstBytesReceivedAt||Date.now())<1e3)){var n=this.currentTime_(),r=i.bandwidth,o=this.pendingSegment_.duration,l=$a.estimateSegmentRequestTime(o,r,this.playlist_,i.bytesReceived),c=I2e(this.buffered_(),n,this.vhs_.tech_.playbackRate())-1;if(!(l<=c)){var d=j1e({master:this.vhs_.playlists.master,currentTime:n,bandwidth:r,duration:this.duration_(),segmentDuration:o,timeUntilRebuffer:c,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(d){var u=l-c,h=u-d.rebufferingImpact,m=.5;c<=ts&&(m=1),!(!d.playlist||d.playlist.uri===this.playlist_.uri||h<m)&&(this.bandwidth=d.playlist.attributes.BANDWIDTH*ma.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},a.handleAbort_=function(i){this.logger_("Aborting "+Kl(i)),this.mediaRequestsAborted+=1},a.handleProgress_=function(i,n){this.earlyAbortWhenNeeded_(n.stats),!this.checkForAbort_(n.requestId)&&this.trigger("progress")},a.handleTrackInfo_=function(i,n){this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)&&(this.checkForIllegalMediaSwitch(n)||(n=n||{},$1e(this.currentMediaInfo_,n)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=n,this.currentMediaInfo_=n,this.logger_("trackinfo update",n),this.trigger("trackinfo")),!this.checkForAbort_(i.requestId)&&(this.pendingSegment_.trackInfo=n,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))},a.handleTimingInfo_=function(i,n,r,o){if(this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)){var l=this.pendingSegment_,c=BA(n);l[c]=l[c]||{},l[c][r]=o,this.logger_("timinginfo: "+n+" - "+r+" - "+o),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},a.handleCaptions_=function(i,n){var r=this;if(this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)){if(n.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,i,n));return}var l=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),c={};n.forEach(function(d){c[d.stream]=c[d.stream]||{startTime:1/0,captions:[],endTime:0};var u=c[d.stream];u.startTime=Math.min(u.startTime,d.startTime+l),u.endTime=Math.max(u.endTime,d.endTime+l),u.captions.push(d)}),Object.keys(c).forEach(function(d){var u=c[d],h=u.startTime,m=u.endTime,p=u.captions,f=r.inbandTextTracks_;r.logger_("adding cues from "+h+" -> "+m+" for "+d),q1e(f,r.vhs_.tech_,d),mu(h,m,f[d]),W1e({captionArray:p,inbandTextTracks:f,timestampOffset:l})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},a.handleId3_=function(i,n,r){if(this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)){var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,i,n,r));return}var l=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();X1e(this.inbandTextTracks_,r,this.vhs_.tech_),K1e({inbandTextTracks:this.inbandTextTracks_,metadataArray:n,timestampOffset:l,videoDuration:this.duration_()})}},a.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(i){return i()}),this.metadataQueue_.caption.forEach(function(i){return i()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},a.processCallQueue_=function(){var i=this.callQueue_;this.callQueue_=[],i.forEach(function(n){return n()})},a.processLoadQueue_=function(){var i=this.loadQueue_;this.loadQueue_=[],i.forEach(function(n){return n()})},a.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var i=this.pendingSegment_;return i?this.getCurrentMediaInfo_()?!DA({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:i.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1},a.getCurrentMediaInfo_=function(i){return i===void 0&&(i=this.pendingSegment_),i&&i.trackInfo||this.currentMediaInfo_},a.getMediaInfo_=function(i){return i===void 0&&(i=this.pendingSegment_),this.getCurrentMediaInfo_(i)||this.startingMediaInfo_},a.getPendingSegmentPlaylist=function(){return this.pendingSegment_?this.pendingSegment_.playlist:null},a.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var i=this.pendingSegment_,n=this.getCurrentMediaInfo_();if(!i||!n)return!1;var r=n.hasAudio,o=n.hasVideo,l=n.isMuxed;return!(o&&!i.videoTimingInfo||r&&!this.audioDisabled_&&!l&&!i.audioTimingInfo||DA({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:i.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},a.handleData_=function(i,n){if(this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,i,n));return}var r=this.pendingSegment_;if(this.setTimeMapping_(r.timeline),this.updateMediaSecondsLoaded_(r.part||r.segment),this.mediaSource_.readyState!=="closed"){if(i.map&&(i.map=this.initSegmentForMap(i.map,!0),r.segment.map=i.map),i.key&&this.segmentKey(i.key,!0),r.isFmp4=i.isFmp4,r.timingInfo=r.timingInfo||{},r.isFmp4)this.trigger("fmp4"),r.timingInfo.start=r[BA(n.type)].start;else{var o=this.getCurrentMediaInfo_(),l=this.loaderType_==="main"&&o&&o.hasVideo,c;l&&(c=r.videoTimingInfo.start),r.timingInfo.start=this.trueSegmentStart_({currentStart:r.timingInfo.start,playlist:r.playlist,mediaIndex:r.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:l,firstVideoFrameTimeForData:c,videoTimingInfo:r.videoTimingInfo,audioTimingInfo:r.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(r,n.type),this.updateSourceBufferTimestampOffset_(r),r.isSyncRequest){this.updateTimingInfoEnd_(r),this.syncController_.saveSegmentTimingInfo({segmentInfo:r,shouldSaveTimelineMapping:this.loaderType_==="main"});var d=this.chooseNextRequest_();if(d.mediaIndex!==r.mediaIndex||d.partIndex!==r.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}r.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(r,n)}}},a.updateAppendInitSegmentStatus=function(i,n){this.loaderType_==="main"&&typeof i.timestampOffset=="number"&&!i.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[n]!==i.playlist&&(this.appendInitSegment_[n]=!0)},a.getInitSegmentAndUpdateState_=function(i){var n=i.type,r=i.initSegment,o=i.map,l=i.playlist;if(o){var c=pf(o);if(this.activeInitSegmentId_===c)return null;r=this.initSegmentForMap(o,!0).bytes,this.activeInitSegmentId_=c}return r&&this.appendInitSegment_[n]?(this.playlistOfLastInitSegment_[n]=l,this.appendInitSegment_[n]=!1,this.activeInitSegmentId_=null,r):null},a.handleQuotaExceededError_=function(i,n){var r=this,o=i.segmentInfo,l=i.type,c=i.bytes,d=this.sourceUpdater_.audioBuffered(),u=this.sourceUpdater_.videoBuffered();d.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Fs(d).join(", ")),u.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Fs(u).join(", "));var h=d.length?d.start(0):0,m=d.length?d.end(d.length-1):0,p=u.length?u.start(0):0,f=u.length?u.end(u.length-1):0;if(m-h<=fu&&f-p<=fu){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+("Appended byte length: "+c.byteLength+", ")+("audio buffer: "+Fs(d).join(", ")+", ")+("video buffer: "+Fs(u).join(", ")+", ")),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:o,type:l,bytes:c}));var y=this.currentTime_(),b=y-fu;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+b),this.remove(0,b,function(){r.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+fu+"s"),r.waitingOnRemove_=!1,r.quotaExceededErrorRetryTimeout_=O.setTimeout(function(){r.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),r.quotaExceededErrorRetryTimeout_=null,r.processCallQueue_()},fu*1e3)},!0)},a.handleAppendError_=function(i,n){var r=i.segmentInfo,o=i.type,l=i.bytes;if(n){if(n.code===PA){this.handleQuotaExceededError_({segmentInfo:r,type:o,bytes:l});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error(o+" append of "+l.length+"b failed for segment "+("#"+r.mediaIndex+" in playlist "+r.playlist.id)),this.trigger("appenderror")}},a.appendToSourceBuffer_=function(i){var n=i.segmentInfo,r=i.type,o=i.initSegment,l=i.data,c=i.bytes;if(!c){var d=[l],u=l.byteLength;o&&(d.unshift(o),u+=o.byteLength),c=H1e({bytes:u,segments:d})}this.sourceUpdater_.appendBuffer({segmentInfo:n,type:r,bytes:c},this.handleAppendError_.bind(this,{segmentInfo:n,type:r,bytes:c}))},a.handleSegmentTimingInfo_=function(i,n,r){if(!(!this.pendingSegment_||n!==this.pendingSegment_.requestId)){var o=this.pendingSegment_.segment,l=i+"TimingInfo";o[l]||(o[l]={}),o[l].transmuxerPrependedSeconds=r.prependedContentDuration||0,o[l].transmuxedPresentationStart=r.start.presentation,o[l].transmuxedDecodeStart=r.start.decode,o[l].transmuxedPresentationEnd=r.end.presentation,o[l].transmuxedDecodeEnd=r.end.decode,o[l].baseMediaDecodeTime=r.baseMediaDecodeTime}},a.appendData_=function(i,n){var r=n.type,o=n.data;if(!(!o||!o.byteLength)&&!(r==="audio"&&this.audioDisabled_)){var l=this.getInitSegmentAndUpdateState_({type:r,initSegment:n.initSegment,playlist:i.playlist,map:i.isFmp4?i.segment.map:null});this.appendToSourceBuffer_({segmentInfo:i,type:r,initSegment:l,data:o})}},a.loadSegment_=function(i){var n=this;if(this.state="WAITING",this.pendingSegment_=i,this.trimBackBuffer_(i),typeof i.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(function(){var r=Ht({},i,{forceTimestampOffset:!0});Ht(i,n.generateSegmentInfo_(r)),n.isPendingTimestampOffset_=!1,n.updateTransmuxerAndRequestSegment_(i)});return}this.updateTransmuxerAndRequestSegment_(i)},a.updateTransmuxerAndRequestSegment_=function(i){var n=this;this.shouldUpdateTransmuxerTimestampOffset_(i.timestampOffset)&&(this.gopBuffer_.length=0,i.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:i.timestampOffset}));var r=this.createSimplifiedSegmentObj_(i),o=this.isEndOfStream_(i.mediaIndex,i.playlist,i.partIndex),l=this.mediaIndex!==null,c=i.timeline!==this.currentTimeline_&&i.timeline>0,d=o||l&&c;this.logger_("Requesting "+Kl(i)),r.map&&!r.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),i.abortRequests=M1e({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:r,abortFn:this.handleAbort_.bind(this,i),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",i.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",i.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:d,endedTimelineFn:function(){n.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(u){var h=u.message,m=u.level,p=u.stream;n.logger_(Kl(i)+" logged from transmuxer stream "+p+" as a "+m+": "+h)}})},a.trimBackBuffer_=function(i){var n=ive(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);n>0&&this.remove(0,n)},a.createSimplifiedSegmentObj_=function(i){var n=i.segment,r=i.part,o={resolvedUri:r?r.resolvedUri:n.resolvedUri,byterange:r?r.byterange:n.byterange,requestId:i.requestId,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,part:i.part},l=i.playlist.segments[i.mediaIndex-1];if(l&&l.timeline===n.timeline&&(l.videoTimingInfo?o.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(o.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),n.key){var c=n.key.iv||new Uint32Array([0,0,0,i.mediaIndex+i.playlist.mediaSequence]);o.key=this.segmentKey(n.key),o.key.iv=c}return n.map&&(o.map=this.initSegmentForMap(n.map)),o},a.saveTransferStats_=function(i){this.mediaRequests+=1,i&&(this.mediaBytesTransferred+=i.bytesReceived,this.mediaTransferDuration+=i.roundTripTime)},a.saveBandwidthRelatedStats_=function(i,n){if(this.pendingSegment_.byteLength=n.bytesReceived,i<_f){this.logger_("Ignoring segment's bandwidth because its duration of "+i+(" is less than the min to record "+_f));return}this.bandwidth=n.bandwidth,this.roundTrip=n.roundTripTime},a.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")},a.segmentRequestFinished_=function(i,n,r){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,i,n,r));return}if(this.saveTransferStats_(n.stats),!!this.pendingSegment_&&n.requestId===this.pendingSegment_.requestId){if(i){if(this.pendingSegment_=null,this.state="READY",i.code===Ln.ABORTED)return;if(this.pause(),i.code===Ln.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(i),this.trigger("error");return}var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,n.stats),o.endOfAllRequests=n.endOfAllRequests,r.gopInfo&&(this.gopBuffer_=Q1e(this.gopBuffer_,r.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},a.setTimeMapping_=function(i){var n=this.syncController_.mappingForTimeline(i);n!==null&&(this.timeMapping_=n)},a.updateMediaSecondsLoaded_=function(i){typeof i.start=="number"&&typeof i.end=="number"?this.mediaSecondsLoaded+=i.end-i.start:this.mediaSecondsLoaded+=i.duration},a.shouldUpdateTransmuxerTimestampOffset_=function(i){return i===null?!1:this.loaderType_==="main"&&i!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&i!==this.sourceUpdater_.audioTimestampOffset()},a.trueSegmentStart_=function(i){var n=i.currentStart,r=i.playlist,o=i.mediaIndex,l=i.firstVideoFrameTimeForData,c=i.currentVideoTimestampOffset,d=i.useVideoTimingInfo,u=i.videoTimingInfo,h=i.audioTimingInfo;if(typeof n<"u")return n;if(!d)return h.start;var m=r.segments[o-1];return o===0||!m||typeof m.start>"u"||m.end!==l+c?l:u.start},a.waitForAppendsToComplete_=function(i){var n=this.getCurrentMediaInfo_(i);if(!n){this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),this.trigger("error");return}var r=n.hasAudio,o=n.hasVideo,l=n.isMuxed,c=this.loaderType_==="main"&&o,d=!this.audioDisabled_&&r&&!l;if(i.waitingOnAppends=0,!i.hasAppendedData_){!i.timingInfo&&typeof i.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),i.timingInfo={start:0},i.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(i),this.processMetadataQueue_()),this.checkAppendsDone_(i);return}c&&i.waitingOnAppends++,d&&i.waitingOnAppends++,c&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,i)),d&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,i))},a.checkAppendsDone_=function(i){this.checkForAbort_(i.requestId)||(i.waitingOnAppends--,i.waitingOnAppends===0&&this.handleAppendsDone_())},a.checkForIllegalMediaSwitch=function(i){var n=ave(this.loaderType_,this.getCurrentMediaInfo_(),i);return n?(this.error({message:n,blacklistDuration:1/0}),this.trigger("error"),!0):!1},a.updateSourceBufferTimestampOffset_=function(i){if(!(i.timestampOffset===null||typeof i.timingInfo.start!="number"||i.changedTimestampOffset||this.loaderType_!=="main")){var n=!1;i.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:i.segment.videoTimingInfo,audioTimingInfo:i.segment.audioTimingInfo,timingInfo:i.timingInfo}),i.changedTimestampOffset=!0,i.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(i.timestampOffset),n=!0),i.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(i.timestampOffset),n=!0),n&&this.trigger("timestampoffset")}},a.getSegmentStartTimeForTimestampOffsetCalculation_=function(i){var n=i.videoTimingInfo,r=i.audioTimingInfo,o=i.timingInfo;return this.useDtsForTimestampOffset_?n&&typeof n.transmuxedDecodeStart=="number"?n.transmuxedDecodeStart:r&&typeof r.transmuxedDecodeStart=="number"?r.transmuxedDecodeStart:o.start:o.start},a.updateTimingInfoEnd_=function(i){i.timingInfo=i.timingInfo||{};var n=this.getMediaInfo_(),r=this.loaderType_==="main"&&n&&n.hasVideo,o=r&&i.videoTimingInfo?i.videoTimingInfo:i.audioTimingInfo;o&&(i.timingInfo.end=typeof o.end=="number"?o.end:o.start+i.duration)},a.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}var i=this.pendingSegment_;this.updateTimingInfoEnd_(i),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});var n=sve(i,this.sourceType_);if(n&&(n.severity==="warn"?te.log.warn(n.message):this.logger_(n.message)),this.recordThroughput_(i),this.pendingSegment_=null,this.state="READY",i.isSyncRequest&&(this.trigger("syncinfoupdate"),!i.hasAppendedData_)){this.logger_("Throwing away un-appended sync request "+Kl(i));return}this.logger_("Appended "+Kl(i)),this.addSegmentMetadataCue_(i),this.fetchAtBuffer_=!0,this.currentTimeline_!==i.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:i.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:i.timeline})),this.currentTimeline_=i.timeline,this.trigger("syncinfoupdate");var r=i.segment,o=i.part,l=r.end&&this.currentTime_()-r.end>i.playlist.targetDuration*3,c=o&&o.end&&this.currentTime_()-o.end>i.playlist.partTargetDuration*3;if(l||c){this.logger_("bad "+(l?"segment":"part")+" "+Kl(i)),this.resetEverything();return}var d=this.mediaIndex!==null;d&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=i.mediaIndex,this.partIndex=i.partIndex,this.isEndOfStream_(i.mediaIndex,i.playlist,i.partIndex)&&this.endOfStream(),this.trigger("appended"),i.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()},a.recordThroughput_=function(i){if(i.duration<_f){this.logger_("Ignoring segment's throughput because its duration of "+i.duration+(" is less than the min to record "+_f));return}var n=this.throughput.rate,r=Date.now()-i.endOfAllRequests+1,o=Math.floor(i.byteLength/r*8*1e3);this.throughput.rate+=(o-n)/++this.throughput.count},a.addSegmentMetadataCue_=function(i){if(this.segmentMetadataTrack_){var n=i.segment,r=n.start,o=n.end;if(!(!OA(r)||!OA(o))){mu(r,o,this.segmentMetadataTrack_);var l=O.WebKitDataCue||O.VTTCue,c={custom:n.custom,dateTimeObject:n.dateTimeObject,dateTimeString:n.dateTimeString,bandwidth:i.playlist.attributes.BANDWIDTH,resolution:i.playlist.attributes.RESOLUTION,codecs:i.playlist.attributes.CODECS,byteLength:i.byteLength,uri:i.uri,timeline:i.timeline,playlist:i.playlist.id,start:r,end:o},d=JSON.stringify(c),u=new l(r,o,d);u.value=c,this.segmentMetadataTrack_.addCue(u)}}},t}(te.EventTarget);function gr(){}var LA=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toUpperCase()})},ove=["video","audio"],Y1=function(e,t){var a=t[e+"Buffer"];return a&&a.updating||t.queuePending[e]},lve=function(e,t){for(var a=0;a<t.length;a++){var i=t[a];if(i.type==="mediaSource")return null;if(i.type===e)return a}return null},Q1=function e(t,a){if(a.queue.length!==0){var i=0,n=a.queue[i];if(n.type==="mediaSource"){!a.updating()&&a.mediaSource.readyState!=="closed"&&(a.queue.shift(),n.action(a),n.doneFn&&n.doneFn(),e("audio",a),e("video",a));return}if(t!=="mediaSource"&&!(!a.ready()||a.mediaSource.readyState==="closed"||Y1(t,a))){if(n.type!==t){if(i=lve(t,a.queue),i===null)return;n=a.queue[i]}if(a.queue.splice(i,1),a.queuePending[t]=n,n.action(t,a),!n.doneFn){a.queuePending[t]=null,e(t,a);return}}}},RA=function(e,t){var a=t[e+"Buffer"],i=LA(e);a&&(a.removeEventListener("updateend",t["on"+i+"UpdateEnd_"]),a.removeEventListener("error",t["on"+i+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},Rn=function(e,t){return e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1},fi={appendBuffer:function(e,t,a){return function(i,n){var r=n[i+"Buffer"];if(Rn(n.mediaSource,r)){n.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+i+"Buffer");try{r.appendBuffer(e)}catch(o){n.logger_("Error with code "+o.code+" "+(o.code===PA?"(QUOTA_EXCEEDED_ERR) ":"")+("when appending segment "+t.mediaIndex+" to "+i+"Buffer")),n.queuePending[i]=null,a(o)}}}},remove:function(e,t){return function(a,i){var n=i[a+"Buffer"];if(Rn(i.mediaSource,n)){i.logger_("Removing "+e+" to "+t+" from "+a+"Buffer");try{n.remove(e,t)}catch{i.logger_("Remove "+e+" to "+t+" from "+a+"Buffer failed")}}}},timestampOffset:function(e){return function(t,a){var i=a[t+"Buffer"];Rn(a.mediaSource,i)&&(a.logger_("Setting "+t+"timestampOffset to "+e),i.timestampOffset=e)}},callback:function(e){return function(t,a){e()}},endOfStream:function(e){return function(t){if(t.mediaSource.readyState==="open"){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(a){te.log.warn("Failed to call media source endOfStream",a)}}}},duration:function(e){return function(t){t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(a){te.log.warn("Failed to set media source duration",a)}}},abort:function(){return function(e,t){if(t.mediaSource.readyState==="open"){var a=t[e+"Buffer"];if(Rn(t.mediaSource,a)){t.logger_("calling abort on "+e+"Buffer");try{a.abort()}catch(i){te.log.warn("Failed to abort on "+e+"Buffer",i)}}}}},addSourceBuffer:function(e,t){return function(a){var i=LA(e),n=Xd(t);a.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var r=a.mediaSource.addSourceBuffer(n);r.addEventListener("updateend",a["on"+i+"UpdateEnd_"]),r.addEventListener("error",a["on"+i+"Error_"]),a.codecs[e]=t,a[e+"Buffer"]=r}},removeSourceBuffer:function(e){return function(t){var a=t[e+"Buffer"];if(RA(e,t),!!Rn(t.mediaSource,a)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(a)}catch(i){te.log.warn("Failed to removeSourceBuffer "+e+"Buffer",i)}}}},changeType:function(e){return function(t,a){var i=a[t+"Buffer"],n=Xd(e);Rn(a.mediaSource,i)&&a.codecs[t]!==e&&(a.logger_("changing "+t+"Buffer codec from "+a.codecs[t]+" to "+e),i.changeType(n),a.codecs[t]=e)}}},gi=function(e){var t=e.type,a=e.sourceUpdater,i=e.action,n=e.doneFn,r=e.name;a.queue.push({type:t,action:i,doneFn:n,name:r}),Q1(t,a)},FA=function(e,t){return function(a){if(t.queuePending[e]){var i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[e+"Error_"])}Q1(e,t)}},VA=function(e){Re(t,e);function t(i){var n;return n=e.call(this)||this,n.mediaSource=i,n.sourceopenListener_=function(){return Q1("mediaSource",$e(n))},n.mediaSource.addEventListener("sourceopen",n.sourceopenListener_),n.logger_=Yi("SourceUpdater"),n.audioTimestampOffset_=0,n.videoTimestampOffset_=0,n.queue=[],n.queuePending={audio:null,video:null},n.delayedAudioAppendQueue_=[],n.videoAppendQueued_=!1,n.codecs={},n.onVideoUpdateEnd_=FA("video",$e(n)),n.onAudioUpdateEnd_=FA("audio",$e(n)),n.onVideoError_=function(r){n.videoError_=r},n.onAudioError_=function(r){n.audioError_=r},n.createdSourceBuffers_=!1,n.initializedEme_=!1,n.triggeredReady_=!1,n}var a=t.prototype;return a.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},a.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},a.hasInitializedAnyEme=function(){return this.initializedEme_},a.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},a.createSourceBuffers=function(i){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(i),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},a.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},a.addSourceBuffer=function(i,n){gi({type:"mediaSource",sourceUpdater:this,action:fi.addSourceBuffer(i,n),name:"addSourceBuffer"})},a.abort=function(i){gi({type:i,sourceUpdater:this,action:fi.abort(i),name:"abort"})},a.removeSourceBuffer=function(i){if(!this.canRemoveSourceBuffer()){te.log.error("removeSourceBuffer is not supported!");return}gi({type:"mediaSource",sourceUpdater:this,action:fi.removeSourceBuffer(i),name:"removeSourceBuffer"})},a.canRemoveSourceBuffer=function(){return!te.browser.IE_VERSION&&!te.browser.IS_FIREFOX&&O.MediaSource&&O.MediaSource.prototype&&typeof O.MediaSource.prototype.removeSourceBuffer=="function"},t.canChangeType=function(){return O.SourceBuffer&&O.SourceBuffer.prototype&&typeof O.SourceBuffer.prototype.changeType=="function"},a.canChangeType=function(){return this.constructor.canChangeType()},a.changeType=function(i,n){if(!this.canChangeType()){te.log.error("changeType is not supported!");return}gi({type:i,sourceUpdater:this,action:fi.changeType(n),name:"changeType"})},a.addOrChangeSourceBuffers=function(i){var n=this;if(!i||typeof i!="object"||Object.keys(i).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(i).forEach(function(r){var o=i[r];if(!n.hasCreatedSourceBuffers())return n.addSourceBuffer(r,o);n.canChangeType()&&n.changeType(r,o)})},a.appendBuffer=function(i,n){var r=this,o=i.segmentInfo,l=i.type,c=i.bytes;if(this.processedAppend_=!0,l==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([i,n]),this.logger_("delayed audio append of "+c.length+" until video append");return}var d=n;if(gi({type:l,sourceUpdater:this,action:fi.appendBuffer(c,o||{mediaIndex:-1},d),doneFn:n,name:"appendBuffer"}),l==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var u=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+u.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,u.forEach(function(h){r.appendBuffer.apply(r,h)})}},a.audioBuffered=function(){return Rn(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:te.createTimeRange()},a.videoBuffered=function(){return Rn(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:te.createTimeRange()},a.buffered=function(){var i=Rn(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,n=Rn(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return n&&!i?this.audioBuffered():i&&!n?this.videoBuffered():E2e(this.audioBuffered(),this.videoBuffered())},a.setDuration=function(i,n){n===void 0&&(n=gr),gi({type:"mediaSource",sourceUpdater:this,action:fi.duration(i),name:"duration",doneFn:n})},a.endOfStream=function(i,n){i===void 0&&(i=null),n===void 0&&(n=gr),typeof i!="string"&&(i=void 0),gi({type:"mediaSource",sourceUpdater:this,action:fi.endOfStream(i),name:"endOfStream",doneFn:n})},a.removeAudio=function(i,n,r){if(r===void 0&&(r=gr),!this.audioBuffered().length||this.audioBuffered().end(0)===0){r();return}gi({type:"audio",sourceUpdater:this,action:fi.remove(i,n),doneFn:r,name:"remove"})},a.removeVideo=function(i,n,r){if(r===void 0&&(r=gr),!this.videoBuffered().length||this.videoBuffered().end(0)===0){r();return}gi({type:"video",sourceUpdater:this,action:fi.remove(i,n),doneFn:r,name:"remove"})},a.updating=function(){return!!(Y1("audio",this)||Y1("video",this))},a.audioTimestampOffset=function(i){return typeof i<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==i&&(gi({type:"audio",sourceUpdater:this,action:fi.timestampOffset(i),name:"timestampOffset"}),this.audioTimestampOffset_=i),this.audioTimestampOffset_},a.videoTimestampOffset=function(i){return typeof i<"u"&&this.videoBuffer&&this.videoTimestampOffset!==i&&(gi({type:"video",sourceUpdater:this,action:fi.timestampOffset(i),name:"timestampOffset"}),this.videoTimestampOffset_=i),this.videoTimestampOffset_},a.audioQueueCallback=function(i){this.audioBuffer&&gi({type:"audio",sourceUpdater:this,action:fi.callback(i),name:"callback"})},a.videoQueueCallback=function(i){this.videoBuffer&&gi({type:"video",sourceUpdater:this,action:fi.callback(i),name:"callback"})},a.dispose=function(){var i=this;this.trigger("dispose"),ove.forEach(function(n){i.abort(n),i.canRemoveSourceBuffer()?i.removeSourceBuffer(n):i[n+"QueueCallback"](function(){return RA(n,i)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},t}(te.EventTarget),UA=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},jA=new Uint8Array(`
303
303
 
304
- `.split("").map(function(e){return e.charCodeAt(0)})),cve=function(e){Re(t,e);function t(){return e.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return t}(B2(Error)),dve=function(e){Re(t,e);function t(i,n){var r;return n===void 0&&(n={}),r=e.call(this,i,n)||this,r.mediaSource_=null,r.subtitlesTrack_=null,r.loaderType_="subtitle",r.featuresNativeTextTracks_=i.featuresNativeTextTracks,r.loadVttJs=i.loadVttJs,r.shouldSaveSegmentTimingInfo_=!1,r}var a=t.prototype;return a.createTransmuxer_=function(){return null},a.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return te.createTimeRanges();var i=this.subtitlesTrack_.cues,n=i[0].startTime,r=i[i.length-1].startTime;return te.createTimeRanges([[n,r]])},a.initSegmentForMap=function(i,n){if(n===void 0&&(n=!1),!i)return null;var r=pf(i),o=this.initSegments_[r];if(n&&!o&&i.bytes){var l=jA.byteLength+i.bytes.byteLength,c=new Uint8Array(l);c.set(i.bytes),c.set(jA,i.bytes.byteLength),this.initSegments_[r]=o={resolvedUri:i.resolvedUri,byterange:i.byterange,bytes:c}}return o||i},a.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},a.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},a.track=function(i){return typeof i>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=i,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},a.remove=function(i,n){mu(i,n,this.subtitlesTrack_)},a.fillBuffer_=function(){var i=this,n=this.chooseNextRequest_();if(n){if(this.syncController_.timestampOffsetForTimeline(n.timeline)===null){var r=function(){i.state="READY",i.paused()||i.monitorBuffer_()};this.syncController_.one("timestampoffset",r),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(n)}},a.timestampOffsetForSegment_=function(){return null},a.chooseNextRequest_=function(){return this.skipEmptySegments_(e.prototype.chooseNextRequest_.call(this))},a.skipEmptySegments_=function(i){for(;i&&i.segment.empty;){if(i.mediaIndex+1>=i.playlist.segments.length){i=null;break}i=this.generateSegmentInfo_({playlist:i.playlist,mediaIndex:i.mediaIndex+1,startOfSegment:i.startOfSegment+i.duration,isSyncRequest:i.isSyncRequest})}return i},a.stopForError=function(i){this.error(i),this.state="READY",this.pause(),this.trigger("error")},a.segmentRequestFinished_=function(i,n,r){var o=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(n.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(i){i.code===Ln.TIMEOUT&&this.handleTimeout_(),i.code===Ln.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(i);return}var l=this.pendingSegment_;this.saveBandwidthRelatedStats_(l.duration,n.stats),n.key&&this.segmentKey(n.key,!0),this.state="APPENDING",this.trigger("appending");var c=l.segment;if(c.map&&(c.map.bytes=n.map.bytes),l.bytes=n.bytes,typeof O.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(function(){return o.segmentRequestFinished_(i,n,r)},function(){return o.stopForError({message:"Error loading vtt.js"})});return}c.requested=!0;try{this.parseVTTCues_(l)}catch(d){this.stopForError({message:d.message});return}if(this.updateTimeMapping_(l,this.syncController_.timelines[l.timeline],this.playlist_),l.cues.length?l.timingInfo={start:l.cues[0].startTime,end:l.cues[l.cues.length-1].endTime}:l.timingInfo={start:l.startOfSegment,end:l.startOfSegment+l.duration},l.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}l.byteLength=l.bytes.byteLength,this.mediaSecondsLoaded+=c.duration,l.cues.forEach(function(d){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new O.VTTCue(d.startTime,d.endTime,d.text):d)}),J1e(this.subtitlesTrack_),this.handleAppendsDone_()},a.handleData_=function(){},a.updateTimingInfoEnd_=function(){},a.parseVTTCues_=function(i){var n,r=!1;if(typeof O.WebVTT!="function")throw new cve;typeof O.TextDecoder=="function"?n=new O.TextDecoder("utf8"):(n=O.WebVTT.StringDecoder(),r=!0);var o=new O.WebVTT.Parser(O,O.vttjs,n);if(i.cues=[],i.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=i.cues.push.bind(i.cues),o.ontimestampmap=function(d){i.timestampmap=d},o.onparsingerror=function(d){te.log.warn("Error encountered when parsing cues: "+d.message)},i.segment.map){var l=i.segment.map.bytes;r&&(l=UA(l)),o.parse(l)}var c=i.bytes;r&&(c=UA(c)),o.parse(c),o.flush()},a.updateTimeMapping_=function(i,n,r){var o=i.segment;if(n){if(!i.cues.length){o.empty=!0;return}var l=i.timestampmap,c=l.MPEGTS/Bm.ONE_SECOND_IN_TS-l.LOCAL+n.mapping;if(i.cues.forEach(function(h){h.startTime+=c,h.endTime+=c}),!r.syncInfo){var d=i.cues[0].startTime,u=i.cues[i.cues.length-1].startTime;r.syncInfo={mediaSequence:r.mediaSequence+i.mediaIndex,time:Math.min(d,u-o.duration)}}}},t}(J1),uve=function(e,t){for(var a=e.cues,i=0;i<a.length;i++){var n=a[i];if(t>=n.adStartTime&&t<=n.adEndTime)return n}return null},hve=function(e,t,a){if(a===void 0&&(a=0),!!e.segments)for(var i=a,n,r=0;r<e.segments.length;r++){var o=e.segments[r];if(n||(n=uve(t,i+o.duration/2)),n){if("cueIn"in o){n.endTime=i,n.adEndTime=i,i+=o.duration,n=null;continue}if(i<n.endTime){i+=o.duration;continue}n.endTime+=o.duration}else if("cueOut"in o&&(n=new O.VTTCue(i,i+o.duration,o.cueOut),n.adStartTime=i,n.adEndTime=i+parseFloat(o.cueOut),t.addCue(n)),"cueOutCont"in o){var l=o.cueOutCont.split("/").map(parseFloat),c=l[0],d=l[1];n=new O.VTTCue(i,i+o.duration,""),n.adStartTime=i-c,n.adEndTime=n.adStartTime+d,t.addCue(n)}i+=o.duration}},pve=86400,zA=[{name:"VOD",run:function(e,t,a,i,n){if(a!==1/0){var r={time:0,segmentIndex:0,partIndex:null};return r}return null}},{name:"ProgramDateTime",run:function(e,t,a,i,n){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var r=null,o=null,l=D1(t);n=n||0;for(var c=0;c<l.length;c++){var d=t.endList||n===0?c:l.length-(c+1),u=l[d],h=u.segment,m=e.timelineToDatetimeMappings[h.timeline];if(!(!m||!h.dateTimeObject)){var p=h.dateTimeObject.getTime()/1e3,f=p+m;if(h.parts&&typeof u.partIndex=="number")for(var y=0;y<u.partIndex;y++)f+=h.parts[y].duration;var b=Math.abs(n-f);if(o!==null&&(b===0||o<b))break;o=b,r={time:f,segmentIndex:u.segmentIndex,partIndex:u.partIndex}}}return r}},{name:"Segment",run:function(e,t,a,i,n){var r=null,o=null;n=n||0;for(var l=D1(t),c=0;c<l.length;c++){var d=t.endList||n===0?c:l.length-(c+1),u=l[d],h=u.segment,m=u.part&&u.part.start||h&&h.start;if(h.timeline===i&&typeof m<"u"){var p=Math.abs(n-m);if(o!==null&&o<p)break;(!r||o===null||o>=p)&&(o=p,r={time:m,segmentIndex:u.segmentIndex,partIndex:u.partIndex})}}return r}},{name:"Discontinuity",run:function(e,t,a,i,n){var r=null;if(n=n||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var o=null,l=0;l<t.discontinuityStarts.length;l++){var c=t.discontinuityStarts[l],d=t.discontinuitySequence+l+1,u=e.discontinuities[d];if(u){var h=Math.abs(n-u.time);if(o!==null&&o<h)break;(!r||o===null||o>=h)&&(o=h,r={time:u.time,segmentIndex:c,partIndex:null})}}return r}},{name:"Playlist",run:function(e,t,a,i,n){if(t.syncInfo){var r={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return r}return null}}],mve=function(e){Re(t,e);function t(i){var n;return n=e.call(this)||this,n.timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=Yi("SyncController"),n}var a=t.prototype;return a.getSyncPoint=function(i,n,r,o){var l=this.runStrategies_(i,n,r,o);return l.length?this.selectSyncPoint_(l,{key:"time",value:o}):null},a.getExpiredTime=function(i,n){if(!i||!i.segments)return null;var r=this.runStrategies_(i,n,i.discontinuitySequence,0);if(!r.length)return null;var o=this.selectSyncPoint_(r,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+uu({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:o.segmentIndex,endIndex:0}))},a.runStrategies_=function(i,n,r,o){for(var l=[],c=0;c<zA.length;c++){var d=zA[c],u=d.run(this,i,n,r,o);u&&(u.strategy=d.name,l.push({strategy:d.name,syncPoint:u}))}return l},a.selectSyncPoint_=function(i,n){for(var r=i[0].syncPoint,o=Math.abs(i[0].syncPoint[n.key]-n.value),l=i[0].strategy,c=1;c<i.length;c++){var d=Math.abs(i[c].syncPoint[n.key]-n.value);d<o&&(o=d,r=i[c].syncPoint,l=i[c].strategy)}return this.logger_("syncPoint for ["+n.key+": "+n.value+"] chosen with strategy"+(" ["+l+"]: [time:"+r.time+",")+(" segmentIndex:"+r.segmentIndex)+(typeof r.partIndex=="number"?",partIndex:"+r.partIndex:"")+"]"),r},a.saveExpiredSegmentInfo=function(i,n){var r=n.mediaSequence-i.mediaSequence;if(r>pve){te.log.warn("Not saving expired segment info. Media sequence gap "+r+" is too large.");return}for(var o=r-1;o>=0;o--){var l=i.segments[o];if(l&&typeof l.start<"u"){n.syncInfo={mediaSequence:i.mediaSequence+o,time:l.start},this.logger_("playlist refresh sync: [time:"+n.syncInfo.time+","+(" mediaSequence: "+n.syncInfo.mediaSequence+"]")),this.trigger("syncinfoupdate");break}}},a.setDateTimeMappingForStart=function(i){if(this.timelineToDatetimeMappings={},i.segments&&i.segments.length&&i.segments[0].dateTimeObject){var n=i.segments[0],r=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-r}},a.saveSegmentTimingInfo=function(i){var n=i.segmentInfo,r=i.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(n,n.timingInfo,r),l=n.segment;o&&(this.saveDiscontinuitySyncInfo_(n),n.playlist.syncInfo||(n.playlist.syncInfo={mediaSequence:n.playlist.mediaSequence+n.mediaIndex,time:l.start}));var c=l.dateTimeObject;l.discontinuity&&r&&c&&(this.timelineToDatetimeMappings[l.timeline]=-(c.getTime()/1e3))},a.timestampOffsetForTimeline=function(i){return typeof this.timelines[i]>"u"?null:this.timelines[i].time},a.mappingForTimeline=function(i){return typeof this.timelines[i]>"u"?null:this.timelines[i].mapping},a.calculateSegmentTimeMapping_=function(i,n,r){var o=i.segment,l=i.part,c=this.timelines[i.timeline],d,u;if(typeof i.timestampOffset=="number")c={time:i.startOfSegment,mapping:i.startOfSegment-n.start},r&&(this.timelines[i.timeline]=c,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+i.timeline+": "+("[time: "+c.time+"] [mapping: "+c.mapping+"]"))),d=i.startOfSegment,u=n.end+c.mapping;else if(c)d=n.start+c.mapping,u=n.end+c.mapping;else return!1;return l&&(l.start=d,l.end=u),(!o.start||d<o.start)&&(o.start=d),o.end=u,!0},a.saveDiscontinuitySyncInfo_=function(i){var n=i.playlist,r=i.segment;if(r.discontinuity)this.discontinuities[r.timeline]={time:r.start,accuracy:0};else if(n.discontinuityStarts&&n.discontinuityStarts.length)for(var o=0;o<n.discontinuityStarts.length;o++){var l=n.discontinuityStarts[o],c=n.discontinuitySequence+o+1,d=l-i.mediaIndex,u=Math.abs(d);if(!this.discontinuities[c]||this.discontinuities[c].accuracy>u){var h=void 0;d<0?h=r.start-uu({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:i.mediaIndex,endIndex:l}):h=r.end+uu({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:i.mediaIndex+1,endIndex:l}),this.discontinuities[c]={time:h,accuracy:u}}}},a.dispose=function(){this.trigger("dispose"),this.off()},t}(te.EventTarget),fve=function(e){Re(t,e);function t(){var i;return i=e.call(this)||this,i.pendingTimelineChanges_={},i.lastTimelineChanges_={},i}var a=t.prototype;return a.clearPendingTimelineChange=function(i){this.pendingTimelineChanges_[i]=null,this.trigger("pendingtimelinechange")},a.pendingTimelineChange=function(i){var n=i.type,r=i.from,o=i.to;return typeof r=="number"&&typeof o=="number"&&(this.pendingTimelineChanges_[n]={type:n,from:r,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[n]},a.lastTimelineChange=function(i){var n=i.type,r=i.from,o=i.to;return typeof r=="number"&&typeof o=="number"&&(this.lastTimelineChanges_[n]={type:n,from:r,to:o},delete this.pendingTimelineChanges_[n],this.trigger("timelinechange")),this.lastTimelineChanges_[n]},a.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(te.EventTarget),gve=fA(gA(function(){var e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function t(N,P,L){return L={path:P,exports:{},require:function(V,$){return a(V,$??L.path)}},N(L,L.exports),L.exports}function a(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var i=t(function(N){function P(V,$){for(var U=0;U<$.length;U++){var ae=$[U];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(V,ae.key,ae)}}function L(V,$,U){return $&&P(V.prototype,$),U&&P(V,U),V}N.exports=L,N.exports.default=N.exports,N.exports.__esModule=!0}),n=t(function(N){function P(L,V){return N.exports=P=Object.setPrototypeOf||function($,U){return $.__proto__=U,$},N.exports.default=N.exports,N.exports.__esModule=!0,P(L,V)}N.exports=P,N.exports.default=N.exports,N.exports.__esModule=!0}),r=t(function(N){function P(L,V){L.prototype=Object.create(V.prototype),L.prototype.constructor=L,n(L,V)}N.exports=P,N.exports.default=N.exports,N.exports.__esModule=!0}),o=function(){function N(){this.listeners={}}var P=N.prototype;return P.on=function(L,V){this.listeners[L]||(this.listeners[L]=[]),this.listeners[L].push(V)},P.off=function(L,V){if(!this.listeners[L])return!1;var $=this.listeners[L].indexOf(V);return this.listeners[L]=this.listeners[L].slice(0),this.listeners[L].splice($,1),$>-1},P.trigger=function(L){var V=this.listeners[L];if(V)if(arguments.length===2)for(var $=V.length,U=0;U<$;++U)V[U].call(this,arguments[1]);else for(var ae=Array.prototype.slice.call(arguments,1),oe=V.length,Y=0;Y<oe;++Y)V[Y].apply(this,ae)},P.dispose=function(){this.listeners={}},P.pipe=function(L){this.on("data",function(V){L.push(V)})},N}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function l(N){return N.subarray(0,N.byteLength-N[N.byteLength-1])}/*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */var c=function(){var N=[[[],[],[],[],[]],[[],[],[],[],[]]],P=N[0],L=N[1],V=P[4],$=L[4],U,ae,oe,Y=[],de=[],we,Se,pe,z,K,ue;for(U=0;U<256;U++)de[(Y[U]=U<<1^(U>>7)*283)^U]=U;for(ae=oe=0;!V[ae];ae^=we||1,oe=de[oe]||1)for(z=oe^oe<<1^oe<<2^oe<<3^oe<<4,z=z>>8^z&255^99,V[ae]=z,$[z]=ae,pe=Y[Se=Y[we=Y[ae]]],ue=pe*16843009^Se*65537^we*257^ae*16843008,K=Y[z]*257^z*16843008,U=0;U<4;U++)P[U][ae]=K=K<<24^K>>>8,L[U][z]=ue=ue<<24^ue>>>8;for(U=0;U<5;U++)P[U]=P[U].slice(0),L[U]=L[U].slice(0);return N},d=null,u=function(){function N(L){d||(d=c()),this._tables=[[d[0][0].slice(),d[0][1].slice(),d[0][2].slice(),d[0][3].slice(),d[0][4].slice()],[d[1][0].slice(),d[1][1].slice(),d[1][2].slice(),d[1][3].slice(),d[1][4].slice()]];var V,$,U,ae=this._tables[0][4],oe=this._tables[1],Y=L.length,de=1;if(Y!==4&&Y!==6&&Y!==8)throw new Error("Invalid aes key size");var we=L.slice(0),Se=[];for(this._key=[we,Se],V=Y;V<4*Y+28;V++)U=we[V-1],(V%Y===0||Y===8&&V%Y===4)&&(U=ae[U>>>24]<<24^ae[U>>16&255]<<16^ae[U>>8&255]<<8^ae[U&255],V%Y===0&&(U=U<<8^U>>>24^de<<24,de=de<<1^(de>>7)*283)),we[V]=we[V-Y]^U;for($=0;V;$++,V--)U=we[$&3?V:V-4],V<=4||$<4?Se[$]=U:Se[$]=oe[0][ae[U>>>24]]^oe[1][ae[U>>16&255]]^oe[2][ae[U>>8&255]]^oe[3][ae[U&255]]}var P=N.prototype;return P.decrypt=function(L,V,$,U,ae,oe){var Y=this._key[1],de=L^Y[0],we=U^Y[1],Se=$^Y[2],pe=V^Y[3],z,K,ue,ie=Y.length/4-2,ne,fe=4,me=this._tables[1],ye=me[0],ee=me[1],re=me[2],X=me[3],R=me[4];for(ne=0;ne<ie;ne++)z=ye[de>>>24]^ee[we>>16&255]^re[Se>>8&255]^X[pe&255]^Y[fe],K=ye[we>>>24]^ee[Se>>16&255]^re[pe>>8&255]^X[de&255]^Y[fe+1],ue=ye[Se>>>24]^ee[pe>>16&255]^re[de>>8&255]^X[we&255]^Y[fe+2],pe=ye[pe>>>24]^ee[de>>16&255]^re[we>>8&255]^X[Se&255]^Y[fe+3],fe+=4,de=z,we=K,Se=ue;for(ne=0;ne<4;ne++)ae[(3&-ne)+oe]=R[de>>>24]<<24^R[we>>16&255]<<16^R[Se>>8&255]<<8^R[pe&255]^Y[fe++],z=de,de=we,we=Se,Se=pe,pe=z},N}(),h=function(N){r(P,N);function P(){var V;return V=N.call(this,o)||this,V.jobs=[],V.delay=1,V.timeout_=null,V}var L=P.prototype;return L.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},L.push=function(V){this.jobs.push(V),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},P}(o),m=function(N){return N<<24|(N&65280)<<8|(N&16711680)>>8|N>>>24},p=function(N,P,L){var V=new Int32Array(N.buffer,N.byteOffset,N.byteLength>>2),$=new u(Array.prototype.slice.call(P)),U=new Uint8Array(N.byteLength),ae=new Int32Array(U.buffer),oe,Y,de,we,Se,pe,z,K,ue;for(oe=L[0],Y=L[1],de=L[2],we=L[3],ue=0;ue<V.length;ue+=4)Se=m(V[ue]),pe=m(V[ue+1]),z=m(V[ue+2]),K=m(V[ue+3]),$.decrypt(Se,pe,z,K,ae,ue),ae[ue]=m(ae[ue]^oe),ae[ue+1]=m(ae[ue+1]^Y),ae[ue+2]=m(ae[ue+2]^de),ae[ue+3]=m(ae[ue+3]^we),oe=Se,Y=pe,de=z,we=K;return U},f=function(){function N(L,V,$,U){var ae=N.STEP,oe=new Int32Array(L.buffer),Y=new Uint8Array(L.byteLength),de=0;for(this.asyncStream_=new h,this.asyncStream_.push(this.decryptChunk_(oe.subarray(de,de+ae),V,$,Y)),de=ae;de<oe.length;de+=ae)$=new Uint32Array([m(oe[de-4]),m(oe[de-3]),m(oe[de-2]),m(oe[de-1])]),this.asyncStream_.push(this.decryptChunk_(oe.subarray(de,de+ae),V,$,Y));this.asyncStream_.push(function(){U(null,l(Y))})}var P=N.prototype;return P.decryptChunk_=function(L,V,$,U){return function(){var ae=p(L,V,$);U.set(ae,L.byteOffset)}},i(N,null,[{key:"STEP",get:function(){return 32e3}}]),N}(),y;typeof window<"u"?y=window:typeof e<"u"?y=e:typeof self<"u"?y=self:y={};var b=y,E=function(N){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(N):N&&N.buffer instanceof ArrayBuffer},D=b.BigInt||Number;D("0x1"),D("0x100"),D("0x10000"),D("0x1000000"),D("0x100000000"),D("0x10000000000"),D("0x1000000000000"),D("0x100000000000000"),D("0x10000000000000000");var M=function(N){var P={};return Object.keys(N).forEach(function(L){var V=N[L];E(V)?P[L]={bytes:V.buffer,byteOffset:V.byteOffset,byteLength:V.byteLength}:P[L]=V}),P};self.onmessage=function(N){var P=N.data,L=new Uint8Array(P.encrypted.bytes,P.encrypted.byteOffset,P.encrypted.byteLength),V=new Uint32Array(P.key.bytes,P.key.byteOffset,P.key.byteLength/4),$=new Uint32Array(P.iv.bytes,P.iv.byteOffset,P.iv.byteLength/4);new f(L,V,$,function(U,ae){self.postMessage(M({source:P.source,decrypted:ae}),[ae.buffer])})}})),yve=mA(gve),_ve=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},bf=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Z1=function(e,t){t.activePlaylistLoader=e,e.load()},bve=function(e,t){return function(){var a=t.segmentLoaders,i=a[e],n=a.main,r=t.mediaTypes[e],o=r.activeTrack(),l=r.getActiveGroup(),c=r.activePlaylistLoader,d=r.lastGroup_;if(!(l&&d&&l.id===d.id)&&(r.lastGroup_=l,r.lastTrack_=o,bf(i,r),!(!l||l.isMasterPlaylist))){if(!l.playlistLoader){c&&n.resetEverything();return}i.resyncLoader(),Z1(l.playlistLoader,r)}}},vve=function(e,t){return function(){var a=t.segmentLoaders[e],i=t.mediaTypes[e];i.lastGroup_=null,a.abort(),a.pause()}},Sve=function(e,t){return function(){var a=t.masterPlaylistLoader,i=t.segmentLoaders,n=i[e],r=i.main,o=t.mediaTypes[e],l=o.activeTrack(),c=o.getActiveGroup(),d=o.activePlaylistLoader,u=o.lastTrack_;if(!(u&&l&&u.id===l.id)&&(o.lastGroup_=c,o.lastTrack_=l,bf(n,o),!!c)){if(c.isMasterPlaylist){if(!l||!u||l.id===u.id)return;var h=t.vhs.masterPlaylistController_,m=h.selectPlaylist();if(h.media()===m)return;o.logger_("track change. Switching master audio from "+u.id+" to "+l.id),a.pause(),r.resetEverything(),h.fastQualityChange_(m);return}if(e==="AUDIO"){if(!c.playlistLoader){r.setAudio(!0),r.resetEverything();return}n.setAudio(!0),r.setAudio(!1)}if(d===c.playlistLoader){Z1(c.playlistLoader,o);return}n.track&&n.track(l),n.resetEverything(),Z1(c.playlistLoader,o)}}},vf={AUDIO:function(e,t){return function(){var a=t.segmentLoaders[e],i=t.mediaTypes[e],n=t.blacklistCurrentPlaylist;bf(a,i);var r=i.activeTrack(),o=i.activeGroup(),l=(o.filter(function(u){return u.default})[0]||o[0]).id,c=i.tracks[l];if(r===c){n({message:"Problem encountered loading the default audio track."});return}te.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var d in i.tracks)i.tracks[d].enabled=i.tracks[d]===c;i.onTrackChanged()}},SUBTITLES:function(e,t){return function(){var a=t.segmentLoaders[e],i=t.mediaTypes[e];te.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),bf(a,i);var n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}}},HA={AUDIO:function(e,t,a){if(t){var i=a.tech,n=a.requestOptions,r=a.segmentLoaders[e];t.on("loadedmetadata",function(){var o=t.media();r.playlist(o,n),(!i.paused()||o.endList&&i.preload()!=="none")&&r.load()}),t.on("loadedplaylist",function(){r.playlist(t.media(),n),i.paused()||r.load()}),t.on("error",vf[e](e,a))}},SUBTITLES:function(e,t,a){var i=a.tech,n=a.requestOptions,r=a.segmentLoaders[e],o=a.mediaTypes[e];t.on("loadedmetadata",function(){var l=t.media();r.playlist(l,n),r.track(o.activeTrack()),(!i.paused()||l.endList&&i.preload()!=="none")&&r.load()}),t.on("loadedplaylist",function(){r.playlist(t.media(),n),i.paused()||r.load()}),t.on("error",vf[e](e,a))}},wve={AUDIO:function(e,t){var a=t.vhs,i=t.sourceType,n=t.segmentLoaders[e],r=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[e],c=l.groups,d=l.tracks,u=l.logger_,h=t.masterPlaylistLoader,m=hu(h.master);(!o[e]||Object.keys(o[e]).length===0)&&(o[e]={main:{default:{default:!0}}},m&&(o[e].main.default.playlists=h.master.playlists));for(var p in o[e]){c[p]||(c[p]=[]);for(var f in o[e][p]){var y=o[e][p][f],b=void 0;if(m?(u("AUDIO group '"+p+"' label '"+f+"' is a master playlist"),y.isMasterPlaylist=!0,b=null):i==="vhs-json"&&y.playlists?b=new Wl(y.playlists[0],a,r):y.resolvedUri?b=new Wl(y.resolvedUri,a,r):y.playlists&&i==="dash"?b=new q1(y.playlists[0],a,r,h):b=null,y=te.mergeOptions({id:f,playlistLoader:b},y),HA[e](e,y.playlistLoader,t),c[p].push(y),typeof d[f]>"u"){var E=new te.AudioTrack({id:f,kind:_ve(y),enabled:!1,language:y.language,default:y.default,label:f});d[f]=E}}}n.on("error",vf[e](e,t))},SUBTITLES:function(e,t){var a=t.tech,i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],o=t.requestOptions,l=t.master.mediaGroups,c=t.mediaTypes[e],d=c.groups,u=c.tracks,h=t.masterPlaylistLoader;for(var m in l[e]){d[m]||(d[m]=[]);for(var p in l[e][m])if(!l[e][m][p].forced){var f=l[e][m][p],y=void 0;if(n==="hls")y=new Wl(f.resolvedUri,i,o);else if(n==="dash"){var b=f.playlists.filter(function(D){return D.excludeUntil!==1/0});if(!b.length)return;y=new q1(f.playlists[0],i,o,h)}else n==="vhs-json"&&(y=new Wl(f.playlists?f.playlists[0]:f.resolvedUri,i,o));if(f=te.mergeOptions({id:p,playlistLoader:y},f),HA[e](e,f.playlistLoader,t),d[m].push(f),typeof u[p]>"u"){var E=a.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;u[p]=E}}}r.on("error",vf[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var a=t.tech,i=t.master.mediaGroups,n=t.mediaTypes[e],r=n.groups,o=n.tracks;for(var l in i[e]){r[l]||(r[l]=[]);for(var c in i[e][l]){var d=i[e][l][c];if(/^(?:CC|SERVICE)/.test(d.instreamId)){var u=a.options_.vhs&&a.options_.vhs.captionServices||{},h={label:c,language:d.language,instreamId:d.instreamId,default:d.default&&d.autoselect};if(u[h.instreamId]&&(h=te.mergeOptions(h,u[h.instreamId])),h.default===void 0&&delete h.default,r[l].push(te.mergeOptions({id:c},d)),typeof o[c]>"u"){var m=a.addRemoteTextTrack({id:h.instreamId,kind:"captions",default:h.default,language:h.language,label:h.label},!1).track;o[c]=m}}}}}},Tve=function e(t,a){for(var i=0;i<t.length;i++)if(R1(a,t[i])||t[i].playlists&&e(t[i].playlists,a))return!0;return!1},Cve=function(e,t){return function(a){var i=t.masterPlaylistLoader,n=t.mediaTypes[e].groups,r=i.media();if(!r)return null;var o=null;r.attributes[e]&&(o=n[r.attributes[e]]);var l=Object.keys(n);if(!o)if(e==="AUDIO"&&l.length>1&&hu(t.master))for(var c=0;c<l.length;c++){var d=n[l[c]];if(Tve(d,r)){o=d;break}}else n.main?o=n.main:l.length===1&&(o=n[l[0]]);return typeof a>"u"?o:a===null||!o?null:o.filter(function(u){return u.id===a.id})[0]||null}},kve={AUDIO:function(e,t){return function(){var a=t.mediaTypes[e].tracks;for(var i in a)if(a[i].enabled)return a[i];return null}},SUBTITLES:function(e,t){return function(){var a=t.mediaTypes[e].tracks;for(var i in a)if(a[i].mode==="showing"||a[i].mode==="hidden")return a[i];return null}}},Eve=function(e,t){var a=t.mediaTypes;return function(){var i=a[e].activeTrack();return i?a[e].activeGroup(i):null}},Ive=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(p){wve[p](p,e)});var t=e.mediaTypes,a=e.masterPlaylistLoader,i=e.tech,n=e.vhs,r=e.segmentLoaders,o=r.AUDIO,l=r.main;["AUDIO","SUBTITLES"].forEach(function(p){t[p].activeGroup=Cve(p,e),t[p].activeTrack=kve[p](p,e),t[p].onGroupChanged=bve(p,e),t[p].onGroupChanging=vve(p,e),t[p].onTrackChanged=Sve(p,e),t[p].getActiveGroup=Eve(p,e)});var c=t.AUDIO.activeGroup();if(c){var d=(c.filter(function(p){return p.default})[0]||c[0]).id;t.AUDIO.tracks[d].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();var u=t.AUDIO.getActiveGroup();u.playlistLoader?(l.setAudio(!1),o.setAudio(!0)):l.setAudio(!0)}a.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(p){return t[p].onGroupChanged()})}),a.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(p){return t[p].onGroupChanging()})});var h=function(){t.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"}),i.trigger({type:"usage",name:"hls-audio-change"})};i.audioTracks().addEventListener("change",h),i.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),n.on("dispose",function(){i.audioTracks().removeEventListener("change",h),i.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(var m in t.AUDIO.tracks)i.audioTracks().addTrack(t.AUDIO.tracks[m])},xve=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:gr,activeTrack:gr,getActiveGroup:gr,onGroupChanged:gr,onTrackChanged:gr,lastTrack_:null,logger_:Yi("MediaGroups["+t+"]")}}),e},Nve=60*2,yr,Ave=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Pve=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Ove=function(e){var t=e.currentPlaylist,a=e.buffered,i=e.currentTime,n=e.nextPlaylist,r=e.bufferLowWaterLine,o=e.bufferHighWaterLine,l=e.duration,c=e.experimentalBufferBasedABR,d=e.log;if(!n)return te.log.warn("We received no playlist to switch to. Please check your stream."),!1;var u="allowing switch "+(t&&t.id||"null")+" -> "+n.id;if(!t)return d(u+" as current playlist is not set"),!0;if(n.id===t.id)return!1;var h=!!Hl(a,i).length;if(!t.endList)return!h&&typeof t.partTargetDuration=="number"?(d("not "+u+" as current playlist is live llhls, but currentTime isn't in buffered."),!1):(d(u+" as current playlist is live"),!0);var m=O1(a,i),p=c?ma.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ma.MAX_BUFFER_LOW_WATER_LINE;if(l<p)return d(u+" as duration < max low water line ("+l+" < "+p+")"),!0;var f=n.attributes.BANDWIDTH,y=t.attributes.BANDWIDTH;if(f<y&&(!c||m<o)){var b=u+" as next bandwidth < current bandwidth ("+f+" < "+y+")";return c&&(b+=" and forwardBuffer < bufferHighWaterLine ("+m+" < "+o+")"),d(b),!0}if((!c||f>y)&&m>=r){var E=u+" as forwardBuffer >= bufferLowWaterLine ("+m+" >= "+r+")";return c&&(E+=" and next bandwidth > current bandwidth ("+f+" > "+y+")"),d(E),!0}return d("not "+u+" as no switching criteria met"),!1},Bve=function(e){Re(t,e);function t(i){var n;n=e.call(this)||this;var r=i.src,o=i.handleManifestRedirects,l=i.withCredentials,c=i.tech,d=i.bandwidth,u=i.externVhs,h=i.useCueTags,m=i.blacklistDuration,p=i.enableLowInitialPlaylist,f=i.sourceType,y=i.cacheEncryptionKeys,b=i.experimentalBufferBasedABR,E=i.experimentalLeastPixelDiffSelector,D=i.captionServices;if(!r)throw new Error("A non-empty playlist URL or JSON manifest string is required");var M=i.maxPlaylistRetries;(M===null||typeof M>"u")&&(M=1/0),yr=u,n.experimentalBufferBasedABR=!!b,n.experimentalLeastPixelDiffSelector=!!E,n.withCredentials=l,n.tech_=c,n.vhs_=c.vhs,n.sourceType_=f,n.useCueTags_=h,n.blacklistDuration=m,n.maxPlaylistRetries=M,n.enableLowInitialPlaylist=p,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:l,handleManifestRedirects:o,maxPlaylistRetries:M,timeout:null},n.on("error",n.pauseLoading),n.mediaTypes_=xve(),n.mediaSource=new O.MediaSource,n.handleDurationChange_=n.handleDurationChange_.bind($e(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind($e(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind($e(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=te.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new mve(i),n.segmentMetadataTrack_=c.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new yve,n.sourceUpdater_=new VA(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new fve;var N={vhs:n.vhs_,parse708captions:i.parse708captions,useDtsForTimestampOffset:i.useDtsForTimestampOffset,captionServices:D,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.duration()},hasPlayed:function(){return n.hasPlayed_},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:d,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_,experimentalExactManifestTimings:i.experimentalExactManifestTimings};n.masterPlaylistLoader_=n.sourceType_==="dash"?new q1(r,n.vhs_,n.requestOptions_):new Wl(r,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new J1(te.mergeOptions(N,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),i),n.audioSegmentLoader_=new J1(te.mergeOptions(N,{loaderType:"audio"}),i),n.subtitleSegmentLoader_=new dve(te.mergeOptions(N,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(L,V){function $(){c.off("vttjserror",U),L()}function U(){c.off("vttjsloaded",$),V()}c.one("vttjsloaded",$),c.one("vttjserror",U),c.addWebVttScript_()})}}),i),n.setupSegmentLoaderListeners_(),n.experimentalBufferBasedABR&&(n.masterPlaylistLoader_.one("loadedplaylist",function(){return n.startABRTimer_()}),n.tech_.on("pause",function(){return n.stopABRTimer_()}),n.tech_.on("play",function(){return n.startABRTimer_()})),Ave.forEach(function(L){n[L+"_"]=Pve.bind($e(n),L)}),n.logger_=Yi("MPC"),n.triggeredFmp4Usage=!1,n.tech_.preload()==="none"?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.masterPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.masterPlaylistLoader_.load(),n.timeToLoadedData__=-1,n.mainAppendsToLoadedData__=-1,n.audioAppendsToLoadedData__=-1;var P=n.tech_.preload()==="none"?"play":"loadstart";return n.tech_.one(P,function(){var L=Date.now();n.tech_.one("loadeddata",function(){n.timeToLoadedData__=Date.now()-L,n.mainAppendsToLoadedData__=n.mainSegmentLoader_.mediaAppends,n.audioAppendsToLoadedData__=n.audioSegmentLoader_.mediaAppends})}),n}var a=t.prototype;return a.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},a.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},a.appendsToLoadedData_=function(){var i=this.mainAppendsToLoadedData_(),n=this.audioAppendsToLoadedData_();return i===-1||n===-1?-1:i+n},a.timeToLoadedData_=function(){return this.timeToLoadedData__},a.checkABR_=function(i){i===void 0&&(i="abr");var n=this.selectPlaylist();n&&this.shouldSwitchToMedia_(n)&&this.switchMedia_(n,i)},a.switchMedia_=function(i,n,r){var o=this.media(),l=o&&(o.id||o.uri),c=i.id||i.uri;l&&l!==c&&(this.logger_("switch media "+l+" -> "+c+" from "+n),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+n})),this.masterPlaylistLoader_.media(i,r)},a.startABRTimer_=function(){var i=this;this.stopABRTimer_(),this.abrTimer_=O.setInterval(function(){return i.checkABR_()},250)},a.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(O.clearInterval(this.abrTimer_),this.abrTimer_=null)},a.getAudioTrackPlaylists_=function(){var i=this.master(),n=i&&i.playlists||[];if(!i||!i.mediaGroups||!i.mediaGroups.AUDIO)return n;var r=i.mediaGroups.AUDIO,o=Object.keys(r),l;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{var c=r.main||o.length&&r[o[0]];for(var d in c)if(c[d].default){l={label:d};break}}if(!l)return n;var u=[];for(var h in r)if(r[h][l.label]){var m=r[h][l.label];if(m.playlists&&m.playlists.length)u.push.apply(u,m.playlists);else if(m.uri)u.push(m);else if(i.playlists.length)for(var p=0;p<i.playlists.length;p++){var f=i.playlists[p];f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===h&&u.push(f)}}return u.length?u:n},a.setupMasterPlaylistLoaderListeners_=function(){var i=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var n=i.masterPlaylistLoader_.media(),r=n.targetDuration*1.5*1e3;L1(i.masterPlaylistLoader_.master,i.masterPlaylistLoader_.media())?i.requestOptions_.timeout=0:i.requestOptions_.timeout=r,n.endList&&i.tech_.preload()!=="none"&&(i.mainSegmentLoader_.playlist(n,i.requestOptions_),i.mainSegmentLoader_.load()),Ive({sourceType:i.sourceType_,segmentLoaders:{AUDIO:i.audioSegmentLoader_,SUBTITLES:i.subtitleSegmentLoader_,main:i.mainSegmentLoader_},tech:i.tech_,requestOptions:i.requestOptions_,masterPlaylistLoader:i.masterPlaylistLoader_,vhs:i.vhs_,master:i.master(),mediaTypes:i.mediaTypes_,blacklistCurrentPlaylist:i.blacklistCurrentPlaylist.bind(i)}),i.triggerPresenceUsage_(i.master(),n),i.setupFirstPlay(),!i.mediaTypes_.AUDIO.activePlaylistLoader||i.mediaTypes_.AUDIO.activePlaylistLoader.media()?i.trigger("selectedinitialmedia"):i.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){i.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){i.loadOnPlay_&&i.tech_.off("play",i.loadOnPlay_);var n=i.masterPlaylistLoader_.media();if(!n){i.excludeUnsupportedVariants_();var r;if(i.enableLowInitialPlaylist&&(r=i.selectInitialPlaylist()),r||(r=i.selectPlaylist()),!r||!i.shouldSwitchToMedia_(r))return;i.initialMedia_=r,i.switchMedia_(i.initialMedia_,"initial");var o=i.sourceType_==="vhs-json"&&i.initialMedia_.segments;if(!o)return;n=i.initialMedia_}i.handleUpdatedMediaPlaylist(n)}),this.masterPlaylistLoader_.on("error",function(){i.blacklistCurrentPlaylist(i.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){i.mainSegmentLoader_.abort(),i.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var n=i.masterPlaylistLoader_.media(),r=n.targetDuration*1.5*1e3;L1(i.masterPlaylistLoader_.master,i.masterPlaylistLoader_.media())?i.requestOptions_.timeout=0:i.requestOptions_.timeout=r,i.masterPlaylistLoader_.load(),i.mainSegmentLoader_.playlist(n,i.requestOptions_),i.mainSegmentLoader_.load(),i.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var n=i.masterPlaylistLoader_.media();if(n.lastExcludeReason_!=="playlist-unchanged"){var r=i.stuckAtPlaylistEnd_(n);r&&(i.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),i.tech_.trigger("playliststuck"))}}),this.masterPlaylistLoader_.on("renditiondisabled",function(){i.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),i.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){i.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),i.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},a.handleUpdatedMediaPlaylist=function(i){this.useCueTags_&&this.updateAdCues_(i),this.mainSegmentLoader_.playlist(i,this.requestOptions_),this.updateDuration(!i.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},a.triggerPresenceUsage_=function(i,n){var r=i.mediaGroups||{},o=!0,l=Object.keys(r.AUDIO);for(var c in r.AUDIO)for(var d in r.AUDIO[c]){var u=r.AUDIO[c][d];u.uri||(o=!1)}o&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(r.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),yr.Playlist.isAes(n)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),l.length&&Object.keys(r.AUDIO[l[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},a.shouldSwitchToMedia_=function(i){var n=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,r=this.tech_.currentTime(),o=this.bufferLowWaterLine(),l=this.bufferHighWaterLine(),c=this.tech_.buffered();return Ove({buffered:c,currentTime:r,currentPlaylist:n,nextPlaylist:i,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},a.setupSegmentLoaderListeners_=function(){var i=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){i.checkABR_("bandwidthupdate"),i.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){i.experimentalBufferBasedABR&&i.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){i.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){i.blacklistCurrentPlaylist(i.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){i.error=i.mainSegmentLoader_.error_,i.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){i.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){i.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),i.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){i.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){i.error=i.audioSegmentLoader_.error_,i.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){i.logger_("main segment loader ended"),i.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(r){i.experimentalBufferBasedABR||(i.delegateLoaders_("all",["abort"]),i.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},Nve))});var n=function(){if(!i.sourceUpdater_.hasCreatedSourceBuffers())return i.tryToCreateSourceBuffers_();var r=i.getCodecsOrExclude_();r&&i.sourceUpdater_.addOrChangeSourceBuffers(r)};this.mainSegmentLoader_.on("trackinfo",n),this.audioSegmentLoader_.on("trackinfo",n),this.mainSegmentLoader_.on("fmp4",function(){i.triggeredFmp4Usage||(i.tech_.trigger({type:"usage",name:"vhs-fmp4"}),i.tech_.trigger({type:"usage",name:"hls-fmp4"}),i.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){i.triggeredFmp4Usage||(i.tech_.trigger({type:"usage",name:"vhs-fmp4"}),i.tech_.trigger({type:"usage",name:"hls-fmp4"}),i.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){i.logger_("audioSegmentLoader ended"),i.onEndOfStream()})},a.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},a.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},a.smoothQualityChange_=function(i){i===void 0&&(i=this.selectPlaylist()),this.fastQualityChange_(i)},a.fastQualityChange_=function(i){var n=this;if(i===void 0&&(i=this.selectPlaylist()),i===this.masterPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(i,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){te.browser.IE_VERSION||te.browser.IS_EDGE?n.tech_.setCurrentTime(n.tech_.currentTime()+.04):n.tech_.setCurrentTime(n.tech_.currentTime())})},a.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var i=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<i.start(0))return this.tech_.setCurrentTime(i.end(i.length-1))}},a.setupFirstPlay=function(){var i=this,n=this.masterPlaylistLoader_.media();if(!n||this.tech_.paused()||this.hasPlayed_)return!1;if(!n.endList){var r=this.seekable();if(!r.length)return!1;if(te.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){i.trigger("firstplay"),i.tech_.setCurrentTime(r.end(0)),i.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(r.end(0))}return this.hasPlayed_=!0,this.load(),!0},a.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var i=this.tech_.play();typeof i<"u"&&typeof i.then=="function"&&i.then(null,function(n){})}this.trigger("sourceopen")},a.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var i=this.inbandTextTracks_.metadataTrack_.cues;if(!(!i||!i.length)){var n=this.duration();i[i.length-1].endTime=isNaN(n)||Math.abs(n)===1/0?Number.MAX_VALUE:n}}},a.handleDurationChange_=function(){this.tech_.trigger("durationchange")},a.onEndOfStream=function(){var i=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var n=this.mainSegmentLoader_.getCurrentMediaInfo_();!n||n.hasVideo?i=i&&this.audioSegmentLoader_.ended_:i=this.audioSegmentLoader_.ended_}i&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},a.stuckAtPlaylistEnd_=function(i){var n=this.seekable();if(!n.length)return!1;var r=this.syncController_.getExpiredTime(i,this.duration());if(r===null)return!1;var o=yr.Playlist.playlistEnd(i,r),l=this.tech_.currentTime(),c=this.tech_.buffered();if(!c.length)return o-l<=Mn;var d=c.end(c.length-1);return d-l<=Mn&&o-d<=Mn},a.blacklistCurrentPlaylist=function(i,n){i===void 0&&(i={});var r=i.playlist||this.masterPlaylistLoader_.media();if(n=n||i.blacklistDuration||this.blacklistDuration,!r){this.error=i,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}r.playlistErrors_++;var o=this.masterPlaylistLoader_.master.playlists,l=o.filter(uf),c=l.length===1&&l[0]===r;if(o.length===1&&n!==1/0)return te.log.warn("Problem encountered with playlist "+r.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(c);if(c){var d=!1;o.forEach(function(b){if(b!==r){var E=b.excludeUntil;typeof E<"u"&&E!==1/0&&(d=!0,delete b.excludeUntil)}}),d&&(te.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}var u;r.playlistErrors_>this.maxPlaylistRetries?u=1/0:u=Date.now()+n*1e3,r.excludeUntil=u,i.reason&&(r.lastExcludeReason_=i.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var h=this.selectPlaylist();if(!h){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}var m=i.internal?this.logger_:te.log.warn,p=i.message?" "+i.message:"";m((i.internal?"Internal problem":"Problem")+" encountered with playlist "+r.id+"."+(p+" Switching to playlist "+h.id+".")),h.attributes.AUDIO!==r.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),h.attributes.SUBTITLES!==r.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var f=h.targetDuration/2*1e3||5*1e3,y=typeof h.lastRequest=="number"&&Date.now()-h.lastRequest<=f;return this.switchMedia_(h,"exclude",c||y)},a.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},a.delegateLoaders_=function(i,n){var r=this,o=[],l=i==="all";(l||i==="main")&&o.push(this.masterPlaylistLoader_);var c=[];(l||i==="audio")&&c.push("AUDIO"),(l||i==="subtitle")&&(c.push("CLOSED-CAPTIONS"),c.push("SUBTITLES")),c.forEach(function(d){var u=r.mediaTypes_[d]&&r.mediaTypes_[d].activePlaylistLoader;u&&o.push(u)}),["main","audio","subtitle"].forEach(function(d){var u=r[d+"SegmentLoader_"];u&&(i===d||i==="all")&&o.push(u)}),o.forEach(function(d){return n.forEach(function(u){typeof d[u]=="function"&&d[u]()})})},a.setCurrentTime=function(i){var n=Hl(this.tech_.buffered(),i);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())||!this.masterPlaylistLoader_.media().segments)return 0;if(n&&n.length)return i;this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),this.load()},a.duration=function(){if(!this.masterPlaylistLoader_)return 0;var i=this.masterPlaylistLoader_.media();return i?i.endList?this.mediaSource?this.mediaSource.duration:yr.Playlist.duration(i):1/0:0},a.seekable=function(){return this.seekable_},a.onSyncInfoUpdate_=function(){var i;if(this.masterPlaylistLoader_){var n=this.masterPlaylistLoader_.media();if(n){var r=this.syncController_.getExpiredTime(n,this.duration());if(r!==null){var o=this.masterPlaylistLoader_.master,l=yr.Playlist.seekable(n,r,yr.Playlist.liveEdgeDelay(o,n));if(l.length!==0&&!(this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),r=this.syncController_.getExpiredTime(n,this.duration()),r===null||(i=yr.Playlist.seekable(n,r,yr.Playlist.liveEdgeDelay(o,n)),i.length===0)))){var c,d;this.seekable_&&this.seekable_.length&&(c=this.seekable_.end(0),d=this.seekable_.start(0)),i?i.start(0)>l.end(0)||l.start(0)>i.end(0)?this.seekable_=l:this.seekable_=te.createTimeRanges([[i.start(0)>l.start(0)?i.start(0):l.start(0),i.end(0)<l.end(0)?i.end(0):l.end(0)]]):this.seekable_=l,!(this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===c&&this.seekable_.start(0)===d)&&(this.logger_("seekable updated ["+jN(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},a.updateDuration=function(i){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,i),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(i){var n=this.seekable();if(!n.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<n.end(n.length-1))&&this.sourceUpdater_.setDuration(n.end(n.length-1));return}var r=this.tech_.buffered(),o=yr.Playlist.duration(this.masterPlaylistLoader_.media());r.length>0&&(o=Math.max(o,r.end(r.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)},a.dispose=function(){var i=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(n){var r=i.mediaTypes_[n].groups;for(var o in r)r[o].forEach(function(l){l.playlistLoader&&l.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},a.master=function(){return this.masterPlaylistLoader_.master},a.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},a.areMediaTypesKnown_=function(){var i=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),r=i?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!n||!r)},a.getCodecsOrExclude_=function(){var i=this,n={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},r=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();n.video=n.main;var o=pu(this.master(),r),l={},c=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(n.main.hasVideo&&(l.video=o.video||n.main.videoCodec||N0e),n.main.isMuxed&&(l.video+=","+(o.audio||n.main.audioCodec||P6)),(n.main.hasAudio&&!n.main.isMuxed||n.audio.hasAudio||c)&&(l.audio=o.audio||n.main.audioCodec||n.audio.audioCodec||P6,n.audio.isFmp4=n.main.hasAudio&&!n.main.isMuxed?n.main.isFmp4:n.audio.isFmp4),!l.audio&&!l.video){this.blacklistCurrentPlaylist({playlist:r,message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var d=function(y,b){return y?Em(b):g2(b)},u={},h;if(["video","audio"].forEach(function(y){if(l.hasOwnProperty(y)&&!d(n[y].isFmp4,l[y])){var b=n[y].isFmp4?"browser":"muxer";u[b]=u[b]||[],u[b].push(l[y]),y==="audio"&&(h=b)}}),c&&h&&r.attributes.AUDIO){var m=r.attributes.AUDIO;this.master().playlists.forEach(function(y){var b=y.attributes&&y.attributes.AUDIO;b===m&&y!==r&&(y.excludeUntil=1/0)}),this.logger_("excluding audio group "+m+" as "+h+' does not support codec(s): "'+l.audio+'"')}if(Object.keys(u).length){var p=Object.keys(u).reduce(function(y,b){return y&&(y+=", "),y+=b+' does not support codec(s): "'+u[b].join(",")+'"',y},"")+".";this.blacklistCurrentPlaylist({playlist:r,internal:!0,message:p,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var f=[];if(["video","audio"].forEach(function(y){var b=(On(i.sourceUpdater_.codecs[y]||"")[0]||{}).type,E=(On(l[y]||"")[0]||{}).type;b&&E&&b.toLowerCase()!==E.toLowerCase()&&f.push('"'+i.sourceUpdater_.codecs[y]+'" -> "'+l[y]+'"')}),f.length){this.blacklistCurrentPlaylist({playlist:r,message:"Codec switching not supported: "+f.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return l},a.tryToCreateSourceBuffers_=function(){if(!(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers())&&this.areMediaTypesKnown_()){var i=this.getCodecsOrExclude_();if(i){this.sourceUpdater_.createSourceBuffers(i);var n=[i.video,i.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}}},a.excludeUnsupportedVariants_=function(){var i=this,n=this.master().playlists,r=[];Object.keys(n).forEach(function(o){var l=n[o];if(r.indexOf(l.id)===-1){r.push(l.id);var c=pu(i.master,l),d=[];c.audio&&!g2(c.audio)&&!Em(c.audio)&&d.push("audio codec "+c.audio),c.video&&!g2(c.video)&&!Em(c.video)&&d.push("video codec "+c.video),c.text&&c.text==="stpp.ttml.im1t"&&d.push("text codec "+c.text),d.length&&(l.excludeUntil=1/0,i.logger_("excluding "+l.id+" for unsupported: "+d.join(", ")))}})},a.excludeIncompatibleVariants_=function(i){var n=this,r=[],o=this.master().playlists,l=ff(On(i)),c=IA(l),d=l.video&&On(l.video)[0]||null,u=l.audio&&On(l.audio)[0]||null;Object.keys(o).forEach(function(h){var m=o[h];if(!(r.indexOf(m.id)!==-1||m.excludeUntil===1/0)){r.push(m.id);var p=[],f=pu(n.masterPlaylistLoader_.master,m),y=IA(f);if(!(!f.audio&&!f.video)){if(y!==c&&p.push('codec count "'+y+'" !== "'+c+'"'),!n.sourceUpdater_.canChangeType()){var b=f.video&&On(f.video)[0]||null,E=f.audio&&On(f.audio)[0]||null;b&&d&&b.type.toLowerCase()!==d.type.toLowerCase()&&p.push('video codec "'+b.type+'" !== "'+d.type+'"'),E&&u&&E.type.toLowerCase()!==u.type.toLowerCase()&&p.push('audio codec "'+E.type+'" !== "'+u.type+'"')}p.length&&(m.excludeUntil=1/0,n.logger_("blacklisting "+m.id+": "+p.join(" && ")))}}})},a.updateAdCues_=function(i){var n=0,r=this.seekable();r.length&&(n=r.start(0)),hve(i,this.cueTagsTrack_,n)},a.goalBufferLength=function(){var i=this.tech_.currentTime(),n=ma.GOAL_BUFFER_LENGTH,r=ma.GOAL_BUFFER_LENGTH_RATE,o=Math.max(n,ma.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+i*r,o)},a.bufferLowWaterLine=function(){var i=this.tech_.currentTime(),n=ma.BUFFER_LOW_WATER_LINE,r=ma.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(n,ma.MAX_BUFFER_LOW_WATER_LINE),l=Math.max(n,ma.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+i*r,this.experimentalBufferBasedABR?l:o)},a.bufferHighWaterLine=function(){return ma.BUFFER_HIGH_WATER_LINE},t}(te.EventTarget),Dve=function(e,t,a){return function(i){var n=e.master.playlists[t],r=M1(n),o=uf(n);return typeof i>"u"?o:(i?delete n.disabled:n.disabled=!0,i!==o&&!r&&(a(),i?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),i)}},Mve=function(e,t,a){var i=e.masterPlaylistController_,n=e.options_.smoothQualityChange,r=n?"smooth":"fast",o=i[r+"QualityChange_"].bind(i);if(t.attributes){var l=t.attributes.RESOLUTION;this.width=l&&l.width,this.height=l&&l.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=pu(i.master(),t),this.playlist=t,this.id=a,this.enabled=Dve(e.playlists,t.id,o)},Lve=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),a=hu(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return a?a.filter(function(i){return!M1(i)}).map(function(i,n){return new Mve(e,i,i.id)}):[]}},qA=["seeking","seeked","pause","playing","error"],Rve=function(){function e(a){var i=this;this.masterPlaylistController_=a.masterPlaylistController,this.tech_=a.tech,this.seekable=a.seekable,this.allowSeeksWithinUnsafeLiveWindow=a.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=a.liveRangeSafeTimeDelta,this.media=a.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Yi("PlaybackWatcher"),this.logger_("initialize");var n=function(){return i.monitorCurrentTime_()},r=function(){return i.monitorCurrentTime_()},o=function(){return i.techWaiting_()},l=function(){return i.cancelTimer_()},c=this.masterPlaylistController_,d=["main","subtitle","audio"],u={};d.forEach(function(m){u[m]={reset:function(){return i.resetSegmentDownloads_(m)},updateend:function(){return i.checkSegmentDownloads_(m)}},c[m+"SegmentLoader_"].on("appendsdone",u[m].updateend),c[m+"SegmentLoader_"].on("playlistupdate",u[m].reset),i.tech_.on(["seeked","seeking"],u[m].reset)});var h=function(m){["main","audio"].forEach(function(p){c[p+"SegmentLoader_"][m]("appended",i.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){i.fixesBadSeeks_()&&(i.consecutiveUpdates=0,i.lastRecordedTime=i.tech_.currentTime(),h("off"))},this.clearSeekingAppendCheck_=function(){return h("off")},this.watchForBadSeeking_=function(){i.clearSeekingAppendCheck_(),h("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",o),this.tech_.on(qA,l),this.tech_.on("canplay",r),this.tech_.one("play",n),this.dispose=function(){i.clearSeekingAppendCheck_(),i.logger_("dispose"),i.tech_.off("waiting",o),i.tech_.off(qA,l),i.tech_.off("canplay",r),i.tech_.off("play",n),i.tech_.off("seeking",i.watchForBadSeeking_),i.tech_.off("seeked",i.clearSeekingAppendCheck_),d.forEach(function(m){c[m+"SegmentLoader_"].off("appendsdone",u[m].updateend),c[m+"SegmentLoader_"].off("playlistupdate",u[m].reset),i.tech_.off(["seeked","seeking"],u[m].reset)}),i.checkCurrentTimeTimeout_&&O.clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&O.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=O.setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(a){var i=this.masterPlaylistController_[a+"SegmentLoader_"];this[a+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+a+" loader"),this[a+"StalledDownloads_"]=0,this[a+"Buffered_"]=i.buffered_()},t.checkSegmentDownloads_=function(a){var i=this.masterPlaylistController_,n=i[a+"SegmentLoader_"],r=n.buffered_(),o=x2e(this[a+"Buffered_"],r);if(this[a+"Buffered_"]=r,o){this.resetSegmentDownloads_(a);return}this[a+"StalledDownloads_"]++,this.logger_("found #"+this[a+"StalledDownloads_"]+" "+a+" appends that did not increase buffer (possible stalled download)",{playlistId:n.playlist_&&n.playlist_.id,buffered:Fs(r)}),!(this[a+"StalledDownloads_"]<10)&&(this.logger_(a+" loader stalled download exclusion"),this.resetSegmentDownloads_(a),this.tech_.trigger({type:"usage",name:"vhs-"+a+"-download-exclusion"}),a!=="subtitle"&&i.blacklistCurrentPlaylist({message:"Excessive "+a+" segment downloading detected."},1/0))},t.checkCurrentTime_=function(){if(!(this.tech_.paused()||this.tech_.seeking())){var a=this.tech_.currentTime(),i=this.tech_.buffered();if(this.lastRecordedTime===a&&(!i.length||a+Mn>=i.end(i.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&a===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):a===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=a)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){var a=this.tech_.seeking();if(!a)return!1;var i=this.seekable(),n=this.tech_.currentTime(),r=this.afterSeekableWindow_(i,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow),o;if(r){var l=i.end(i.length-1);o=l}if(this.beforeSeekableWindow_(i,n)){var c=i.start(0);o=c+(c===i.end(0)?0:Mn)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+n+" with "+("seekable range "+jN(i)+". Seeking to ")+(o+".")),this.tech_.setCurrentTime(o),!0;for(var d=this.masterPlaylistController_.sourceUpdater_,u=this.tech_.buffered(),h=d.audioBuffer?d.audioBuffered():null,m=d.videoBuffer?d.videoBuffered():null,p=this.media(),f=p.partTargetDuration?p.partTargetDuration:(p.targetDuration-ts)*2,y=[h,m],b=0;b<y.length;b++)if(y[b]){var E=O1(y[b],n);if(E<f)return!1}var D=df(u,n);return D.length===0?!1:(o=D.start(0)+Mn,this.logger_("Buffered region starts ("+D.start(0)+") "+(" just beyond seek point ("+n+"). Seeking to "+o+".")),this.tech_.setCurrentTime(o),!0)},t.waiting_=function(){if(!this.techWaiting_()){var a=this.tech_.currentTime(),i=this.tech_.buffered(),n=Hl(i,a);if(n.length&&a+3<=n.end(0)){this.cancelTimer_(),this.tech_.setCurrentTime(a),this.logger_("Stopped at "+a+" while inside a buffered region "+("["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume ")+"playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"});return}}},t.techWaiting_=function(){var a=this.seekable(),i=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(a,i)){var n=a.end(a.length-1);return this.logger_("Fell out of live window at time "+i+". Seeking to "+("live point (seekable end) "+n)),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var r=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),l=this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:i});if(l)return this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var c=df(o,i);if(c.length>0){var d=c.start(0)-i;return this.logger_("Stopped at "+i+", setting timer for "+d+", seeking "+("to "+c.start(0))),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),d*1e3,i),!0}return!1},t.afterSeekableWindow_=function(a,i,n,r){if(r===void 0&&(r=!1),!a.length)return!1;var o=a.end(a.length-1)+Mn,l=!n.endList;return l&&r&&(o=a.end(a.length-1)+n.targetDuration*3),i>o},t.beforeSeekableWindow_=function(a,i){return!!(a.length&&a.start(0)>0&&i<a.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(a){var i=a.videoBuffered,n=a.audioBuffered,r=a.currentTime;if(i){var o;if(i.length&&n.length){var l=Hl(i,r-3),c=Hl(i,r),d=Hl(n,r);d.length&&!c.length&&l.length&&(o={start:l.end(0),end:d.end(0)})}else{var u=df(i,r);u.length||(o=this.gapFromVideoUnderflow_(i,r))}return o?(this.logger_("Encountered a gap in video from "+o.start+" to "+o.end+". "+("Seeking to current time "+r)),!0):!1}},t.skipTheGap_=function(a){var i=this.tech_.buffered(),n=this.tech_.currentTime(),r=df(i,n);this.cancelTimer_(),!(r.length===0||n!==a)&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",a,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+ts),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},t.gapFromVideoUnderflow_=function(a,i){for(var n=k2e(a),r=0;r<n.length;r++){var o=n.start(r),l=n.end(r);if(i-o<4&&i-o>2)return{start:o,end:l}}return null},e}(),Fve={errorInterval:30,getSource:function(e){var t=this.tech({IWillNotUseThisInPlugins:!0}),a=t.currentSource_||this.currentSource();return e(a)}},Vve=function e(t,a){var i=0,n=0,r=te.mergeOptions(Fve,a);t.ready(function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var o=function(){n&&t.currentTime(n)},l=function(h){h!=null&&(n=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",o),t.src(h),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},c=function(){if(Date.now()-i<r.errorInterval*1e3){t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),t.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){te.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return i=Date.now(),r.getSource.call(t,l)},d=function h(){t.off("loadedmetadata",o),t.off("error",c),t.off("dispose",h)},u=function(h){d(),e(t,h)};t.on("error",c),t.on("dispose",d),t.reloadSourceOnError=u},Uve=function(e){Vve(this,e)},WA="2.16.2",jve="6.0.1",zve="0.22.1",Hve="4.8.0",qve="3.1.3",va={PlaylistLoader:Wl,Playlist:$a,utils:$2e,STANDARD_PLAYLIST_SELECTOR:AA,INITIAL_PLAYLIST_SELECTOR:z1e,lastBandwidthSelector:AA,movingAverageBandwidthSelector:U1e,comparePlaylistBandwidth:X1,comparePlaylistResolution:V1e,xhr:rA()};Object.keys(ma).forEach(function(e){Object.defineProperty(va,e,{get:function(){return te.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),ma[e]},set:function(t){if(te.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),typeof t!="number"||t<0){te.log.warn("value of Vhs."+e+" must be greater than or equal to 0");return}ma[e]=t}})});var GA="videojs-vhs",KA=function(e,t){for(var a=t.media(),i=-1,n=0;n<e.length;n++)if(e[n].id===a.id){i=n;break}e.selectedIndex_=i,e.trigger({selectedIndex:i,type:"change"})},Wve=function(e,t){t.representations().forEach(function(a){e.addQualityLevel(a)}),KA(e,t.playlists)};va.canPlaySource=function(){return te.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Gve=function(e,t,a){if(!e)return e;var i={};t&&t.attributes&&t.attributes.CODECS&&(i=ff(On(t.attributes.CODECS))),a&&a.attributes&&a.attributes.CODECS&&(i.audio=a.attributes.CODECS);var n=Xd(i.video),r=Xd(i.audio),o={};for(var l in e)o[l]={},r&&(o[l].audioContentType=r),n&&(o[l].videoContentType=n),t.contentProtection&&t.contentProtection[l]&&t.contentProtection[l].pssh&&(o[l].pssh=t.contentProtection[l].pssh),typeof e[l]=="string"&&(o[l].url=e[l]);return te.mergeOptions(e,o)},Kve=function(e,t){return e.reduce(function(a,i){if(!i.contentProtection)return a;var n=t.reduce(function(r,o){var l=i.contentProtection[o];return l&&l.pssh&&(r[o]={pssh:l.pssh}),r},{});return Object.keys(n).length&&a.push(n),a},[])},Xve=function(e){var t=e.player,a=e.sourceKeySystems,i=e.audioMedia,n=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var r=i?n.concat([i]):n,o=Kve(r,Object.keys(a)),l=[],c=[];return o.forEach(function(d){c.push(new Promise(function(u,h){t.tech_.one("keysessioncreated",u)})),l.push(new Promise(function(u,h){t.eme.initializeMediaKeys({keySystems:d},function(m){if(m){h(m);return}u()})}))}),Promise.race([Promise.all(l),Promise.race(c)])},Jve=function(e){var t=e.player,a=e.sourceKeySystems,i=e.media,n=e.audioMedia,r=Gve(a,i,n);return r?(t.currentSource().keySystems=r,r&&!t.eme?(te.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},XA=function(){if(!O.localStorage)return null;var e=O.localStorage.getItem(GA);if(!e)return null;try{return JSON.parse(e)}catch{return null}},Yve=function(e){if(!O.localStorage)return!1;var t=XA();t=t?te.mergeOptions(t,e):e;try{O.localStorage.setItem(GA,JSON.stringify(t))}catch{return!1}return t},Qve=function(e){return e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(e.substring(e.indexOf(",")+1)):e};va.supportsNativeHls=function(){if(!le||!le.createElement)return!1;var e=le.createElement("video");if(!te.getTech("Html5").isSupported())return!1;var t=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return t.some(function(a){return/maybe|probably/i.test(e.canPlayType(a))})}(),va.supportsNativeDash=function(){return!le||!le.createElement||!te.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(le.createElement("video").canPlayType("application/dash+xml"))}(),va.supportsTypeNatively=function(e){return e==="hls"?va.supportsNativeHls:e==="dash"?va.supportsNativeDash:!1},va.isSupported=function(){return te.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Zve=te.getComponent("Component"),$1=function(e){Re(t,e);function t(i,n,r){var o;if(o=e.call(this,n,te.mergeOptions(r.hls,r.vhs))||this,r.hls&&Object.keys(r.hls).length&&te.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),typeof r.initialBandwidth=="number"&&(o.options_.bandwidth=r.initialBandwidth),o.logger_=Yi("VhsHandler"),n.options_&&n.options_.playerId){var l=te(n.options_.playerId);l.hasOwnProperty("hls")||Object.defineProperty(l,"hls",{get:function(){return te.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"hls-player-access"}),$e(o)},configurable:!0}),l.hasOwnProperty("vhs")||Object.defineProperty(l,"vhs",{get:function(){return te.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"vhs-player-access"}),$e(o)},configurable:!0}),l.hasOwnProperty("dash")||Object.defineProperty(l,"dash",{get:function(){return te.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),$e(o)},configurable:!0}),o.player_=l}if(o.tech_=n,o.source_=i,o.stats={},o.ignoreNextSeekingEvent_=!1,o.setOptions_(),o.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(o.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return o.on(le,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(c){var d=le.fullscreenElement||le.webkitFullscreenElement||le.mozFullScreenElement||le.msFullscreenElement;d&&d.contains(o.tech_.el())?o.masterPlaylistController_.fastQualityChange_():o.masterPlaylistController_.checkABR_()}),o.on(o.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),o.on(o.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),o.on(o.tech_,"play",o.play),o}var a=t.prototype;return a.setOptions_=function(){var i=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects!==!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=5*60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){var n=XA();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=ma.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===ma.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(r){typeof i.source_[r]<"u"&&(i.options_[r]=i.source_[r])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},a.src=function(i,n){var r=this;if(i){this.setOptions_(),this.options_.src=Qve(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=va,this.options_.sourceType=O6(n),this.options_.seekTo=function(c){r.tech_.setCurrentTime(c)},this.options_.smoothQualityChange&&te.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new Bve(this.options_);var o=te.mergeOptions({liveRangeSafeTimeDelta:Mn},this.options_,{seekable:function(){return r.seekable()},media:function(){return r.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new Rve(o),this.masterPlaylistController_.on("error",function(){var c=te.players[r.tech_.options_.playerId],d=r.masterPlaylistController_.error;typeof d=="object"&&!d.code?d.code=3:typeof d=="string"&&(d={message:d,code:3}),c.error(d)});var l=this.options_.experimentalBufferBasedABR?va.movingAverageBandwidthSelector(.55):va.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):l.bind(this),this.masterPlaylistController_.selectInitialPlaylist=va.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(c){this.masterPlaylistController_.selectPlaylist=c.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=c,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var c=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,d=O.navigator.connection||O.navigator.mozConnection||O.navigator.webkitConnection,u=1e7;if(this.options_.useNetworkInformationApi&&d){var h=d.downlink*1e3*1e3;h>=u&&c>=u?c=Math.max(c,h):c=h}return c},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=c,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var c=1/(this.bandwidth||1),d;this.throughput>0?d=1/this.throughput:d=0;var u=Math.floor(1/(c+d));return u},set:function(){te.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return r.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return r.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return r.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return r.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return r.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return r.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return r.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return r.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return r.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return r.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return r.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return r.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return r.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return Fs(r.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return r.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return r.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return r.tech_.name_},enumerable:!0},duration:{get:function(){return r.tech_.duration()},enumerable:!0},master:{get:function(){return r.playlists.master},enumerable:!0},playerDimensions:{get:function(){return r.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Fs(r.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return r.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){r.options_.useBandwidthFromLocalStorage&&Yve({bandwidth:r.bandwidth,throughput:Math.round(r.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){Lve(r)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){r.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=O.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},a.createKeySessions_=function(){var i=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Xve({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:n&&n.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){i.logger_("created EME key session"),i.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(r){i.logger_("error while creating EME key session",r),i.player_.error({message:"Failed to initialize media keys for EME",code:3})})},a.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},a.setupEme_=function(){var i=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,r=Jve({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:n&&n.media()});if(this.player_.tech_.on("keystatuschange",function(o){if(o.status==="output-restricted"){var l=i.masterPlaylistController_.master();if(!(!l||!l.playlists)){var c=[];if(l.playlists.forEach(function(u){u&&u.attributes&&u.attributes.RESOLUTION&&u.attributes.RESOLUTION.height>=720&&(!u.excludeUntil||u.excludeUntil<1/0)&&(u.excludeUntil=1/0,c.push(u))}),c.length){var d;(d=te.log).warn.apply(d,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(c)),i.masterPlaylistController_.fastQualityChange_()}}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),te.browser.IE_VERSION===11||!r){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},a.setupQualityLevels_=function(){var i=this,n=te.players[this.tech_.options_.playerId];!n||!n.qualityLevels||this.qualityLevels_||(this.qualityLevels_=n.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){Wve(i.qualityLevels_,i)}),this.playlists.on("mediachange",function(){KA(i.qualityLevels_,i.playlists)}))},t.version=function(){return{"@videojs/http-streaming":WA,"mux.js":jve,"mpd-parser":zve,"m3u8-parser":Hve,"aes-decrypter":qve}},a.version=function(){return this.constructor.version()},a.canChangeType=function(){return VA.canChangeType()},a.play=function(){this.masterPlaylistController_.play()},a.setCurrentTime=function(i){this.masterPlaylistController_.setCurrentTime(i)},a.duration=function(){return this.masterPlaylistController_.duration()},a.seekable=function(){return this.masterPlaylistController_.seekable()},a.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&O.URL.revokeObjectURL&&(O.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},a.convertToProgramTime=function(i,n){return s1e({playlist:this.masterPlaylistController_.media(),time:i,callback:n})},a.seekToProgramTime=function(i,n,r,o){return r===void 0&&(r=!0),o===void 0&&(o=2),o1e({programTime:i,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})},t}(Zve),gu={name:"videojs-http-streaming",VERSION:WA,canHandleSource:function(e,t){t===void 0&&(t={});var a=te.mergeOptions(te.options,t);return gu.canPlayType(e.type,a)},handleSource:function(e,t,a){a===void 0&&(a={});var i=te.mergeOptions(te.options,a);return t.vhs=new $1(e,t,i),te.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return te.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=rA(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){var a=O6(e);if(!a)return"";var i=gu.getOverrideNative(t),n=va.supportsTypeNatively(a),r=!n||i;return r?"maybe":""},getOverrideNative:function(e){e===void 0&&(e={});var t=e,a=t.vhs,i=a===void 0?{}:a,n=t.hls,r=n===void 0?{}:n,o=!(te.browser.IS_ANY_SAFARI||te.browser.IS_IOS),l=i.overrideNative,c=l===void 0?o:l,d=r.overrideNative,u=d===void 0?!1:d;return u||c}},$ve=function(){return Em("avc1.4d400d,mp4a.40.2")};if($ve()&&te.getTech("Html5").registerSourceHandler(gu,0),te.VhsHandler=$1,Object.defineProperty(te,"HlsHandler",{get:function(){return te.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),$1},configurable:!0}),te.VhsSourceHandler=gu,Object.defineProperty(te,"HlsSourceHandler",{get:function(){return te.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),gu},configurable:!0}),te.Vhs=va,Object.defineProperty(te,"Hls",{get:function(){return te.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),va},configurable:!0}),te.use||(te.registerComponent("Hls",va),te.registerComponent("Vhs",va)),te.options.vhs=te.options.vhs||{},te.options.hls=te.options.hls||{},!te.getPlugin||!te.getPlugin("reloadSourceOnError")){var eSe=te.registerPlugin||te.plugin;eSe("reloadSourceOnError",Uve)}/*! @name videojs-offset @version 2.1.3 @license MIT */var tSe="2.1.3",aSe={},iSe=te.registerPlugin||te.plugin,nSe=function e(){var t=this,a=this.currentTime();a<0&&(this.currentTime(0),this.play()),this._offsetEnd>0&&a>this._offsetEnd-this._offsetStart&&(this.off("timeupdate",e),this.pause(),this.trigger("ended"),this.one("play",function(){t.on("timeupdate",e)}),this._restartBeginning?(this.trigger("loadstart"),this.currentTime(0)):this.currentTime(this._offsetEnd-this._offsetStart))},rSe=function(e,t){e.one("play",function(){e.on("timeupdate",nSe)})},ev=function(e){var t=this;e=e||{};var a=this.constructor;this._offsetStart=parseFloat(e.start||"0"),this._offsetEnd=parseFloat(e.end||"0"),this._restartBeginning=e.restart_beginning||!1,(!a.__super__||!a.__super__.__offsetInit)&&(a.__super__={__offsetInit:!0,duration:a.prototype.duration,currentTime:a.prototype.currentTime,bufferedPercent:a.prototype.bufferedPercent,remainingTime:a.prototype.remainingTime,buffered:a.prototype.buffered},a.prototype.duration=function(){return this._offsetEnd!==void 0&&this._offsetStart!==void 0?this._offsetEnd>0?this._offsetEnd-this._offsetStart:a.__super__.duration.apply(this,arguments)-this._offsetStart:a.__super__.duration.apply(this,arguments)},a.prototype.currentTime=function(i){if(i!==void 0)return this._offsetStart!==void 0?a.__super__.currentTime.call(this,i+this._offsetStart):a.__super__.currentTime.call(this,i);if(this._offsetStart!==void 0){var n=a.__super__.currentTime.apply(this)-this._offsetStart;return this.getCache().currentTime=n,n}return a.__super__.currentTime.apply(this)},a.prototype.remainingTime=function(){return this.duration()-this.currentTime()},a.prototype.startOffset=function(){return this._offsetStart},a.prototype.endOffset=function(){return this._offsetEnd>0?this._offsetEnd:this.duration()},a.prototype.buffered=function(){for(var i=a.__super__.buffered.call(this),n=[],r=0;r<i.length;r++)n[r]=[Math.max(0,i.start(r)-this._offsetStart),Math.min(Math.max(0,i.end(r)-this._offsetStart),this.duration())];return te.createTimeRanges(n)}),this.ready(function(){rSe(t,te.mergeOptions(aSe,e))})};iSe("offset",ev),ev.VERSION=tSe;const sSe=[{name:"",color:"#26C6DA",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol"},{name:"",color:"#FFFF00",points:[1,2,3],categories:[510],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal",singleName:"Tiro a gol"},{name:"",color:"#9933FF",points:[1,2,3],categories:[537,540,544,547],translationKey:"chalkboard.offensive.team.shots_on_goal_2",singleName:"Tiro a gol (portería)"},{name:"",color:"#FFA726",points:[1,2,3],categories:[13,25],translationKey:"chalkboard.offensive.team.center_crosses",singleName:"Centro"},{name:"",color:"#4DB6AC",points:[1,2,3],categories:[98,101,104,105,109,112,115,116],translationKey:"chalkboard.offensive.team.successful_center_crosses",singleName:"Centro acertado"},{name:"",color:"#F06292",points:[1,2],categories:[11],translationKey:"chalkboard.offensive.team.balls_won_opponent_penalty_box",singleName:"Balón ganado"},{name:"",color:"#3A3838",points:[1],categories:[4],translationKey:"chalkboard.offensive.team.successful_1_on_1_attacking",singleName:"1 vs 1 ofensivo"},{name:"",color:"#00B050",points:[1],categories:[208],translationKey:"chalkboard.offensive.team.unsuccessful_1_on_1_attacking",singleName:"1 vs 1 ofensivo"}],oSe=[{name:"",color:"#26C6DA",points:[1,2,3],categories:["57_r","326_r","56_r","60_r","59_r","55_r",35,54],invert:[57,326,56,60,59,55],negative:!1,translationKey:"chalkboard.defensive.team.goals_received",singleName:"Gol recibido"},{name:"",color:"#FFFF00",points:[1,2,3],categories:["510_r"],invert:[510],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"},{name:"",color:"#9933FF",points:[1,2,3],categories:["537_r","540_r","544_r","547_r"],invert:[537,540,544,547],translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"},{name:"",color:"#FFA726",points:[1,2,3],categories:["13_r","25_r"],invert:[13,25],translationKey:"chalkboard.defensive.team.total_centers_received",singleName:"Centro recibido"},{name:"",color:"#4DB6AC",points:[1,2,3],categories:["98_r","101_r","104_r","105_r","109_r","112_r","115_r","116_r"],invert:[98,101,104,105,109,112,115,116],translationKey:"chalkboard.defensive.team.successful_centers_by_opponent",singleName:"Centro acertado"},{name:"",color:"#00FF00",points:[1,2,3],categories:["33_r"],invert:[33],translationKey:"chalkboard.defensive.team.offsides_caused",singleName:"Fuera de lugar"},{name:"",color:"#FF3399",points:[1,2],categories:[483],translationKey:"chalkboard.defensive.team.balls_recovered_in_challenge",singleName:"Balón recuperado"},{name:"",color:"#B4005A",points:[1,2],categories:[484],translationKey:"chalkboard.defensive.team.balls_recovered_without_challenge",singleName:"Balón recuperado"},{name:"",color:"#3A3838",points:[1],categories:[5],translationKey:"chalkboard.defensive.team.successful_1_on_1",singleName:"1 vs 1 defensivo"},{name:"",color:"#00B050",points:[1],categories:[209],translationKey:"chalkboard.defensive.team.unsuccessful_1_on_1",singleName:"1 vs 1 defensivo"},{name:"",color:"#305496",points:[1,2],categories:[23],translationKey:"chalkboard.defensive.team.balls_won_own_penalty_box",singleName:"Balón ganado"},{name:"",color:"#FF9966",points:[1,2,3],categories:[24],translationKey:"chalkboard.defensive.team.arial_game_rest_pitch",singleName:"Juego aéreo"},{name:"",color:"#700000",points:[1],categories:[518],translationKey:"chalkboard.defensive.team.slide_tackles",singleName:"Barrida"},{name:"",color:"#CC0000",points:[1],categories:[34],translationKey:"chalkboard.defensive.team.clearances",singleName:"Rechace"}],lSe=[{id:1,category:"featured_players.possession.successful_passes",category_id:[2,20],singleName:"Pase acertado"},{id:2,category:"featured_players.possession.successful_passes_opponents_half",category_id:[20],singleName:"Pase acertado c. rival"},{id:3,category:"featured_players.possession.successful_passes_own_half",category_id:[2],singleName:"Pase acertado c. propia"},{id:4,category:"featured_players.possession.recovered_balls",category_id:[482],singleName:"Balón recuperado"},{id:5,category:"featured_players.possession.balls_recovered_in_challenge",category_id:[485,486,489,490],singleName:"B. recuperado en disputa"}],cSe=[{id:1,category:"featured_players.offensive.shots_on_goal",category_id:[510],singleName:"Tiro a gol"},{id:2,category:"featured_players.offensive.centers_from_right",category_id:[25],singleName:"Centro por derecha"},{id:3,category:"featured_players.offensive.centers_from_left",category_id:[13],singleName:"Centro por izquierda"},{id:4,category:"featured_players.offensive.successful_1_on_1",category_id:[4],singleName:"1 vs 1 exitoso ofensivo"},{id:5,category:"featured_players.offensive.balls_won_opponent_penalty_box",category_id:[11],singleName:"B. ganado en área rival"}],dSe=[{id:1,category:"featured_players.defensive.balls_recovered",category_id:[482],singleName:"Balón recuperado"},{id:19,category:"featured_players.defensive.balls_recovered_opponents_half",category_id:[491,492,487,488],singleName:"B. recuperado C. rival"},{id:3,category:"featured_players.defensive.balls_won_own_penalty_box",category_id:[23],singleName:"B. ganado área propia"},{id:4,category:"featured_players.defensive.clearances",category_id:[34],singleName:"Rechace"},{id:5,category:"featured_players.defensive.successful_1_on_1",category_id:[5],singleName:"1 vs 1 exitoso defensivo"}],uSe=function(){const e=[...lSe,...cSe,...dSe];return e.forEach(t=>{t.categories=t.category_id}),e}(),hSe=[{name:"",color:"#26C6DA",points:[1,2,3],categories:[12],negative:!1,translationKey:"chalkboard.offensive.player.goals"},{name:"",color:"#305496",points:[1,2,3],categories:[10],negative:!1,translationKey:"chalkboard.offensive.player.assists"},{name:"",color:"#000066",points:[1,2,3],categories:[27],translationKey:"chalkboard.offensive.player.participation_in_goals"},{name:"",color:"#FFFF00",points:[1,2,3],categories:[510],translationKey:"chalkboard.offensive.player.shots_on_goal"},{name:"",color:"#9933FF",points:[1,2,3],categories:[537,540,544,547],translationKey:"chalkboard.offensive.player.shots_on_goal_2"},{name:"",color:"#FFA726",points:[1,2,3],categories:[13,25],translationKey:"chalkboard.offensive.player.center_crosses"},{name:"",color:"#4DB6AC",points:[1,2,3],categories:[98,101,104,105,109,112,115,116],translationKey:"chalkboard.offensive.player.successful_center_crosses"},{name:"",color:"#F06292",points:[1,2],categories:[11],translationKey:"chalkboard.offensive.player.balls_won_opponent_penalty_box"},{name:"",color:"#3A3838",points:[1],categories:[4],translationKey:"chalkboard.offensive.player.successful_1_on_1_attacking"},{name:"",color:"#00B050",points:[1],categories:[208],translationKey:"chalkboard.offensive.player.unsuccessful_1_on_1_attacking"}],pSe=[{name:"",color:"#F06292",points:[1,2,3],categories:[44],translationKey:"chalkboard.offensive.goalkeeper.footwork"},{name:"",color:"#9C27B0",points:[1,2],categories:[302],translationKey:"chalkboard.offensive.goalkeeper.throw"},{name:"",color:"#455A64",points:[1,2],categories:[303],translationKey:"chalkboard.offensive.goalkeeper.punt"},{name:"",color:"#000066",points:[1,2,3],categories:[323],translationKey:"chalkboard.offensive.goalkeeper.participation_in_goals"},{name:"",color:"#305496",points:[1,2],categories:[324],translationKey:"chalkboard.offensive.goalkeeper.assist"},{name:"",color:"#FFA726",points:[1,2],categories:[264],translationKey:"chalkboard.offensive.goalkeeper.goal_kick"}],mSe=[...hSe,...pSe],fSe=[{name:"",color:"#F06292",points:[1,2],categories:[483],translationKey:"chalkboard.defensive.player.balls_recovered_in_challenge",singleName:"Balón recuperado"},{name:"",color:"#B4005A",points:[1,2],categories:[484],translationKey:"chalkboard.defensive.player.balls_recovered_without_challenge",singleName:"Balón recuperado"},{name:"",color:"#455A64",points:[1],categories:[5],translationKey:"chalkboard.defensive.player.successful_1_on_1",singleName:"1 vs 1 exitoso defensivo"},{name:"",color:"#4CAF50",points:[1],categories:[209],translationKey:"chalkboard.defensive.player.unsuccessful_1_on_1",singleName:"1 vs 1 no exitoso defensivo"},{name:"",color:"#305496",points:[1,2],categories:[23],translationKey:"chalkboard.defensive.player.balls_won_own_penalty_box",singleName:"Balón ganado"},{name:"",color:"#FFA726",points:[1,2,3],categories:[517],translationKey:"chalkboard.defensive.player.allowed_crosses",singleName:"Juego aéreo resto del campo"},{name:"",color:"#700000",points:[1],categories:[34],translationKey:"chalkboard.defensive.player.clearances",singleName:"Rechace"},{name:"",color:"#CC0000",points:[1],categories:[518],translationKey:"chalkboard.defensive.player.slide_tackles",singleName:"Barrida"}],gSe=[{name:"",color:"#26C6DA",points:[1,2,3],categories:[40],translationKey:"chalkboard.defensive.goalkeeper.goals_received",singleName:"Gol recibido"},{name:"",color:"#F06292",points:[1,2],categories:[39],translationKey:"chalkboard.defensive.goalkeeper.saves",singleName:"Atajada"},{name:"",color:"#455A64",points:[1,2],categories:[42],translationKey:"chalkboard.defensive.goalkeeper.successful_aerial_game",singleName:"Juego aéreo exitoso"},{name:"",color:"#4CAF50",points:[1,2,3],categories:[43],translationKey:"chalkboard.defensive.goalkeeper.unsuccessful_aerial_game",singleName:"Juego aéreo no exitoso"},{name:"",color:"#FFF176",points:[1],categories:[41],translationKey:"chalkboard.defensive.goalkeeper.1_on_1",singleName:"1 vs 1"},{name:"",color:"#FFA726",points:[1],categories:[312],translationKey:"chalkboard.defensive.goalkeeper.recovered_balls",singleName:"Balón recuperado"}],ySe=[...fSe,...gSe],_Se=[{category:"PASES ACERTADOS",categoryIds:null,translationKey:"table.possession.team.successful_passes",singleName:"Pase acertado",generalName:"Pases acertados",items:[{category:"PASES ACERTADOS EN 1/4",categoryIds:[213],translationKey:"table.possession.team.successful_passes_1/4",singleName:"Pase acertado en 1/4",generalName:"Pases acertados en 1/4"},{category:"PASES ACERTADOS EN 2/4",categoryIds:[214],translationKey:"table.possession.team.successful_passes_2/4",singleName:"Pase acertado en 2/4",generalName:"Pases acertados en 2/4"},{category:"PASES ACERTADOS EN 3/4",categoryIds:[215],translationKey:"table.possession.team.successful_passes_3/4",singleName:"Pase acertado en 3/4",generalName:"Pases acertados en 3/4"},{category:"PASES ACERTADOS EN 4/4",categoryIds:[216],translationKey:"table.possession.team.successful_passes_4/4",singleName:"Pase acertado en 4/4",generalName:"Pases acertados en 4/4"}]},{category:"PASES FILTRADOS",categoryIds:[217],translationKey:"table.possession.team.through_passes",singleName:"Pase filtrado",generalName:"Pases filtrados"},{category:"PASES NO ACERTADOS",categoryIds:null,translationKey:"table.possession.team.unsuccessful_passes",generalName:"Pases no acertados",singleName:"Pase no acertado",items:[{category:"PASES NO ACERTADOS EN 1/4",categoryIds:[218],translationKey:"table.possession.team.unsuccessful_passes_1/4",generalName:"Pases no acertados en 1/4",singleName:"Pase no acertado en 1/4"},{category:"PASES NO ACERTADOS EN 2/4",categoryIds:[219],translationKey:"table.possession.team.unsuccessful_passes_2/4",generalName:"Pases no acertados en 2/4",singleName:"Pase no acertado en 2/4"},{category:"PASES NO ACERTADOS EN 3/4",categoryIds:[220],translationKey:"table.possession.team.unsuccessful_passes_3/4",generalName:"Pases no acertados en 3/4",singleName:"Pase no acertado en 3/4"},{category:"PASES NO ACERTADOS EN 4/4",categoryIds:[221],translationKey:"table.possession.team.unsuccessful_passes_4/4",generalName:"Pases no acertados en 4/4",singleName:"Pase no acertado en 4/4"}]},{category:"BALONES RECUPERADOS EN DISPUTA",categoryIds:null,translationKey:"table.possession.team.ball_recovered_in_challenge",generalName:"Balones recuperados en disputa",singleName:"Balón recuperado en disputa",items:[{category:"B.R.E.D CANCHA PROPIA",categoryIds:[485,486],translationKey:"table.possession.team.b_r_i_c_own_half",generalName:"B.R.E.D cancha propia",singleName:"B.R.E.D cancha propia"},{category:"B.R.E.D CANCHA RIVAL",categoryIds:[487,488],translationKey:"table.possession.team.b_r_i_c_opponents_half",generalName:"B.R.E.D cancha rival",singleName:"B.R.E.D cancha rival"}]},{category:"BALONES RECUPERADOS SIN DISPUTA",categoryIds:null,translationKey:"table.possession.team.ball_recovered_without_challenge",generalName:"Balones recuperados sin disputa",singleName:"Balon recuperado sin disputa",items:[{category:"B.R.S.D CANCHA PROPIA",categoryIds:[489,490],translationKey:"table.possession.team.b_r_w_c_own_half",generalName:"B.R.S.D cancha propia",singleName:"B.R.S.D cancha propia"},{category:"B.R.S.D CANCHA RIVAL",categoryIds:[491,492],translationKey:"table.possession.team.b_r_w_c_opponents_half",generalName:"B.R.S.D cancha rival",singleName:"B.R.S.D cancha rival"}]},{category:"BALONES PERDIDOS EN DISPUTA",categoryIds:null,translationKey:"table.possession.team.balls_lost_in_challenge",generalName:"Balones perdidos en disputa",singleName:"Balon perdido en disputa",items:[{category:"B.P.E.D. CANCHA PROPIA",categoryIds:[496,497],translationKey:"table.possession.team.b_l_i_c_own_half",generalName:"B.P.E.D. cancha propia",singleName:"B.P.E.D. cancha propia"},{category:"B.P.E.D. CANCHA RIVAL",categoryIds:[498,499],translationKey:"table.possession.team.b_l_i_c_opponents_half",generalName:"B.P.E.D. cancha rival",singleName:"B.P.E.D. cancha rival"}]},{category:"BALONES PERDIDOS SIN DISPUTA",categoryIds:null,translationKey:"table.possession.team.balls_lost_without_challenge",generalName:"Balones perdidos sin disputa",singleName:"Balon perdido sin disputa",items:[{category:"B.P.S.D. CANCHA PROPIA",categoryIds:[500,501],translationKey:"table.possession.team.b_l_w_c_own_half",generalName:"B.P.S.D. cancha propia",singleName:"B.P.S.D. cancha propia"},{category:"B.P.S.D. CANCHA RIVAL",categoryIds:[502,503],translationKey:"table.possession.team.b_l_w_c_opponents_half",generalName:"B.P.S.D. cancha rival",singleName:"B.P.S.D. cancha rival"}]}],bSe=[{category:"GOLES",categoryIds:null,translationKey:"table.offensive.team.goals",generalName:"Goles",singleName:"Gol",items:[{category:"GOLES PIE DENTRO DEL ÁREA",categoryIds:[57],translationKey:"table.offensive.team.goals_foot_inside_penalty",generalName:"Goles pie dentro del área",singleName:"Gol pie dentro del área"},{category:"GOLES PIE FUERA DEL ÁREA",categoryIds:[326],translationKey:"table.offensive.team.goals_foot_outside_penalty",generalName:"Goles pie fuera del área",singleName:"Gol pie fuera del área"},{category:"GOLES CABEZA",categoryIds:[56],translationKey:"table.offensive.team.header_goals",generalName:"Goles cabeza",singleName:"Gol cabeza"},{category:"GOLES TIRO LIBRE",categoryIds:[60],translationKey:"table.offensive.team.free_kick_goals",generalName:"Goles tiro libre",singleName:"Gol tiro libre"},{category:"GOLES PENAL",categoryIds:[59],translationKey:"table.offensive.team.penalty_goals",generalName:"Goles penal",singleName:"Gol penal"},{category:"GOLES DE PORTERO",categoryIds:[55],translationKey:"table.offensive.team.goalkeeper_goals",generalName:"Goles de portero",singleName:"Gol de portero"},{category:"AUTOGOLES",rCategoryIds:[35,54],translationKey:"table.offensive.team.opponents_own_goals",generalName:"Autogoles a favor",singleName:"Autogol"}]},{category:"TIROS A GOL (ORIGEN)",categoryIds:null,translationKey:"table.offensive.team.shots_on_goal_from",generalName:"Tiros a gol (origen)",singleName:"Tiro a gol (origen)",items:[{category:"DENTRO DEL ÁREA",categoryIds:[514,516],translationKey:"table.offensive.team.inside_the_box",generalName:"Tiros a gol dentro del área",singleName:"Tiro a gol dentro del área"},{category:"FUERA DEL ÁREA",categoryIds:[513,515],translationKey:"table.offensive.team.outside_the_box",generalName:"Tiros a gol fuera del área",singleName:"Tiro a gol fuera del área"}]},{category:"TIROS A GOL (DESTINO)",categoryIds:null,translationKey:"table.offensive.team.shots_on_goal_to",generalName:"Tiros a gol (destino)",singleName:"Tiro a gol (destino)",items:[{category:"CON DESTINO A PORTERÍA",generalName:"Tiros a gol con destino a portería",categoryIds:[537,540,544,547],translationKey:"table.offensive.team.shots_on_goal"},{category:"SIN DESTINO A PORTERÍA",generalName:"Tiros a gol sin destino a portería",categoryIds:[538,541,545,548],translationKey:"table.offensive.team.not_to_destiny"},{category:"BLOQUEADOS",generalName:"Tiros a gol bloqueados",categoryIds:[539,542,546,549],items:null,categoriesTypes:[2,3],translationKey:"table.offensive.team.blocked"}]},{category:"CENTROS POR IZQUIERDA",singleName:"Centro por izquierda",categoryIds:null,translationKey:"table.offensive.team.centers_from_left",items:[{category:"C.P.I. ACERTADOS",singleName:"C.P.I. acertado",categoryIds:[98,101,104,105],translationKey:"table.offensive.team.successful_c_f_l_s"},{category:"C.P.I. NO ACERTADOS",categoryIds:[106,107,108],translationKey:"table.offensive.team.unsuccessful_c_f_l_s"}]},{category:"CENTROS POR DERECHA",categoryIds:null,translationKey:"table.offensive.team.centers_from_right",items:[{category:"C.P.D. ACERTADOS",categoryIds:[109,112,115,116],translationKey:"table.offensive.team.successful_c_f_r_s"},{category:"C.P.D. NO ACERTADOS",categoryIds:[117,118,119],translationKey:"table.offensive.team.unsuccessful_c_f_r_s"}]},{category:"BALONES GANADOS EN ÁREA RIVAL",categoryIds:[11],translationKey:"table.offensive.team.balls_won_opponents_penalty"}],vSe=[{category:"GOLES RECIBIDOS",categoryIds:null,translationKey:"table.defensive.team.goals_received",items:[{category:"GOLES PIE DENTRO DEL ÁREA",rCategoryIds:[57],translationKey:"table.defensive.team.goals_foot_inside_penalty"},{category:"GOLES PIE FUERA DEL ÁREA",rCategoryIds:[326],translationKey:"table.defensive.team.goals_foot_outside_penalty"},{category:"GOLES DE CABEZA",rCategoryIds:[56],translationKey:"table.defensive.team.header_goals"},{category:"GOLES DE TIRO LIBRE",rCategoryIds:[60],translationKey:"table.defensive.team.free_kick_goals"},{category:"GOLES DE PENAL",rCategoryIds:[59],translationKey:"table.defensive.team.penalty_goals"},{category:"GOLES DE PORTERO RECIBIDOS",rCategoryIds:[55],translationKey:"table.defensive.team.goalkeeper_goals"},{category:"AUTOGOLES",categoryIds:[35,54],translationKey:"table.defensive.team.opponents_own_goals"}]},{category:"TIROS A GOL RECIBIDOS (ORIGEN)",categoryIds:null,translationKey:"table.defensive.team.shots_on_goal_from",items:[{category:"DENTRO DEL ÁREA",generalName:"Tiros a gol recibidos dentro del área",rCategoryIds:[514,516],translationKey:"table.defensive.team.inside_the_box"},{category:"FUERA DEL ÁREA",generalName:"Tiros a gol recibidos fuera del área",rCategoryIds:[513,515],translationKey:"table.defensive.team.outside_the_box"}]},{category:"TIROS A GOL RECIBIDOS (DESTINO)",categoryIds:null,translationKey:"table.defensive.team.shots_on_goal_to",items:[{category:"CON DESTINO A PORTERÍA",rCategoryIds:[537,540,544,547],translationKey:"table.defensive.team.shot_on_goal",generalName:"Tiros a gol recibidos con destino a portería"},{category:"SIN DESTINO A PORTERÍA",rCategoryIds:[538,541,545,548],translationKey:"table.defensive.team.missed",generalName:"Tiros a gol recibidos sin destino a portería"},{category:"BLOQUEADOS",categoryIds:null,rCategoryIds:[539,542,546,549],translationKey:"table.defensive.team.blocked",generalName:"Tiros a gol recibidos bloqueados"}]},{category:"CENTROS POR IZQUIERDA RECIBIDOS",categoryIds:null,translationKey:"table.defensive.team.centers_left_side_received",items:[{category:"C.P.I.R. ACERTADOS",rCategoryIds:[109,112,115,116],translationKey:"table.defensive.team.successful_c_f_l_r"},{category:"C.P.I.R. NO ACERTADOS",rCategoryIds:[117,118,119],translationKey:"table.defensive.team.unsuccessful_c_f_l_r"}]},{category:"CENTROS POR DERECHA RECIBIDOS",categoryIds:null,translationKey:"table.defensive.team.centers_right_side_received",items:[{category:"C.P.D.R. ACERTADOS",rCategoryIds:[98,101,104,105],translationKey:"table.defensive.team.successful_c_f_r_r"},{category:"C.P.D.R. NO ACERTADOS",rCategoryIds:[106,107,108],translationKey:"table.defensive.team.unsuccessful_c_f_r_r"}]},{category:"BALONES RECUPERADOS CANCHA RIVAL",categoryIds:null,translationKey:"table.defensive.team.balls_recovered_opponents_half",items:[{category:"B.R.C.R. EN DISPUTA",categoryIds:[487,488],translationKey:"table.defensive.team.b_r_o_h_in_challenge"},{category:"B.R.C.R. SIN DISPUTA",categoryIds:[491,492],translationKey:"table.defensive.team.b_r_o_h_without_challenge"}]},{category:"BALONES RECUPERADOS CANCHA PROPIA",categoryIds:null,translationKey:"table.defensive.team.balls_recovered_own_half",items:[{category:"B.R.C.P. EN DISPUTA",categoryIds:[485,486],translationKey:"table.defensive.team.b_r_own_h_in_challenge"},{category:"B.R.C.P. SIN DISPUTA",categoryIds:[489,490],translationKey:"table.defensive.team.b_r_own_h_without_challenge"}]}],SSe=function(){let e=[];return e=e.concat(Xn(_Se)),e=e.concat(Xn(bSe)),e=e.concat(Xn(vSe)),e}(),wSe=[{category:"PASES ACERTADOS",categoryIds:null,translationKey:"table.possession.player.successful_passes",items:[{category:"P. ACERTADOS 1/4",categoryIds:[213],translationKey:"table.possession.player.successful_passes_1/4"},{category:"P. ACERTADOS 2/4",categoryIds:[214],translationKey:"table.possession.player.successful_passes_2/4"},{category:"P. ACERTADOS 3/4",categoryIds:[215],translationKey:"table.possession.player.successful_passes_3/4"},{category:"P. ACERTADOS 4/4",categoryIds:[216],translationKey:"table.possession.player.successful_passes_4/4"}]},{category:"PASES FILTRADOS",categoryIds:[217],translationKey:"table.possession.player.through_passes"},{category:"PASES NO ACERTADOS",categoryIds:null,translationKey:"table.possession.player.unsuccessful_passes",items:[{category:"P. NO ACERTADOS 1/4",categoryIds:[218],translationKey:"table.possession.player.unsuccessful_passes_1/4"},{category:"P. NO ACERTADOS 2/4",categoryIds:[219],translationKey:"table.possession.player.unsuccessful_passes_2/4"},{category:"P. NO ACERTADOS 3/4",categoryIds:[220],translationKey:"table.possession.player.unsuccessful_passes_3/4"},{category:"P. NO ACERTADOS 4/4",categoryIds:[221],translationKey:"table.possession.player.unsuccessful_passes_4/4"}]},{category:"BALONES RECUPERADOS EN DISPUTA",categoryIds:null,translationKey:"table.possession.player.ball_recovered_in_challenge",items:[{category:"B.R.E.D CANCHA PROPIA",categoryIds:[485,486],translationKey:"table.possession.player.b_r_i_c_own_half"},{category:"B.R.E.D CANCHA RIVAL",categoryIds:[487,488],translationKey:"table.possession.player.b_r_i_c_opponents_half"}]},{category:"BALONES RECUPERADOS SIN DISPUTA",categoryIds:null,translationKey:"table.possession.player.ball_recovered_without_challenge",items:[{category:"B.R.S.D CANCHA PROPIA",categoryIds:[489,490],translationKey:"table.possession.player.b_r_w_c_own_half"},{category:"B.R.S.D CANCHA RIVAL",categoryIds:[491,492],translationKey:"table.possession.player.b_r_w_c_opponents_half"}]},{category:"BALONES PERDIDOS EN DISPUTA",categoryIds:null,translationKey:"table.possession.player.balls_lost_in_challenge",items:[{category:"B.P.E.D. CANCHA PROPIA",categoryIds:[496,497],translationKey:"table.possession.player.b_l_i_c_own_half"},{category:"B.P.E.D. CANCHA RIVAL",categoryIds:[498,499],translationKey:"table.possession.player.b_l_i_c_opponents_half"}]},{category:"BALONES PERDIDOS SIN DISPUTA",categoryIds:null,translationKey:"table.possession.player.balls_lost_without_challenge",items:[{category:"B.P.S.D. CANCHA PROPIA",categoryIds:[500,501],translationKey:"table.possession.player.b_l_w_c_own_half"},{category:"B.P.S.D. CANCHA RIVAL",categoryIds:[502,503],translationKey:"table.possession.player.b_l_w_c_opponents_half"}]}],TSe=[{category:"GOLES",categoryIds:null,translationKey:"table.offensive.player.goals",items:[{category:"GOLES PIE DENTRO DEL ÁREA",categoryIds:[57],translationKey:"table.offensive.player.goals_foot_inside_penalty"},{category:"GOLES PIE FUERA DEL ÁREA",categoryIds:[326],translationKey:"table.offensive.player.goals_foot_outside_penalty"},{category:"GOLES CABEZA",categoryIds:[56],translationKey:"table.offensive.player.header_goals"},{category:"GOLES TIRO LIBRE",categoryIds:[60],translationKey:"table.offensive.player.free_kick_goals"},{category:"GOLES PENAL",categoryIds:[59],translationKey:"table.offensive.player.penalty_goals"}]},{category:"TIROS A GOL (ORIGEN)",categoryIds:null,translationKey:"table.offensive.player.shots_on_goal_from",items:[{category:"DENTRO DEL ÁREA",categoryIds:[514,516],translationKey:"table.offensive.player.inside_the_box",generalName:"Tiros a gol dentro del área"},{category:"FUERA DEL ÁREA",categoryIds:[513,515],translationKey:"table.offensive.player.outside_the_box",generalName:"Tiros a gol fuera del área"}]},{category:"TIROS A GOL (DESTINO)",categoryIds:null,translationKey:"table.offensive.player.shots_on_goal_to",items:[{category:"CON DESTINO A PORTERÍA",categoryIds:[537,540,544,547],translationKey:"table.offensive.player.shots_on_goal",generalName:"Tiros a gol con destino a portería"},{category:"SIN DESTINO A PORTERÍA",categoryIds:[538,541,545,548],translationKey:"table.offensive.player.not_to_destiny",generalName:"Tiros a gol sin destino a portería"},{category:"BLOQUEADOS",categoryIds:[539,542,546,549],translationKey:"table.offensive.player.blocked",generalName:"Tiros a gol bloqueados"}]},{category:"CENTROS POR IZQUIERDA",categoryIds:null,translationKey:"table.offensive.player.centers_from_left",items:[{category:"C.P.I. ACERTADOS",categoryIds:[98,101,104,105],translationKey:"table.offensive.player.successful_c_f_l_s"},{category:"C.P.I. NO ACERTADOS",categoryIds:[106,107,108],translationKey:"table.offensive.player.unsuccessful_c_f_l_s"}]},{category:"CENTROS POR DERECHA",categoryIds:null,translationKey:"table.offensive.player.centers_from_right",items:[{category:"C.P.D. ACERTADOS",categoryIds:[109,112,115,116],translationKey:"table.offensive.player.successful_c_f_r_s"},{category:"C.P.D. NO ACERTADOS",categoryIds:[117,118,119],translationKey:"table.offensive.player.unsuccessful_c_f_r_s"}]},{category:"BALONES GANADOS EN ÁREA RIVAL",categoryIds:[11],translationKey:"table.offensive.player.balls_won_opponents_penalty"}],CSe=[{category:"BALONES RECUPERADOS CANCHA RIVAL",categoryIds:null,translationKey:"table.defensive.player.balls_recovered_opponents_half",items:[{category:"B.R.C.R. EN DISPUTA",categoryIds:[487,488],translationKey:"table.defensive.player.b_r_o_h_in_challenge"},{category:"B.R.C.R. SIN DISPUTA",categoryIds:[491,492],translationKey:"table.defensive.player.b_r_o_h_without_challenge"}]},{category:"BALONES RECUPERADOS CANCHA PROPIA",categoryIds:null,translationKey:"table.defensive.player.balls_recovered_own_half",items:[{category:"B.R.C.P. EN DISPUTA",categoryIds:[485,486],translationKey:"table.defensive.player.b_r_own_h_in_challenge"},{category:"B.R.C.P. SIN DISPUTA",categoryIds:[489,490],translationKey:"table.defensive.player.b_r_own_h_without_challenge"}]},{category:"BALONES GANADOS EN ÁREA PROPIA",categoryIds:[23],items:null,translationKey:"table.defensive.player.balls_won_own_penalty_box"},{category:"1 VS 1 EXITOSOS",categoryIds:null,translationKey:"table.defensive.player.successful_1_on_1",items:[{category:"OFENSIVOS",categoryIds:[4],translationKey:"table.defensive.player.attacking",generalName:"1 vs 1 exitoso Ofensivo"},{category:"DEFENSIVOS",categoryIds:[5],translationKey:"table.defensive.player.defensive",generalName:"1 vs 1 exitoso Defensivo"}]},{category:"BARRIDAS",categoryIds:null,translationKey:"table.defensive.player.slide_tackles",items:[{category:"CON POSESIÓN",categoryIds:[521],translationKey:"table.defensive.player.with_possession",generalName:"Barridas con posesión"},{category:"SIN POSESIÓN",categoryIds:[522],translationKey:"table.defensive.player.without_possession",generalName:"Barridas sin posesión"},{category:"PROVOCA FALTA",categoryIds:[543],translationKey:"table.defensive.player.with_foul_committed",generalName:"Barridas que provocan falta"}]},{category:"CENTROS PERMITIDOS",categoryIds:[517],items:null,translationKey:"table.defensive.player.allow_crosses"},{category:"RECHACES",categoryIds:[34],items:null,translationKey:"table.defensive.player.clearances"}],kSe=function(){let e=[];return e=e.concat(Xn(wSe)),e=e.concat(Xn(TSe)),e=e.concat(Xn(CSe)),e}(),ESe=[{category:"",categoryIds:null,translationKey:"table.possession.goalkeeper.footwork",items:[{category:"",categoryIds:[310],translationKey:"table.possession.goalkeeper.successful_long_pass"},{category:"",categoryIds:[311],translationKey:"table.possession.goalkeeper.unsuccessful_long_pass"},{category:"",categoryIds:[308],translationKey:"table.possession.goalkeeper.successful_short_pass"},{category:"",categoryIds:[309],translationKey:"table.possession.goalkeeper.unsuccessful_short_pass"}]},{category:"",categoryIds:null,translationKey:"table.possession.goalkeeper.throw",items:[{category:"",categoryIds:[304],translationKey:"table.possession.goalkeeper.successful_throw"},{category:"",categoryIds:[305],translationKey:"table.possession.goalkeeper.unsuccessful_throw"}]},{category:"",categoryIds:null,translationKey:"table.possession.goalkeeper.punt",items:[{category:"",categoryIds:[306],translationKey:"table.possession.goalkeeper.successful_punt"},{category:"",categoryIds:[307],translationKey:"table.possession.goalkeeper.unsuccessful_punt"}]},{category:"",categoryIds:[323],items:null,translationKey:"table.possession.goalkeeper.participation_in_goals"}],ISe=[{category:"",categoryIds:null,translationKey:"table.offensive.goalkeeper.footwork",items:[{category:"",categoryIds:[310],translationKey:"table.offensive.goalkeeper.successful_long_pass"},{category:"",categoryIds:[311],translationKey:"table.offensive.goalkeeper.unsuccessful_long_pass"},{category:"",categoryIds:[308],translationKey:"table.offensive.goalkeeper.successful_short_pass"},{category:"",categoryIds:[309],translationKey:"table.offensive.goalkeeper.unsuccessful_short_pass"}]},{category:"",categoryIds:null,translationKey:"table.offensive.goalkeeper.throw",items:[{category:"",categoryIds:[304],translationKey:"table.offensive.goalkeeper.successful_throw"},{category:"",categoryIds:[305],translationKey:"table.offensive.goalkeeper.unsuccessful_throw"}]},{category:"",categoryIds:null,translationKey:"table.offensive.goalkeeper.punt",items:[{category:"",categoryIds:[306],translationKey:"table.offensive.goalkeeper.successful_punt"},{category:"",categoryIds:[307],translationKey:"table.offensive.goalkeeper.unsuccessful_punt"}]},{category:"",categoryIds:[323],items:null,translationKey:"table.offensive.goalkeeper.participation_in_goals"}],xSe=[{category:"",categoryIds:[40],items:null,translationKey:"table.defensive.goalkeeper.goals_received"},{category:"",categoryIds:null,translationKey:"table.defensive.goalkeeper.saves",items:[{category:"",categoryIds:[300],translationKey:"table.defensive.goalkeeper.goalkeeper_handled",generalName:"Atajadas que se queda con el balón"},{category:"",categoryIds:[301],translationKey:"table.defensive.goalkeeper.goalkeeper_un-handled",generalName:"Atajadas que no se queda con el balón"}]},{category:"",categoryIds:null,translationKey:"table.defensive.goalkeeper.aerial_game",items:[{category:"",categoryIds:[313],translationKey:"table.defensive.goalkeeper.successful_handled",generalName:"Juego aéreo exitoso que se queda con el balón"},{category:"",categoryIds:[314],translationKey:"table.defensive.goalkeeper.successful_un-handled",generalName:"Juego aéreo exitoso que no se queda con el balón"}]},{category:"",categoryIds:[41],items:null,translationKey:"table.defensive.goalkeeper.1_on_1"},{category:"",categoryIds:[312],items:null,translationKey:"table.defensive.goalkeeper.recovered_balls"}],NSe=function(){let e=[];return e=e.concat(Xn(ESe)),e=e.concat(Xn(ISe)),e=e.concat(Xn(xSe)),e}(),Qi={1:13,2:14,3:15,4:16,5:9,6:10,7:11,8:12,9:5,10:6,11:7,12:8,13:1,14:2,15:3,16:4},yu={1:16,2:15,3:14,4:13,5:12,6:11,7:10,8:9,9:8,10:7,11:6,12:5,13:4,14:3,15:2,16:1},ASe=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},PSe={class:"menu-container"},OSe={__name:"GSC-Menu",props:{menuMarginTop:{type:Number,default:0,validator(e){return!Number.isNaN(e)}},modelValue:{type:Boolean,default:!1},width:{type:String,default:"fit-content"},menuWidth:{type:String,default:"fit-content"}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e;s.useCssVars(d=>({"1c0de360":e.width,"5088a52e":o.value,"8225919e":e.menuWidth}));const i=s.ref(null),n=s.ref(!1),r=s.computed(()=>i.value?{top:`${i.value.getBoundingClientRect().height+a.menuMarginTop}px`}:{top:"0px"}),o=s.computed(()=>n.value?3:1);s.watch(()=>a.modelValue,d=>{d!==n.value&&(n.value=d)},{immediate:!0});function l(){n.value=!n.value,t("update:modelValue",n.value)}function c(){n.value=!1,t("update:modelValue",n.value)}return(d,u)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[n.value?(s.openBlock(),s.createElementBlock("div",{key:0,id:"menu-overlay",onClick:c})):s.createCommentVNode("",!0),s.createElementVNode("div",PSe,[s.createElementVNode("div",{ref_key:"trigger",ref:i,class:"menu-container__trigger",onClick:l},[s.renderSlot(d.$slots,"trigger",{},void 0,!0)],512),s.createVNode(s.Transition,null,{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{class:"menu-container__menu",style:s.normalizeStyle(r.value)},[s.renderSlot(d.$slots,"menu",{},void 0,!0)],4),[[s.vShow,n.value]])]),_:3})])],64))}},JA=ASe(OSe,[["__scopeId","data-v-ea0b7b18"]]),YA=[{id:"goals",name:"Goles",componentName:"VideosGoals",actionId:1},{id:"player",name:"Jugador",componentName:"VideosPlayer",actionId:4},{id:"team",name:"Equipo",componentName:"VideosTeam",actionId:3},{id:"game",name:"Partido",componentName:"VideosGame",actionId:2}],Fn=e=>(s.pushScopeId("data-v-c62b28bf"),e=e(),s.popScopeId(),e),BSe={class:"video-search__input"},DSe=Fn(()=>s.createElementVNode("div",{class:"video-search__input__icon"},[s.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M21.3057 20.0167L18.3107 17.0217C19.7585 15.2432 20.4679 12.9765 20.2923 10.69C20.1168 8.40341 19.0697 6.27161 17.3674 4.73492C15.6652 3.19823 13.4377 2.37404 11.1451 2.43261C8.8526 2.49117 6.67012 3.42801 5.04852 5.04962C3.42692 6.67122 2.49007 8.8537 2.43151 11.1462C2.37294 13.4388 3.19713 15.6663 4.73382 17.3685C6.27051 19.0708 8.40231 20.1179 10.6889 20.2934C12.9754 20.469 15.2421 19.7596 17.0206 18.3118L20.0156 21.3068C20.1878 21.4757 20.4194 21.5703 20.6607 21.5703C20.9019 21.5703 21.1335 21.4757 21.3057 21.3068C21.4759 21.1353 21.5714 20.9034 21.5714 20.6618C21.5714 20.4201 21.4759 20.1883 21.3057 20.0167ZM4.25581 11.3798C4.25581 9.97099 4.67356 8.59386 5.45623 7.42252C6.2389 6.25117 7.35133 5.33822 8.65286 4.79911C9.95439 4.25999 11.3866 4.11894 12.7683 4.39377C14.15 4.66861 15.4191 5.347 16.4153 6.34314C17.4114 7.33929 18.0898 8.60846 18.3646 9.99016C18.6395 11.3719 18.4984 12.804 17.9593 14.1055C17.4202 15.4071 16.5072 16.5195 15.3359 17.3022C14.1646 18.0849 12.7874 18.5026 11.3787 18.5026C9.4905 18.4996 7.68055 17.7481 6.34541 16.413C5.01028 15.0779 4.25886 13.2679 4.25581 11.3798Z",fill:"#98A2B3"})])],-1)),MSe={key:0,class:"video-search__menu"},LSe={class:"video-search__menu__results"},RSe={key:0,class:"video-search__menu__results__player"},FSe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__title"},"Jugador",-1)),VSe=[FSe],USe={key:1,class:"video-search__menu__results__player"},jSe=["onClick"],zSe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__result__icon"},[s.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M21.3057 20.0167L18.3107 17.0217C19.7585 15.2432 20.4679 12.9765 20.2923 10.69C20.1168 8.40341 19.0697 6.27161 17.3674 4.73492C15.6652 3.19823 13.4377 2.37404 11.1451 2.43261C8.8526 2.49117 6.67012 3.42801 5.04852 5.04962C3.42692 6.67122 2.49007 8.8537 2.43151 11.1462C2.37294 13.4388 3.19713 15.6663 4.73382 17.3685C6.27051 19.0708 8.40231 20.1179 10.6889 20.2934C12.9754 20.469 15.2421 19.7596 17.0206 18.3118L20.0156 21.3068C20.1878 21.4757 20.4194 21.5703 20.6607 21.5703C20.9019 21.5703 21.1335 21.4757 21.3057 21.3068C21.4759 21.1353 21.5714 20.9034 21.5714 20.6618C21.5714 20.4201 21.4759 20.1883 21.3057 20.0167ZM4.25581 11.3798C4.25581 9.97099 4.67356 8.59386 5.45623 7.42252C6.2389 6.25117 7.35133 5.33822 8.65286 4.79911C9.95439 4.25999 11.3866 4.11894 12.7683 4.39377C14.15 4.66861 15.4191 5.347 16.4153 6.34314C17.4114 7.33929 18.0898 8.60846 18.3646 9.99016C18.6395 11.3719 18.4984 12.804 17.9593 14.1055C17.4202 15.4071 16.5072 16.5195 15.3359 17.3022C14.1646 18.0849 12.7874 18.5026 11.3787 18.5026C9.4905 18.4996 7.68055 17.7481 6.34541 16.413C5.01028 15.0779 4.25886 13.2679 4.25581 11.3798Z",fill:"#98A2B3"})])],-1)),HSe={class:"video-search__menu__results__result__description"},qSe={key:2,class:"video-search__menu__results__player__season"},WSe=["onClick"],GSe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__result__icon"},[s.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M21.3057 20.0167L18.3107 17.0217C19.7585 15.2432 20.4679 12.9765 20.2923 10.69C20.1168 8.40341 19.0697 6.27161 17.3674 4.73492C15.6652 3.19823 13.4377 2.37404 11.1451 2.43261C8.8526 2.49117 6.67012 3.42801 5.04852 5.04962C3.42692 6.67122 2.49007 8.8537 2.43151 11.1462C2.37294 13.4388 3.19713 15.6663 4.73382 17.3685C6.27051 19.0708 8.40231 20.1179 10.6889 20.2934C12.9754 20.469 15.2421 19.7596 17.0206 18.3118L20.0156 21.3068C20.1878 21.4757 20.4194 21.5703 20.6607 21.5703C20.9019 21.5703 21.1335 21.4757 21.3057 21.3068C21.4759 21.1353 21.5714 20.9034 21.5714 20.6618C21.5714 20.4201 21.4759 20.1883 21.3057 20.0167ZM4.25581 11.3798C4.25581 9.97099 4.67356 8.59386 5.45623 7.42252C6.2389 6.25117 7.35133 5.33822 8.65286 4.79911C9.95439 4.25999 11.3866 4.11894 12.7683 4.39377C14.15 4.66861 15.4191 5.347 16.4153 6.34314C17.4114 7.33929 18.0898 8.60846 18.3646 9.99016C18.6395 11.3719 18.4984 12.804 17.9593 14.1055C17.4202 15.4071 16.5072 16.5195 15.3359 17.3022C14.1646 18.0849 12.7874 18.5026 11.3787 18.5026C9.4905 18.4996 7.68055 17.7481 6.34541 16.413C5.01028 15.0779 4.25886 13.2679 4.25581 11.3798Z",fill:"#98A2B3"})])],-1)),KSe={class:"video-search__menu__results__result__description"},XSe={key:3,class:"video-search__menu__results__team"},JSe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__title"},"Equipo",-1)),YSe=[JSe],QSe={key:4,class:"video-search__menu__results__team"},ZSe=["onClick"],$Se=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__result__icon"},[s.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M21.3057 20.0167L18.3107 17.0217C19.7585 15.2432 20.4679 12.9765 20.2923 10.69C20.1168 8.40341 19.0697 6.27161 17.3674 4.73492C15.6652 3.19823 13.4377 2.37404 11.1451 2.43261C8.8526 2.49117 6.67012 3.42801 5.04852 5.04962C3.42692 6.67122 2.49007 8.8537 2.43151 11.1462C2.37294 13.4388 3.19713 15.6663 4.73382 17.3685C6.27051 19.0708 8.40231 20.1179 10.6889 20.2934C12.9754 20.469 15.2421 19.7596 17.0206 18.3118L20.0156 21.3068C20.1878 21.4757 20.4194 21.5703 20.6607 21.5703C20.9019 21.5703 21.1335 21.4757 21.3057 21.3068C21.4759 21.1353 21.5714 20.9034 21.5714 20.6618C21.5714 20.4201 21.4759 20.1883 21.3057 20.0167ZM4.25581 11.3798C4.25581 9.97099 4.67356 8.59386 5.45623 7.42252C6.2389 6.25117 7.35133 5.33822 8.65286 4.79911C9.95439 4.25999 11.3866 4.11894 12.7683 4.39377C14.15 4.66861 15.4191 5.347 16.4153 6.34314C17.4114 7.33929 18.0898 8.60846 18.3646 9.99016C18.6395 11.3719 18.4984 12.804 17.9593 14.1055C17.4202 15.4071 16.5072 16.5195 15.3359 17.3022C14.1646 18.0849 12.7874 18.5026 11.3787 18.5026C9.4905 18.4996 7.68055 17.7481 6.34541 16.413C5.01028 15.0779 4.25886 13.2679 4.25581 11.3798Z",fill:"#98A2B3"})])],-1)),ewe={class:"video-search__menu__results__result__description"},twe={key:5,class:"video-search__menu__results__team"},awe=["onClick"],iwe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__result__icon"},[s.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M21.3057 20.0167L18.3107 17.0217C19.7585 15.2432 20.4679 12.9765 20.2923 10.69C20.1168 8.40341 19.0697 6.27161 17.3674 4.73492C15.6652 3.19823 13.4377 2.37404 11.1451 2.43261C8.8526 2.49117 6.67012 3.42801 5.04852 5.04962C3.42692 6.67122 2.49007 8.8537 2.43151 11.1462C2.37294 13.4388 3.19713 15.6663 4.73382 17.3685C6.27051 19.0708 8.40231 20.1179 10.6889 20.2934C12.9754 20.469 15.2421 19.7596 17.0206 18.3118L20.0156 21.3068C20.1878 21.4757 20.4194 21.5703 20.6607 21.5703C20.9019 21.5703 21.1335 21.4757 21.3057 21.3068C21.4759 21.1353 21.5714 20.9034 21.5714 20.6618C21.5714 20.4201 21.4759 20.1883 21.3057 20.0167ZM4.25581 11.3798C4.25581 9.97099 4.67356 8.59386 5.45623 7.42252C6.2389 6.25117 7.35133 5.33822 8.65286 4.79911C9.95439 4.25999 11.3866 4.11894 12.7683 4.39377C14.15 4.66861 15.4191 5.347 16.4153 6.34314C17.4114 7.33929 18.0898 8.60846 18.3646 9.99016C18.6395 11.3719 18.4984 12.804 17.9593 14.1055C17.4202 15.4071 16.5072 16.5195 15.3359 17.3022C14.1646 18.0849 12.7874 18.5026 11.3787 18.5026C9.4905 18.4996 7.68055 17.7481 6.34541 16.413C5.01028 15.0779 4.25886 13.2679 4.25581 11.3798Z",fill:"#98A2B3"})])],-1)),nwe={class:"video-search__menu__results__result__description"},rwe={key:6,class:"video-search__menu__results__game"},swe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__title"},"Partidos",-1)),owe=["onClick"],lwe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__result__icon"},[s.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M21.3057 20.0167L18.3107 17.0217C19.7585 15.2432 20.4679 12.9765 20.2923 10.69C20.1168 8.40341 19.0697 6.27161 17.3674 4.73492C15.6652 3.19823 13.4377 2.37404 11.1451 2.43261C8.8526 2.49117 6.67012 3.42801 5.04852 5.04962C3.42692 6.67122 2.49007 8.8537 2.43151 11.1462C2.37294 13.4388 3.19713 15.6663 4.73382 17.3685C6.27051 19.0708 8.40231 20.1179 10.6889 20.2934C12.9754 20.469 15.2421 19.7596 17.0206 18.3118L20.0156 21.3068C20.1878 21.4757 20.4194 21.5703 20.6607 21.5703C20.9019 21.5703 21.1335 21.4757 21.3057 21.3068C21.4759 21.1353 21.5714 20.9034 21.5714 20.6618C21.5714 20.4201 21.4759 20.1883 21.3057 20.0167ZM4.25581 11.3798C4.25581 9.97099 4.67356 8.59386 5.45623 7.42252C6.2389 6.25117 7.35133 5.33822 8.65286 4.79911C9.95439 4.25999 11.3866 4.11894 12.7683 4.39377C14.15 4.66861 15.4191 5.347 16.4153 6.34314C17.4114 7.33929 18.0898 8.60846 18.3646 9.99016C18.6395 11.3719 18.4984 12.804 17.9593 14.1055C17.4202 15.4071 16.5072 16.5195 15.3359 17.3022C14.1646 18.0849 12.7874 18.5026 11.3787 18.5026C9.4905 18.4996 7.68055 17.7481 6.34541 16.413C5.01028 15.0779 4.25886 13.2679 4.25581 11.3798Z",fill:"#98A2B3"})])],-1)),cwe={class:"video-search__menu__results__result__description"},dwe={class:"video-search__menu__categories"},uwe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__categories__title"},"Buscar por categoría:",-1)),hwe={class:"video-search__menu__categories__buttons"},pwe=["onClick"],mwe="https://7dnlmh3q0m.execute-api.us-west-2.amazonaws.com/dev/search",fwe={__name:"VideoSearch",props:{clientWidth:{type:Number,default:0}},emits:["update:search-result","click-advanced-filter-type"],setup(e,{emit:t}){const a=e,i=s.computed(()=>{let p=[];return a.clientWidth>0&&(a.clientWidth<=472?p.push("video-search__472"):a.clientWidth<=752?p.push("video-search__752"):a.clientWidth<=1280?p.push("video-search__1280"):p.push("video-search")),p}),n=s.ref({team:[],team_by_game:[],player:[],player_by_game:[],game:[]}),r=s.ref(!1),o=s.ref(null);async function l(p){try{const f=await(await fetch(mwe,{method:"POST",body:p})).json();n.value.player=[...f.players||[]],n.value.player_by_game=[...f.players_by_game||[]],n.value.team=[...f.teams||[]],n.value.team_by_game=[...f.teams_by_game||[]],n.value.game=[...f.games||[]],r.value=!0}catch(f){throw new Error(f)}}function c(p=!1){p&&(o.value.value=""),n.value.player=[],n.value.player_by_game=[],n.value.team=[],n.value.team_by_game=[],n.value.game=[],r.value=!1}function d(p,f){const y={categoryIds:p.stats.categories};p.season_id&&(y.seasonId=p.season_id),p.game&&(y.game={id:p.game.game_id},y.seasonId=p.game.season_id),f==="player"?(y.player={id:p.player_id,positionId:p.position_id},y.team={id:p.team_id}):y.team={id:p.team_id,acronym:p.team_short_name,colloquialName:p.team_colloquial_name,name:p.team},t("update:search-result",y)}function u(p){d(p,p.player&&p.player_id?"player":"team"),c(!0)}function h(p){p.target.value.length<4?c():l(p.target.value)}function m(p){t("click-advanced-filter-type",p),c(!0)}return(p,f)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["video-search",i.value])},[s.createVNode(s.unref(JA),{modelValue:r.value,"onUpdate:modelValue":f[0]||(f[0]=y=>r.value=y),"menu-margin-top":8},{trigger:s.withCtx(()=>[s.createElementVNode("div",BSe,[DSe,s.createElementVNode("input",{ref_key:"searchInput",ref:o,placeholder:"¿Qué video quieres ver hoy?",type:"text",onKeyup:h},null,544)])]),menu:s.withCtx(()=>[n.value.player.length||n.value.team.length||n.value.game.length?(s.openBlock(),s.createElementBlock("div",MSe,[s.createElementVNode("div",LSe,[n.value.player.length>0||n.value.player_by_game.length>0?(s.openBlock(),s.createElementBlock("div",RSe,VSe)):s.createCommentVNode("",!0),n.value.player.length>0?(s.openBlock(),s.createElementBlock("div",USe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.player,(y,b)=>(s.openBlock(),s.createElementBlock("div",{key:b,class:"video-search__menu__results__result",onClick:E=>u(y)},[zSe,s.createElementVNode("div",HSe,s.toDisplayString(y.player)+" "+s.toDisplayString(y.stats.name)+" "+s.toDisplayString(y.season),1)],8,jSe))),128))])):s.createCommentVNode("",!0),n.value.player_by_game.length>0?(s.openBlock(),s.createElementBlock("div",qSe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.player_by_game,(y,b)=>(s.openBlock(),s.createElementBlock("div",{key:b,class:"video-search__menu__results__result",onClick:E=>u(y)},[GSe,s.createElementVNode("div",KSe,s.toDisplayString(y.player)+" "+s.toDisplayString(y.stats.name)+" "+s.toDisplayString(y.game.season)+" ("+s.toDisplayString(y.game.home_team.colloquial_name)+" "+s.toDisplayString(y.game.score)+" "+s.toDisplayString(y.game.away_team.colloquial_name)+") ",1)],8,WSe))),128))])):s.createCommentVNode("",!0),n.value.team.length>0||n.value.team_by_game.length>0?(s.openBlock(),s.createElementBlock("div",XSe,YSe)):s.createCommentVNode("",!0),n.value.team.length>0?(s.openBlock(),s.createElementBlock("div",QSe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.team,(y,b)=>(s.openBlock(),s.createElementBlock("div",{key:b,class:"video-search__menu__results__result",onClick:E=>u(y)},[$Se,s.createElementVNode("div",ewe,s.toDisplayString(y.team)+" "+s.toDisplayString(y.stats.name)+" "+s.toDisplayString(y.season),1)],8,ZSe))),128))])):s.createCommentVNode("",!0),n.value.team_by_game.length>0?(s.openBlock(),s.createElementBlock("div",twe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.team_by_game,(y,b)=>(s.openBlock(),s.createElementBlock("div",{key:b,class:"video-search__menu__results__result",onClick:E=>u(y)},[iwe,s.createElementVNode("div",nwe,s.toDisplayString(y.team)+" "+s.toDisplayString(y.stats.name)+" "+s.toDisplayString(y.game.season)+" ("+s.toDisplayString(y.game.home_team.colloquial_name)+" "+s.toDisplayString(y.game.score)+" "+s.toDisplayString(y.game.away_team.colloquial_name)+") ",1)],8,awe))),128))])):s.createCommentVNode("",!0),n.value.game.length>0?(s.openBlock(),s.createElementBlock("div",rwe,[swe,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.game,(y,b)=>(s.openBlock(),s.createElementBlock("div",{key:b,class:"video-search__menu__results__result",onClick:E=>u(y)},[lwe,s.createElementVNode("div",cwe,s.toDisplayString(y.season)+" "+s.toDisplayString(y.home_team.colloquial_name)+" "+s.toDisplayString(y.score)+" "+s.toDisplayString(y.away_team.colloquial_name)+" "+s.toDisplayString(y.stats.name),1)],8,owe))),128))])):s.createCommentVNode("",!0)]),s.createElementVNode("div",dwe,[uwe,s.createElementVNode("div",hwe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(YA),y=>(s.openBlock(),s.createElementBlock("button",{key:y.id,class:"video-search__menu__categories__buttons__button",onClick:b=>m(y)},s.toDisplayString(y.name),9,pwe))),128))])])])):s.createCommentVNode("",!0)]),_:1},8,["modelValue"])],2))}},gwe=bt(fwe,[["__scopeId","data-v-c62b28bf"]]),ywe={__name:"ButtonCustom",props:{text:{type:String,default:""},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},padding:{type:String,default:"0px"},borderRadius:{type:String,default:"0px"},borderWidth:{type:String,default:"1px"},borderColor:{type:String,default:"#d9d9d9"},backgroundColor:{type:String,default:"#FFFFFF"},activeBackgroundColor:{type:String,default:""},activeBorderColor:{type:String,default:""},activeFontColor:{type:String,default:""},fontColor:{type:String,default:"#000000"},fontSize:{type:String,default:"16px"},fontFamily:{type:String,default:"Poppins-Regular, sans-serif"},isActive:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const a=e,i=s.computed(()=>({"--height":a.height,"--width":a.width,"--padding":a.padding,"--border-radius":a.borderRadius,"--border":`solid ${a.borderWidth} ${a.borderColor}`,"--background-color":a.backgroundColor,"--font-color":a.fontColor,"--font-size":a.fontSize,"--font-family":a.fontFamily,"--active-background-color":a.activeBackgroundColor||a.backgroundColor,"--active-border-color":a.activeBorderColor||a.borderColor,"--active-font-color":a.activeFontColor||a.fontColor}));function n(){t("click")}return(r,o)=>(s.openBlock(),s.createElementBlock("button",{class:s.normalizeClass(["button",{active:e.isActive}]),style:s.normalizeStyle(i.value),onClick:n},s.toDisplayString(e.text),7))}},Xl=bt(ywe,[["__scopeId","data-v-3a5141c4"]]),_we={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},QA={DF:"Dieciseisavos",OF:"Octavos",CF:"Cuartos",SF:"Semifinales","3ER":"Tercer lugar",FINAL:"Final"},bwe={4:"Octavos",5:"Cuartos",6:"Semifinales",7:"Final"},vwe={4:"OF",5:"Cf",6:"S",7:"F"};function tv(e=""){return e?localStorage.getItem(e):localStorage.getItem("user_token")||localStorage.getItem("token")}const Swe=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},av={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},ZA=()=>{s.useCssVars(e=>({"1c960139":e.height,b2f635d8:e.borderWidthBtn,"06e99898":e.borderType,"55555c76":e.borderColor,"23b6d320":e.borderRadius,"22c97374":e.width,"22bb09fa":e.backgroundColor,c148da7c:e.cursorType,cce756fc:e.fontSize,cff98d60:e.fontStyle,"5123b3a5":e.fontFamily,"47bf58db":e.marginLeftStat,cadc8414:e.fontSizeStat}))},$A=av.setup;av.setup=$A?(e,t)=>(ZA(),$A(e,t)):ZA;const wwe=e=>(s.pushScopeId("data-v-fb269a1e"),e=e(),s.popScopeId(),e),Twe=["src"],Cwe={key:1,class:"text"},kwe=["src"],Ewe={class:"stats"},Iwe=wwe(()=>s.createElementVNode("img",{class:"iconstats",src:"https://az755631.vo.msecnd.net/todoelfut/playdes.png"},null,-1)),xwe={class:"numstats"},Nwe={class:"leyend"};function Awe(e,t,a,i,n,r){return s.openBlock(),s.createElementBlock("div",null,[a.type==0?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["button",n.status&&a.typeOnOff&&"button-active"]),style:s.normalizeStyle([r.customStyle,n.status&&a.typeOnOff&&r.customActive]),onClick:t[0]||(t[0]=(...o)=>r.btnClick&&r.btnClick(...o))},[a.icon&&a.iconPosition.toLowerCase()==="left"?(s.openBlock(),s.createElementBlock("img",{key:0,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,Twe)):s.createCommentVNode("",!0),a.textValue?(s.openBlock(),s.createElementBlock("div",Cwe,s.toDisplayString(a.textValue),1)):s.createCommentVNode("",!0),a.icon&&a.iconPosition.toLowerCase()==="right"?(s.openBlock(),s.createElementBlock("img",{key:2,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,kwe)):s.createCommentVNode("",!0)],6)):s.createCommentVNode("",!0),a.type==1?(s.openBlock(),s.createElementBlock("div",{key:1,class:"button-target",onClick:t[1]||(t[1]=(...o)=>r.btnClick&&r.btnClick(...o))},[s.createElementVNode("div",Ewe,[Iwe,s.createElementVNode("div",xwe,s.toDisplayString(a.textStat),1)]),s.createElementVNode("div",Nwe,s.toDisplayString(a.textCategory),1)])):s.createCommentVNode("",!0)])}const Pwe=Swe(av,[["render",Awe],["__scopeId","data-v-fb269a1e"]]),Owe={class:"gsc-dropdown__main-container__item-selected"},Bwe=["height","width"],Dwe=["stroke"],Mwe={class:"gsc-dropdown__items-container"},Lwe=["onClick"],Rwe={key:0,class:"gsc-dropdown__items-footer"},iv={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(t=>t in e)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listItemPadding:{type:String,default:"10px 12px"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1}},emits:["input","click-ready","update:modelValue"],setup(e,{emit:t}){const a=e,i=s.ref({}),n=s.ref(null),r=s.ref(a.isMultipleOption?-1:0),o=s.ref(!1);s.watch(()=>a.items,(p,f)=>{if(!a.modelValue&&(!a.onlyFirstTime||!f||!f.length)&&p&&p.length){if(a.defaultItemByProp){const y=a.items.findIndex(b=>b[a.defaultItemByProp.propName]===a.defaultItemByProp.value);y!==-1?(r.value=y,i.value=p[y]):(r.value=0,i.value=p[0])}else i.value=p[a.defaultItemByIndex];t("input",i.value)}},{immediate:!0}),s.watch(()=>a.modelValue,p=>{if(p){const f=a.items.findIndex(y=>typeof p=="object"?JSON.stringify(y)===JSON.stringify(p):y===p);f!==-1&&(r.value=f,i.value=a.items[f],t("update:modelValue",i.value))}},{immediate:!0});const l=s.computed(()=>({height:a.height,width:a.width,backgroundColor:a.backgroundColor,borderRadius:`${a.borderRadius}px`,border:`${a.borderType} ${a.borderWidth}px ${a.borderColor}`,color:a.color,"--hover-background-color":a.hoverBackgroundColor,"--list-item-padding":a.listItemPadding,"--list-background-color":a.listBackgroundColor,"--list-height":a.listHeight,"--list-item-selected-color":a.listItemSelectedColor,"--list-item-selected-background-color":a.listItemSelectedBackgroundColor,"--list-item-color":a.listItemColor,"--list-border-radius":`${a.listBorderRadius}`,"--list-border-color":a.listBorderColor,"--list-width":a.isListSameWidth?a.width:"fit-content","--list-border-width":`${a.listBorderWidth}px`,"--footer-border":`${a.footerBorderWidth}px solid ${a.footerBorderColor}`,"--dropdown-opacity":a.isDisabled?"0.5":"1","--dropdown-cursor":a.isDisabled?"not-allowed":"pointer","--dropdown-font-size":a.fontSize?a.fontSize:"14px"})),c=s.computed(()=>({height:`${a.arrowHeight}px`,width:`${a.arrowWidth}px`}));function d(){a.isDisabled||(o.value=!o.value)}function u(p){n.value.contains(p.target)||(o.value=!1)}function h(p,f){a.isMultipleOption?r.value=-1:(r.value=f,o.value=!1),i.value=p,t("input",i.value),t("update:modelValue",i.value)}function m(){o.value=!1,t("click-ready")}return s.onMounted(()=>{document.addEventListener("click",u)}),s.onBeforeMount(()=>{document.removeEventListener("click",u)}),(p,f)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"dropDown",ref:n,class:"gsc-dropdown",style:s.normalizeStyle(l.value)},[s.createElementVNode("div",{class:"gsc-dropdown__main-container",style:s.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:d},[s.createElementVNode("div",Owe,[s.renderSlot(p.$slots,"default",{selectedItem:i.value})]),s.createElementVNode("div",{class:s.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":o.value}]),style:s.normalizeStyle(c.value)},[(s.openBlock(),s.createElementBlock("svg",{height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:e.arrowColor},null,8,Dwe)],8,Bwe))],6)],4),s.createVNode(s.Transition,null,{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",Mwe,[s.createElementVNode("div",null,[s.createElementVNode("div",{class:"gsc-dropdown__items",style:s.normalizeStyle({"margin-top":`${a.borderWidth}px`})},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.items,(y,b)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["gsc-dropdown__items__item",{selected:b===r.value}]),key:b,onClick:E=>h(y,b)},[s.renderSlot(p.$slots,"availableItem",{item:y})],10,Lwe))),128))],4),e.isFooterVisible?(s.openBlock(),s.createElementBlock("div",Rwe,[s.createVNode(s.unref(Pwe),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:m})])):s.createCommentVNode("",!0)])],512),[[s.vShow,o.value]])]),_:3})],4))}},nv={borderType:"solid",listBackgroundColor:"#2E3B46",listBorderColor:"rgba(255, 255, 255, 0.2)",listBorderRadius:"5px",height:"38px",borderWidth:.8,borderColor:"white",backgroundColor:"#2E3B46",color:"white",listItemColor:"white",listItemSelectedBackgroundColor:"#2E3B46",arrowColor:"#fff",width:"100%",listHeight:"200px",isListSameWidth:!0,isFooterVisible:!0,hoverBackgroundColor:"#2E3B46"},Fwe={class:"dropdown"},Vwe={class:"selected-item"},Uwe={__name:"DropdownTextOnly",props:{items:{type:Array,default:()=>[]},itemTextKey:{type:String,default:""},isListSameWidth:{type:Boolean,default:!0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(t=>t in e)}},emits:["input"],setup(e,{emit:t}){function a(i){t("input",i)}return(i,n)=>(s.openBlock(),s.createElementBlock("div",Fwe,[s.createVNode(s.unref(iv),s.mergeProps(s.unref(nv),{"is-list-same-width":e.isListSameWidth,items:e.items,"default-item-by-prop":e.defaultItemByProp,onInput:a}),{default:s.withCtx(({selectedItem:r})=>[s.createElementVNode("div",Vwe,s.toDisplayString(e.itemTextKey?r[e.itemTextKey]:r),1)]),availableItem:s.withCtx(({item:r})=>[s.createElementVNode("div",null,s.toDisplayString(e.itemTextKey?r[e.itemTextKey]:r),1)]),_:1},16,["is-list-same-width","items","default-item-by-prop"])]))}},ei=bt(Uwe,[["__scopeId","data-v-57f6e06e"]]),jwe={class:"dropdown"},zwe={class:"game-item"},Hwe={key:0,class:"item-game"},qwe={class:"match-day"},Wwe={class:"team-logo"},Gwe=["src"],Kwe={class:"text"},Xwe={class:"text score"},Jwe={class:"text"},Ywe={class:"team-logo"},Qwe=["src"],Zwe={class:"item-game"},$we={class:"team-logo"},eTe=["src"],tTe={class:"text"},aTe={class:"text score"},iTe={class:"text"},nTe={class:"team-logo"},rTe=["src"],sTe={__name:"DropdownGame",props:{items:{type:Array,default:()=>[]}},emits:["input"],setup(e,{emit:t}){function a(i){t("input",i)}return(i,n)=>(s.openBlock(),s.createElementBlock("div",jwe,[s.createVNode(s.unref(iv),s.mergeProps(s.unref(nv),{items:e.items,onInput:a}),{default:s.withCtx(({selectedItem:r})=>[s.createElementVNode("div",zwe,[r.homeTeam?(s.openBlock(),s.createElementBlock("div",Hwe,[s.createElementVNode("div",qwe,s.toDisplayString(r.roundAbbreviation),1),s.createElementVNode("div",Wwe,[s.createElementVNode("img",{src:r.homeTeam.logo,alt:""},null,8,Gwe)]),s.createElementVNode("div",Kwe,s.toDisplayString(r.homeTeam.acronym),1),s.createElementVNode("div",Xwe,s.toDisplayString(r.score[0])+" - "+s.toDisplayString(r.score[1]),1),s.createElementVNode("div",Jwe,s.toDisplayString(r.awayTeam.acronym),1),s.createElementVNode("div",Ywe,[s.createElementVNode("img",{src:r.awayTeam.logo,alt:""},null,8,Qwe)])])):s.createCommentVNode("",!0)])]),availableItem:s.withCtx(({item:r})=>[s.createElementVNode("div",Zwe,[s.createElementVNode("div",null,s.toDisplayString(r.roundAbbreviation),1),s.createElementVNode("div",$we,[s.createElementVNode("img",{src:r.homeTeam.logo,alt:""},null,8,eTe)]),s.createElementVNode("div",tTe,s.toDisplayString(r.homeTeam.acronym),1),s.createElementVNode("div",aTe,s.toDisplayString(r.score[0])+" - "+s.toDisplayString(r.score[1]),1),s.createElementVNode("div",iTe,s.toDisplayString(r.awayTeam.acronym),1),s.createElementVNode("div",nTe,[s.createElementVNode("img",{src:r.awayTeam.logo,alt:""},null,8,rTe)])])]),_:1},16,["items"])]))}},Sf=bt(sTe,[["__scopeId","data-v-eb1a6125"]]),oTe={class:"empty-plays"},lTe=s.createStaticVNode('<div class="empty-plays__icon" data-v-7ed695b3><svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-7ed695b3><g clip-path="url(#clip0_4365_291310)" data-v-7ed695b3><path d="M30 0C13.4176 0 0 13.4188 0 30C0 46.5824 13.4188 60 30 60C46.5824 60 60 46.5812 60 30C60 13.4176 46.5812 0 30 0ZM30 55.3125C16.0086 55.3125 4.6875 43.9904 4.6875 30C4.6875 16.0086 16.0096 4.6875 30 4.6875C43.9914 4.6875 55.3125 16.0096 55.3125 30C55.3125 43.9914 43.9904 55.3125 30 55.3125Z" fill="white" data-v-7ed695b3></path><path d="M30 15.1025C28.7055 15.1025 27.6562 16.1518 27.6562 17.4463V32.5392C27.6562 33.8337 28.7055 34.883 30 34.883C31.2945 34.883 32.3438 33.8337 32.3438 32.5392V17.4463C32.3438 16.1518 31.2945 15.1025 30 15.1025Z" fill="white" data-v-7ed695b3></path><path d="M30 44.0811C31.7475 44.0811 33.1641 42.6645 33.1641 40.917C33.1641 39.1695 31.7475 37.7529 30 37.7529C28.2525 37.7529 26.8359 39.1695 26.8359 40.917C26.8359 42.6645 28.2525 44.0811 30 44.0811Z" fill="white" data-v-7ed695b3></path></g><defs data-v-7ed695b3><clipPath id="clip0_4365_291310" data-v-7ed695b3><rect width="60" height="60" fill="white" data-v-7ed695b3></rect></clipPath></defs></svg></div><div class="empty-plays__text" data-v-7ed695b3><div data-v-7ed695b3><span data-v-7ed695b3>No existen resultados para esta búsqueda</span></div></div>',2),cTe={class:"empty-plays__actions"},dTe={__name:"EmptyPlays",emits:["cancel","modify-filters"],setup(e,{emit:t}){const a={borderRadius:"20px",padding:"6px 0",width:"130px",fontSize:"12px"},i=s.ref([{label:"Cancelar",props:{...a,borderColor:"white",borderWidth:"1px",backgroundColor:"#16313b",fontColor:"grey"},fn:()=>{t("cancel")}},{label:"Modificar filtros",props:{...a,backgroundColor:"#CBEE6B",fontColor:"#0E1725"},fn:()=>{t("modify-filters")}}]);function n(r){r()}return(r,o)=>(s.openBlock(),s.createElementBlock("div",oTe,[lTe,s.createElementVNode("div",cTe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.value,(l,c)=>(s.openBlock(),s.createBlock(Xl,s.mergeProps(l.props,{key:c,text:l.label,onClick:d=>n(l.fn)}),null,16,["text","onClick"]))),128))])]))}},wf=bt(dTe,[["__scopeId","data-v-7ed695b3"]]),Tf=e=>(s.pushScopeId("data-v-4433b6aa"),e=e(),s.popScopeId(),e),uTe={class:"container"},hTe={class:"container__row"},pTe={class:"container__row__wrapper"},mTe=Tf(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"1. Elige la liga",-1)),fTe={class:"container__row__wrapper__input"},gTe={class:"container__row two-items"},yTe={class:"container__row__wrapper"},_Te=Tf(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"2. Elige el torneo",-1)),bTe={key:0,class:"container__row__wrapper__input"},vTe={class:"container__row__wrapper"},STe=Tf(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"3. Elige la jornada",-1)),wTe={key:0,class:"container__row__wrapper__input"},TTe={class:"container__row"},CTe={class:"container__row__wrapper"},kTe=Tf(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"4. Elige el partido",-1)),ETe={key:0,class:"container__row__wrapper__input"},ITe={class:"container__action"},xTe={__name:"VideosGoals",props:{tournaments:{type:Array,required:!0},advancedFilterCategories:{type:Object,default:()=>({team:[]})},actionId:{type:Number,required:!0}},emits:["update:tournament","update:season","apply-filters","cancel"],setup(e,{emit:t}){const a=e,i={text:"Buscar",width:"100%",padding:"12px 0",borderRadius:"34px",backgroundColor:"#CBEE6B",borderColor:"#CBEE6B",fontColor:"#132634"},n=s.ref(null),r=s.ref(null),o=s.ref(null),l=s.ref(null),c=s.ref(null),d=s.ref(null),u=s.ref(null);function h(K){n.value=K,t("update:tournament",K)}function m(K){r.value=K,t("update:season",K)}function p(K){o.value=K}function f(K){l.value=K}const y=Kd();let b=null;const E=s.ref(null),D=s.ref([]),M=s.ref([]),N=s.ref([]),P=s.ref([]),L=s.ref(null),V=s.ref(!1),$=s.computed(()=>a.actionId===4&&u.value&&u.value.position_id===1);s.watch(()=>a.advancedFilterCategories,K=>{K.team&&(d.value=K.team[0])},{immediate:!0});function U(K){const ue=K.indexOf(".")>-1?K.substring(0,K.indexOf(".")):K,[ie,ne,fe]=ue.split(":").reverse();return(fe?Number(fe)*60*60:0)+Number(ne)*60+Number(ie)}function ae(K,ue){let ie="",ne=0;switch(K.matchLapse){case 1:ie=K.syncStartFirstTime;break;case 2:ie=K.syncStartSecondTime,ne=45;break;case 3:ie=K.syncStartFirstExtraTime,ne=90;break;case 4:ie=K.syncStartSecondExtraTime,ne=105;break;case 5:ie=K.syncStartPenals,ne=120;break}return(!ie||ie==="0")&&(ie="00:00"),U(ie)+(U(K[ue])-ne*60)}function oe(K){L.value=new Map,b=new Map,K.forEach(ie=>{const ne=ie.reduce((re,X,R)=>(re[y[R]]=X,re),{});ne.playRaw=ie,ne.stringMainCategoryName=d.value.name;let fe=null,me=null,ye=null,ee=0;if(ye=r.value.mapTeams,ee=r.value.maxGameId,fe=r.value.mapGames.get(ne.gameId),me=r.value.mapPlayers.get(ne.playerId),me&&fe&&ne.gameId<=ee){ne.game=fe,ne.game.awayTeam.id===ne.teamId?(ne.teamName=ne.game.awayTeam.name,ne.rivalName=ne.game.homeTeam.name):(ne.teamName=ne.game.homeTeam.name,ne.rivalName=ne.game.awayTeam.name),ne.playingAs=ne.teamId===ne.game.homeTeam.id?1:2,ne.player=me,ne.playerTeamLogo=ye.get(ne.player.teamId).logo,ne.rivalTeamLogo=ye.get(ne.player.teamId===ne.game.homeTeam.id?ne.game.awayTeam.id:ne.game.homeTeam.id).logo,ne.startSeconds=ae(ne,"startTime"),ne.endSeconds=ae(ne,"endTime");const re=new Date(ne.gameDate),[X,R]=ne.gameHour.split(":");re.setHours(X),re.setMinutes(R),ne.dateTimeMillis=re.valueOf(),b.has(ne.gameId)?b.get(ne.gameId).plays.push(ne):b.set(ne.gameId,{dateTimeMillis:re.valueOf(),plays:[ne]})}});const ue=Array.from(b.values());return ue.sort((ie,ne)=>ne.dateTimeMillis-ie.dateTimeMillis),ue.reduce((ie,ne)=>(ne.plays.sort((fe,me)=>+`${fe.matchLapse}${fe.startTime.replace(/:*\.*/g,"")}`-+`${me.matchLapse}${me.startTime.replace(/:*\.*/g,"")}`),ie.push(...ne.plays),ie),[])}function Y(K,ue,ie){const ne=oe(K).reduce((fe,me)=>{if(E.value){let ye=!0;if(E.value.requiresRivalTransform&&c.value&&(ye=me.rivalTeamId===c.value.team_id),ye&&E.value.arrayPlayingAs&&([3,4].includes(a.actionId)?ye=!(E.value.requiresRivalTransform&&E.value.arrayPlayingAs.length===1&&me.teamId!==c.value.team_id?E.value.arrayPlayingAs.includes(me.playingAs):!E.value.arrayPlayingAs.includes(me.playingAs)):ye=E.value.arrayPlayingAs.includes(me.playingAs)),ye&&E.value.arrayTimeSections&&(ye=E.value.arrayTimeSections.includes(me.section)),ye&&E.value.coordinatePoint&&E.value.arrayFieldSections){const ee=`${vl(me[`x${E.value.coordinatePoint}`],me[`y${E.value.coordinatePoint}`])+1}`,re=Qi[ee],X=E.value.requiresRivalTransform&&P.value.includes(`${me.categoryId}_r`)?Qi[`${yu[ee]}`]:re;ye=!!E.value.arrayFieldSections.find(R=>R.num===X&&R.isSelected)}ye&&fe.push(me)}else fe.push(me);return fe},[]);if(V.value=ne.length===0,!V.value){let fe=-1;E.value.gameId&&(fe=ne.findIndex(me=>E.value.gameId===me.gameId)),V.value=fe===-1,V.value||t("apply-filters",{filterData:{arrayFormattedPlays:ne,arrayCategoriesIds:[...D.value],arrayRivalCategoriesIds:[...M.value],arrayCategoriesIdsRaw:[...N.value],objectTournamentSelected:{...n.value},objectGameSelected:{...l.value},objectSeasonSelected:{...r.value},stringQueryCategoryIds:ue,stringQueryParams:ie,objectFilters:{numberActionId:a.actionId,numberMediaPlayerType:a.actionId===3?3:a.actionId===4?2:1,objectCategorySelected:{...d.value},objectAdvancedFilters:{booleanIsPlayerGoalKeeper:$,arraySelectedSubcategoryIds:P.value?[...P.value]:null,booleanRequiresRivalTransform:E.value.requiresRivalTransform,numberCoordinatePoint:E.value.coordinatePoint,numberTeamId:a.actionId===3?c.value.team_id:null,numberPlayerId:a.actionId===4?u.value.player_id:null,arrayPlayingAs:E.value.arrayPlayingAs?[...E.value.arrayPlayingAs]:null,arrayTimeSections:E.value.arrayTimeSections?[...E.value.arrayTimeSections]:null,arrayFieldSections:E.value.arrayFieldSections?[...E.value.arrayFieldSections]:null}},numberPlaylistIndex:fe},categoryName:"Goles"})}}async function de(K,ue){try{const ie=await Ei.get(`https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/videos/plays/seasons/${r.value.id}?${K}${ue}`);if(ie.data&&ie.data.plays){const ne=[...ie.data.plays];return ie.data.plays_rival?ne.concat(ie.data.plays_rival):ne}return[]}catch(ie){throw new Error(ie)}}async function we(){try{E.value=null,D.value=[12,55],M.value=[54,35],N.value=["12","55","54_r","35_r"];const K="categories=12&categories=55&rcategories=54&rcategories=35",ue=await de(K,"");E.value={gameId:l.value.game_id},Y(ue,K,"")}catch(K){throw new Error(K)}}function Se(){we()}function pe(){V.value=!1}function z(){V.value=!1,t("cancel")}return(K,ue)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.withDirectives(s.createVNode(wf,{onModifyFilters:pe,onCancel:z},null,512),[[s.vShow,V.value]]),s.withDirectives(s.createElementVNode("div",uTe,[s.createElementVNode("div",hTe,[s.createElementVNode("div",pTe,[mTe,s.createElementVNode("div",fTe,[s.createVNode(ei,{items:e.tournaments,"default-item-by-prop":{propName:"id",value:1},"item-text-key":"name",onInput:h},null,8,["items"])])])]),s.createElementVNode("div",gTe,[s.createElementVNode("div",yTe,[_Te,n.value&&n.value.seasons?(s.openBlock(),s.createElementBlock("div",bTe,[s.createVNode(ei,{items:n.value.seasons,itemTextKey:"name",onInput:m},null,8,["items"])])):s.createCommentVNode("",!0)]),s.createElementVNode("div",vTe,[STe,r.value&&r.value.arrayMatchDays?(s.openBlock(),s.createElementBlock("div",wTe,[s.createVNode(ei,{items:r.value.arrayMatchDays,itemTextKey:"stringMatchDayAbbreviation",onInput:p},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",TTe,[s.createElementVNode("div",CTe,[kTe,o.value&&o.value.arrayGames?(s.openBlock(),s.createElementBlock("div",ETe,[s.createVNode(Sf,{items:o.value.arrayGames,onInput:f},null,8,["items"])])):s.createCommentVNode("",!0)])])],512),[[s.vShow,!V.value]]),s.withDirectives(s.createElementVNode("div",ITe,[s.createVNode(Xl,s.mergeProps(i,{onClick:Se}),null,16)],512),[[s.vShow,!V.value]])],64))}},NTe=bt(xTe,[["__scopeId","data-v-4433b6aa"]]),ATe={class:"dropdown"},PTe={class:"item-team"},OTe={class:"team-logo"},BTe=["src"],DTe={class:"team-acronym"},MTe={class:"item-team"},LTe={class:"team-logo"},RTe=["src"],FTe={class:"team-acronym"},VTe={__name:"DropdownTeam",props:{items:{type:Array,default:()=>[]}},emits:["input"],setup(e,{emit:t}){function a(i){t("input",i)}return(i,n)=>(s.openBlock(),s.createElementBlock("div",ATe,[s.createVNode(s.unref(iv),s.mergeProps(s.unref(nv),{items:e.items,onInput:a}),{default:s.withCtx(({selectedItem:r})=>[s.createElementVNode("div",PTe,[s.createElementVNode("div",OTe,[s.createElementVNode("img",{src:r.logo,alt:""},null,8,BTe)]),s.createElementVNode("div",DTe,s.toDisplayString(r.acronym),1)])]),availableItem:s.withCtx(({item:r})=>[s.createElementVNode("div",MTe,[s.createElementVNode("div",LTe,[s.createElementVNode("img",{src:r.logo,alt:""},null,8,RTe)]),s.createElementVNode("div",FTe,s.toDisplayString(r.acronym),1)])]),_:1},16,["items"])]))}},eP=bt(VTe,[["__scopeId","data-v-38339a09"]]),UTe={__name:"SwitchCustom",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,i=s.ref(null);s.watch(()=>a.modelValue,()=>{n()},{immediate:!0});function n(){i.value&&(i.value.checked=a.modelValue)}function r(o){t("update:modelValue",o.target.checked)}return s.onMounted(()=>{n()}),(o,l)=>(s.openBlock(),s.createElementBlock("input",{ref_key:"switchCustom",ref:i,id:"toggle",class:"toggle",type:"checkbox",role:"switch",name:"toggle",onInput:r},null,544))}},rv=bt(UTe,[["__scopeId","data-v-caefc67f"]]),jTe={class:"advanced-filters"},zTe={class:"advanced-filters__buttons"},HTe=["onClick"],qTe={class:"advanced-filters__filters"},WTe={__name:"AdvancedFilters",props:{selectedCategory:{type:Object,default:()=>({})},conditions:{type:Object,default:()=>({playingAs:[{name:"Local",value:1,isSelected:!0},{name:"Visitante",value:2,isSelected:!0}],gameSections:[{text:"0-15",value:1,isSelected:!0},{text:"16-30",value:2,isSelected:!0},{text:"31-45",value:3,isSelected:!0},{text:"46-60",value:4,isSelected:!0},{text:"61-75",value:5,isSelected:!0},{text:"76-90",value:6,isSelected:!0}]})}},emits:["apply-filters"],setup(e,{emit:t}){const a=e,i=s.defineAsyncComponent(()=>Promise.resolve().then(()=>D4e)),n=s.defineAsyncComponent(()=>Promise.resolve().then(()=>Z4e)),r=s.defineAsyncComponent(()=>Promise.resolve().then(()=>$3e)),o=[{name:"Sub categorías",component:s.shallowRef(i)},{name:"Cancha",component:s.shallowRef(r)},{name:"Condiciones",component:s.shallowRef(n)}],l=s.ref(o[0]),c=s.computed(()=>a.selectedCategory?a.selectedCategory.subcategoryGroups||[]:[]);function d(h){l.value=h}function u(h){t("apply-filters",h)}return(h,m)=>(s.openBlock(),s.createElementBlock("div",jTe,[s.createElementVNode("div",zTe,[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(o,p=>s.createElementVNode("div",{key:p.name,role:"button",class:s.normalizeClass(["advanced-filters__buttons__button",{active:l.value.name===p.name}]),onClick:f=>d(p)},s.toDisplayString(p.name),11,HTe)),64))]),s.createElementVNode("div",qTe,[(s.openBlock(),s.createBlock(s.KeepAlive,null,[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(l.value.component),{"subcategory-groups":c.value,conditions:e.conditions,onApplyFilters:u},null,40,["subcategory-groups","conditions"]))],1024))])]))}},sv=bt(WTe,[["__scopeId","data-v-aab43cfa"]]);function ov(){return{playingAs:[{name:"Local",value:1,isSelected:!0},{name:"Visitante",value:2,isSelected:!0}],gameSections:[{text:"0-15",value:1,isSelected:!0},{text:"16-30",value:2,isSelected:!0},{text:"31-45",value:3,isSelected:!0},{text:"46-60",value:4,isSelected:!0},{text:"61-75",value:5,isSelected:!0},{text:"76-90",value:6,isSelected:!0}]}}function lv(){return Array.from({length:16},(e,t)=>t+1)}const Vs=e=>(s.pushScopeId("data-v-f598ad6f"),e=e(),s.popScopeId(),e),GTe={class:"container"},KTe={class:"container__row"},XTe={class:"container__row__wrapper"},JTe=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"1. Elige la liga",-1)),YTe={class:"container__row__wrapper__input"},QTe={class:"container__row two-items"},ZTe={class:"container__row__wrapper"},$Te=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"2. Elige el torneo",-1)),eCe={key:0,class:"container__row__wrapper__input"},tCe={class:"container__row__wrapper"},aCe=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"3. En que equipo juega?",-1)),iCe={key:0,class:"container__row__wrapper__input"},nCe={class:"container__row"},rCe={class:"container__row__wrapper"},sCe=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"4. Nombre del jugador",-1)),oCe={key:0,class:"container__row__wrapper__input"},lCe={class:"container__row"},cCe={class:"container__row__wrapper"},dCe=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"5. Elige el partido",-1)),uCe={key:0,class:"container__row__wrapper__input"},hCe={class:"container__row type-and-advanced"},pCe={class:"container__row__wrapper"},mCe=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"6. Elige el tipo de video",-1)),fCe={class:"container__row__wrapper__input"},gCe={class:"container__row__wrapper center"},yCe=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"Filtrado avanzado",-1)),_Ce={class:"container__row__wrapper__input"},bCe={class:"container__row"},vCe={class:"container__action"},SCe={__name:"VideosPlayer",props:{tournaments:{type:Array,required:!0},advancedFilterCategories:{type:Object,default:()=>({player:[],goalkeeper:[]})},actionId:{type:Number,required:!0}},emits:["update:tournament","update:season","update:team","apply-filters","cancel"],setup(e,{emit:t}){const a=e,i={text:"Buscar",width:"100%",padding:"12px 0",borderRadius:"34px",backgroundColor:"#CBEE6B",borderColor:"#CBEE6B",fontColor:"#132634"},n=s.ref(null),r=s.ref(null);s.ref(null);const o=s.ref(null),l=s.ref(null),c=s.ref(null),d=s.ref(null),u=s.ref(!1),h=s.computed(()=>c.value?c.value.position_id===1?a.advancedFilterCategories.goalkeeper:a.advancedFilterCategories.player:[]);function m(ee){n.value=ee}function p(ee){r.value=ee,t("update:season",ee)}function f(ee){l.value=ee,t("update:team",ee)}function y(ee){c.value=ee}function b(ee){o.value=ee}function E(ee){d.value=ee}const D=s.ref(ov()),M=s.ref(lv()),N=Kd();let P=null;const L=s.ref(null),V=s.ref([]),$=s.ref([]),U=s.ref([]),ae=s.ref([]),oe=s.ref(null),Y=s.ref(!1),de=s.computed(()=>a.actionId===4&&c.value&&c.value.position_id===1);s.watch(()=>a.advancedFilterCategories,ee=>{ee.team&&(d.value=ee.team[0])},{immediate:!0});function we(ee){const re=ee.indexOf(".")>-1?ee.substring(0,ee.indexOf(".")):ee,[X,R,he]=re.split(":").reverse();return(he?Number(he)*60*60:0)+Number(R)*60+Number(X)}function Se(ee,re){let X="",R=0;switch(ee.matchLapse){case 1:X=ee.syncStartFirstTime;break;case 2:X=ee.syncStartSecondTime,R=45;break;case 3:X=ee.syncStartFirstExtraTime,R=90;break;case 4:X=ee.syncStartSecondExtraTime,R=105;break;case 5:X=ee.syncStartPenals,R=120;break}return(!X||X==="0")&&(X="00:00"),we(X)+(we(ee[re])-R*60)}function pe(ee){oe.value=new Map,P=new Map,ee.forEach(X=>{const R=X.reduce((Ge,J,De)=>(Ge[N[De]]=J,Ge),{});R.playRaw=X,R.stringMainCategoryName=d.value.name;let he=null,ve=null,Le=null,qe=0;if(Le=r.value.mapTeams,qe=r.value.maxGameId,he=r.value.mapGames.get(R.gameId),ve=r.value.mapPlayers.get(R.playerId),ve&&he&&R.gameId<=qe){R.game=he,R.game.awayTeam.id===R.teamId?(R.teamName=R.game.awayTeam.name,R.rivalName=R.game.homeTeam.name):(R.teamName=R.game.homeTeam.name,R.rivalName=R.game.awayTeam.name),R.playingAs=R.teamId===R.game.homeTeam.id?1:2,R.player=ve,R.playerTeamLogo=Le.get(R.player.teamId).logo,R.rivalTeamLogo=Le.get(R.player.teamId===R.game.homeTeam.id?R.game.awayTeam.id:R.game.homeTeam.id).logo,R.startSeconds=Se(R,"startTime"),R.endSeconds=Se(R,"endTime");const Ge=new Date(R.gameDate),[J,De]=R.gameHour.split(":");Ge.setHours(J),Ge.setMinutes(De),R.dateTimeMillis=Ge.valueOf(),P.has(R.gameId)?P.get(R.gameId).plays.push(R):P.set(R.gameId,{dateTimeMillis:Ge.valueOf(),plays:[R]})}});const re=Array.from(P.values());return re.sort((X,R)=>R.dateTimeMillis-X.dateTimeMillis),re.reduce((X,R)=>(R.plays.sort((he,ve)=>+`${he.matchLapse}${he.startTime.replace(/:*\.*/g,"")}`-+`${ve.matchLapse}${ve.startTime.replace(/:*\.*/g,"")}`),X.push(...R.plays),X),[])}function z(ee,re,X){const R=pe(ee).reduce((he,ve)=>{if(L.value){let Le=!0;if(L.value.requiresRivalTransform&&l.value&&(Le=ve.rivalTeamId===l.value.team_id),Le&&L.value.arrayPlayingAs&&([3,4].includes(a.actionId)?Le=!(L.value.requiresRivalTransform&&L.value.arrayPlayingAs.length===1&&ve.teamId!==l.value.team_id?L.value.arrayPlayingAs.includes(ve.playingAs):!L.value.arrayPlayingAs.includes(ve.playingAs)):Le=L.value.arrayPlayingAs.includes(ve.playingAs)),Le&&L.value.arrayTimeSections&&(Le=L.value.arrayTimeSections.includes(ve.section)),Le&&L.value.coordinatePoint&&L.value.arrayFieldSections){const qe=`${vl(ve[`x${L.value.coordinatePoint}`],ve[`y${L.value.coordinatePoint}`])+1}`,Ge=Qi[qe],J=L.value.requiresRivalTransform&&ae.value.includes(`${ve.categoryId}_r`)?Qi[`${yu[qe]}`]:Ge;Le=L.value.arrayFieldSections.includes(J)}Le&&he.push(ve)}else he.push(ve);return he},[]);if(Y.value=R.length===0,!Y.value){let he=-1;L.value.gameId&&(he=R.findIndex(ve=>L.value.gameId===ve.gameId)),Y.value=he===-1,Y.value||t("apply-filters",{filterData:{arrayFormattedPlays:R,arrayCategoriesIds:[...V.value],arrayRivalCategoriesIds:[...$.value],arrayCategoriesIdsRaw:[...U.value],objectTournamentSelected:{...n.value},objectGameSelected:{...o.value},objectSeasonSelected:{...r.value},stringQueryCategoryIds:re,stringQueryParams:X,objectFilters:{numberActionId:a.actionId,numberMediaPlayerType:a.actionId===3?3:a.actionId===4?2:1,objectCategorySelected:{...d.value},objectAdvancedFilters:{booleanIsPlayerGoalKeeper:de,arraySelectedSubcategoryIds:ae.value?[...ae.value]:null,booleanRequiresRivalTransform:L.value.requiresRivalTransform,numberCoordinatePoint:L.value.coordinatePoint,numberTeamId:a.actionId===3?l.value.team_id:null,numberPlayerId:a.actionId===4?c.value.player_id:null,arrayPlayingAs:L.value.arrayPlayingAs?[...L.value.arrayPlayingAs]:null,arrayTimeSections:L.value.arrayTimeSections?[...L.value.arrayTimeSections]:null,arrayFieldSections:L.value.arrayFieldSections?[...L.value.arrayFieldSections]:null}},numberPlaylistIndex:he},categoryName:d.value.name})}}async function K(ee,re){try{const X=await Ei.get(`https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/videos/plays/seasons/${r.value.id}?${ee}${re}`);if(X.data&&X.data.plays){const R=[...X.data.plays];return X.data.plays_rival?R.concat(X.data.plays_rival):R}return[]}catch(X){throw new Error(X)}}function ue(ee){const re=ee||d.value;if(!re)return;if(re.booleanIsBestPlays)return re.arrayCategoriesIds;const X={total:[],toRemove:[]};if(re.subcategoryGroups&&re.subcategoryGroups.length?re.subcategoryGroups[0].forEach(R=>{ie(R,null,X)}):(re.ids&&X.total.push(...re.ids),re.rival_ids&&re.rival_ids.forEach(R=>{X.total.push(`${R}_r`)})),X.total=X.total.reduce((R,he)=>(X.toRemove.includes(he)||R.push(he),R),[]),!ee){const R=re.name.toLowerCase().includes("recibid");L.value.isRivalSubject=R,L.value.avoidCategorySingleName=R,L.value.coordinatePoint=re.coordinatePoint,L.value.requiresRivalTransform=re.requiresRivalTransform}return X.total}function ie(ee,re=[],X={total:[],toRemove:[]}){ee.isSelected?ee.childCategories?ee.childCategories.forEach(R=>{const he=re?Object.entries(ee.idsByFatherCategory).reduce((ve,[Le,qe])=>(re.includes(Number(Le))&&qe.forEach(Ge=>{typeof Ge=="string"&&Ge.endsWith("_r")?ve.push(Number(Ge.split("_")[0])):ve.push(Ge)}),ve),[]):[ee.id];ie(R,he,X)}):re?Object.entries(ee.idsByFatherCategory).forEach(([R,he])=>{re.includes(Number(R))&&he.forEach(ve=>{X.total.push(ve)})}):ee.level===1?Object.entries(ee.idsByFatherCategory).forEach(([R,he])=>{he.forEach(ve=>{X.total.push(ve)})}):X.total.push(ee.id):ee.childCategories||ee.ids.forEach(R=>{X.toRemove.push(R)})}async function ne(){try{L.value=null,L.value={arrayPlayingAs:D.value.playingAs.reduce((R,he)=>(he.isSelected&&R.push(he.value),R),[]),arrayTimeSections:D.value.gameSections.reduce((R,he)=>(he.isSelected&&R.push(he.value),R),[]),arrayFieldSections:M},L.value.gameId=o.value.game_id,L.value.requiresRivalTransform=d.value.requiresRivalTransform,ae.value=d.value.booleanIsMinutesPlayed?d.value.arrayCategoriesIds:ue(),V.value=[],$.value=[],U.value=[];const ee=ae.value.reduce((R,he,ve)=>{U.value.push(he);let Le=he;const qe=typeof he=="string"&&he.includes("_");return qe?(Le=Number(he.split("_")[0]),$.value.push(Le)):V.value.push(Le),`${R}${ve>0?"&":""}${qe?"r":""}categories=${Le}`},""),re=a.actionId===3?`&team=${l.value.team_id}`:a.actionId===4?`&player=${c.value.player_id}`:"",X=await K(ee,re);z(X)}catch(ee){throw new Error(ee)}}function fe(){ne()}function me(){Y.value=!1}function ye(){Y.value=!1,t("cancel")}return(ee,re)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.withDirectives(s.createVNode(wf,{onModifyFilters:me,onCancel:ye},null,512),[[s.vShow,Y.value]]),s.withDirectives(s.createElementVNode("div",GTe,[s.createElementVNode("div",KTe,[s.createElementVNode("div",XTe,[JTe,s.createElementVNode("div",YTe,[s.createVNode(ei,{items:e.tournaments,"default-item-by-prop":{propName:"id",value:1},itemTextKey:"name",onInput:m},null,8,["items"])])])]),s.createElementVNode("div",QTe,[s.createElementVNode("div",ZTe,[$Te,n.value&&n.value.seasons?(s.openBlock(),s.createElementBlock("div",eCe,[s.createVNode(ei,{items:n.value.seasons,itemTextKey:"name",onInput:p},null,8,["items"])])):s.createCommentVNode("",!0)]),s.createElementVNode("div",tCe,[aCe,r.value&&r.value.arrayTeams?(s.openBlock(),s.createElementBlock("div",iCe,[s.createVNode(eP,{items:r.value.arrayTeams,itemTextKey:"stringMatchDayAbbreviation",onInput:f},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",nCe,[s.createElementVNode("div",rCe,[sCe,l.value&&l.value.arrayPlayers?(s.openBlock(),s.createElementBlock("div",oCe,[s.createVNode(ei,{items:l.value.arrayPlayers,itemTextKey:"player_name",onInput:y},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",lCe,[s.createElementVNode("div",cCe,[dCe,r.value&&r.value.mapGamesByTeam&&l.value?(s.openBlock(),s.createElementBlock("div",uCe,[s.createVNode(Sf,{items:r.value.mapGamesByTeam.get(l.value.team_id),onInput:b},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",hCe,[s.createElementVNode("div",pCe,[mCe,s.createElementVNode("div",fCe,[s.createVNode(ei,{items:h.value,itemTextKey:"name","is-list-same-width":!1,onInput:E},null,8,["items"])])]),s.createElementVNode("div",gCe,[yCe,s.createElementVNode("div",_Ce,[s.createVNode(rv,{modelValue:u.value,"onUpdate:modelValue":re[0]||(re[0]=X=>u.value=X)},null,8,["modelValue"])])])]),s.createElementVNode("div",bCe,[s.createVNode(s.Transition,null,{default:s.withCtx(()=>[u.value?(s.openBlock(),s.createBlock(sv,{key:0,"selected-category":d.value,conditions:D.value,"field-areas":M.value},null,8,["selected-category","conditions","field-areas"])):s.createCommentVNode("",!0)]),_:1})])],512),[[s.vShow,!Y.value]]),s.withDirectives(s.createElementVNode("div",vCe,[s.createVNode(Xl,s.mergeProps(i,{onClick:fe}),null,16)],512),[[s.vShow,!Y.value]])],64))}},wCe=bt(SCe,[["__scopeId","data-v-f598ad6f"]]),Jl=e=>(s.pushScopeId("data-v-0e429f76"),e=e(),s.popScopeId(),e),TCe={class:"container"},CCe={class:"container__row"},kCe={class:"container__row__wrapper"},ECe=Jl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"1. Elige la liga",-1)),ICe={class:"container__row__wrapper__input"},xCe={class:"container__row two-items"},NCe={class:"container__row__wrapper"},ACe=Jl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"2. Elige el torneo",-1)),PCe={key:0,class:"container__row__wrapper__input"},OCe={class:"container__row__wrapper"},BCe=Jl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"3. Elige el equipo",-1)),DCe={key:0,class:"container__row__wrapper__input"},MCe={class:"container__row"},LCe={class:"container__row__wrapper"},RCe=Jl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"4. Elige el partido",-1)),FCe={key:0,class:"container__row__wrapper__input"},VCe={class:"container__row type-and-advanced"},UCe={class:"container__row__wrapper"},jCe=Jl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"5. Elige el tipo de video",-1)),zCe={class:"container__row__wrapper__input"},HCe={class:"container__row__wrapper center"},qCe=Jl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"Filtrado avanzado",-1)),WCe={class:"container__row__wrapper__input"},GCe={class:"container__row"},KCe={class:"container__action"},XCe={__name:"VideosTeam",props:{tournaments:{type:Array,required:!0},advancedFilterCategories:{type:Object,default:()=>({team:[]})},actionId:{type:Number,required:!0}},emits:["update:tournament","update:season","update:team","click-apply-filters"],setup(e,{emit:t}){const a=e,i={text:"Buscar",width:"100%",padding:"12px 0",borderRadius:"34px",backgroundColor:"#CBEE6B",borderColor:"#CBEE6B",fontColor:"#132634"},n=s.ref(null),r=s.ref(null);s.ref(null);const o=s.ref(null),l=s.ref(null),c=s.ref(null),d=s.ref(null),u=s.ref(!1),h=s.computed(()=>a.advancedFilterCategories.team);function m(ye){n.value=ye,t("update:tournament",ye)}function p(ye){r.value=ye,t("update:season",ye)}function f(ye){l.value=ye,t("update:team",ye)}function y(ye){o.value=ye}function b(ye){c.value=ye}const E=s.ref(ov()),D=s.ref(lv()),M=Kd();let N=null;const P=s.ref(null),L=s.ref([]),V=s.ref([]),$=s.ref([]),U=s.ref([]),ae=s.ref(null),oe=s.ref(!1),Y=s.computed(()=>a.actionId===4&&d.value&&d.value.position_id===1);s.watch(()=>a.advancedFilterCategories,ye=>{ye.team&&(c.value=ye.team[0])},{immediate:!0});function de(ye){const ee=ye.indexOf(".")>-1?ye.substring(0,ye.indexOf(".")):ye,[re,X,R]=ee.split(":").reverse();return(R?Number(R)*60*60:0)+Number(X)*60+Number(re)}function we(ye,ee){let re="",X=0;switch(ye.matchLapse){case 1:re=ye.syncStartFirstTime;break;case 2:re=ye.syncStartSecondTime,X=45;break;case 3:re=ye.syncStartFirstExtraTime,X=90;break;case 4:re=ye.syncStartSecondExtraTime,X=105;break;case 5:re=ye.syncStartPenals,X=120;break}return(!re||re==="0")&&(re="00:00"),de(re)+(de(ye[ee])-X*60)}function Se(ye){ae.value=new Map,N=new Map,ye.forEach(re=>{const X=re.reduce((qe,Ge,J)=>(qe[M[J]]=Ge,qe),{});X.playRaw=re,X.stringMainCategoryName=c.value.name;let R=null,he=null,ve=null,Le=0;if(ve=r.value.mapTeams,Le=r.value.maxGameId,R=r.value.mapGames.get(X.gameId),he=r.value.mapPlayers.get(X.playerId),he&&R&&X.gameId<=Le){X.game=R,X.game.awayTeam.id===X.teamId?(X.teamName=X.game.awayTeam.name,X.rivalName=X.game.homeTeam.name):(X.teamName=X.game.homeTeam.name,X.rivalName=X.game.awayTeam.name),X.playingAs=X.teamId===X.game.homeTeam.id?1:2,X.player=he,X.playerTeamLogo=ve.get(X.player.teamId).logo,X.rivalTeamLogo=ve.get(X.player.teamId===X.game.homeTeam.id?X.game.awayTeam.id:X.game.homeTeam.id).logo,X.startSeconds=we(X,"startTime"),X.endSeconds=we(X,"endTime");const qe=new Date(X.gameDate),[Ge,J]=X.gameHour.split(":");qe.setHours(Ge),qe.setMinutes(J),X.dateTimeMillis=qe.valueOf(),N.has(X.gameId)?N.get(X.gameId).plays.push(X):N.set(X.gameId,{dateTimeMillis:qe.valueOf(),plays:[X]})}});const ee=Array.from(N.values());return ee.sort((re,X)=>X.dateTimeMillis-re.dateTimeMillis),ee.reduce((re,X)=>(X.plays.sort((R,he)=>+`${R.matchLapse}${R.startTime.replace(/:*\.*/g,"")}`-+`${he.matchLapse}${he.startTime.replace(/:*\.*/g,"")}`),re.push(...X.plays),re),[])}function pe(ye,ee,re){const X=Se(ye).reduce((R,he)=>{if(P.value){let ve=!0;if(P.value.requiresRivalTransform&&l.value&&(ve=he.rivalTeamId===l.value.team_id),ve&&P.value.arrayPlayingAs&&([3,4].includes(a.actionId)?ve=!(P.value.requiresRivalTransform&&P.value.arrayPlayingAs.length===1&&he.teamId!==l.value.team_id?P.value.arrayPlayingAs.includes(he.playingAs):!P.value.arrayPlayingAs.includes(he.playingAs)):ve=P.value.arrayPlayingAs.includes(he.playingAs)),ve&&P.value.arrayTimeSections&&(ve=P.value.arrayTimeSections.includes(he.section)),ve&&P.value.coordinatePoint&&P.value.arrayFieldSections){const Le=`${vl(he[`x${P.value.coordinatePoint}`],he[`y${P.value.coordinatePoint}`])+1}`,qe=Qi[Le],Ge=P.value.requiresRivalTransform&&U.value.includes(`${he.categoryId}_r`)?Qi[`${yu[Le]}`]:qe;ve=P.value.arrayFieldSections.includes(Ge)}ve&&R.push(he)}else R.push(he);return R},[]);if(oe.value=X.length===0,!oe.value){let R=-1;P.value.gameId&&(R=X.findIndex(he=>P.value.gameId===he.gameId)),oe.value=R===-1,oe.value||t("apply-filters",{filterData:{arrayFormattedPlays:X,arrayCategoriesIds:[...L.value],arrayRivalCategoriesIds:[...V.value],arrayCategoriesIdsRaw:[...$.value],objectTournamentSelected:{...n.value},objectGameSelected:{...o.value},objectSeasonSelected:{...r.value},stringQueryCategoryIds:ee,stringQueryParams:re,objectFilters:{numberActionId:a.actionId,numberMediaPlayerType:a.actionId===3?3:a.actionId===4?2:1,objectCategorySelected:{...c.value},objectAdvancedFilters:{booleanIsPlayerGoalKeeper:Y,arraySelectedSubcategoryIds:U.value?[...U.value]:null,booleanRequiresRivalTransform:P.value.requiresRivalTransform,numberCoordinatePoint:P.value.coordinatePoint,numberTeamId:a.actionId===3?l.value.team_id:null,numberPlayerId:a.actionId===4?d.value.player_id:null,arrayPlayingAs:P.value.arrayPlayingAs?[...P.value.arrayPlayingAs]:null,arrayTimeSections:P.value.arrayTimeSections?[...P.value.arrayTimeSections]:null,arrayFieldSections:P.value.arrayFieldSections?[...P.value.arrayFieldSections]:null}},numberPlaylistIndex:R},categoryName:c.value.name})}}async function z(ye,ee){try{const re=await Ei.get(`https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/videos/plays/seasons/${r.value.id}?${ye}${ee}`);if(re.data&&re.data.plays){const X=[...re.data.plays];return re.data.plays_rival?X.concat(re.data.plays_rival):X}return[]}catch(re){throw new Error(re)}}function K(ye){const ee=ye||c.value;if(!ee)return;if(ee.booleanIsBestPlays)return ee.arrayCategoriesIds;const re={total:[],toRemove:[]};if(ee.subcategoryGroups&&ee.subcategoryGroups.length?ee.subcategoryGroups[0].forEach(X=>{ue(X,null,re)}):(ee.ids&&re.total.push(...ee.ids),ee.rival_ids&&ee.rival_ids.forEach(X=>{re.total.push(`${X}_r`)})),re.total=re.total.reduce((X,R)=>(re.toRemove.includes(R)||X.push(R),X),[]),!ye){const X=ee.name.toLowerCase().includes("recibid");P.value.isRivalSubject=X,P.value.avoidCategorySingleName=X,P.value.coordinatePoint=ee.coordinatePoint,P.value.requiresRivalTransform=ee.requiresRivalTransform}return re.total}function ue(ye,ee=[],re={total:[],toRemove:[]}){ye.isSelected?ye.childCategories?ye.childCategories.forEach(X=>{const R=ee?Object.entries(ye.idsByFatherCategory).reduce((he,[ve,Le])=>(ee.includes(Number(ve))&&Le.forEach(qe=>{typeof qe=="string"&&qe.endsWith("_r")?he.push(Number(qe.split("_")[0])):he.push(qe)}),he),[]):[ye.id];ue(X,R,re)}):ee?Object.entries(ye.idsByFatherCategory).forEach(([X,R])=>{ee.includes(Number(X))&&R.forEach(he=>{re.total.push(he)})}):ye.level===1?Object.entries(ye.idsByFatherCategory).forEach(([X,R])=>{R.forEach(he=>{re.total.push(he)})}):re.total.push(ye.id):ye.childCategories||ye.ids.forEach(X=>{re.toRemove.push(X)})}async function ie(){try{P.value=null,P.value={arrayPlayingAs:E.value.playingAs.reduce((X,R)=>(R.isSelected&&X.push(R.value),X),[]),arrayTimeSections:E.value.gameSections.reduce((X,R)=>(R.isSelected&&X.push(R.value),X),[]),arrayFieldSections:D},P.value.gameId=o.value.game_id,P.value.requiresRivalTransform=c.value.requiresRivalTransform,U.value=c.value.booleanIsMinutesPlayed?c.value.arrayCategoriesIds:K(),L.value=[],V.value=[],$.value=[];const ye=U.value.reduce((X,R,he)=>{$.value.push(R);let ve=R;const Le=typeof R=="string"&&R.includes("_");return Le?(ve=Number(R.split("_")[0]),V.value.push(ve)):L.value.push(ve),`${X}${he>0?"&":""}${Le?"r":""}categories=${ve}`},""),ee=a.actionId===3?`&team=${l.value.team_id}`:a.actionId===4?`&player=${d.value.player_id}`:"",re=await z(ye,ee);pe(re)}catch(ye){throw new Error(ye)}}function ne(){ie()}function fe(){oe.value=!1}function me(){oe.value=!1,t("cancel")}return(ye,ee)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.withDirectives(s.createVNode(wf,{onModifyFilters:fe,onCancel:me},null,512),[[s.vShow,oe.value]]),s.withDirectives(s.createElementVNode("div",TCe,[s.createElementVNode("div",CCe,[s.createElementVNode("div",kCe,[ECe,s.createElementVNode("div",ICe,[s.createVNode(ei,{items:e.tournaments,"default-item-by-prop":{propName:"id",value:1},itemTextKey:"name",onInput:m},null,8,["items"])])])]),s.createElementVNode("div",xCe,[s.createElementVNode("div",NCe,[ACe,n.value&&n.value.seasons?(s.openBlock(),s.createElementBlock("div",PCe,[s.createVNode(ei,{items:n.value.seasons,itemTextKey:"name",onInput:p},null,8,["items"])])):s.createCommentVNode("",!0)]),s.createElementVNode("div",OCe,[BCe,r.value&&r.value.arrayTeams?(s.openBlock(),s.createElementBlock("div",DCe,[s.createVNode(eP,{items:r.value.arrayTeams,itemTextKey:"stringMatchDayAbbreviation",onInput:f},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",MCe,[s.createElementVNode("div",LCe,[RCe,r.value&&r.value.mapGamesByTeam&&l.value?(s.openBlock(),s.createElementBlock("div",FCe,[s.createVNode(Sf,{items:r.value.mapGamesByTeam.get(l.value.team_id),onInput:y},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",VCe,[s.createElementVNode("div",UCe,[jCe,s.createElementVNode("div",zCe,[s.createVNode(ei,{items:h.value,itemTextKey:"name","is-list-same-width":!1,onInput:b},null,8,["items"])])]),s.createElementVNode("div",HCe,[qCe,s.createElementVNode("div",WCe,[s.createVNode(rv,{modelValue:u.value,"onUpdate:modelValue":ee[0]||(ee[0]=re=>u.value=re)},null,8,["modelValue"])])])]),s.createElementVNode("div",GCe,[s.createVNode(s.Transition,null,{default:s.withCtx(()=>[u.value?(s.openBlock(),s.createBlock(sv,{key:0,"selected-category":c.value,conditions:E.value,"field-areas":D.value},null,8,["selected-category","conditions","field-areas"])):s.createCommentVNode("",!0)]),_:1})])],512),[[s.vShow,!oe.value]]),s.withDirectives(s.createElementVNode("div",KCe,[s.createVNode(Xl,s.mergeProps(i,{onClick:ne}),null,16)],512),[[s.vShow,!oe.value]])],64))}},JCe=bt(XCe,[["__scopeId","data-v-0e429f76"]]),Yl=e=>(s.pushScopeId("data-v-1967b860"),e=e(),s.popScopeId(),e),YCe={class:"container"},QCe={class:"container__row"},ZCe={class:"container__row__wrapper"},$Ce=Yl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"1. Elige la liga",-1)),eke={class:"container__row__wrapper__input"},tke={class:"container__row two-items"},ake={class:"container__row__wrapper"},ike=Yl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"2. Elige el torneo",-1)),nke={key:0,class:"container__row__wrapper__input"},rke={class:"container__row__wrapper"},ske=Yl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"3. Elige la jornada",-1)),oke={key:0,class:"container__row__wrapper__input"},lke={class:"container__row"},cke={class:"container__row__wrapper"},dke=Yl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"4. Elige el partido",-1)),uke={key:0,class:"container__row__wrapper__input"},hke={class:"container__row type-and-advanced"},pke={class:"container__row__wrapper"},mke=Yl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"6. Elige el tipo de video",-1)),fke={class:"container__row__wrapper__input"},gke={class:"container__row__wrapper center"},yke=Yl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"Filtrado avanzado",-1)),_ke={class:"container__row__wrapper__input",style:{width:"fit-content"}},bke={class:"container__row"},vke={class:"container__action"},Ske={__name:"VideosGame",props:{tournaments:{type:Array,required:!0},advancedFilterCategories:{type:Object,default:()=>({games:[]})},actionId:{type:Number,required:!0}},emits:["update:tournament","update:season","click-apply-filters"],setup(e,{emit:t}){const a=e,i={text:"Buscar",width:"100%",padding:"12px 0",borderRadius:"34px",backgroundColor:"#CBEE6B",borderColor:"#CBEE6B",fontColor:"#132634"},n=s.ref(null),r=s.ref(null),o=s.ref(null),l=s.ref(null),c=s.ref(null),d=s.ref(null),u=s.ref(null),h=s.ref(!1),m=s.computed(()=>a.advancedFilterCategories.games);function p(ee){n.value=ee,t("update:tournament",ee)}function f(ee){r.value=ee,t("update:season",ee)}function y(ee){o.value=ee}function b(ee){l.value=ee}function E(ee){c.value=ee}const D=s.ref(ov()),M=s.ref(lv()),N=Kd();let P=null;const L=s.ref(null),V=s.ref([]),$=s.ref([]),U=s.ref([]),ae=s.ref([]),oe=s.ref(null),Y=s.ref(!1),de=s.computed(()=>a.actionId===4&&d.value&&d.value.position_id===1);s.watch(()=>a.advancedFilterCategories,ee=>{ee.team&&(c.value=ee.team[0])},{immediate:!0});function we(ee){const re=ee.indexOf(".")>-1?ee.substring(0,ee.indexOf(".")):ee,[X,R,he]=re.split(":").reverse();return(he?Number(he)*60*60:0)+Number(R)*60+Number(X)}function Se(ee,re){let X="",R=0;switch(ee.matchLapse){case 1:X=ee.syncStartFirstTime;break;case 2:X=ee.syncStartSecondTime,R=45;break;case 3:X=ee.syncStartFirstExtraTime,R=90;break;case 4:X=ee.syncStartSecondExtraTime,R=105;break;case 5:X=ee.syncStartPenals,R=120;break}return(!X||X==="0")&&(X="00:00"),we(X)+(we(ee[re])-R*60)}function pe(ee){oe.value=new Map,P=new Map,ee.forEach(X=>{const R=X.reduce((Ge,J,De)=>(Ge[N[De]]=J,Ge),{});R.playRaw=X,R.stringMainCategoryName=c.value.name;let he=null,ve=null,Le=null,qe=0;if(Le=r.value.mapTeams,qe=r.value.maxGameId,he=r.value.mapGames.get(R.gameId),ve=r.value.mapPlayers.get(R.playerId),ve&&he&&R.gameId<=qe){R.game=he,R.game.awayTeam.id===R.teamId?(R.teamName=R.game.awayTeam.name,R.rivalName=R.game.homeTeam.name):(R.teamName=R.game.homeTeam.name,R.rivalName=R.game.awayTeam.name),R.playingAs=R.teamId===R.game.homeTeam.id?1:2,R.player=ve,R.playerTeamLogo=Le.get(R.player.teamId).logo,R.rivalTeamLogo=Le.get(R.player.teamId===R.game.homeTeam.id?R.game.awayTeam.id:R.game.homeTeam.id).logo,R.startSeconds=Se(R,"startTime"),R.endSeconds=Se(R,"endTime");const Ge=new Date(R.gameDate),[J,De]=R.gameHour.split(":");Ge.setHours(J),Ge.setMinutes(De),R.dateTimeMillis=Ge.valueOf(),P.has(R.gameId)?P.get(R.gameId).plays.push(R):P.set(R.gameId,{dateTimeMillis:Ge.valueOf(),plays:[R]})}});const re=Array.from(P.values());return re.sort((X,R)=>R.dateTimeMillis-X.dateTimeMillis),re.reduce((X,R)=>(R.plays.sort((he,ve)=>+`${he.matchLapse}${he.startTime.replace(/:*\.*/g,"")}`-+`${ve.matchLapse}${ve.startTime.replace(/:*\.*/g,"")}`),X.push(...R.plays),X),[])}function z(ee,re,X){const R=pe(ee).reduce((he,ve)=>{if(L.value){let Le=!0;if(L.value.requiresRivalTransform&&u.value&&(Le=ve.rivalTeamId===u.value.team_id),Le&&L.value.arrayPlayingAs&&([3,4].includes(a.actionId)?Le=!(L.value.requiresRivalTransform&&L.value.arrayPlayingAs.length===1&&ve.teamId!==u.value.team_id?L.value.arrayPlayingAs.includes(ve.playingAs):!L.value.arrayPlayingAs.includes(ve.playingAs)):Le=L.value.arrayPlayingAs.includes(ve.playingAs)),Le&&L.value.arrayTimeSections&&(Le=L.value.arrayTimeSections.includes(ve.section)),Le&&L.value.coordinatePoint&&L.value.arrayFieldSections){const qe=`${vl(ve[`x${L.value.coordinatePoint}`],ve[`y${L.value.coordinatePoint}`])+1}`,Ge=Qi[qe],J=L.value.requiresRivalTransform&&ae.value.includes(`${ve.categoryId}_r`)?Qi[`${yu[qe]}`]:Ge;Le=L.value.arrayFieldSections.includes(J)}Le&&he.push(ve)}else he.push(ve);return he},[]);if(Y.value=R.length===0,!Y.value){let he=-1;L.value.gameId&&(he=R.findIndex(ve=>L.value.gameId===ve.gameId)),Y.value=he===-1,Y.value||t("apply-filters",{filterData:{arrayFormattedPlays:R,arrayCategoriesIds:[...V.value],arrayRivalCategoriesIds:[...$.value],arrayCategoriesIdsRaw:[...U.value],objectTournamentSelected:{...n.value},objectGameSelected:{...l.value},objectSeasonSelected:{...r.value},stringQueryCategoryIds:re,stringQueryParams:X,objectFilters:{numberActionId:a.actionId,numberMediaPlayerType:a.actionId===3?3:a.actionId===4?2:1,objectCategorySelected:{...c.value},objectAdvancedFilters:{booleanIsPlayerGoalKeeper:de,arraySelectedSubcategoryIds:ae.value?[...ae.value]:null,booleanRequiresRivalTransform:L.value.requiresRivalTransform,numberCoordinatePoint:L.value.coordinatePoint,numberTeamId:a.actionId===3?u.value.team_id:null,numberPlayerId:a.actionId===4?d.value.player_id:null,arrayPlayingAs:L.value.arrayPlayingAs?[...L.value.arrayPlayingAs]:null,arrayTimeSections:L.value.arrayTimeSections?[...L.value.arrayTimeSections]:null,arrayFieldSections:L.value.arrayFieldSections?[...L.value.arrayFieldSections]:null}},numberPlaylistIndex:he},categoryName:c.value.name})}}async function K(ee,re){try{const X=await Ei.get(`https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/videos/plays/seasons/${r.value.id}?${ee}${re}`);if(X.data&&X.data.plays){const R=[...X.data.plays];return X.data.plays_rival?R.concat(X.data.plays_rival):R}return[]}catch(X){throw new Error(X)}}function ue(ee){const re=ee||c.value;if(!re)return;if(re.booleanIsBestPlays)return re.arrayCategoriesIds;const X={total:[],toRemove:[]};if(re.subcategoryGroups&&re.subcategoryGroups.length?re.subcategoryGroups[0].forEach(R=>{ie(R,null,X)}):(re.ids&&X.total.push(...re.ids),re.rival_ids&&re.rival_ids.forEach(R=>{X.total.push(`${R}_r`)})),X.total=X.total.reduce((R,he)=>(X.toRemove.includes(he)||R.push(he),R),[]),!ee){const R=re.name.toLowerCase().includes("recibid");L.value.isRivalSubject=R,L.value.avoidCategorySingleName=R,L.value.coordinatePoint=re.coordinatePoint,L.value.requiresRivalTransform=re.requiresRivalTransform}return X.total}function ie(ee,re=[],X={total:[],toRemove:[]}){ee.isSelected?ee.childCategories?ee.childCategories.forEach(R=>{const he=re?Object.entries(ee.idsByFatherCategory).reduce((ve,[Le,qe])=>(re.includes(Number(Le))&&qe.forEach(Ge=>{typeof Ge=="string"&&Ge.endsWith("_r")?ve.push(Number(Ge.split("_")[0])):ve.push(Ge)}),ve),[]):[ee.id];ie(R,he,X)}):re?Object.entries(ee.idsByFatherCategory).forEach(([R,he])=>{re.includes(Number(R))&&he.forEach(ve=>{X.total.push(ve)})}):ee.level===1?Object.entries(ee.idsByFatherCategory).forEach(([R,he])=>{he.forEach(ve=>{X.total.push(ve)})}):X.total.push(ee.id):ee.childCategories||ee.ids.forEach(R=>{X.toRemove.push(R)})}async function ne(){try{L.value=null,L.value={arrayPlayingAs:D.value.playingAs.reduce((R,he)=>(he.isSelected&&R.push(he.value),R),[]),arrayTimeSections:D.value.gameSections.reduce((R,he)=>(he.isSelected&&R.push(he.value),R),[]),arrayFieldSections:M},L.value.gameId=l.value.game_id,L.value.requiresRivalTransform=c.value.requiresRivalTransform,ae.value=c.value.booleanIsMinutesPlayed?c.value.arrayCategoriesIds:ue(),V.value=[],$.value=[],U.value=[];const ee=ae.value.reduce((R,he,ve)=>{U.value.push(he);let Le=he;const qe=typeof he=="string"&&he.includes("_");return qe?(Le=Number(he.split("_")[0]),$.value.push(Le)):V.value.push(Le),`${R}${ve>0?"&":""}${qe?"r":""}categories=${Le}`},""),re=a.actionId===3?`&team=${u.value.team_id}`:a.actionId===4?`&player=${d.value.player_id}`:"",X=await K(ee,re);z(X)}catch(ee){throw new Error(ee)}}function fe(){ne()}function me(){Y.value=!1}function ye(){Y.value=!1,t("cancel")}return(ee,re)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.withDirectives(s.createVNode(wf,{onModifyFilters:me,onCancel:ye},null,512),[[s.vShow,Y.value]]),s.withDirectives(s.createElementVNode("div",YCe,[s.createElementVNode("div",QCe,[s.createElementVNode("div",ZCe,[$Ce,s.createElementVNode("div",eke,[s.createVNode(ei,{items:e.tournaments,"default-item-by-prop":{propName:"id",value:1},itemTextKey:"name",onInput:p},null,8,["items"])])])]),s.createElementVNode("div",tke,[s.createElementVNode("div",ake,[ike,n.value&&n.value.seasons?(s.openBlock(),s.createElementBlock("div",nke,[s.createVNode(ei,{items:n.value.seasons,itemTextKey:"name",onInput:f},null,8,["items"])])):s.createCommentVNode("",!0)]),s.createElementVNode("div",rke,[ske,r.value&&r.value.arrayMatchDays?(s.openBlock(),s.createElementBlock("div",oke,[s.createVNode(ei,{items:r.value.arrayMatchDays,itemTextKey:"stringMatchDayAbbreviation",onInput:y},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",lke,[s.createElementVNode("div",cke,[dke,o.value&&o.value.arrayGames?(s.openBlock(),s.createElementBlock("div",uke,[s.createVNode(Sf,{items:o.value.arrayGames,onInput:b},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",hke,[s.createElementVNode("div",pke,[mke,s.createElementVNode("div",fke,[s.createVNode(ei,{items:m.value,itemTextKey:"name","is-list-same-width":!1,onInput:E},null,8,["items"])])]),s.createElementVNode("div",gke,[yke,s.createElementVNode("div",_ke,[s.createVNode(rv,{modelValue:h.value,"onUpdate:modelValue":re[0]||(re[0]=X=>h.value=X)},null,8,["modelValue"])])])]),s.createElementVNode("div",bke,[s.createVNode(s.Transition,null,{default:s.withCtx(()=>[h.value?(s.openBlock(),s.createBlock(sv,{key:0,"selected-category":c.value,conditions:D.value,"field-areas":M.value},null,8,["selected-category","conditions","field-areas"])):s.createCommentVNode("",!0)]),_:1})])],512),[[s.vShow,!Y.value]]),s.withDirectives(s.createElementVNode("div",vke,[s.createVNode(Xl,s.mergeProps(i,{onClick:fe}),null,16)],512),[[s.vShow,!Y.value]])],64))}},wke=bt(Ske,[["__scopeId","data-v-1967b860"]]),Tke={class:"template-videos"},Cke={class:"template-videos__header"},kke={class:"template-videos__body"},Eke=s.defineComponent({name:"TemplateVideos",components:{VideosGoals:NTe,VideosPlayer:wCe,VideosTeam:JCe,VideosGame:wke}}),Ike=Object.assign(Eke,{props:{gamesUrl:{type:String,default:"https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?"},tournamentsUrl:{type:String,default:"https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/tournaments"},playersUrl:{type:String,default:"https://ts7thxzaik.execute-api.us-west-2.amazonaws.com/prod/players/seasons/"},token:{type:String,default:""},filterTypeToSetUp:{type:Object,default:null}},emits:["loading-data","apply-filters","cancel"],setup(e,{emit:t}){const a=e,i={padding:"4px 18px",borderRadius:"160px",backgroundColor:"#3A4851",borderColor:"#3A4851",activeBorderColor:"#CBEE6B",fontSize:"11px",fontColor:"#FFFFFF"},n=[],r=["g-23","g-24","g-25"],o={games:[607,608,12,55,54,35,14,52,15,53,466,477],team:[607,608,12,55,54,35,14,52,15,53,466,477,40,257,39],player:{regular:[12,35,10,27,607,61,519,98,101,109,112,121,122,127,128,135,136,141,142,161,170,179,702,730,466,217,211,232,235,239,242,282,284,289,291,296,485,486,487,488,14,15,257],goalkeeper:[55,324,323,608,39,774,802,52,53,40,54]}},l={player:1,team:2,goalkeeper:3},c=s.ref(YA),d=s.ref([]),u=s.ref(c.value[0]),h=s.ref({}),m=s.ref({}),p=s.ref({}),f=s.ref({}),y=s.ref({games:[],player:[],team:[],goalkeeper:[],isEmpty:!0}),b=s.ref([]);s.ref({});const E=s.ref(null);s.ref(null),s.watch(h,ie=>{m.value.numberSeasonSelectedIndex=m.value.seasons.findIndex(ne=>ne.id===ie.id),ie.arrayMatchDays?(f.value=ie.arrayMatchDays[0]||{},p.value=ie.arrayTeams[0]||{}):(L(ie),V(ie))}),s.watch(p,()=>{setTimeout(()=>{h.value.mapPlayersByTeam&&(!p.value.arrayPlayers||!p.value.arrayPlayers.length)&&(p.value.arrayPlayers=h.value.mapPlayersByTeam.get(p.value.team_id))},700)}),s.watch(()=>a.filterTypeToSetUp,ie=>{ie&&(u.value=ie)},{immediate:!0});async function D(){try{d.value=await M()}catch(ie){throw new Error(ie)}}async function M(){try{const ie={Authorization:tv()||a.token},ne={}.API_TOURNAMENTS||a.tournamentsUrl,fe=await Ei.get(ne,{headers:ie});return fe.data?fe.data.map(me=>({...me.tournament,seasons:me.seasons})):[]}catch(ie){return Promise.reject(ie)}}async function N(ie,ne,fe=""){t("loading-data");let me=fe;try{me||(me={}.API_CALENDAR_GAMES_BY_SEASON||a.gamesUrl,ie.forEach((X,R)=>{me+=`${R===0?"":"&"}seasons=${X}`}));const ye={Authorization:tv()||a.token},{data:{data:ee,teams:re}}=await Ei.get(me,{headers:ye});return{seasonsAndGames:ee,seasonsAndTeams:re}}catch(ye){if(ne>0)return N(ie,ne-1,me);throw new Error(ye)}finally{t("loading-data")}}async function P(ie){try{const ne={Authorization:tv()||a.token},fe=` ${{}.API_PLAYERS_BY_SEASON||a.playersUrl}${ie.seasonId}`,me=await Ei.get(fe,{headers:ne});return me.data?me.data.players:[]}catch(ne){return Promise.reject(ne)}}async function L(ie){try{const{seasonsAndGames:ne,seasonsAndTeams:fe}=await N([ie.id,...ie.related_seasons.map(re=>re.id)],3),me=fe.find(re=>re._id===ie.id);h.value.arrayTeams=[],h.value.mapTeams=new Map;const ye=me.teams.reduce((re,X)=>(h.value.arrayTeams.push(X),h.value.mapTeams.set(X.team_id,{name:X.colloquial_name,acronym:X.acronym,logo:X.logo,id:X.team_id}),re.set(X.team_id,X),re),new Map);p.value=h.value.arrayTeams[0],h.value.mapGames=new Map,h.value.mapGamesByTeam=new Map;const ee=Array.from(ne.reduce((re,X)=>(X.games.forEach(R=>{if(R.game_status===1&&R.has_video){(!h.value.maxGameId||R.game_id>h.value.maxGameId)&&(h.value.maxGameId=R.game_id);let he=R.matchday_abbreviation.replace("M","J"),ve=R.matchday_abbreviation.replace("M","Jornada ");const Le=R.matchday_abbreviation.replace("M","");X.season_type===0?m.value.tournament_type===1&&(R.seasonId===881?(he=vwe[Le]||he,ve=bwe[Le]||ve):(he=QA[R.matchday_abbreviation]?R.matchday_abbreviation:he,ve=QA[R.matchday_abbreviation]||ve,he==="FINAL"&&(he="F"))):X.season_type===1?(he=_we[R.matchday_abbreviation],ve=he):(he=R.matchday_abbreviation.replace("PO","R"),ve="Repechaje"),R.roundAbbreviation=he,R.roundName=ve,h.value.mapGames.set(R.game_id,{id:R.game_id,date:R.date,dateTimeMillis:new Date(R.date_time_utc).valueOf(),homeTeam:h.value.mapTeams.get(R.home_team),awayTeam:h.value.mapTeams.get(R.visiting_team),roundAbbreviation:R.roundAbbreviation,roundName:R.roundName,score:R.score,gameResult:R.score[0]>R.score[1]?1:R.score[0]<R.score[1]?2:3,seasonId:X.season_id});const qe=re.get(R.roundAbbreviation);R.numberDateTimeMillis=new Date(R.date_time_utc).getTime(),R.homeTeam=ye.get(R.home_team),R.awayTeam=ye.get(R.visiting_team);const Ge=h.value.mapGamesByTeam.get(R.home_team),J=h.value.mapGamesByTeam.get(R.visiting_team);Ge?Ge.push(R):h.value.mapGamesByTeam.set(R.home_team,[R]),J?J.push(R):h.value.mapGamesByTeam.set(R.visiting_team,[R]),qe?qe.arrayGames.push(R):re.set(R.roundAbbreviation,{stringMatchDayAbbreviation:R.roundAbbreviation,stringMatchDayName:R.roundName,arrayGames:[R]})}}),re),new Map).values());ee.reverse(),ee.forEach(re=>{re.arrayGames.sort((X,R)=>X.numberDateTimeMillis-R.numberDateTimeMillis)}),h.value.arrayMatchDays=ee,f.value=ee[0]||{}}catch(ne){throw new Error(ne)}}async function V(ie){try{const ne=await Y(ie.id);h.value.mapPlayers=new Map,h.value.mapPlayersByTeam=ne.reduce((fe,me)=>{h.value.mapPlayers.set(me.player_id,{id:me.player_id,name:me.player_name,shortName:me.shortName,photo:me.player_photo,teamId:me.team_id,positionId:me.position_id});const ye=fe.get(me.team_id);return ye?ye.push(me):fe.set(me.team_id,[me]),fe},new Map)}catch(ne){throw new Error(ne)}}async function $(){try{let ie=[];y.value.isEmpty?(ie=await de(),b.value={...ie}):ie=b.value;const ne=[];if(ie&&ie.length){y.value=ie.reduce((X,R)=>{if(R.group_id!=="g-55"){const he={idAux:R.group_id,ids:[...R.ids?R.ids:[],...R.rival_Ids?R.rival_Ids:[]],type:R.type,name:R.name,coordinatePoint:R.coordinate_point,requiresRivalTransform:r.includes(R.group_id)};he.idsAux=[...he.ids],he.subcategoryGroups=R.group_id==="g-12"?[]:U(R,0,new Map,!1,{},he.idsAux),ne.push(he),he.type.includes(l.player)&&X.player.push(he),he.type.includes(l.team)&&(he.idAux!=="g-2"&&X.games.push(he),X.team.push(he)),he.type.includes(l.goalkeeper)&&X.goalkeeper.push(he)}return X},{games:[],player:[],team:[],goalkeeper:[],isEmpty:!1});const fe=new Map,me="Resumen",ye="Todas sus jugadas",ee=y.value.player.reduce((X,R)=>{const he=ae(R);return he.forEach(ve=>{fe.set(ve,R.name)}),X.push(...he),X},[]),re=y.value.goalkeeper.reduce((X,R)=>{const he=ae(R);return he.forEach(ve=>{fe.set(ve,R.name)}),X.push(...he),X},[]);y.value.games.unshift({name:me,arrayCategoriesIds:o.games,booleanIsBestPlays:!0}),y.value.team.unshift({name:me,arrayCategoriesIds:o.team,booleanIsBestPlays:!0}),y.value.player.unshift({name:me,arrayCategoriesIds:o.player.regular,booleanIsBestPlays:!0},{name:ye,arrayCategoriesIds:ee,booleanIsMinutesPlayed:!0}),y.value.goalkeeper.unshift({name:me,arrayCategoriesIds:o.player.goalkeeper,booleanIsBestPlays:!0},{name:ye,arrayCategoriesIds:re,booleanIsMinutesPlayed:!0})}}catch(ie){throw new Error(ie)}}function U(ie,ne=0,fe=new Map,me=!1,ye={},ee=[]){if(!ie.group_id)return;let re=fe.get(ne);const X=me?`${ie.id_category}_r`:ie.id_category;ie.id_category&&ee.push(ie.id_category);let R={ids:[X],groupId:ie.group_id,level:ne,name:ie.name,isSelected:!0,fatherCategories:ne>0?[ye]:[],idsByFatherCategory:{[ie.category_father]:[X]}};if(ne>0&&ne===1&&(R.id=ie.id_category),re&&ne!==0){const he=ie.group_id.charAt(ie.group_id.length-1),ve=re.find(Le=>Le.groupId.endsWith(he));ve&&!n.includes(R.groupId)?(R=ve,ve.ids.push(X),ve.fatherCategories.push(ye),ve.fatherCategories.forEach(Le=>{Le.childCategories?Le.childCategories.find(qe=>qe.groupId===R.groupId)||Le.childCategories.push(R):Le.childCategories=[R]}),ve.idsByFatherCategory[ie.category_father]?ve.idsByFatherCategory[ie.category_father].push(X):ve.idsByFatherCategory[ie.category_father]=[X]):(R.fatherCategories.forEach(Le=>{Le.childCategories?Le.childCategories.find(qe=>qe.groupId===R.groupId)||Le.childCategories.push(R):Le.childCategories=[R]}),re.push(R))}else ne!==0&&(ye.childCategories?ye.childCategories.push(R):ye.childCategories=[R],re=[R],fe.set(ne,re));if(ie.categories&&ie.categories.length?ie.categories.forEach(he=>{U(he,ne+1,fe,me,R,ee)}):ie.rival_categories&&ie.rival_categories.length&&ie.rival_categories.forEach(he=>{U(he,ne+1,fe,!0,R,ee)}),ne===0)return Array.from(fe.values())}function ae(ie){const ne=ie||ie;if(ne.booleanIsBestPlays)return ne.arrayCategoriesIds;const fe={total:[],toRemove:[]};if(ne.subcategoryGroups&&ne.subcategoryGroups.length?ne.subcategoryGroups[0].forEach(me=>{oe(me,null,fe)}):(ne.ids&&fe.total.push(...ne.ids),ne.rival_ids&&ne.rival_ids.forEach(me=>{fe.total.push(`${me}_r`)})),fe.total=fe.total.reduce((me,ye)=>(fe.toRemove.includes(ye)||me.push(ye),me),[]),!ie){const me=ne.name.toLowerCase().includes("recibid");E.value.isRivalSubject=me,E.value.avoidCategorySingleName=me,E.value.coordinatePoint=ne.coordinatePoint,E.value.requiresRivalTransform=ne.requiresRivalTransform}return fe.total}function oe(ie,ne=[],fe={total:[],toRemove:[]}){ie.isSelected?ie.childCategories?ie.childCategories.forEach(me=>{const ye=ne?Object.entries(ie.idsByFatherCategory).reduce((ee,[re,X])=>(ne.includes(Number(re))&&X.forEach(R=>{typeof R=="string"&&R.endsWith("_r")?ee.push(Number(R.split("_")[0])):ee.push(R)}),ee),[]):[ie.id];oe(me,ye,fe)}):ne?Object.entries(ie.idsByFatherCategory).forEach(([me,ye])=>{ne.includes(Number(me))&&ye.forEach(ee=>{fe.total.push(ee)})}):ie.level===1?Object.entries(ie.idsByFatherCategory).forEach(([me,ye])=>{ye.forEach(ee=>{fe.total.push(ee)})}):fe.total.push(ie.id):ie.childCategories||ie.ids.forEach(me=>{fe.toRemove.push(me)})}async function Y(ie){try{const ne=await P({seasonId:ie});return ne.forEach(fe=>{const[me,ye]=fe.player_name.split(","),ee=me.split(" ");let re="";for(const X of ee)if(re+=` ${X}`,X.length>3)break;fe.shortName=ye&&me?`${ye.trim().charAt(0)}.${re}`:""}),ne}catch(ne){return Promise.reject(ne)}}async function de(){try{const ie={Authorization:localStorage.getItem("user_token")||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"};return(await Ei.get("https://2gfppi9wb6.execute-api.us-east-2.amazonaws.com/prod/videos/categories",{headers:ie})).data||[]}catch(ie){return Promise.reject(ie)}}function we(ie){u.value=ie}function Se(ie){m.value=ie}function pe(ie){h.value=ie}function z(ie){p.value=ie}function K(ie){t("apply-filters",ie)}function ue(){u.value=c.value[0],t("cancel")}return D(),$(),(ie,ne)=>(s.openBlock(),s.createElementBlock("div",Tke,[s.createElementVNode("div",Cke,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.value,fe=>(s.openBlock(),s.createBlock(Xl,s.mergeProps({key:fe.name},i,{text:fe.name,"is-active":u.value.componentName===fe.componentName,tournaments:d.value,onClick:me=>we(fe)}),null,16,["text","is-active","tournaments","onClick"]))),128))]),s.createElementVNode("div",kke,[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(u.value.componentName),{tournaments:d.value,"advanced-filter-categories":y.value,"action-id":u.value.actionId,onApplyFilters:K,onCancel:ue,"onUpdate:tournament":Se,"onUpdate:season":pe,"onUpdate:team":z},null,40,["tournaments","advanced-filter-categories","action-id"]))])]))}}),xke=bt(Ike,[["__scopeId","data-v-6a7442aa"]]),Nke=e=>(s.pushScopeId("data-v-b3e59e8c"),e=e(),s.popScopeId(),e),Ake={class:"search-filters__input"},Pke=Nke(()=>s.createElementVNode("div",{class:"search-filters__input__icon"},[s.createElementVNode("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),s.createElementVNode("path",{d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),s.createElementVNode("path",{d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})])],-1)),Oke=["value"],Bke={ref:"categoryInput",class:"search-input-icon",type:"text",readonly:""},Dke={class:"search-filters__menu"},Mke={__name:"SearchFilters",props:{clientWidth:{type:Number,default:0},filterTypeToSetUp:{type:Object,default:null}},emits:["apply-filters"],setup(e,{emit:t}){const a=e,i=s.ref("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"),n=s.ref(!1),r=s.ref("");s.ref(null);const o=s.computed(()=>"Por categoría"),l=s.computed(()=>{let u=[];return a.clientWidth>0&&(a.clientWidth<=560?u.push("search-filters__480"):a.clientWidth<=1280?u.push("search-filters__1280"):u.push("search-filters")),u});s.watch(()=>a.filterTypeToSetUp,u=>{u&&(n.value=!0)});function c(u){r.value=u.categoryName,t("apply-filters",u.filterData),n.value=!1}function d(){r.value="",n.value=!1}return(u,h)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["search-filters",l.value])},[s.createVNode(s.unref(JA),{modelValue:n.value,"onUpdate:modelValue":h[0]||(h[0]=m=>n.value=m),"menu-margin-top":8},{trigger:s.withCtx(()=>[s.createElementVNode("div",Ake,[Pke,s.createElementVNode("input",{ref:"categoryInput",class:"search-input-name",value:o.value,type:"text",readonly:""},null,8,Oke),s.createElementVNode("input",Bke,null,512)])]),menu:s.withCtx(()=>[s.createElementVNode("div",Dke,[s.createVNode(xke,{"filter-type-to-set-up":e.filterTypeToSetUp,token:i.value,onApplyFilters:c,onCancel:d},null,8,["filter-type-to-set-up","token"])])]),_:1},8,["modelValue"])],2))}},Lke=bt(Mke,[["__scopeId","data-v-b3e59e8c"]]);/**
304
+ `.split("").map(function(e){return e.charCodeAt(0)})),cve=function(e){Re(t,e);function t(){return e.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return t}(B2(Error)),dve=function(e){Re(t,e);function t(i,n){var r;return n===void 0&&(n={}),r=e.call(this,i,n)||this,r.mediaSource_=null,r.subtitlesTrack_=null,r.loaderType_="subtitle",r.featuresNativeTextTracks_=i.featuresNativeTextTracks,r.loadVttJs=i.loadVttJs,r.shouldSaveSegmentTimingInfo_=!1,r}var a=t.prototype;return a.createTransmuxer_=function(){return null},a.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return te.createTimeRanges();var i=this.subtitlesTrack_.cues,n=i[0].startTime,r=i[i.length-1].startTime;return te.createTimeRanges([[n,r]])},a.initSegmentForMap=function(i,n){if(n===void 0&&(n=!1),!i)return null;var r=pf(i),o=this.initSegments_[r];if(n&&!o&&i.bytes){var l=jA.byteLength+i.bytes.byteLength,c=new Uint8Array(l);c.set(i.bytes),c.set(jA,i.bytes.byteLength),this.initSegments_[r]=o={resolvedUri:i.resolvedUri,byterange:i.byterange,bytes:c}}return o||i},a.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},a.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},a.track=function(i){return typeof i>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=i,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},a.remove=function(i,n){mu(i,n,this.subtitlesTrack_)},a.fillBuffer_=function(){var i=this,n=this.chooseNextRequest_();if(n){if(this.syncController_.timestampOffsetForTimeline(n.timeline)===null){var r=function(){i.state="READY",i.paused()||i.monitorBuffer_()};this.syncController_.one("timestampoffset",r),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(n)}},a.timestampOffsetForSegment_=function(){return null},a.chooseNextRequest_=function(){return this.skipEmptySegments_(e.prototype.chooseNextRequest_.call(this))},a.skipEmptySegments_=function(i){for(;i&&i.segment.empty;){if(i.mediaIndex+1>=i.playlist.segments.length){i=null;break}i=this.generateSegmentInfo_({playlist:i.playlist,mediaIndex:i.mediaIndex+1,startOfSegment:i.startOfSegment+i.duration,isSyncRequest:i.isSyncRequest})}return i},a.stopForError=function(i){this.error(i),this.state="READY",this.pause(),this.trigger("error")},a.segmentRequestFinished_=function(i,n,r){var o=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(n.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(i){i.code===Ln.TIMEOUT&&this.handleTimeout_(),i.code===Ln.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(i);return}var l=this.pendingSegment_;this.saveBandwidthRelatedStats_(l.duration,n.stats),n.key&&this.segmentKey(n.key,!0),this.state="APPENDING",this.trigger("appending");var c=l.segment;if(c.map&&(c.map.bytes=n.map.bytes),l.bytes=n.bytes,typeof O.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(function(){return o.segmentRequestFinished_(i,n,r)},function(){return o.stopForError({message:"Error loading vtt.js"})});return}c.requested=!0;try{this.parseVTTCues_(l)}catch(d){this.stopForError({message:d.message});return}if(this.updateTimeMapping_(l,this.syncController_.timelines[l.timeline],this.playlist_),l.cues.length?l.timingInfo={start:l.cues[0].startTime,end:l.cues[l.cues.length-1].endTime}:l.timingInfo={start:l.startOfSegment,end:l.startOfSegment+l.duration},l.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}l.byteLength=l.bytes.byteLength,this.mediaSecondsLoaded+=c.duration,l.cues.forEach(function(d){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new O.VTTCue(d.startTime,d.endTime,d.text):d)}),J1e(this.subtitlesTrack_),this.handleAppendsDone_()},a.handleData_=function(){},a.updateTimingInfoEnd_=function(){},a.parseVTTCues_=function(i){var n,r=!1;if(typeof O.WebVTT!="function")throw new cve;typeof O.TextDecoder=="function"?n=new O.TextDecoder("utf8"):(n=O.WebVTT.StringDecoder(),r=!0);var o=new O.WebVTT.Parser(O,O.vttjs,n);if(i.cues=[],i.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=i.cues.push.bind(i.cues),o.ontimestampmap=function(d){i.timestampmap=d},o.onparsingerror=function(d){te.log.warn("Error encountered when parsing cues: "+d.message)},i.segment.map){var l=i.segment.map.bytes;r&&(l=UA(l)),o.parse(l)}var c=i.bytes;r&&(c=UA(c)),o.parse(c),o.flush()},a.updateTimeMapping_=function(i,n,r){var o=i.segment;if(n){if(!i.cues.length){o.empty=!0;return}var l=i.timestampmap,c=l.MPEGTS/Bm.ONE_SECOND_IN_TS-l.LOCAL+n.mapping;if(i.cues.forEach(function(h){h.startTime+=c,h.endTime+=c}),!r.syncInfo){var d=i.cues[0].startTime,u=i.cues[i.cues.length-1].startTime;r.syncInfo={mediaSequence:r.mediaSequence+i.mediaIndex,time:Math.min(d,u-o.duration)}}}},t}(J1),uve=function(e,t){for(var a=e.cues,i=0;i<a.length;i++){var n=a[i];if(t>=n.adStartTime&&t<=n.adEndTime)return n}return null},hve=function(e,t,a){if(a===void 0&&(a=0),!!e.segments)for(var i=a,n,r=0;r<e.segments.length;r++){var o=e.segments[r];if(n||(n=uve(t,i+o.duration/2)),n){if("cueIn"in o){n.endTime=i,n.adEndTime=i,i+=o.duration,n=null;continue}if(i<n.endTime){i+=o.duration;continue}n.endTime+=o.duration}else if("cueOut"in o&&(n=new O.VTTCue(i,i+o.duration,o.cueOut),n.adStartTime=i,n.adEndTime=i+parseFloat(o.cueOut),t.addCue(n)),"cueOutCont"in o){var l=o.cueOutCont.split("/").map(parseFloat),c=l[0],d=l[1];n=new O.VTTCue(i,i+o.duration,""),n.adStartTime=i-c,n.adEndTime=n.adStartTime+d,t.addCue(n)}i+=o.duration}},pve=86400,zA=[{name:"VOD",run:function(e,t,a,i,n){if(a!==1/0){var r={time:0,segmentIndex:0,partIndex:null};return r}return null}},{name:"ProgramDateTime",run:function(e,t,a,i,n){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var r=null,o=null,l=D1(t);n=n||0;for(var c=0;c<l.length;c++){var d=t.endList||n===0?c:l.length-(c+1),u=l[d],h=u.segment,m=e.timelineToDatetimeMappings[h.timeline];if(!(!m||!h.dateTimeObject)){var p=h.dateTimeObject.getTime()/1e3,f=p+m;if(h.parts&&typeof u.partIndex=="number")for(var y=0;y<u.partIndex;y++)f+=h.parts[y].duration;var b=Math.abs(n-f);if(o!==null&&(b===0||o<b))break;o=b,r={time:f,segmentIndex:u.segmentIndex,partIndex:u.partIndex}}}return r}},{name:"Segment",run:function(e,t,a,i,n){var r=null,o=null;n=n||0;for(var l=D1(t),c=0;c<l.length;c++){var d=t.endList||n===0?c:l.length-(c+1),u=l[d],h=u.segment,m=u.part&&u.part.start||h&&h.start;if(h.timeline===i&&typeof m<"u"){var p=Math.abs(n-m);if(o!==null&&o<p)break;(!r||o===null||o>=p)&&(o=p,r={time:m,segmentIndex:u.segmentIndex,partIndex:u.partIndex})}}return r}},{name:"Discontinuity",run:function(e,t,a,i,n){var r=null;if(n=n||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var o=null,l=0;l<t.discontinuityStarts.length;l++){var c=t.discontinuityStarts[l],d=t.discontinuitySequence+l+1,u=e.discontinuities[d];if(u){var h=Math.abs(n-u.time);if(o!==null&&o<h)break;(!r||o===null||o>=h)&&(o=h,r={time:u.time,segmentIndex:c,partIndex:null})}}return r}},{name:"Playlist",run:function(e,t,a,i,n){if(t.syncInfo){var r={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return r}return null}}],mve=function(e){Re(t,e);function t(i){var n;return n=e.call(this)||this,n.timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=Yi("SyncController"),n}var a=t.prototype;return a.getSyncPoint=function(i,n,r,o){var l=this.runStrategies_(i,n,r,o);return l.length?this.selectSyncPoint_(l,{key:"time",value:o}):null},a.getExpiredTime=function(i,n){if(!i||!i.segments)return null;var r=this.runStrategies_(i,n,i.discontinuitySequence,0);if(!r.length)return null;var o=this.selectSyncPoint_(r,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+uu({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:o.segmentIndex,endIndex:0}))},a.runStrategies_=function(i,n,r,o){for(var l=[],c=0;c<zA.length;c++){var d=zA[c],u=d.run(this,i,n,r,o);u&&(u.strategy=d.name,l.push({strategy:d.name,syncPoint:u}))}return l},a.selectSyncPoint_=function(i,n){for(var r=i[0].syncPoint,o=Math.abs(i[0].syncPoint[n.key]-n.value),l=i[0].strategy,c=1;c<i.length;c++){var d=Math.abs(i[c].syncPoint[n.key]-n.value);d<o&&(o=d,r=i[c].syncPoint,l=i[c].strategy)}return this.logger_("syncPoint for ["+n.key+": "+n.value+"] chosen with strategy"+(" ["+l+"]: [time:"+r.time+",")+(" segmentIndex:"+r.segmentIndex)+(typeof r.partIndex=="number"?",partIndex:"+r.partIndex:"")+"]"),r},a.saveExpiredSegmentInfo=function(i,n){var r=n.mediaSequence-i.mediaSequence;if(r>pve){te.log.warn("Not saving expired segment info. Media sequence gap "+r+" is too large.");return}for(var o=r-1;o>=0;o--){var l=i.segments[o];if(l&&typeof l.start<"u"){n.syncInfo={mediaSequence:i.mediaSequence+o,time:l.start},this.logger_("playlist refresh sync: [time:"+n.syncInfo.time+","+(" mediaSequence: "+n.syncInfo.mediaSequence+"]")),this.trigger("syncinfoupdate");break}}},a.setDateTimeMappingForStart=function(i){if(this.timelineToDatetimeMappings={},i.segments&&i.segments.length&&i.segments[0].dateTimeObject){var n=i.segments[0],r=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-r}},a.saveSegmentTimingInfo=function(i){var n=i.segmentInfo,r=i.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(n,n.timingInfo,r),l=n.segment;o&&(this.saveDiscontinuitySyncInfo_(n),n.playlist.syncInfo||(n.playlist.syncInfo={mediaSequence:n.playlist.mediaSequence+n.mediaIndex,time:l.start}));var c=l.dateTimeObject;l.discontinuity&&r&&c&&(this.timelineToDatetimeMappings[l.timeline]=-(c.getTime()/1e3))},a.timestampOffsetForTimeline=function(i){return typeof this.timelines[i]>"u"?null:this.timelines[i].time},a.mappingForTimeline=function(i){return typeof this.timelines[i]>"u"?null:this.timelines[i].mapping},a.calculateSegmentTimeMapping_=function(i,n,r){var o=i.segment,l=i.part,c=this.timelines[i.timeline],d,u;if(typeof i.timestampOffset=="number")c={time:i.startOfSegment,mapping:i.startOfSegment-n.start},r&&(this.timelines[i.timeline]=c,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+i.timeline+": "+("[time: "+c.time+"] [mapping: "+c.mapping+"]"))),d=i.startOfSegment,u=n.end+c.mapping;else if(c)d=n.start+c.mapping,u=n.end+c.mapping;else return!1;return l&&(l.start=d,l.end=u),(!o.start||d<o.start)&&(o.start=d),o.end=u,!0},a.saveDiscontinuitySyncInfo_=function(i){var n=i.playlist,r=i.segment;if(r.discontinuity)this.discontinuities[r.timeline]={time:r.start,accuracy:0};else if(n.discontinuityStarts&&n.discontinuityStarts.length)for(var o=0;o<n.discontinuityStarts.length;o++){var l=n.discontinuityStarts[o],c=n.discontinuitySequence+o+1,d=l-i.mediaIndex,u=Math.abs(d);if(!this.discontinuities[c]||this.discontinuities[c].accuracy>u){var h=void 0;d<0?h=r.start-uu({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:i.mediaIndex,endIndex:l}):h=r.end+uu({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:i.mediaIndex+1,endIndex:l}),this.discontinuities[c]={time:h,accuracy:u}}}},a.dispose=function(){this.trigger("dispose"),this.off()},t}(te.EventTarget),fve=function(e){Re(t,e);function t(){var i;return i=e.call(this)||this,i.pendingTimelineChanges_={},i.lastTimelineChanges_={},i}var a=t.prototype;return a.clearPendingTimelineChange=function(i){this.pendingTimelineChanges_[i]=null,this.trigger("pendingtimelinechange")},a.pendingTimelineChange=function(i){var n=i.type,r=i.from,o=i.to;return typeof r=="number"&&typeof o=="number"&&(this.pendingTimelineChanges_[n]={type:n,from:r,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[n]},a.lastTimelineChange=function(i){var n=i.type,r=i.from,o=i.to;return typeof r=="number"&&typeof o=="number"&&(this.lastTimelineChanges_[n]={type:n,from:r,to:o},delete this.pendingTimelineChanges_[n],this.trigger("timelinechange")),this.lastTimelineChanges_[n]},a.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(te.EventTarget),gve=fA(gA(function(){var e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function t(N,P,L){return L={path:P,exports:{},require:function(V,$){return a(V,$??L.path)}},N(L,L.exports),L.exports}function a(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var i=t(function(N){function P(V,$){for(var U=0;U<$.length;U++){var ae=$[U];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(V,ae.key,ae)}}function L(V,$,U){return $&&P(V.prototype,$),U&&P(V,U),V}N.exports=L,N.exports.default=N.exports,N.exports.__esModule=!0}),n=t(function(N){function P(L,V){return N.exports=P=Object.setPrototypeOf||function($,U){return $.__proto__=U,$},N.exports.default=N.exports,N.exports.__esModule=!0,P(L,V)}N.exports=P,N.exports.default=N.exports,N.exports.__esModule=!0}),r=t(function(N){function P(L,V){L.prototype=Object.create(V.prototype),L.prototype.constructor=L,n(L,V)}N.exports=P,N.exports.default=N.exports,N.exports.__esModule=!0}),o=function(){function N(){this.listeners={}}var P=N.prototype;return P.on=function(L,V){this.listeners[L]||(this.listeners[L]=[]),this.listeners[L].push(V)},P.off=function(L,V){if(!this.listeners[L])return!1;var $=this.listeners[L].indexOf(V);return this.listeners[L]=this.listeners[L].slice(0),this.listeners[L].splice($,1),$>-1},P.trigger=function(L){var V=this.listeners[L];if(V)if(arguments.length===2)for(var $=V.length,U=0;U<$;++U)V[U].call(this,arguments[1]);else for(var ae=Array.prototype.slice.call(arguments,1),oe=V.length,Y=0;Y<oe;++Y)V[Y].apply(this,ae)},P.dispose=function(){this.listeners={}},P.pipe=function(L){this.on("data",function(V){L.push(V)})},N}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function l(N){return N.subarray(0,N.byteLength-N[N.byteLength-1])}/*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */var c=function(){var N=[[[],[],[],[],[]],[[],[],[],[],[]]],P=N[0],L=N[1],V=P[4],$=L[4],U,ae,oe,Y=[],de=[],we,Se,pe,z,K,ue;for(U=0;U<256;U++)de[(Y[U]=U<<1^(U>>7)*283)^U]=U;for(ae=oe=0;!V[ae];ae^=we||1,oe=de[oe]||1)for(z=oe^oe<<1^oe<<2^oe<<3^oe<<4,z=z>>8^z&255^99,V[ae]=z,$[z]=ae,pe=Y[Se=Y[we=Y[ae]]],ue=pe*16843009^Se*65537^we*257^ae*16843008,K=Y[z]*257^z*16843008,U=0;U<4;U++)P[U][ae]=K=K<<24^K>>>8,L[U][z]=ue=ue<<24^ue>>>8;for(U=0;U<5;U++)P[U]=P[U].slice(0),L[U]=L[U].slice(0);return N},d=null,u=function(){function N(L){d||(d=c()),this._tables=[[d[0][0].slice(),d[0][1].slice(),d[0][2].slice(),d[0][3].slice(),d[0][4].slice()],[d[1][0].slice(),d[1][1].slice(),d[1][2].slice(),d[1][3].slice(),d[1][4].slice()]];var V,$,U,ae=this._tables[0][4],oe=this._tables[1],Y=L.length,de=1;if(Y!==4&&Y!==6&&Y!==8)throw new Error("Invalid aes key size");var we=L.slice(0),Se=[];for(this._key=[we,Se],V=Y;V<4*Y+28;V++)U=we[V-1],(V%Y===0||Y===8&&V%Y===4)&&(U=ae[U>>>24]<<24^ae[U>>16&255]<<16^ae[U>>8&255]<<8^ae[U&255],V%Y===0&&(U=U<<8^U>>>24^de<<24,de=de<<1^(de>>7)*283)),we[V]=we[V-Y]^U;for($=0;V;$++,V--)U=we[$&3?V:V-4],V<=4||$<4?Se[$]=U:Se[$]=oe[0][ae[U>>>24]]^oe[1][ae[U>>16&255]]^oe[2][ae[U>>8&255]]^oe[3][ae[U&255]]}var P=N.prototype;return P.decrypt=function(L,V,$,U,ae,oe){var Y=this._key[1],de=L^Y[0],we=U^Y[1],Se=$^Y[2],pe=V^Y[3],z,K,ue,ie=Y.length/4-2,ne,fe=4,me=this._tables[1],ye=me[0],ee=me[1],re=me[2],X=me[3],R=me[4];for(ne=0;ne<ie;ne++)z=ye[de>>>24]^ee[we>>16&255]^re[Se>>8&255]^X[pe&255]^Y[fe],K=ye[we>>>24]^ee[Se>>16&255]^re[pe>>8&255]^X[de&255]^Y[fe+1],ue=ye[Se>>>24]^ee[pe>>16&255]^re[de>>8&255]^X[we&255]^Y[fe+2],pe=ye[pe>>>24]^ee[de>>16&255]^re[we>>8&255]^X[Se&255]^Y[fe+3],fe+=4,de=z,we=K,Se=ue;for(ne=0;ne<4;ne++)ae[(3&-ne)+oe]=R[de>>>24]<<24^R[we>>16&255]<<16^R[Se>>8&255]<<8^R[pe&255]^Y[fe++],z=de,de=we,we=Se,Se=pe,pe=z},N}(),h=function(N){r(P,N);function P(){var V;return V=N.call(this,o)||this,V.jobs=[],V.delay=1,V.timeout_=null,V}var L=P.prototype;return L.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},L.push=function(V){this.jobs.push(V),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},P}(o),m=function(N){return N<<24|(N&65280)<<8|(N&16711680)>>8|N>>>24},p=function(N,P,L){var V=new Int32Array(N.buffer,N.byteOffset,N.byteLength>>2),$=new u(Array.prototype.slice.call(P)),U=new Uint8Array(N.byteLength),ae=new Int32Array(U.buffer),oe,Y,de,we,Se,pe,z,K,ue;for(oe=L[0],Y=L[1],de=L[2],we=L[3],ue=0;ue<V.length;ue+=4)Se=m(V[ue]),pe=m(V[ue+1]),z=m(V[ue+2]),K=m(V[ue+3]),$.decrypt(Se,pe,z,K,ae,ue),ae[ue]=m(ae[ue]^oe),ae[ue+1]=m(ae[ue+1]^Y),ae[ue+2]=m(ae[ue+2]^de),ae[ue+3]=m(ae[ue+3]^we),oe=Se,Y=pe,de=z,we=K;return U},f=function(){function N(L,V,$,U){var ae=N.STEP,oe=new Int32Array(L.buffer),Y=new Uint8Array(L.byteLength),de=0;for(this.asyncStream_=new h,this.asyncStream_.push(this.decryptChunk_(oe.subarray(de,de+ae),V,$,Y)),de=ae;de<oe.length;de+=ae)$=new Uint32Array([m(oe[de-4]),m(oe[de-3]),m(oe[de-2]),m(oe[de-1])]),this.asyncStream_.push(this.decryptChunk_(oe.subarray(de,de+ae),V,$,Y));this.asyncStream_.push(function(){U(null,l(Y))})}var P=N.prototype;return P.decryptChunk_=function(L,V,$,U){return function(){var ae=p(L,V,$);U.set(ae,L.byteOffset)}},i(N,null,[{key:"STEP",get:function(){return 32e3}}]),N}(),y;typeof window<"u"?y=window:typeof e<"u"?y=e:typeof self<"u"?y=self:y={};var b=y,E=function(N){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(N):N&&N.buffer instanceof ArrayBuffer},D=b.BigInt||Number;D("0x1"),D("0x100"),D("0x10000"),D("0x1000000"),D("0x100000000"),D("0x10000000000"),D("0x1000000000000"),D("0x100000000000000"),D("0x10000000000000000");var M=function(N){var P={};return Object.keys(N).forEach(function(L){var V=N[L];E(V)?P[L]={bytes:V.buffer,byteOffset:V.byteOffset,byteLength:V.byteLength}:P[L]=V}),P};self.onmessage=function(N){var P=N.data,L=new Uint8Array(P.encrypted.bytes,P.encrypted.byteOffset,P.encrypted.byteLength),V=new Uint32Array(P.key.bytes,P.key.byteOffset,P.key.byteLength/4),$=new Uint32Array(P.iv.bytes,P.iv.byteOffset,P.iv.byteLength/4);new f(L,V,$,function(U,ae){self.postMessage(M({source:P.source,decrypted:ae}),[ae.buffer])})}})),yve=mA(gve),_ve=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},bf=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Z1=function(e,t){t.activePlaylistLoader=e,e.load()},bve=function(e,t){return function(){var a=t.segmentLoaders,i=a[e],n=a.main,r=t.mediaTypes[e],o=r.activeTrack(),l=r.getActiveGroup(),c=r.activePlaylistLoader,d=r.lastGroup_;if(!(l&&d&&l.id===d.id)&&(r.lastGroup_=l,r.lastTrack_=o,bf(i,r),!(!l||l.isMasterPlaylist))){if(!l.playlistLoader){c&&n.resetEverything();return}i.resyncLoader(),Z1(l.playlistLoader,r)}}},vve=function(e,t){return function(){var a=t.segmentLoaders[e],i=t.mediaTypes[e];i.lastGroup_=null,a.abort(),a.pause()}},Sve=function(e,t){return function(){var a=t.masterPlaylistLoader,i=t.segmentLoaders,n=i[e],r=i.main,o=t.mediaTypes[e],l=o.activeTrack(),c=o.getActiveGroup(),d=o.activePlaylistLoader,u=o.lastTrack_;if(!(u&&l&&u.id===l.id)&&(o.lastGroup_=c,o.lastTrack_=l,bf(n,o),!!c)){if(c.isMasterPlaylist){if(!l||!u||l.id===u.id)return;var h=t.vhs.masterPlaylistController_,m=h.selectPlaylist();if(h.media()===m)return;o.logger_("track change. Switching master audio from "+u.id+" to "+l.id),a.pause(),r.resetEverything(),h.fastQualityChange_(m);return}if(e==="AUDIO"){if(!c.playlistLoader){r.setAudio(!0),r.resetEverything();return}n.setAudio(!0),r.setAudio(!1)}if(d===c.playlistLoader){Z1(c.playlistLoader,o);return}n.track&&n.track(l),n.resetEverything(),Z1(c.playlistLoader,o)}}},vf={AUDIO:function(e,t){return function(){var a=t.segmentLoaders[e],i=t.mediaTypes[e],n=t.blacklistCurrentPlaylist;bf(a,i);var r=i.activeTrack(),o=i.activeGroup(),l=(o.filter(function(u){return u.default})[0]||o[0]).id,c=i.tracks[l];if(r===c){n({message:"Problem encountered loading the default audio track."});return}te.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var d in i.tracks)i.tracks[d].enabled=i.tracks[d]===c;i.onTrackChanged()}},SUBTITLES:function(e,t){return function(){var a=t.segmentLoaders[e],i=t.mediaTypes[e];te.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),bf(a,i);var n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}}},HA={AUDIO:function(e,t,a){if(t){var i=a.tech,n=a.requestOptions,r=a.segmentLoaders[e];t.on("loadedmetadata",function(){var o=t.media();r.playlist(o,n),(!i.paused()||o.endList&&i.preload()!=="none")&&r.load()}),t.on("loadedplaylist",function(){r.playlist(t.media(),n),i.paused()||r.load()}),t.on("error",vf[e](e,a))}},SUBTITLES:function(e,t,a){var i=a.tech,n=a.requestOptions,r=a.segmentLoaders[e],o=a.mediaTypes[e];t.on("loadedmetadata",function(){var l=t.media();r.playlist(l,n),r.track(o.activeTrack()),(!i.paused()||l.endList&&i.preload()!=="none")&&r.load()}),t.on("loadedplaylist",function(){r.playlist(t.media(),n),i.paused()||r.load()}),t.on("error",vf[e](e,a))}},wve={AUDIO:function(e,t){var a=t.vhs,i=t.sourceType,n=t.segmentLoaders[e],r=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[e],c=l.groups,d=l.tracks,u=l.logger_,h=t.masterPlaylistLoader,m=hu(h.master);(!o[e]||Object.keys(o[e]).length===0)&&(o[e]={main:{default:{default:!0}}},m&&(o[e].main.default.playlists=h.master.playlists));for(var p in o[e]){c[p]||(c[p]=[]);for(var f in o[e][p]){var y=o[e][p][f],b=void 0;if(m?(u("AUDIO group '"+p+"' label '"+f+"' is a master playlist"),y.isMasterPlaylist=!0,b=null):i==="vhs-json"&&y.playlists?b=new Wl(y.playlists[0],a,r):y.resolvedUri?b=new Wl(y.resolvedUri,a,r):y.playlists&&i==="dash"?b=new q1(y.playlists[0],a,r,h):b=null,y=te.mergeOptions({id:f,playlistLoader:b},y),HA[e](e,y.playlistLoader,t),c[p].push(y),typeof d[f]>"u"){var E=new te.AudioTrack({id:f,kind:_ve(y),enabled:!1,language:y.language,default:y.default,label:f});d[f]=E}}}n.on("error",vf[e](e,t))},SUBTITLES:function(e,t){var a=t.tech,i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],o=t.requestOptions,l=t.master.mediaGroups,c=t.mediaTypes[e],d=c.groups,u=c.tracks,h=t.masterPlaylistLoader;for(var m in l[e]){d[m]||(d[m]=[]);for(var p in l[e][m])if(!l[e][m][p].forced){var f=l[e][m][p],y=void 0;if(n==="hls")y=new Wl(f.resolvedUri,i,o);else if(n==="dash"){var b=f.playlists.filter(function(D){return D.excludeUntil!==1/0});if(!b.length)return;y=new q1(f.playlists[0],i,o,h)}else n==="vhs-json"&&(y=new Wl(f.playlists?f.playlists[0]:f.resolvedUri,i,o));if(f=te.mergeOptions({id:p,playlistLoader:y},f),HA[e](e,f.playlistLoader,t),d[m].push(f),typeof u[p]>"u"){var E=a.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;u[p]=E}}}r.on("error",vf[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var a=t.tech,i=t.master.mediaGroups,n=t.mediaTypes[e],r=n.groups,o=n.tracks;for(var l in i[e]){r[l]||(r[l]=[]);for(var c in i[e][l]){var d=i[e][l][c];if(/^(?:CC|SERVICE)/.test(d.instreamId)){var u=a.options_.vhs&&a.options_.vhs.captionServices||{},h={label:c,language:d.language,instreamId:d.instreamId,default:d.default&&d.autoselect};if(u[h.instreamId]&&(h=te.mergeOptions(h,u[h.instreamId])),h.default===void 0&&delete h.default,r[l].push(te.mergeOptions({id:c},d)),typeof o[c]>"u"){var m=a.addRemoteTextTrack({id:h.instreamId,kind:"captions",default:h.default,language:h.language,label:h.label},!1).track;o[c]=m}}}}}},Tve=function e(t,a){for(var i=0;i<t.length;i++)if(R1(a,t[i])||t[i].playlists&&e(t[i].playlists,a))return!0;return!1},Cve=function(e,t){return function(a){var i=t.masterPlaylistLoader,n=t.mediaTypes[e].groups,r=i.media();if(!r)return null;var o=null;r.attributes[e]&&(o=n[r.attributes[e]]);var l=Object.keys(n);if(!o)if(e==="AUDIO"&&l.length>1&&hu(t.master))for(var c=0;c<l.length;c++){var d=n[l[c]];if(Tve(d,r)){o=d;break}}else n.main?o=n.main:l.length===1&&(o=n[l[0]]);return typeof a>"u"?o:a===null||!o?null:o.filter(function(u){return u.id===a.id})[0]||null}},kve={AUDIO:function(e,t){return function(){var a=t.mediaTypes[e].tracks;for(var i in a)if(a[i].enabled)return a[i];return null}},SUBTITLES:function(e,t){return function(){var a=t.mediaTypes[e].tracks;for(var i in a)if(a[i].mode==="showing"||a[i].mode==="hidden")return a[i];return null}}},Eve=function(e,t){var a=t.mediaTypes;return function(){var i=a[e].activeTrack();return i?a[e].activeGroup(i):null}},Ive=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(p){wve[p](p,e)});var t=e.mediaTypes,a=e.masterPlaylistLoader,i=e.tech,n=e.vhs,r=e.segmentLoaders,o=r.AUDIO,l=r.main;["AUDIO","SUBTITLES"].forEach(function(p){t[p].activeGroup=Cve(p,e),t[p].activeTrack=kve[p](p,e),t[p].onGroupChanged=bve(p,e),t[p].onGroupChanging=vve(p,e),t[p].onTrackChanged=Sve(p,e),t[p].getActiveGroup=Eve(p,e)});var c=t.AUDIO.activeGroup();if(c){var d=(c.filter(function(p){return p.default})[0]||c[0]).id;t.AUDIO.tracks[d].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();var u=t.AUDIO.getActiveGroup();u.playlistLoader?(l.setAudio(!1),o.setAudio(!0)):l.setAudio(!0)}a.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(p){return t[p].onGroupChanged()})}),a.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(p){return t[p].onGroupChanging()})});var h=function(){t.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"}),i.trigger({type:"usage",name:"hls-audio-change"})};i.audioTracks().addEventListener("change",h),i.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),n.on("dispose",function(){i.audioTracks().removeEventListener("change",h),i.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(var m in t.AUDIO.tracks)i.audioTracks().addTrack(t.AUDIO.tracks[m])},xve=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:gr,activeTrack:gr,getActiveGroup:gr,onGroupChanged:gr,onTrackChanged:gr,lastTrack_:null,logger_:Yi("MediaGroups["+t+"]")}}),e},Nve=60*2,yr,Ave=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Pve=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Ove=function(e){var t=e.currentPlaylist,a=e.buffered,i=e.currentTime,n=e.nextPlaylist,r=e.bufferLowWaterLine,o=e.bufferHighWaterLine,l=e.duration,c=e.experimentalBufferBasedABR,d=e.log;if(!n)return te.log.warn("We received no playlist to switch to. Please check your stream."),!1;var u="allowing switch "+(t&&t.id||"null")+" -> "+n.id;if(!t)return d(u+" as current playlist is not set"),!0;if(n.id===t.id)return!1;var h=!!Hl(a,i).length;if(!t.endList)return!h&&typeof t.partTargetDuration=="number"?(d("not "+u+" as current playlist is live llhls, but currentTime isn't in buffered."),!1):(d(u+" as current playlist is live"),!0);var m=O1(a,i),p=c?ma.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ma.MAX_BUFFER_LOW_WATER_LINE;if(l<p)return d(u+" as duration < max low water line ("+l+" < "+p+")"),!0;var f=n.attributes.BANDWIDTH,y=t.attributes.BANDWIDTH;if(f<y&&(!c||m<o)){var b=u+" as next bandwidth < current bandwidth ("+f+" < "+y+")";return c&&(b+=" and forwardBuffer < bufferHighWaterLine ("+m+" < "+o+")"),d(b),!0}if((!c||f>y)&&m>=r){var E=u+" as forwardBuffer >= bufferLowWaterLine ("+m+" >= "+r+")";return c&&(E+=" and next bandwidth > current bandwidth ("+f+" > "+y+")"),d(E),!0}return d("not "+u+" as no switching criteria met"),!1},Bve=function(e){Re(t,e);function t(i){var n;n=e.call(this)||this;var r=i.src,o=i.handleManifestRedirects,l=i.withCredentials,c=i.tech,d=i.bandwidth,u=i.externVhs,h=i.useCueTags,m=i.blacklistDuration,p=i.enableLowInitialPlaylist,f=i.sourceType,y=i.cacheEncryptionKeys,b=i.experimentalBufferBasedABR,E=i.experimentalLeastPixelDiffSelector,D=i.captionServices;if(!r)throw new Error("A non-empty playlist URL or JSON manifest string is required");var M=i.maxPlaylistRetries;(M===null||typeof M>"u")&&(M=1/0),yr=u,n.experimentalBufferBasedABR=!!b,n.experimentalLeastPixelDiffSelector=!!E,n.withCredentials=l,n.tech_=c,n.vhs_=c.vhs,n.sourceType_=f,n.useCueTags_=h,n.blacklistDuration=m,n.maxPlaylistRetries=M,n.enableLowInitialPlaylist=p,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:l,handleManifestRedirects:o,maxPlaylistRetries:M,timeout:null},n.on("error",n.pauseLoading),n.mediaTypes_=xve(),n.mediaSource=new O.MediaSource,n.handleDurationChange_=n.handleDurationChange_.bind($e(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind($e(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind($e(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=te.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new mve(i),n.segmentMetadataTrack_=c.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new yve,n.sourceUpdater_=new VA(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new fve;var N={vhs:n.vhs_,parse708captions:i.parse708captions,useDtsForTimestampOffset:i.useDtsForTimestampOffset,captionServices:D,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.duration()},hasPlayed:function(){return n.hasPlayed_},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:d,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_,experimentalExactManifestTimings:i.experimentalExactManifestTimings};n.masterPlaylistLoader_=n.sourceType_==="dash"?new q1(r,n.vhs_,n.requestOptions_):new Wl(r,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new J1(te.mergeOptions(N,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),i),n.audioSegmentLoader_=new J1(te.mergeOptions(N,{loaderType:"audio"}),i),n.subtitleSegmentLoader_=new dve(te.mergeOptions(N,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(L,V){function $(){c.off("vttjserror",U),L()}function U(){c.off("vttjsloaded",$),V()}c.one("vttjsloaded",$),c.one("vttjserror",U),c.addWebVttScript_()})}}),i),n.setupSegmentLoaderListeners_(),n.experimentalBufferBasedABR&&(n.masterPlaylistLoader_.one("loadedplaylist",function(){return n.startABRTimer_()}),n.tech_.on("pause",function(){return n.stopABRTimer_()}),n.tech_.on("play",function(){return n.startABRTimer_()})),Ave.forEach(function(L){n[L+"_"]=Pve.bind($e(n),L)}),n.logger_=Yi("MPC"),n.triggeredFmp4Usage=!1,n.tech_.preload()==="none"?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.masterPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.masterPlaylistLoader_.load(),n.timeToLoadedData__=-1,n.mainAppendsToLoadedData__=-1,n.audioAppendsToLoadedData__=-1;var P=n.tech_.preload()==="none"?"play":"loadstart";return n.tech_.one(P,function(){var L=Date.now();n.tech_.one("loadeddata",function(){n.timeToLoadedData__=Date.now()-L,n.mainAppendsToLoadedData__=n.mainSegmentLoader_.mediaAppends,n.audioAppendsToLoadedData__=n.audioSegmentLoader_.mediaAppends})}),n}var a=t.prototype;return a.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},a.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},a.appendsToLoadedData_=function(){var i=this.mainAppendsToLoadedData_(),n=this.audioAppendsToLoadedData_();return i===-1||n===-1?-1:i+n},a.timeToLoadedData_=function(){return this.timeToLoadedData__},a.checkABR_=function(i){i===void 0&&(i="abr");var n=this.selectPlaylist();n&&this.shouldSwitchToMedia_(n)&&this.switchMedia_(n,i)},a.switchMedia_=function(i,n,r){var o=this.media(),l=o&&(o.id||o.uri),c=i.id||i.uri;l&&l!==c&&(this.logger_("switch media "+l+" -> "+c+" from "+n),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+n})),this.masterPlaylistLoader_.media(i,r)},a.startABRTimer_=function(){var i=this;this.stopABRTimer_(),this.abrTimer_=O.setInterval(function(){return i.checkABR_()},250)},a.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(O.clearInterval(this.abrTimer_),this.abrTimer_=null)},a.getAudioTrackPlaylists_=function(){var i=this.master(),n=i&&i.playlists||[];if(!i||!i.mediaGroups||!i.mediaGroups.AUDIO)return n;var r=i.mediaGroups.AUDIO,o=Object.keys(r),l;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{var c=r.main||o.length&&r[o[0]];for(var d in c)if(c[d].default){l={label:d};break}}if(!l)return n;var u=[];for(var h in r)if(r[h][l.label]){var m=r[h][l.label];if(m.playlists&&m.playlists.length)u.push.apply(u,m.playlists);else if(m.uri)u.push(m);else if(i.playlists.length)for(var p=0;p<i.playlists.length;p++){var f=i.playlists[p];f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===h&&u.push(f)}}return u.length?u:n},a.setupMasterPlaylistLoaderListeners_=function(){var i=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var n=i.masterPlaylistLoader_.media(),r=n.targetDuration*1.5*1e3;L1(i.masterPlaylistLoader_.master,i.masterPlaylistLoader_.media())?i.requestOptions_.timeout=0:i.requestOptions_.timeout=r,n.endList&&i.tech_.preload()!=="none"&&(i.mainSegmentLoader_.playlist(n,i.requestOptions_),i.mainSegmentLoader_.load()),Ive({sourceType:i.sourceType_,segmentLoaders:{AUDIO:i.audioSegmentLoader_,SUBTITLES:i.subtitleSegmentLoader_,main:i.mainSegmentLoader_},tech:i.tech_,requestOptions:i.requestOptions_,masterPlaylistLoader:i.masterPlaylistLoader_,vhs:i.vhs_,master:i.master(),mediaTypes:i.mediaTypes_,blacklistCurrentPlaylist:i.blacklistCurrentPlaylist.bind(i)}),i.triggerPresenceUsage_(i.master(),n),i.setupFirstPlay(),!i.mediaTypes_.AUDIO.activePlaylistLoader||i.mediaTypes_.AUDIO.activePlaylistLoader.media()?i.trigger("selectedinitialmedia"):i.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){i.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){i.loadOnPlay_&&i.tech_.off("play",i.loadOnPlay_);var n=i.masterPlaylistLoader_.media();if(!n){i.excludeUnsupportedVariants_();var r;if(i.enableLowInitialPlaylist&&(r=i.selectInitialPlaylist()),r||(r=i.selectPlaylist()),!r||!i.shouldSwitchToMedia_(r))return;i.initialMedia_=r,i.switchMedia_(i.initialMedia_,"initial");var o=i.sourceType_==="vhs-json"&&i.initialMedia_.segments;if(!o)return;n=i.initialMedia_}i.handleUpdatedMediaPlaylist(n)}),this.masterPlaylistLoader_.on("error",function(){i.blacklistCurrentPlaylist(i.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){i.mainSegmentLoader_.abort(),i.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var n=i.masterPlaylistLoader_.media(),r=n.targetDuration*1.5*1e3;L1(i.masterPlaylistLoader_.master,i.masterPlaylistLoader_.media())?i.requestOptions_.timeout=0:i.requestOptions_.timeout=r,i.masterPlaylistLoader_.load(),i.mainSegmentLoader_.playlist(n,i.requestOptions_),i.mainSegmentLoader_.load(),i.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var n=i.masterPlaylistLoader_.media();if(n.lastExcludeReason_!=="playlist-unchanged"){var r=i.stuckAtPlaylistEnd_(n);r&&(i.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),i.tech_.trigger("playliststuck"))}}),this.masterPlaylistLoader_.on("renditiondisabled",function(){i.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),i.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){i.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),i.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},a.handleUpdatedMediaPlaylist=function(i){this.useCueTags_&&this.updateAdCues_(i),this.mainSegmentLoader_.playlist(i,this.requestOptions_),this.updateDuration(!i.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},a.triggerPresenceUsage_=function(i,n){var r=i.mediaGroups||{},o=!0,l=Object.keys(r.AUDIO);for(var c in r.AUDIO)for(var d in r.AUDIO[c]){var u=r.AUDIO[c][d];u.uri||(o=!1)}o&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(r.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),yr.Playlist.isAes(n)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),l.length&&Object.keys(r.AUDIO[l[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},a.shouldSwitchToMedia_=function(i){var n=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,r=this.tech_.currentTime(),o=this.bufferLowWaterLine(),l=this.bufferHighWaterLine(),c=this.tech_.buffered();return Ove({buffered:c,currentTime:r,currentPlaylist:n,nextPlaylist:i,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},a.setupSegmentLoaderListeners_=function(){var i=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){i.checkABR_("bandwidthupdate"),i.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){i.experimentalBufferBasedABR&&i.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){i.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){i.blacklistCurrentPlaylist(i.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){i.error=i.mainSegmentLoader_.error_,i.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){i.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){i.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),i.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){i.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){i.error=i.audioSegmentLoader_.error_,i.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){i.logger_("main segment loader ended"),i.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(r){i.experimentalBufferBasedABR||(i.delegateLoaders_("all",["abort"]),i.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},Nve))});var n=function(){if(!i.sourceUpdater_.hasCreatedSourceBuffers())return i.tryToCreateSourceBuffers_();var r=i.getCodecsOrExclude_();r&&i.sourceUpdater_.addOrChangeSourceBuffers(r)};this.mainSegmentLoader_.on("trackinfo",n),this.audioSegmentLoader_.on("trackinfo",n),this.mainSegmentLoader_.on("fmp4",function(){i.triggeredFmp4Usage||(i.tech_.trigger({type:"usage",name:"vhs-fmp4"}),i.tech_.trigger({type:"usage",name:"hls-fmp4"}),i.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){i.triggeredFmp4Usage||(i.tech_.trigger({type:"usage",name:"vhs-fmp4"}),i.tech_.trigger({type:"usage",name:"hls-fmp4"}),i.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){i.logger_("audioSegmentLoader ended"),i.onEndOfStream()})},a.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},a.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},a.smoothQualityChange_=function(i){i===void 0&&(i=this.selectPlaylist()),this.fastQualityChange_(i)},a.fastQualityChange_=function(i){var n=this;if(i===void 0&&(i=this.selectPlaylist()),i===this.masterPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(i,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){te.browser.IE_VERSION||te.browser.IS_EDGE?n.tech_.setCurrentTime(n.tech_.currentTime()+.04):n.tech_.setCurrentTime(n.tech_.currentTime())})},a.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var i=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<i.start(0))return this.tech_.setCurrentTime(i.end(i.length-1))}},a.setupFirstPlay=function(){var i=this,n=this.masterPlaylistLoader_.media();if(!n||this.tech_.paused()||this.hasPlayed_)return!1;if(!n.endList){var r=this.seekable();if(!r.length)return!1;if(te.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){i.trigger("firstplay"),i.tech_.setCurrentTime(r.end(0)),i.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(r.end(0))}return this.hasPlayed_=!0,this.load(),!0},a.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var i=this.tech_.play();typeof i<"u"&&typeof i.then=="function"&&i.then(null,function(n){})}this.trigger("sourceopen")},a.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var i=this.inbandTextTracks_.metadataTrack_.cues;if(!(!i||!i.length)){var n=this.duration();i[i.length-1].endTime=isNaN(n)||Math.abs(n)===1/0?Number.MAX_VALUE:n}}},a.handleDurationChange_=function(){this.tech_.trigger("durationchange")},a.onEndOfStream=function(){var i=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var n=this.mainSegmentLoader_.getCurrentMediaInfo_();!n||n.hasVideo?i=i&&this.audioSegmentLoader_.ended_:i=this.audioSegmentLoader_.ended_}i&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},a.stuckAtPlaylistEnd_=function(i){var n=this.seekable();if(!n.length)return!1;var r=this.syncController_.getExpiredTime(i,this.duration());if(r===null)return!1;var o=yr.Playlist.playlistEnd(i,r),l=this.tech_.currentTime(),c=this.tech_.buffered();if(!c.length)return o-l<=Mn;var d=c.end(c.length-1);return d-l<=Mn&&o-d<=Mn},a.blacklistCurrentPlaylist=function(i,n){i===void 0&&(i={});var r=i.playlist||this.masterPlaylistLoader_.media();if(n=n||i.blacklistDuration||this.blacklistDuration,!r){this.error=i,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}r.playlistErrors_++;var o=this.masterPlaylistLoader_.master.playlists,l=o.filter(uf),c=l.length===1&&l[0]===r;if(o.length===1&&n!==1/0)return te.log.warn("Problem encountered with playlist "+r.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(c);if(c){var d=!1;o.forEach(function(b){if(b!==r){var E=b.excludeUntil;typeof E<"u"&&E!==1/0&&(d=!0,delete b.excludeUntil)}}),d&&(te.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}var u;r.playlistErrors_>this.maxPlaylistRetries?u=1/0:u=Date.now()+n*1e3,r.excludeUntil=u,i.reason&&(r.lastExcludeReason_=i.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var h=this.selectPlaylist();if(!h){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}var m=i.internal?this.logger_:te.log.warn,p=i.message?" "+i.message:"";m((i.internal?"Internal problem":"Problem")+" encountered with playlist "+r.id+"."+(p+" Switching to playlist "+h.id+".")),h.attributes.AUDIO!==r.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),h.attributes.SUBTITLES!==r.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var f=h.targetDuration/2*1e3||5*1e3,y=typeof h.lastRequest=="number"&&Date.now()-h.lastRequest<=f;return this.switchMedia_(h,"exclude",c||y)},a.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},a.delegateLoaders_=function(i,n){var r=this,o=[],l=i==="all";(l||i==="main")&&o.push(this.masterPlaylistLoader_);var c=[];(l||i==="audio")&&c.push("AUDIO"),(l||i==="subtitle")&&(c.push("CLOSED-CAPTIONS"),c.push("SUBTITLES")),c.forEach(function(d){var u=r.mediaTypes_[d]&&r.mediaTypes_[d].activePlaylistLoader;u&&o.push(u)}),["main","audio","subtitle"].forEach(function(d){var u=r[d+"SegmentLoader_"];u&&(i===d||i==="all")&&o.push(u)}),o.forEach(function(d){return n.forEach(function(u){typeof d[u]=="function"&&d[u]()})})},a.setCurrentTime=function(i){var n=Hl(this.tech_.buffered(),i);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())||!this.masterPlaylistLoader_.media().segments)return 0;if(n&&n.length)return i;this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),this.load()},a.duration=function(){if(!this.masterPlaylistLoader_)return 0;var i=this.masterPlaylistLoader_.media();return i?i.endList?this.mediaSource?this.mediaSource.duration:yr.Playlist.duration(i):1/0:0},a.seekable=function(){return this.seekable_},a.onSyncInfoUpdate_=function(){var i;if(this.masterPlaylistLoader_){var n=this.masterPlaylistLoader_.media();if(n){var r=this.syncController_.getExpiredTime(n,this.duration());if(r!==null){var o=this.masterPlaylistLoader_.master,l=yr.Playlist.seekable(n,r,yr.Playlist.liveEdgeDelay(o,n));if(l.length!==0&&!(this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),r=this.syncController_.getExpiredTime(n,this.duration()),r===null||(i=yr.Playlist.seekable(n,r,yr.Playlist.liveEdgeDelay(o,n)),i.length===0)))){var c,d;this.seekable_&&this.seekable_.length&&(c=this.seekable_.end(0),d=this.seekable_.start(0)),i?i.start(0)>l.end(0)||l.start(0)>i.end(0)?this.seekable_=l:this.seekable_=te.createTimeRanges([[i.start(0)>l.start(0)?i.start(0):l.start(0),i.end(0)<l.end(0)?i.end(0):l.end(0)]]):this.seekable_=l,!(this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===c&&this.seekable_.start(0)===d)&&(this.logger_("seekable updated ["+jN(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},a.updateDuration=function(i){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,i),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(i){var n=this.seekable();if(!n.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<n.end(n.length-1))&&this.sourceUpdater_.setDuration(n.end(n.length-1));return}var r=this.tech_.buffered(),o=yr.Playlist.duration(this.masterPlaylistLoader_.media());r.length>0&&(o=Math.max(o,r.end(r.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)},a.dispose=function(){var i=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(n){var r=i.mediaTypes_[n].groups;for(var o in r)r[o].forEach(function(l){l.playlistLoader&&l.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},a.master=function(){return this.masterPlaylistLoader_.master},a.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},a.areMediaTypesKnown_=function(){var i=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),r=i?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!n||!r)},a.getCodecsOrExclude_=function(){var i=this,n={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},r=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();n.video=n.main;var o=pu(this.master(),r),l={},c=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(n.main.hasVideo&&(l.video=o.video||n.main.videoCodec||N0e),n.main.isMuxed&&(l.video+=","+(o.audio||n.main.audioCodec||P6)),(n.main.hasAudio&&!n.main.isMuxed||n.audio.hasAudio||c)&&(l.audio=o.audio||n.main.audioCodec||n.audio.audioCodec||P6,n.audio.isFmp4=n.main.hasAudio&&!n.main.isMuxed?n.main.isFmp4:n.audio.isFmp4),!l.audio&&!l.video){this.blacklistCurrentPlaylist({playlist:r,message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var d=function(y,b){return y?Em(b):g2(b)},u={},h;if(["video","audio"].forEach(function(y){if(l.hasOwnProperty(y)&&!d(n[y].isFmp4,l[y])){var b=n[y].isFmp4?"browser":"muxer";u[b]=u[b]||[],u[b].push(l[y]),y==="audio"&&(h=b)}}),c&&h&&r.attributes.AUDIO){var m=r.attributes.AUDIO;this.master().playlists.forEach(function(y){var b=y.attributes&&y.attributes.AUDIO;b===m&&y!==r&&(y.excludeUntil=1/0)}),this.logger_("excluding audio group "+m+" as "+h+' does not support codec(s): "'+l.audio+'"')}if(Object.keys(u).length){var p=Object.keys(u).reduce(function(y,b){return y&&(y+=", "),y+=b+' does not support codec(s): "'+u[b].join(",")+'"',y},"")+".";this.blacklistCurrentPlaylist({playlist:r,internal:!0,message:p,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var f=[];if(["video","audio"].forEach(function(y){var b=(On(i.sourceUpdater_.codecs[y]||"")[0]||{}).type,E=(On(l[y]||"")[0]||{}).type;b&&E&&b.toLowerCase()!==E.toLowerCase()&&f.push('"'+i.sourceUpdater_.codecs[y]+'" -> "'+l[y]+'"')}),f.length){this.blacklistCurrentPlaylist({playlist:r,message:"Codec switching not supported: "+f.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return l},a.tryToCreateSourceBuffers_=function(){if(!(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers())&&this.areMediaTypesKnown_()){var i=this.getCodecsOrExclude_();if(i){this.sourceUpdater_.createSourceBuffers(i);var n=[i.video,i.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}}},a.excludeUnsupportedVariants_=function(){var i=this,n=this.master().playlists,r=[];Object.keys(n).forEach(function(o){var l=n[o];if(r.indexOf(l.id)===-1){r.push(l.id);var c=pu(i.master,l),d=[];c.audio&&!g2(c.audio)&&!Em(c.audio)&&d.push("audio codec "+c.audio),c.video&&!g2(c.video)&&!Em(c.video)&&d.push("video codec "+c.video),c.text&&c.text==="stpp.ttml.im1t"&&d.push("text codec "+c.text),d.length&&(l.excludeUntil=1/0,i.logger_("excluding "+l.id+" for unsupported: "+d.join(", ")))}})},a.excludeIncompatibleVariants_=function(i){var n=this,r=[],o=this.master().playlists,l=ff(On(i)),c=IA(l),d=l.video&&On(l.video)[0]||null,u=l.audio&&On(l.audio)[0]||null;Object.keys(o).forEach(function(h){var m=o[h];if(!(r.indexOf(m.id)!==-1||m.excludeUntil===1/0)){r.push(m.id);var p=[],f=pu(n.masterPlaylistLoader_.master,m),y=IA(f);if(!(!f.audio&&!f.video)){if(y!==c&&p.push('codec count "'+y+'" !== "'+c+'"'),!n.sourceUpdater_.canChangeType()){var b=f.video&&On(f.video)[0]||null,E=f.audio&&On(f.audio)[0]||null;b&&d&&b.type.toLowerCase()!==d.type.toLowerCase()&&p.push('video codec "'+b.type+'" !== "'+d.type+'"'),E&&u&&E.type.toLowerCase()!==u.type.toLowerCase()&&p.push('audio codec "'+E.type+'" !== "'+u.type+'"')}p.length&&(m.excludeUntil=1/0,n.logger_("blacklisting "+m.id+": "+p.join(" && ")))}}})},a.updateAdCues_=function(i){var n=0,r=this.seekable();r.length&&(n=r.start(0)),hve(i,this.cueTagsTrack_,n)},a.goalBufferLength=function(){var i=this.tech_.currentTime(),n=ma.GOAL_BUFFER_LENGTH,r=ma.GOAL_BUFFER_LENGTH_RATE,o=Math.max(n,ma.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+i*r,o)},a.bufferLowWaterLine=function(){var i=this.tech_.currentTime(),n=ma.BUFFER_LOW_WATER_LINE,r=ma.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(n,ma.MAX_BUFFER_LOW_WATER_LINE),l=Math.max(n,ma.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+i*r,this.experimentalBufferBasedABR?l:o)},a.bufferHighWaterLine=function(){return ma.BUFFER_HIGH_WATER_LINE},t}(te.EventTarget),Dve=function(e,t,a){return function(i){var n=e.master.playlists[t],r=M1(n),o=uf(n);return typeof i>"u"?o:(i?delete n.disabled:n.disabled=!0,i!==o&&!r&&(a(),i?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),i)}},Mve=function(e,t,a){var i=e.masterPlaylistController_,n=e.options_.smoothQualityChange,r=n?"smooth":"fast",o=i[r+"QualityChange_"].bind(i);if(t.attributes){var l=t.attributes.RESOLUTION;this.width=l&&l.width,this.height=l&&l.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=pu(i.master(),t),this.playlist=t,this.id=a,this.enabled=Dve(e.playlists,t.id,o)},Lve=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),a=hu(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return a?a.filter(function(i){return!M1(i)}).map(function(i,n){return new Mve(e,i,i.id)}):[]}},qA=["seeking","seeked","pause","playing","error"],Rve=function(){function e(a){var i=this;this.masterPlaylistController_=a.masterPlaylistController,this.tech_=a.tech,this.seekable=a.seekable,this.allowSeeksWithinUnsafeLiveWindow=a.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=a.liveRangeSafeTimeDelta,this.media=a.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Yi("PlaybackWatcher"),this.logger_("initialize");var n=function(){return i.monitorCurrentTime_()},r=function(){return i.monitorCurrentTime_()},o=function(){return i.techWaiting_()},l=function(){return i.cancelTimer_()},c=this.masterPlaylistController_,d=["main","subtitle","audio"],u={};d.forEach(function(m){u[m]={reset:function(){return i.resetSegmentDownloads_(m)},updateend:function(){return i.checkSegmentDownloads_(m)}},c[m+"SegmentLoader_"].on("appendsdone",u[m].updateend),c[m+"SegmentLoader_"].on("playlistupdate",u[m].reset),i.tech_.on(["seeked","seeking"],u[m].reset)});var h=function(m){["main","audio"].forEach(function(p){c[p+"SegmentLoader_"][m]("appended",i.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){i.fixesBadSeeks_()&&(i.consecutiveUpdates=0,i.lastRecordedTime=i.tech_.currentTime(),h("off"))},this.clearSeekingAppendCheck_=function(){return h("off")},this.watchForBadSeeking_=function(){i.clearSeekingAppendCheck_(),h("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",o),this.tech_.on(qA,l),this.tech_.on("canplay",r),this.tech_.one("play",n),this.dispose=function(){i.clearSeekingAppendCheck_(),i.logger_("dispose"),i.tech_.off("waiting",o),i.tech_.off(qA,l),i.tech_.off("canplay",r),i.tech_.off("play",n),i.tech_.off("seeking",i.watchForBadSeeking_),i.tech_.off("seeked",i.clearSeekingAppendCheck_),d.forEach(function(m){c[m+"SegmentLoader_"].off("appendsdone",u[m].updateend),c[m+"SegmentLoader_"].off("playlistupdate",u[m].reset),i.tech_.off(["seeked","seeking"],u[m].reset)}),i.checkCurrentTimeTimeout_&&O.clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&O.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=O.setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(a){var i=this.masterPlaylistController_[a+"SegmentLoader_"];this[a+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+a+" loader"),this[a+"StalledDownloads_"]=0,this[a+"Buffered_"]=i.buffered_()},t.checkSegmentDownloads_=function(a){var i=this.masterPlaylistController_,n=i[a+"SegmentLoader_"],r=n.buffered_(),o=x2e(this[a+"Buffered_"],r);if(this[a+"Buffered_"]=r,o){this.resetSegmentDownloads_(a);return}this[a+"StalledDownloads_"]++,this.logger_("found #"+this[a+"StalledDownloads_"]+" "+a+" appends that did not increase buffer (possible stalled download)",{playlistId:n.playlist_&&n.playlist_.id,buffered:Fs(r)}),!(this[a+"StalledDownloads_"]<10)&&(this.logger_(a+" loader stalled download exclusion"),this.resetSegmentDownloads_(a),this.tech_.trigger({type:"usage",name:"vhs-"+a+"-download-exclusion"}),a!=="subtitle"&&i.blacklistCurrentPlaylist({message:"Excessive "+a+" segment downloading detected."},1/0))},t.checkCurrentTime_=function(){if(!(this.tech_.paused()||this.tech_.seeking())){var a=this.tech_.currentTime(),i=this.tech_.buffered();if(this.lastRecordedTime===a&&(!i.length||a+Mn>=i.end(i.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&a===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):a===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=a)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){var a=this.tech_.seeking();if(!a)return!1;var i=this.seekable(),n=this.tech_.currentTime(),r=this.afterSeekableWindow_(i,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow),o;if(r){var l=i.end(i.length-1);o=l}if(this.beforeSeekableWindow_(i,n)){var c=i.start(0);o=c+(c===i.end(0)?0:Mn)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+n+" with "+("seekable range "+jN(i)+". Seeking to ")+(o+".")),this.tech_.setCurrentTime(o),!0;for(var d=this.masterPlaylistController_.sourceUpdater_,u=this.tech_.buffered(),h=d.audioBuffer?d.audioBuffered():null,m=d.videoBuffer?d.videoBuffered():null,p=this.media(),f=p.partTargetDuration?p.partTargetDuration:(p.targetDuration-ts)*2,y=[h,m],b=0;b<y.length;b++)if(y[b]){var E=O1(y[b],n);if(E<f)return!1}var D=df(u,n);return D.length===0?!1:(o=D.start(0)+Mn,this.logger_("Buffered region starts ("+D.start(0)+") "+(" just beyond seek point ("+n+"). Seeking to "+o+".")),this.tech_.setCurrentTime(o),!0)},t.waiting_=function(){if(!this.techWaiting_()){var a=this.tech_.currentTime(),i=this.tech_.buffered(),n=Hl(i,a);if(n.length&&a+3<=n.end(0)){this.cancelTimer_(),this.tech_.setCurrentTime(a),this.logger_("Stopped at "+a+" while inside a buffered region "+("["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume ")+"playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"});return}}},t.techWaiting_=function(){var a=this.seekable(),i=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(a,i)){var n=a.end(a.length-1);return this.logger_("Fell out of live window at time "+i+". Seeking to "+("live point (seekable end) "+n)),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var r=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),l=this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:i});if(l)return this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var c=df(o,i);if(c.length>0){var d=c.start(0)-i;return this.logger_("Stopped at "+i+", setting timer for "+d+", seeking "+("to "+c.start(0))),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),d*1e3,i),!0}return!1},t.afterSeekableWindow_=function(a,i,n,r){if(r===void 0&&(r=!1),!a.length)return!1;var o=a.end(a.length-1)+Mn,l=!n.endList;return l&&r&&(o=a.end(a.length-1)+n.targetDuration*3),i>o},t.beforeSeekableWindow_=function(a,i){return!!(a.length&&a.start(0)>0&&i<a.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(a){var i=a.videoBuffered,n=a.audioBuffered,r=a.currentTime;if(i){var o;if(i.length&&n.length){var l=Hl(i,r-3),c=Hl(i,r),d=Hl(n,r);d.length&&!c.length&&l.length&&(o={start:l.end(0),end:d.end(0)})}else{var u=df(i,r);u.length||(o=this.gapFromVideoUnderflow_(i,r))}return o?(this.logger_("Encountered a gap in video from "+o.start+" to "+o.end+". "+("Seeking to current time "+r)),!0):!1}},t.skipTheGap_=function(a){var i=this.tech_.buffered(),n=this.tech_.currentTime(),r=df(i,n);this.cancelTimer_(),!(r.length===0||n!==a)&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",a,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+ts),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},t.gapFromVideoUnderflow_=function(a,i){for(var n=k2e(a),r=0;r<n.length;r++){var o=n.start(r),l=n.end(r);if(i-o<4&&i-o>2)return{start:o,end:l}}return null},e}(),Fve={errorInterval:30,getSource:function(e){var t=this.tech({IWillNotUseThisInPlugins:!0}),a=t.currentSource_||this.currentSource();return e(a)}},Vve=function e(t,a){var i=0,n=0,r=te.mergeOptions(Fve,a);t.ready(function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var o=function(){n&&t.currentTime(n)},l=function(h){h!=null&&(n=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",o),t.src(h),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},c=function(){if(Date.now()-i<r.errorInterval*1e3){t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),t.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){te.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return i=Date.now(),r.getSource.call(t,l)},d=function h(){t.off("loadedmetadata",o),t.off("error",c),t.off("dispose",h)},u=function(h){d(),e(t,h)};t.on("error",c),t.on("dispose",d),t.reloadSourceOnError=u},Uve=function(e){Vve(this,e)},WA="2.16.2",jve="6.0.1",zve="0.22.1",Hve="4.8.0",qve="3.1.3",va={PlaylistLoader:Wl,Playlist:$a,utils:$2e,STANDARD_PLAYLIST_SELECTOR:AA,INITIAL_PLAYLIST_SELECTOR:z1e,lastBandwidthSelector:AA,movingAverageBandwidthSelector:U1e,comparePlaylistBandwidth:X1,comparePlaylistResolution:V1e,xhr:rA()};Object.keys(ma).forEach(function(e){Object.defineProperty(va,e,{get:function(){return te.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),ma[e]},set:function(t){if(te.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),typeof t!="number"||t<0){te.log.warn("value of Vhs."+e+" must be greater than or equal to 0");return}ma[e]=t}})});var GA="videojs-vhs",KA=function(e,t){for(var a=t.media(),i=-1,n=0;n<e.length;n++)if(e[n].id===a.id){i=n;break}e.selectedIndex_=i,e.trigger({selectedIndex:i,type:"change"})},Wve=function(e,t){t.representations().forEach(function(a){e.addQualityLevel(a)}),KA(e,t.playlists)};va.canPlaySource=function(){return te.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Gve=function(e,t,a){if(!e)return e;var i={};t&&t.attributes&&t.attributes.CODECS&&(i=ff(On(t.attributes.CODECS))),a&&a.attributes&&a.attributes.CODECS&&(i.audio=a.attributes.CODECS);var n=Xd(i.video),r=Xd(i.audio),o={};for(var l in e)o[l]={},r&&(o[l].audioContentType=r),n&&(o[l].videoContentType=n),t.contentProtection&&t.contentProtection[l]&&t.contentProtection[l].pssh&&(o[l].pssh=t.contentProtection[l].pssh),typeof e[l]=="string"&&(o[l].url=e[l]);return te.mergeOptions(e,o)},Kve=function(e,t){return e.reduce(function(a,i){if(!i.contentProtection)return a;var n=t.reduce(function(r,o){var l=i.contentProtection[o];return l&&l.pssh&&(r[o]={pssh:l.pssh}),r},{});return Object.keys(n).length&&a.push(n),a},[])},Xve=function(e){var t=e.player,a=e.sourceKeySystems,i=e.audioMedia,n=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var r=i?n.concat([i]):n,o=Kve(r,Object.keys(a)),l=[],c=[];return o.forEach(function(d){c.push(new Promise(function(u,h){t.tech_.one("keysessioncreated",u)})),l.push(new Promise(function(u,h){t.eme.initializeMediaKeys({keySystems:d},function(m){if(m){h(m);return}u()})}))}),Promise.race([Promise.all(l),Promise.race(c)])},Jve=function(e){var t=e.player,a=e.sourceKeySystems,i=e.media,n=e.audioMedia,r=Gve(a,i,n);return r?(t.currentSource().keySystems=r,r&&!t.eme?(te.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},XA=function(){if(!O.localStorage)return null;var e=O.localStorage.getItem(GA);if(!e)return null;try{return JSON.parse(e)}catch{return null}},Yve=function(e){if(!O.localStorage)return!1;var t=XA();t=t?te.mergeOptions(t,e):e;try{O.localStorage.setItem(GA,JSON.stringify(t))}catch{return!1}return t},Qve=function(e){return e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(e.substring(e.indexOf(",")+1)):e};va.supportsNativeHls=function(){if(!le||!le.createElement)return!1;var e=le.createElement("video");if(!te.getTech("Html5").isSupported())return!1;var t=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return t.some(function(a){return/maybe|probably/i.test(e.canPlayType(a))})}(),va.supportsNativeDash=function(){return!le||!le.createElement||!te.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(le.createElement("video").canPlayType("application/dash+xml"))}(),va.supportsTypeNatively=function(e){return e==="hls"?va.supportsNativeHls:e==="dash"?va.supportsNativeDash:!1},va.isSupported=function(){return te.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Zve=te.getComponent("Component"),$1=function(e){Re(t,e);function t(i,n,r){var o;if(o=e.call(this,n,te.mergeOptions(r.hls,r.vhs))||this,r.hls&&Object.keys(r.hls).length&&te.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),typeof r.initialBandwidth=="number"&&(o.options_.bandwidth=r.initialBandwidth),o.logger_=Yi("VhsHandler"),n.options_&&n.options_.playerId){var l=te(n.options_.playerId);l.hasOwnProperty("hls")||Object.defineProperty(l,"hls",{get:function(){return te.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"hls-player-access"}),$e(o)},configurable:!0}),l.hasOwnProperty("vhs")||Object.defineProperty(l,"vhs",{get:function(){return te.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"vhs-player-access"}),$e(o)},configurable:!0}),l.hasOwnProperty("dash")||Object.defineProperty(l,"dash",{get:function(){return te.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),$e(o)},configurable:!0}),o.player_=l}if(o.tech_=n,o.source_=i,o.stats={},o.ignoreNextSeekingEvent_=!1,o.setOptions_(),o.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(o.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return o.on(le,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(c){var d=le.fullscreenElement||le.webkitFullscreenElement||le.mozFullScreenElement||le.msFullscreenElement;d&&d.contains(o.tech_.el())?o.masterPlaylistController_.fastQualityChange_():o.masterPlaylistController_.checkABR_()}),o.on(o.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),o.on(o.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),o.on(o.tech_,"play",o.play),o}var a=t.prototype;return a.setOptions_=function(){var i=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects!==!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=5*60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){var n=XA();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=ma.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===ma.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(r){typeof i.source_[r]<"u"&&(i.options_[r]=i.source_[r])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},a.src=function(i,n){var r=this;if(i){this.setOptions_(),this.options_.src=Qve(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=va,this.options_.sourceType=O6(n),this.options_.seekTo=function(c){r.tech_.setCurrentTime(c)},this.options_.smoothQualityChange&&te.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new Bve(this.options_);var o=te.mergeOptions({liveRangeSafeTimeDelta:Mn},this.options_,{seekable:function(){return r.seekable()},media:function(){return r.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new Rve(o),this.masterPlaylistController_.on("error",function(){var c=te.players[r.tech_.options_.playerId],d=r.masterPlaylistController_.error;typeof d=="object"&&!d.code?d.code=3:typeof d=="string"&&(d={message:d,code:3}),c.error(d)});var l=this.options_.experimentalBufferBasedABR?va.movingAverageBandwidthSelector(.55):va.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):l.bind(this),this.masterPlaylistController_.selectInitialPlaylist=va.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(c){this.masterPlaylistController_.selectPlaylist=c.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=c,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var c=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,d=O.navigator.connection||O.navigator.mozConnection||O.navigator.webkitConnection,u=1e7;if(this.options_.useNetworkInformationApi&&d){var h=d.downlink*1e3*1e3;h>=u&&c>=u?c=Math.max(c,h):c=h}return c},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=c,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var c=1/(this.bandwidth||1),d;this.throughput>0?d=1/this.throughput:d=0;var u=Math.floor(1/(c+d));return u},set:function(){te.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return r.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return r.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return r.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return r.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return r.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return r.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return r.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return r.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return r.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return r.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return r.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return r.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return r.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return Fs(r.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return r.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return r.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return r.tech_.name_},enumerable:!0},duration:{get:function(){return r.tech_.duration()},enumerable:!0},master:{get:function(){return r.playlists.master},enumerable:!0},playerDimensions:{get:function(){return r.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Fs(r.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return r.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){r.options_.useBandwidthFromLocalStorage&&Yve({bandwidth:r.bandwidth,throughput:Math.round(r.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){Lve(r)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){r.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=O.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},a.createKeySessions_=function(){var i=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Xve({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:n&&n.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){i.logger_("created EME key session"),i.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(r){i.logger_("error while creating EME key session",r),i.player_.error({message:"Failed to initialize media keys for EME",code:3})})},a.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},a.setupEme_=function(){var i=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,r=Jve({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:n&&n.media()});if(this.player_.tech_.on("keystatuschange",function(o){if(o.status==="output-restricted"){var l=i.masterPlaylistController_.master();if(!(!l||!l.playlists)){var c=[];if(l.playlists.forEach(function(u){u&&u.attributes&&u.attributes.RESOLUTION&&u.attributes.RESOLUTION.height>=720&&(!u.excludeUntil||u.excludeUntil<1/0)&&(u.excludeUntil=1/0,c.push(u))}),c.length){var d;(d=te.log).warn.apply(d,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(c)),i.masterPlaylistController_.fastQualityChange_()}}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),te.browser.IE_VERSION===11||!r){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},a.setupQualityLevels_=function(){var i=this,n=te.players[this.tech_.options_.playerId];!n||!n.qualityLevels||this.qualityLevels_||(this.qualityLevels_=n.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){Wve(i.qualityLevels_,i)}),this.playlists.on("mediachange",function(){KA(i.qualityLevels_,i.playlists)}))},t.version=function(){return{"@videojs/http-streaming":WA,"mux.js":jve,"mpd-parser":zve,"m3u8-parser":Hve,"aes-decrypter":qve}},a.version=function(){return this.constructor.version()},a.canChangeType=function(){return VA.canChangeType()},a.play=function(){this.masterPlaylistController_.play()},a.setCurrentTime=function(i){this.masterPlaylistController_.setCurrentTime(i)},a.duration=function(){return this.masterPlaylistController_.duration()},a.seekable=function(){return this.masterPlaylistController_.seekable()},a.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&O.URL.revokeObjectURL&&(O.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},a.convertToProgramTime=function(i,n){return s1e({playlist:this.masterPlaylistController_.media(),time:i,callback:n})},a.seekToProgramTime=function(i,n,r,o){return r===void 0&&(r=!0),o===void 0&&(o=2),o1e({programTime:i,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})},t}(Zve),gu={name:"videojs-http-streaming",VERSION:WA,canHandleSource:function(e,t){t===void 0&&(t={});var a=te.mergeOptions(te.options,t);return gu.canPlayType(e.type,a)},handleSource:function(e,t,a){a===void 0&&(a={});var i=te.mergeOptions(te.options,a);return t.vhs=new $1(e,t,i),te.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return te.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=rA(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){var a=O6(e);if(!a)return"";var i=gu.getOverrideNative(t),n=va.supportsTypeNatively(a),r=!n||i;return r?"maybe":""},getOverrideNative:function(e){e===void 0&&(e={});var t=e,a=t.vhs,i=a===void 0?{}:a,n=t.hls,r=n===void 0?{}:n,o=!(te.browser.IS_ANY_SAFARI||te.browser.IS_IOS),l=i.overrideNative,c=l===void 0?o:l,d=r.overrideNative,u=d===void 0?!1:d;return u||c}},$ve=function(){return Em("avc1.4d400d,mp4a.40.2")};if($ve()&&te.getTech("Html5").registerSourceHandler(gu,0),te.VhsHandler=$1,Object.defineProperty(te,"HlsHandler",{get:function(){return te.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),$1},configurable:!0}),te.VhsSourceHandler=gu,Object.defineProperty(te,"HlsSourceHandler",{get:function(){return te.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),gu},configurable:!0}),te.Vhs=va,Object.defineProperty(te,"Hls",{get:function(){return te.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),va},configurable:!0}),te.use||(te.registerComponent("Hls",va),te.registerComponent("Vhs",va)),te.options.vhs=te.options.vhs||{},te.options.hls=te.options.hls||{},!te.getPlugin||!te.getPlugin("reloadSourceOnError")){var eSe=te.registerPlugin||te.plugin;eSe("reloadSourceOnError",Uve)}/*! @name videojs-offset @version 2.1.3 @license MIT */var tSe="2.1.3",aSe={},iSe=te.registerPlugin||te.plugin,nSe=function e(){var t=this,a=this.currentTime();a<0&&(this.currentTime(0),this.play()),this._offsetEnd>0&&a>this._offsetEnd-this._offsetStart&&(this.off("timeupdate",e),this.pause(),this.trigger("ended"),this.one("play",function(){t.on("timeupdate",e)}),this._restartBeginning?(this.trigger("loadstart"),this.currentTime(0)):this.currentTime(this._offsetEnd-this._offsetStart))},rSe=function(e,t){e.one("play",function(){e.on("timeupdate",nSe)})},ev=function(e){var t=this;e=e||{};var a=this.constructor;this._offsetStart=parseFloat(e.start||"0"),this._offsetEnd=parseFloat(e.end||"0"),this._restartBeginning=e.restart_beginning||!1,(!a.__super__||!a.__super__.__offsetInit)&&(a.__super__={__offsetInit:!0,duration:a.prototype.duration,currentTime:a.prototype.currentTime,bufferedPercent:a.prototype.bufferedPercent,remainingTime:a.prototype.remainingTime,buffered:a.prototype.buffered},a.prototype.duration=function(){return this._offsetEnd!==void 0&&this._offsetStart!==void 0?this._offsetEnd>0?this._offsetEnd-this._offsetStart:a.__super__.duration.apply(this,arguments)-this._offsetStart:a.__super__.duration.apply(this,arguments)},a.prototype.currentTime=function(i){if(i!==void 0)return this._offsetStart!==void 0?a.__super__.currentTime.call(this,i+this._offsetStart):a.__super__.currentTime.call(this,i);if(this._offsetStart!==void 0){var n=a.__super__.currentTime.apply(this)-this._offsetStart;return this.getCache().currentTime=n,n}return a.__super__.currentTime.apply(this)},a.prototype.remainingTime=function(){return this.duration()-this.currentTime()},a.prototype.startOffset=function(){return this._offsetStart},a.prototype.endOffset=function(){return this._offsetEnd>0?this._offsetEnd:this.duration()},a.prototype.buffered=function(){for(var i=a.__super__.buffered.call(this),n=[],r=0;r<i.length;r++)n[r]=[Math.max(0,i.start(r)-this._offsetStart),Math.min(Math.max(0,i.end(r)-this._offsetStart),this.duration())];return te.createTimeRanges(n)}),this.ready(function(){rSe(t,te.mergeOptions(aSe,e))})};iSe("offset",ev),ev.VERSION=tSe;const sSe=[{name:"",color:"#26C6DA",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol"},{name:"",color:"#FFFF00",points:[1,2,3],categories:[510],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal",singleName:"Tiro a gol"},{name:"",color:"#9933FF",points:[1,2,3],categories:[537,540,544,547],translationKey:"chalkboard.offensive.team.shots_on_goal_2",singleName:"Tiro a gol (portería)"},{name:"",color:"#FFA726",points:[1,2,3],categories:[13,25],translationKey:"chalkboard.offensive.team.center_crosses",singleName:"Centro"},{name:"",color:"#4DB6AC",points:[1,2,3],categories:[98,101,104,105,109,112,115,116],translationKey:"chalkboard.offensive.team.successful_center_crosses",singleName:"Centro acertado"},{name:"",color:"#F06292",points:[1,2],categories:[11],translationKey:"chalkboard.offensive.team.balls_won_opponent_penalty_box",singleName:"Balón ganado"},{name:"",color:"#3A3838",points:[1],categories:[4],translationKey:"chalkboard.offensive.team.successful_1_on_1_attacking",singleName:"1 vs 1 ofensivo"},{name:"",color:"#00B050",points:[1],categories:[208],translationKey:"chalkboard.offensive.team.unsuccessful_1_on_1_attacking",singleName:"1 vs 1 ofensivo"}],oSe=[{name:"",color:"#26C6DA",points:[1,2,3],categories:["57_r","326_r","56_r","60_r","59_r","55_r",35,54],invert:[57,326,56,60,59,55],negative:!1,translationKey:"chalkboard.defensive.team.goals_received",singleName:"Gol recibido"},{name:"",color:"#FFFF00",points:[1,2,3],categories:["510_r"],invert:[510],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"},{name:"",color:"#9933FF",points:[1,2,3],categories:["537_r","540_r","544_r","547_r"],invert:[537,540,544,547],translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"},{name:"",color:"#FFA726",points:[1,2,3],categories:["13_r","25_r"],invert:[13,25],translationKey:"chalkboard.defensive.team.total_centers_received",singleName:"Centro recibido"},{name:"",color:"#4DB6AC",points:[1,2,3],categories:["98_r","101_r","104_r","105_r","109_r","112_r","115_r","116_r"],invert:[98,101,104,105,109,112,115,116],translationKey:"chalkboard.defensive.team.successful_centers_by_opponent",singleName:"Centro acertado"},{name:"",color:"#00FF00",points:[1,2,3],categories:["33_r"],invert:[33],translationKey:"chalkboard.defensive.team.offsides_caused",singleName:"Fuera de lugar"},{name:"",color:"#FF3399",points:[1,2],categories:[483],translationKey:"chalkboard.defensive.team.balls_recovered_in_challenge",singleName:"Balón recuperado"},{name:"",color:"#B4005A",points:[1,2],categories:[484],translationKey:"chalkboard.defensive.team.balls_recovered_without_challenge",singleName:"Balón recuperado"},{name:"",color:"#3A3838",points:[1],categories:[5],translationKey:"chalkboard.defensive.team.successful_1_on_1",singleName:"1 vs 1 defensivo"},{name:"",color:"#00B050",points:[1],categories:[209],translationKey:"chalkboard.defensive.team.unsuccessful_1_on_1",singleName:"1 vs 1 defensivo"},{name:"",color:"#305496",points:[1,2],categories:[23],translationKey:"chalkboard.defensive.team.balls_won_own_penalty_box",singleName:"Balón ganado"},{name:"",color:"#FF9966",points:[1,2,3],categories:[24],translationKey:"chalkboard.defensive.team.arial_game_rest_pitch",singleName:"Juego aéreo"},{name:"",color:"#700000",points:[1],categories:[518],translationKey:"chalkboard.defensive.team.slide_tackles",singleName:"Barrida"},{name:"",color:"#CC0000",points:[1],categories:[34],translationKey:"chalkboard.defensive.team.clearances",singleName:"Rechace"}],lSe=[{id:1,category:"featured_players.possession.successful_passes",category_id:[2,20],singleName:"Pase acertado"},{id:2,category:"featured_players.possession.successful_passes_opponents_half",category_id:[20],singleName:"Pase acertado c. rival"},{id:3,category:"featured_players.possession.successful_passes_own_half",category_id:[2],singleName:"Pase acertado c. propia"},{id:4,category:"featured_players.possession.recovered_balls",category_id:[482],singleName:"Balón recuperado"},{id:5,category:"featured_players.possession.balls_recovered_in_challenge",category_id:[485,486,489,490],singleName:"B. recuperado en disputa"}],cSe=[{id:1,category:"featured_players.offensive.shots_on_goal",category_id:[510],singleName:"Tiro a gol"},{id:2,category:"featured_players.offensive.centers_from_right",category_id:[25],singleName:"Centro por derecha"},{id:3,category:"featured_players.offensive.centers_from_left",category_id:[13],singleName:"Centro por izquierda"},{id:4,category:"featured_players.offensive.successful_1_on_1",category_id:[4],singleName:"1 vs 1 exitoso ofensivo"},{id:5,category:"featured_players.offensive.balls_won_opponent_penalty_box",category_id:[11],singleName:"B. ganado en área rival"}],dSe=[{id:1,category:"featured_players.defensive.balls_recovered",category_id:[482],singleName:"Balón recuperado"},{id:19,category:"featured_players.defensive.balls_recovered_opponents_half",category_id:[491,492,487,488],singleName:"B. recuperado C. rival"},{id:3,category:"featured_players.defensive.balls_won_own_penalty_box",category_id:[23],singleName:"B. ganado área propia"},{id:4,category:"featured_players.defensive.clearances",category_id:[34],singleName:"Rechace"},{id:5,category:"featured_players.defensive.successful_1_on_1",category_id:[5],singleName:"1 vs 1 exitoso defensivo"}],uSe=function(){const e=[...lSe,...cSe,...dSe];return e.forEach(t=>{t.categories=t.category_id}),e}(),hSe=[{name:"",color:"#26C6DA",points:[1,2,3],categories:[12],negative:!1,translationKey:"chalkboard.offensive.player.goals"},{name:"",color:"#305496",points:[1,2,3],categories:[10],negative:!1,translationKey:"chalkboard.offensive.player.assists"},{name:"",color:"#000066",points:[1,2,3],categories:[27],translationKey:"chalkboard.offensive.player.participation_in_goals"},{name:"",color:"#FFFF00",points:[1,2,3],categories:[510],translationKey:"chalkboard.offensive.player.shots_on_goal"},{name:"",color:"#9933FF",points:[1,2,3],categories:[537,540,544,547],translationKey:"chalkboard.offensive.player.shots_on_goal_2"},{name:"",color:"#FFA726",points:[1,2,3],categories:[13,25],translationKey:"chalkboard.offensive.player.center_crosses"},{name:"",color:"#4DB6AC",points:[1,2,3],categories:[98,101,104,105,109,112,115,116],translationKey:"chalkboard.offensive.player.successful_center_crosses"},{name:"",color:"#F06292",points:[1,2],categories:[11],translationKey:"chalkboard.offensive.player.balls_won_opponent_penalty_box"},{name:"",color:"#3A3838",points:[1],categories:[4],translationKey:"chalkboard.offensive.player.successful_1_on_1_attacking"},{name:"",color:"#00B050",points:[1],categories:[208],translationKey:"chalkboard.offensive.player.unsuccessful_1_on_1_attacking"}],pSe=[{name:"",color:"#F06292",points:[1,2,3],categories:[44],translationKey:"chalkboard.offensive.goalkeeper.footwork"},{name:"",color:"#9C27B0",points:[1,2],categories:[302],translationKey:"chalkboard.offensive.goalkeeper.throw"},{name:"",color:"#455A64",points:[1,2],categories:[303],translationKey:"chalkboard.offensive.goalkeeper.punt"},{name:"",color:"#000066",points:[1,2,3],categories:[323],translationKey:"chalkboard.offensive.goalkeeper.participation_in_goals"},{name:"",color:"#305496",points:[1,2],categories:[324],translationKey:"chalkboard.offensive.goalkeeper.assist"},{name:"",color:"#FFA726",points:[1,2],categories:[264],translationKey:"chalkboard.offensive.goalkeeper.goal_kick"}],mSe=[...hSe,...pSe],fSe=[{name:"",color:"#F06292",points:[1,2],categories:[483],translationKey:"chalkboard.defensive.player.balls_recovered_in_challenge",singleName:"Balón recuperado"},{name:"",color:"#B4005A",points:[1,2],categories:[484],translationKey:"chalkboard.defensive.player.balls_recovered_without_challenge",singleName:"Balón recuperado"},{name:"",color:"#455A64",points:[1],categories:[5],translationKey:"chalkboard.defensive.player.successful_1_on_1",singleName:"1 vs 1 exitoso defensivo"},{name:"",color:"#4CAF50",points:[1],categories:[209],translationKey:"chalkboard.defensive.player.unsuccessful_1_on_1",singleName:"1 vs 1 no exitoso defensivo"},{name:"",color:"#305496",points:[1,2],categories:[23],translationKey:"chalkboard.defensive.player.balls_won_own_penalty_box",singleName:"Balón ganado"},{name:"",color:"#FFA726",points:[1,2,3],categories:[517],translationKey:"chalkboard.defensive.player.allowed_crosses",singleName:"Juego aéreo resto del campo"},{name:"",color:"#700000",points:[1],categories:[34],translationKey:"chalkboard.defensive.player.clearances",singleName:"Rechace"},{name:"",color:"#CC0000",points:[1],categories:[518],translationKey:"chalkboard.defensive.player.slide_tackles",singleName:"Barrida"}],gSe=[{name:"",color:"#26C6DA",points:[1,2,3],categories:[40],translationKey:"chalkboard.defensive.goalkeeper.goals_received",singleName:"Gol recibido"},{name:"",color:"#F06292",points:[1,2],categories:[39],translationKey:"chalkboard.defensive.goalkeeper.saves",singleName:"Atajada"},{name:"",color:"#455A64",points:[1,2],categories:[42],translationKey:"chalkboard.defensive.goalkeeper.successful_aerial_game",singleName:"Juego aéreo exitoso"},{name:"",color:"#4CAF50",points:[1,2,3],categories:[43],translationKey:"chalkboard.defensive.goalkeeper.unsuccessful_aerial_game",singleName:"Juego aéreo no exitoso"},{name:"",color:"#FFF176",points:[1],categories:[41],translationKey:"chalkboard.defensive.goalkeeper.1_on_1",singleName:"1 vs 1"},{name:"",color:"#FFA726",points:[1],categories:[312],translationKey:"chalkboard.defensive.goalkeeper.recovered_balls",singleName:"Balón recuperado"}],ySe=[...fSe,...gSe],_Se=[{category:"PASES ACERTADOS",categoryIds:null,translationKey:"table.possession.team.successful_passes",singleName:"Pase acertado",generalName:"Pases acertados",items:[{category:"PASES ACERTADOS EN 1/4",categoryIds:[213],translationKey:"table.possession.team.successful_passes_1/4",singleName:"Pase acertado en 1/4",generalName:"Pases acertados en 1/4"},{category:"PASES ACERTADOS EN 2/4",categoryIds:[214],translationKey:"table.possession.team.successful_passes_2/4",singleName:"Pase acertado en 2/4",generalName:"Pases acertados en 2/4"},{category:"PASES ACERTADOS EN 3/4",categoryIds:[215],translationKey:"table.possession.team.successful_passes_3/4",singleName:"Pase acertado en 3/4",generalName:"Pases acertados en 3/4"},{category:"PASES ACERTADOS EN 4/4",categoryIds:[216],translationKey:"table.possession.team.successful_passes_4/4",singleName:"Pase acertado en 4/4",generalName:"Pases acertados en 4/4"}]},{category:"PASES FILTRADOS",categoryIds:[217],translationKey:"table.possession.team.through_passes",singleName:"Pase filtrado",generalName:"Pases filtrados"},{category:"PASES NO ACERTADOS",categoryIds:null,translationKey:"table.possession.team.unsuccessful_passes",generalName:"Pases no acertados",singleName:"Pase no acertado",items:[{category:"PASES NO ACERTADOS EN 1/4",categoryIds:[218],translationKey:"table.possession.team.unsuccessful_passes_1/4",generalName:"Pases no acertados en 1/4",singleName:"Pase no acertado en 1/4"},{category:"PASES NO ACERTADOS EN 2/4",categoryIds:[219],translationKey:"table.possession.team.unsuccessful_passes_2/4",generalName:"Pases no acertados en 2/4",singleName:"Pase no acertado en 2/4"},{category:"PASES NO ACERTADOS EN 3/4",categoryIds:[220],translationKey:"table.possession.team.unsuccessful_passes_3/4",generalName:"Pases no acertados en 3/4",singleName:"Pase no acertado en 3/4"},{category:"PASES NO ACERTADOS EN 4/4",categoryIds:[221],translationKey:"table.possession.team.unsuccessful_passes_4/4",generalName:"Pases no acertados en 4/4",singleName:"Pase no acertado en 4/4"}]},{category:"BALONES RECUPERADOS EN DISPUTA",categoryIds:null,translationKey:"table.possession.team.ball_recovered_in_challenge",generalName:"Balones recuperados en disputa",singleName:"Balón recuperado en disputa",items:[{category:"B.R.E.D CANCHA PROPIA",categoryIds:[485,486],translationKey:"table.possession.team.b_r_i_c_own_half",generalName:"B.R.E.D cancha propia",singleName:"B.R.E.D cancha propia"},{category:"B.R.E.D CANCHA RIVAL",categoryIds:[487,488],translationKey:"table.possession.team.b_r_i_c_opponents_half",generalName:"B.R.E.D cancha rival",singleName:"B.R.E.D cancha rival"}]},{category:"BALONES RECUPERADOS SIN DISPUTA",categoryIds:null,translationKey:"table.possession.team.ball_recovered_without_challenge",generalName:"Balones recuperados sin disputa",singleName:"Balon recuperado sin disputa",items:[{category:"B.R.S.D CANCHA PROPIA",categoryIds:[489,490],translationKey:"table.possession.team.b_r_w_c_own_half",generalName:"B.R.S.D cancha propia",singleName:"B.R.S.D cancha propia"},{category:"B.R.S.D CANCHA RIVAL",categoryIds:[491,492],translationKey:"table.possession.team.b_r_w_c_opponents_half",generalName:"B.R.S.D cancha rival",singleName:"B.R.S.D cancha rival"}]},{category:"BALONES PERDIDOS EN DISPUTA",categoryIds:null,translationKey:"table.possession.team.balls_lost_in_challenge",generalName:"Balones perdidos en disputa",singleName:"Balon perdido en disputa",items:[{category:"B.P.E.D. CANCHA PROPIA",categoryIds:[496,497],translationKey:"table.possession.team.b_l_i_c_own_half",generalName:"B.P.E.D. cancha propia",singleName:"B.P.E.D. cancha propia"},{category:"B.P.E.D. CANCHA RIVAL",categoryIds:[498,499],translationKey:"table.possession.team.b_l_i_c_opponents_half",generalName:"B.P.E.D. cancha rival",singleName:"B.P.E.D. cancha rival"}]},{category:"BALONES PERDIDOS SIN DISPUTA",categoryIds:null,translationKey:"table.possession.team.balls_lost_without_challenge",generalName:"Balones perdidos sin disputa",singleName:"Balon perdido sin disputa",items:[{category:"B.P.S.D. CANCHA PROPIA",categoryIds:[500,501],translationKey:"table.possession.team.b_l_w_c_own_half",generalName:"B.P.S.D. cancha propia",singleName:"B.P.S.D. cancha propia"},{category:"B.P.S.D. CANCHA RIVAL",categoryIds:[502,503],translationKey:"table.possession.team.b_l_w_c_opponents_half",generalName:"B.P.S.D. cancha rival",singleName:"B.P.S.D. cancha rival"}]}],bSe=[{category:"GOLES",categoryIds:null,translationKey:"table.offensive.team.goals",generalName:"Goles",singleName:"Gol",items:[{category:"GOLES PIE DENTRO DEL ÁREA",categoryIds:[57],translationKey:"table.offensive.team.goals_foot_inside_penalty",generalName:"Goles pie dentro del área",singleName:"Gol pie dentro del área"},{category:"GOLES PIE FUERA DEL ÁREA",categoryIds:[326],translationKey:"table.offensive.team.goals_foot_outside_penalty",generalName:"Goles pie fuera del área",singleName:"Gol pie fuera del área"},{category:"GOLES CABEZA",categoryIds:[56],translationKey:"table.offensive.team.header_goals",generalName:"Goles cabeza",singleName:"Gol cabeza"},{category:"GOLES TIRO LIBRE",categoryIds:[60],translationKey:"table.offensive.team.free_kick_goals",generalName:"Goles tiro libre",singleName:"Gol tiro libre"},{category:"GOLES PENAL",categoryIds:[59],translationKey:"table.offensive.team.penalty_goals",generalName:"Goles penal",singleName:"Gol penal"},{category:"GOLES DE PORTERO",categoryIds:[55],translationKey:"table.offensive.team.goalkeeper_goals",generalName:"Goles de portero",singleName:"Gol de portero"},{category:"AUTOGOLES",rCategoryIds:[35,54],translationKey:"table.offensive.team.opponents_own_goals",generalName:"Autogoles a favor",singleName:"Autogol"}]},{category:"TIROS A GOL (ORIGEN)",categoryIds:null,translationKey:"table.offensive.team.shots_on_goal_from",generalName:"Tiros a gol (origen)",singleName:"Tiro a gol (origen)",items:[{category:"DENTRO DEL ÁREA",categoryIds:[514,516],translationKey:"table.offensive.team.inside_the_box",generalName:"Tiros a gol dentro del área",singleName:"Tiro a gol dentro del área"},{category:"FUERA DEL ÁREA",categoryIds:[513,515],translationKey:"table.offensive.team.outside_the_box",generalName:"Tiros a gol fuera del área",singleName:"Tiro a gol fuera del área"}]},{category:"TIROS A GOL (DESTINO)",categoryIds:null,translationKey:"table.offensive.team.shots_on_goal_to",generalName:"Tiros a gol (destino)",singleName:"Tiro a gol (destino)",items:[{category:"CON DESTINO A PORTERÍA",generalName:"Tiros a gol con destino a portería",categoryIds:[537,540,544,547],translationKey:"table.offensive.team.shots_on_goal"},{category:"SIN DESTINO A PORTERÍA",generalName:"Tiros a gol sin destino a portería",categoryIds:[538,541,545,548],translationKey:"table.offensive.team.not_to_destiny"},{category:"BLOQUEADOS",generalName:"Tiros a gol bloqueados",categoryIds:[539,542,546,549],items:null,categoriesTypes:[2,3],translationKey:"table.offensive.team.blocked"}]},{category:"CENTROS POR IZQUIERDA",singleName:"Centro por izquierda",categoryIds:null,translationKey:"table.offensive.team.centers_from_left",items:[{category:"C.P.I. ACERTADOS",singleName:"C.P.I. acertado",categoryIds:[98,101,104,105],translationKey:"table.offensive.team.successful_c_f_l_s"},{category:"C.P.I. NO ACERTADOS",categoryIds:[106,107,108],translationKey:"table.offensive.team.unsuccessful_c_f_l_s"}]},{category:"CENTROS POR DERECHA",categoryIds:null,translationKey:"table.offensive.team.centers_from_right",items:[{category:"C.P.D. ACERTADOS",categoryIds:[109,112,115,116],translationKey:"table.offensive.team.successful_c_f_r_s"},{category:"C.P.D. NO ACERTADOS",categoryIds:[117,118,119],translationKey:"table.offensive.team.unsuccessful_c_f_r_s"}]},{category:"BALONES GANADOS EN ÁREA RIVAL",categoryIds:[11],translationKey:"table.offensive.team.balls_won_opponents_penalty"}],vSe=[{category:"GOLES RECIBIDOS",categoryIds:null,translationKey:"table.defensive.team.goals_received",items:[{category:"GOLES PIE DENTRO DEL ÁREA",rCategoryIds:[57],translationKey:"table.defensive.team.goals_foot_inside_penalty"},{category:"GOLES PIE FUERA DEL ÁREA",rCategoryIds:[326],translationKey:"table.defensive.team.goals_foot_outside_penalty"},{category:"GOLES DE CABEZA",rCategoryIds:[56],translationKey:"table.defensive.team.header_goals"},{category:"GOLES DE TIRO LIBRE",rCategoryIds:[60],translationKey:"table.defensive.team.free_kick_goals"},{category:"GOLES DE PENAL",rCategoryIds:[59],translationKey:"table.defensive.team.penalty_goals"},{category:"GOLES DE PORTERO RECIBIDOS",rCategoryIds:[55],translationKey:"table.defensive.team.goalkeeper_goals"},{category:"AUTOGOLES",categoryIds:[35,54],translationKey:"table.defensive.team.opponents_own_goals"}]},{category:"TIROS A GOL RECIBIDOS (ORIGEN)",categoryIds:null,translationKey:"table.defensive.team.shots_on_goal_from",items:[{category:"DENTRO DEL ÁREA",generalName:"Tiros a gol recibidos dentro del área",rCategoryIds:[514,516],translationKey:"table.defensive.team.inside_the_box"},{category:"FUERA DEL ÁREA",generalName:"Tiros a gol recibidos fuera del área",rCategoryIds:[513,515],translationKey:"table.defensive.team.outside_the_box"}]},{category:"TIROS A GOL RECIBIDOS (DESTINO)",categoryIds:null,translationKey:"table.defensive.team.shots_on_goal_to",items:[{category:"CON DESTINO A PORTERÍA",rCategoryIds:[537,540,544,547],translationKey:"table.defensive.team.shot_on_goal",generalName:"Tiros a gol recibidos con destino a portería"},{category:"SIN DESTINO A PORTERÍA",rCategoryIds:[538,541,545,548],translationKey:"table.defensive.team.missed",generalName:"Tiros a gol recibidos sin destino a portería"},{category:"BLOQUEADOS",categoryIds:null,rCategoryIds:[539,542,546,549],translationKey:"table.defensive.team.blocked",generalName:"Tiros a gol recibidos bloqueados"}]},{category:"CENTROS POR IZQUIERDA RECIBIDOS",categoryIds:null,translationKey:"table.defensive.team.centers_left_side_received",items:[{category:"C.P.I.R. ACERTADOS",rCategoryIds:[109,112,115,116],translationKey:"table.defensive.team.successful_c_f_l_r"},{category:"C.P.I.R. NO ACERTADOS",rCategoryIds:[117,118,119],translationKey:"table.defensive.team.unsuccessful_c_f_l_r"}]},{category:"CENTROS POR DERECHA RECIBIDOS",categoryIds:null,translationKey:"table.defensive.team.centers_right_side_received",items:[{category:"C.P.D.R. ACERTADOS",rCategoryIds:[98,101,104,105],translationKey:"table.defensive.team.successful_c_f_r_r"},{category:"C.P.D.R. NO ACERTADOS",rCategoryIds:[106,107,108],translationKey:"table.defensive.team.unsuccessful_c_f_r_r"}]},{category:"BALONES RECUPERADOS CANCHA RIVAL",categoryIds:null,translationKey:"table.defensive.team.balls_recovered_opponents_half",items:[{category:"B.R.C.R. EN DISPUTA",categoryIds:[487,488],translationKey:"table.defensive.team.b_r_o_h_in_challenge"},{category:"B.R.C.R. SIN DISPUTA",categoryIds:[491,492],translationKey:"table.defensive.team.b_r_o_h_without_challenge"}]},{category:"BALONES RECUPERADOS CANCHA PROPIA",categoryIds:null,translationKey:"table.defensive.team.balls_recovered_own_half",items:[{category:"B.R.C.P. EN DISPUTA",categoryIds:[485,486],translationKey:"table.defensive.team.b_r_own_h_in_challenge"},{category:"B.R.C.P. SIN DISPUTA",categoryIds:[489,490],translationKey:"table.defensive.team.b_r_own_h_without_challenge"}]}],SSe=function(){let e=[];return e=e.concat(Xn(_Se)),e=e.concat(Xn(bSe)),e=e.concat(Xn(vSe)),e}(),wSe=[{category:"PASES ACERTADOS",categoryIds:null,translationKey:"table.possession.player.successful_passes",items:[{category:"P. ACERTADOS 1/4",categoryIds:[213],translationKey:"table.possession.player.successful_passes_1/4"},{category:"P. ACERTADOS 2/4",categoryIds:[214],translationKey:"table.possession.player.successful_passes_2/4"},{category:"P. ACERTADOS 3/4",categoryIds:[215],translationKey:"table.possession.player.successful_passes_3/4"},{category:"P. ACERTADOS 4/4",categoryIds:[216],translationKey:"table.possession.player.successful_passes_4/4"}]},{category:"PASES FILTRADOS",categoryIds:[217],translationKey:"table.possession.player.through_passes"},{category:"PASES NO ACERTADOS",categoryIds:null,translationKey:"table.possession.player.unsuccessful_passes",items:[{category:"P. NO ACERTADOS 1/4",categoryIds:[218],translationKey:"table.possession.player.unsuccessful_passes_1/4"},{category:"P. NO ACERTADOS 2/4",categoryIds:[219],translationKey:"table.possession.player.unsuccessful_passes_2/4"},{category:"P. NO ACERTADOS 3/4",categoryIds:[220],translationKey:"table.possession.player.unsuccessful_passes_3/4"},{category:"P. NO ACERTADOS 4/4",categoryIds:[221],translationKey:"table.possession.player.unsuccessful_passes_4/4"}]},{category:"BALONES RECUPERADOS EN DISPUTA",categoryIds:null,translationKey:"table.possession.player.ball_recovered_in_challenge",items:[{category:"B.R.E.D CANCHA PROPIA",categoryIds:[485,486],translationKey:"table.possession.player.b_r_i_c_own_half"},{category:"B.R.E.D CANCHA RIVAL",categoryIds:[487,488],translationKey:"table.possession.player.b_r_i_c_opponents_half"}]},{category:"BALONES RECUPERADOS SIN DISPUTA",categoryIds:null,translationKey:"table.possession.player.ball_recovered_without_challenge",items:[{category:"B.R.S.D CANCHA PROPIA",categoryIds:[489,490],translationKey:"table.possession.player.b_r_w_c_own_half"},{category:"B.R.S.D CANCHA RIVAL",categoryIds:[491,492],translationKey:"table.possession.player.b_r_w_c_opponents_half"}]},{category:"BALONES PERDIDOS EN DISPUTA",categoryIds:null,translationKey:"table.possession.player.balls_lost_in_challenge",items:[{category:"B.P.E.D. CANCHA PROPIA",categoryIds:[496,497],translationKey:"table.possession.player.b_l_i_c_own_half"},{category:"B.P.E.D. CANCHA RIVAL",categoryIds:[498,499],translationKey:"table.possession.player.b_l_i_c_opponents_half"}]},{category:"BALONES PERDIDOS SIN DISPUTA",categoryIds:null,translationKey:"table.possession.player.balls_lost_without_challenge",items:[{category:"B.P.S.D. CANCHA PROPIA",categoryIds:[500,501],translationKey:"table.possession.player.b_l_w_c_own_half"},{category:"B.P.S.D. CANCHA RIVAL",categoryIds:[502,503],translationKey:"table.possession.player.b_l_w_c_opponents_half"}]}],TSe=[{category:"GOLES",categoryIds:null,translationKey:"table.offensive.player.goals",items:[{category:"GOLES PIE DENTRO DEL ÁREA",categoryIds:[57],translationKey:"table.offensive.player.goals_foot_inside_penalty"},{category:"GOLES PIE FUERA DEL ÁREA",categoryIds:[326],translationKey:"table.offensive.player.goals_foot_outside_penalty"},{category:"GOLES CABEZA",categoryIds:[56],translationKey:"table.offensive.player.header_goals"},{category:"GOLES TIRO LIBRE",categoryIds:[60],translationKey:"table.offensive.player.free_kick_goals"},{category:"GOLES PENAL",categoryIds:[59],translationKey:"table.offensive.player.penalty_goals"}]},{category:"TIROS A GOL (ORIGEN)",categoryIds:null,translationKey:"table.offensive.player.shots_on_goal_from",items:[{category:"DENTRO DEL ÁREA",categoryIds:[514,516],translationKey:"table.offensive.player.inside_the_box",generalName:"Tiros a gol dentro del área"},{category:"FUERA DEL ÁREA",categoryIds:[513,515],translationKey:"table.offensive.player.outside_the_box",generalName:"Tiros a gol fuera del área"}]},{category:"TIROS A GOL (DESTINO)",categoryIds:null,translationKey:"table.offensive.player.shots_on_goal_to",items:[{category:"CON DESTINO A PORTERÍA",categoryIds:[537,540,544,547],translationKey:"table.offensive.player.shots_on_goal",generalName:"Tiros a gol con destino a portería"},{category:"SIN DESTINO A PORTERÍA",categoryIds:[538,541,545,548],translationKey:"table.offensive.player.not_to_destiny",generalName:"Tiros a gol sin destino a portería"},{category:"BLOQUEADOS",categoryIds:[539,542,546,549],translationKey:"table.offensive.player.blocked",generalName:"Tiros a gol bloqueados"}]},{category:"CENTROS POR IZQUIERDA",categoryIds:null,translationKey:"table.offensive.player.centers_from_left",items:[{category:"C.P.I. ACERTADOS",categoryIds:[98,101,104,105],translationKey:"table.offensive.player.successful_c_f_l_s"},{category:"C.P.I. NO ACERTADOS",categoryIds:[106,107,108],translationKey:"table.offensive.player.unsuccessful_c_f_l_s"}]},{category:"CENTROS POR DERECHA",categoryIds:null,translationKey:"table.offensive.player.centers_from_right",items:[{category:"C.P.D. ACERTADOS",categoryIds:[109,112,115,116],translationKey:"table.offensive.player.successful_c_f_r_s"},{category:"C.P.D. NO ACERTADOS",categoryIds:[117,118,119],translationKey:"table.offensive.player.unsuccessful_c_f_r_s"}]},{category:"BALONES GANADOS EN ÁREA RIVAL",categoryIds:[11],translationKey:"table.offensive.player.balls_won_opponents_penalty"}],CSe=[{category:"BALONES RECUPERADOS CANCHA RIVAL",categoryIds:null,translationKey:"table.defensive.player.balls_recovered_opponents_half",items:[{category:"B.R.C.R. EN DISPUTA",categoryIds:[487,488],translationKey:"table.defensive.player.b_r_o_h_in_challenge"},{category:"B.R.C.R. SIN DISPUTA",categoryIds:[491,492],translationKey:"table.defensive.player.b_r_o_h_without_challenge"}]},{category:"BALONES RECUPERADOS CANCHA PROPIA",categoryIds:null,translationKey:"table.defensive.player.balls_recovered_own_half",items:[{category:"B.R.C.P. EN DISPUTA",categoryIds:[485,486],translationKey:"table.defensive.player.b_r_own_h_in_challenge"},{category:"B.R.C.P. SIN DISPUTA",categoryIds:[489,490],translationKey:"table.defensive.player.b_r_own_h_without_challenge"}]},{category:"BALONES GANADOS EN ÁREA PROPIA",categoryIds:[23],items:null,translationKey:"table.defensive.player.balls_won_own_penalty_box"},{category:"1 VS 1 EXITOSOS",categoryIds:null,translationKey:"table.defensive.player.successful_1_on_1",items:[{category:"OFENSIVOS",categoryIds:[4],translationKey:"table.defensive.player.attacking",generalName:"1 vs 1 exitoso Ofensivo"},{category:"DEFENSIVOS",categoryIds:[5],translationKey:"table.defensive.player.defensive",generalName:"1 vs 1 exitoso Defensivo"}]},{category:"BARRIDAS",categoryIds:null,translationKey:"table.defensive.player.slide_tackles",items:[{category:"CON POSESIÓN",categoryIds:[521],translationKey:"table.defensive.player.with_possession",generalName:"Barridas con posesión"},{category:"SIN POSESIÓN",categoryIds:[522],translationKey:"table.defensive.player.without_possession",generalName:"Barridas sin posesión"},{category:"PROVOCA FALTA",categoryIds:[543],translationKey:"table.defensive.player.with_foul_committed",generalName:"Barridas que provocan falta"}]},{category:"CENTROS PERMITIDOS",categoryIds:[517],items:null,translationKey:"table.defensive.player.allow_crosses"},{category:"RECHACES",categoryIds:[34],items:null,translationKey:"table.defensive.player.clearances"}],kSe=function(){let e=[];return e=e.concat(Xn(wSe)),e=e.concat(Xn(TSe)),e=e.concat(Xn(CSe)),e}(),ESe=[{category:"",categoryIds:null,translationKey:"table.possession.goalkeeper.footwork",items:[{category:"",categoryIds:[310],translationKey:"table.possession.goalkeeper.successful_long_pass"},{category:"",categoryIds:[311],translationKey:"table.possession.goalkeeper.unsuccessful_long_pass"},{category:"",categoryIds:[308],translationKey:"table.possession.goalkeeper.successful_short_pass"},{category:"",categoryIds:[309],translationKey:"table.possession.goalkeeper.unsuccessful_short_pass"}]},{category:"",categoryIds:null,translationKey:"table.possession.goalkeeper.throw",items:[{category:"",categoryIds:[304],translationKey:"table.possession.goalkeeper.successful_throw"},{category:"",categoryIds:[305],translationKey:"table.possession.goalkeeper.unsuccessful_throw"}]},{category:"",categoryIds:null,translationKey:"table.possession.goalkeeper.punt",items:[{category:"",categoryIds:[306],translationKey:"table.possession.goalkeeper.successful_punt"},{category:"",categoryIds:[307],translationKey:"table.possession.goalkeeper.unsuccessful_punt"}]},{category:"",categoryIds:[323],items:null,translationKey:"table.possession.goalkeeper.participation_in_goals"}],ISe=[{category:"",categoryIds:null,translationKey:"table.offensive.goalkeeper.footwork",items:[{category:"",categoryIds:[310],translationKey:"table.offensive.goalkeeper.successful_long_pass"},{category:"",categoryIds:[311],translationKey:"table.offensive.goalkeeper.unsuccessful_long_pass"},{category:"",categoryIds:[308],translationKey:"table.offensive.goalkeeper.successful_short_pass"},{category:"",categoryIds:[309],translationKey:"table.offensive.goalkeeper.unsuccessful_short_pass"}]},{category:"",categoryIds:null,translationKey:"table.offensive.goalkeeper.throw",items:[{category:"",categoryIds:[304],translationKey:"table.offensive.goalkeeper.successful_throw"},{category:"",categoryIds:[305],translationKey:"table.offensive.goalkeeper.unsuccessful_throw"}]},{category:"",categoryIds:null,translationKey:"table.offensive.goalkeeper.punt",items:[{category:"",categoryIds:[306],translationKey:"table.offensive.goalkeeper.successful_punt"},{category:"",categoryIds:[307],translationKey:"table.offensive.goalkeeper.unsuccessful_punt"}]},{category:"",categoryIds:[323],items:null,translationKey:"table.offensive.goalkeeper.participation_in_goals"}],xSe=[{category:"",categoryIds:[40],items:null,translationKey:"table.defensive.goalkeeper.goals_received"},{category:"",categoryIds:null,translationKey:"table.defensive.goalkeeper.saves",items:[{category:"",categoryIds:[300],translationKey:"table.defensive.goalkeeper.goalkeeper_handled",generalName:"Atajadas que se queda con el balón"},{category:"",categoryIds:[301],translationKey:"table.defensive.goalkeeper.goalkeeper_un-handled",generalName:"Atajadas que no se queda con el balón"}]},{category:"",categoryIds:null,translationKey:"table.defensive.goalkeeper.aerial_game",items:[{category:"",categoryIds:[313],translationKey:"table.defensive.goalkeeper.successful_handled",generalName:"Juego aéreo exitoso que se queda con el balón"},{category:"",categoryIds:[314],translationKey:"table.defensive.goalkeeper.successful_un-handled",generalName:"Juego aéreo exitoso que no se queda con el balón"}]},{category:"",categoryIds:[41],items:null,translationKey:"table.defensive.goalkeeper.1_on_1"},{category:"",categoryIds:[312],items:null,translationKey:"table.defensive.goalkeeper.recovered_balls"}],NSe=function(){let e=[];return e=e.concat(Xn(ESe)),e=e.concat(Xn(ISe)),e=e.concat(Xn(xSe)),e}(),Qi={1:13,2:14,3:15,4:16,5:9,6:10,7:11,8:12,9:5,10:6,11:7,12:8,13:1,14:2,15:3,16:4},yu={1:16,2:15,3:14,4:13,5:12,6:11,7:10,8:9,9:8,10:7,11:6,12:5,13:4,14:3,15:2,16:1},ASe=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},PSe={class:"menu-container"},OSe={__name:"GSC-Menu",props:{menuMarginTop:{type:Number,default:0,validator(e){return!Number.isNaN(e)}},modelValue:{type:Boolean,default:!1},width:{type:String,default:"fit-content"},menuWidth:{type:String,default:"fit-content"}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e;s.useCssVars(d=>({"1c0de360":e.width,"5088a52e":o.value,"8225919e":e.menuWidth}));const i=s.ref(null),n=s.ref(!1),r=s.computed(()=>i.value?{top:`${i.value.getBoundingClientRect().height+a.menuMarginTop}px`}:{top:"0px"}),o=s.computed(()=>n.value?3:1);s.watch(()=>a.modelValue,d=>{d!==n.value&&(n.value=d)},{immediate:!0});function l(){n.value=!n.value,t("update:modelValue",n.value)}function c(){n.value=!1,t("update:modelValue",n.value)}return(d,u)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[n.value?(s.openBlock(),s.createElementBlock("div",{key:0,id:"menu-overlay",onClick:c})):s.createCommentVNode("",!0),s.createElementVNode("div",PSe,[s.createElementVNode("div",{ref_key:"trigger",ref:i,class:"menu-container__trigger",onClick:l},[s.renderSlot(d.$slots,"trigger",{},void 0,!0)],512),s.createVNode(s.Transition,null,{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{class:"menu-container__menu",style:s.normalizeStyle(r.value)},[s.renderSlot(d.$slots,"menu",{},void 0,!0)],4),[[s.vShow,n.value]])]),_:3})])],64))}},JA=ASe(OSe,[["__scopeId","data-v-ea0b7b18"]]),YA=[{id:"goals",name:"Goles",componentName:"VideosGoals",actionId:1},{id:"player",name:"Jugador",componentName:"VideosPlayer",actionId:4},{id:"team",name:"Equipo",componentName:"VideosTeam",actionId:3},{id:"game",name:"Partido",componentName:"VideosGame",actionId:2}],Fn=e=>(s.pushScopeId("data-v-c62b28bf"),e=e(),s.popScopeId(),e),BSe={class:"video-search__input"},DSe=Fn(()=>s.createElementVNode("div",{class:"video-search__input__icon"},[s.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M21.3057 20.0167L18.3107 17.0217C19.7585 15.2432 20.4679 12.9765 20.2923 10.69C20.1168 8.40341 19.0697 6.27161 17.3674 4.73492C15.6652 3.19823 13.4377 2.37404 11.1451 2.43261C8.8526 2.49117 6.67012 3.42801 5.04852 5.04962C3.42692 6.67122 2.49007 8.8537 2.43151 11.1462C2.37294 13.4388 3.19713 15.6663 4.73382 17.3685C6.27051 19.0708 8.40231 20.1179 10.6889 20.2934C12.9754 20.469 15.2421 19.7596 17.0206 18.3118L20.0156 21.3068C20.1878 21.4757 20.4194 21.5703 20.6607 21.5703C20.9019 21.5703 21.1335 21.4757 21.3057 21.3068C21.4759 21.1353 21.5714 20.9034 21.5714 20.6618C21.5714 20.4201 21.4759 20.1883 21.3057 20.0167ZM4.25581 11.3798C4.25581 9.97099 4.67356 8.59386 5.45623 7.42252C6.2389 6.25117 7.35133 5.33822 8.65286 4.79911C9.95439 4.25999 11.3866 4.11894 12.7683 4.39377C14.15 4.66861 15.4191 5.347 16.4153 6.34314C17.4114 7.33929 18.0898 8.60846 18.3646 9.99016C18.6395 11.3719 18.4984 12.804 17.9593 14.1055C17.4202 15.4071 16.5072 16.5195 15.3359 17.3022C14.1646 18.0849 12.7874 18.5026 11.3787 18.5026C9.4905 18.4996 7.68055 17.7481 6.34541 16.413C5.01028 15.0779 4.25886 13.2679 4.25581 11.3798Z",fill:"#98A2B3"})])],-1)),MSe={key:0,class:"video-search__menu"},LSe={class:"video-search__menu__results"},RSe={key:0,class:"video-search__menu__results__player"},FSe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__title"},"Jugador",-1)),VSe=[FSe],USe={key:1,class:"video-search__menu__results__player"},jSe=["onClick"],zSe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__result__icon"},[s.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M21.3057 20.0167L18.3107 17.0217C19.7585 15.2432 20.4679 12.9765 20.2923 10.69C20.1168 8.40341 19.0697 6.27161 17.3674 4.73492C15.6652 3.19823 13.4377 2.37404 11.1451 2.43261C8.8526 2.49117 6.67012 3.42801 5.04852 5.04962C3.42692 6.67122 2.49007 8.8537 2.43151 11.1462C2.37294 13.4388 3.19713 15.6663 4.73382 17.3685C6.27051 19.0708 8.40231 20.1179 10.6889 20.2934C12.9754 20.469 15.2421 19.7596 17.0206 18.3118L20.0156 21.3068C20.1878 21.4757 20.4194 21.5703 20.6607 21.5703C20.9019 21.5703 21.1335 21.4757 21.3057 21.3068C21.4759 21.1353 21.5714 20.9034 21.5714 20.6618C21.5714 20.4201 21.4759 20.1883 21.3057 20.0167ZM4.25581 11.3798C4.25581 9.97099 4.67356 8.59386 5.45623 7.42252C6.2389 6.25117 7.35133 5.33822 8.65286 4.79911C9.95439 4.25999 11.3866 4.11894 12.7683 4.39377C14.15 4.66861 15.4191 5.347 16.4153 6.34314C17.4114 7.33929 18.0898 8.60846 18.3646 9.99016C18.6395 11.3719 18.4984 12.804 17.9593 14.1055C17.4202 15.4071 16.5072 16.5195 15.3359 17.3022C14.1646 18.0849 12.7874 18.5026 11.3787 18.5026C9.4905 18.4996 7.68055 17.7481 6.34541 16.413C5.01028 15.0779 4.25886 13.2679 4.25581 11.3798Z",fill:"#98A2B3"})])],-1)),HSe={class:"video-search__menu__results__result__description"},qSe={key:2,class:"video-search__menu__results__player__season"},WSe=["onClick"],GSe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__result__icon"},[s.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M21.3057 20.0167L18.3107 17.0217C19.7585 15.2432 20.4679 12.9765 20.2923 10.69C20.1168 8.40341 19.0697 6.27161 17.3674 4.73492C15.6652 3.19823 13.4377 2.37404 11.1451 2.43261C8.8526 2.49117 6.67012 3.42801 5.04852 5.04962C3.42692 6.67122 2.49007 8.8537 2.43151 11.1462C2.37294 13.4388 3.19713 15.6663 4.73382 17.3685C6.27051 19.0708 8.40231 20.1179 10.6889 20.2934C12.9754 20.469 15.2421 19.7596 17.0206 18.3118L20.0156 21.3068C20.1878 21.4757 20.4194 21.5703 20.6607 21.5703C20.9019 21.5703 21.1335 21.4757 21.3057 21.3068C21.4759 21.1353 21.5714 20.9034 21.5714 20.6618C21.5714 20.4201 21.4759 20.1883 21.3057 20.0167ZM4.25581 11.3798C4.25581 9.97099 4.67356 8.59386 5.45623 7.42252C6.2389 6.25117 7.35133 5.33822 8.65286 4.79911C9.95439 4.25999 11.3866 4.11894 12.7683 4.39377C14.15 4.66861 15.4191 5.347 16.4153 6.34314C17.4114 7.33929 18.0898 8.60846 18.3646 9.99016C18.6395 11.3719 18.4984 12.804 17.9593 14.1055C17.4202 15.4071 16.5072 16.5195 15.3359 17.3022C14.1646 18.0849 12.7874 18.5026 11.3787 18.5026C9.4905 18.4996 7.68055 17.7481 6.34541 16.413C5.01028 15.0779 4.25886 13.2679 4.25581 11.3798Z",fill:"#98A2B3"})])],-1)),KSe={class:"video-search__menu__results__result__description"},XSe={key:3,class:"video-search__menu__results__team"},JSe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__title"},"Equipo",-1)),YSe=[JSe],QSe={key:4,class:"video-search__menu__results__team"},ZSe=["onClick"],$Se=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__result__icon"},[s.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M21.3057 20.0167L18.3107 17.0217C19.7585 15.2432 20.4679 12.9765 20.2923 10.69C20.1168 8.40341 19.0697 6.27161 17.3674 4.73492C15.6652 3.19823 13.4377 2.37404 11.1451 2.43261C8.8526 2.49117 6.67012 3.42801 5.04852 5.04962C3.42692 6.67122 2.49007 8.8537 2.43151 11.1462C2.37294 13.4388 3.19713 15.6663 4.73382 17.3685C6.27051 19.0708 8.40231 20.1179 10.6889 20.2934C12.9754 20.469 15.2421 19.7596 17.0206 18.3118L20.0156 21.3068C20.1878 21.4757 20.4194 21.5703 20.6607 21.5703C20.9019 21.5703 21.1335 21.4757 21.3057 21.3068C21.4759 21.1353 21.5714 20.9034 21.5714 20.6618C21.5714 20.4201 21.4759 20.1883 21.3057 20.0167ZM4.25581 11.3798C4.25581 9.97099 4.67356 8.59386 5.45623 7.42252C6.2389 6.25117 7.35133 5.33822 8.65286 4.79911C9.95439 4.25999 11.3866 4.11894 12.7683 4.39377C14.15 4.66861 15.4191 5.347 16.4153 6.34314C17.4114 7.33929 18.0898 8.60846 18.3646 9.99016C18.6395 11.3719 18.4984 12.804 17.9593 14.1055C17.4202 15.4071 16.5072 16.5195 15.3359 17.3022C14.1646 18.0849 12.7874 18.5026 11.3787 18.5026C9.4905 18.4996 7.68055 17.7481 6.34541 16.413C5.01028 15.0779 4.25886 13.2679 4.25581 11.3798Z",fill:"#98A2B3"})])],-1)),ewe={class:"video-search__menu__results__result__description"},twe={key:5,class:"video-search__menu__results__team"},awe=["onClick"],iwe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__result__icon"},[s.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M21.3057 20.0167L18.3107 17.0217C19.7585 15.2432 20.4679 12.9765 20.2923 10.69C20.1168 8.40341 19.0697 6.27161 17.3674 4.73492C15.6652 3.19823 13.4377 2.37404 11.1451 2.43261C8.8526 2.49117 6.67012 3.42801 5.04852 5.04962C3.42692 6.67122 2.49007 8.8537 2.43151 11.1462C2.37294 13.4388 3.19713 15.6663 4.73382 17.3685C6.27051 19.0708 8.40231 20.1179 10.6889 20.2934C12.9754 20.469 15.2421 19.7596 17.0206 18.3118L20.0156 21.3068C20.1878 21.4757 20.4194 21.5703 20.6607 21.5703C20.9019 21.5703 21.1335 21.4757 21.3057 21.3068C21.4759 21.1353 21.5714 20.9034 21.5714 20.6618C21.5714 20.4201 21.4759 20.1883 21.3057 20.0167ZM4.25581 11.3798C4.25581 9.97099 4.67356 8.59386 5.45623 7.42252C6.2389 6.25117 7.35133 5.33822 8.65286 4.79911C9.95439 4.25999 11.3866 4.11894 12.7683 4.39377C14.15 4.66861 15.4191 5.347 16.4153 6.34314C17.4114 7.33929 18.0898 8.60846 18.3646 9.99016C18.6395 11.3719 18.4984 12.804 17.9593 14.1055C17.4202 15.4071 16.5072 16.5195 15.3359 17.3022C14.1646 18.0849 12.7874 18.5026 11.3787 18.5026C9.4905 18.4996 7.68055 17.7481 6.34541 16.413C5.01028 15.0779 4.25886 13.2679 4.25581 11.3798Z",fill:"#98A2B3"})])],-1)),nwe={class:"video-search__menu__results__result__description"},rwe={key:6,class:"video-search__menu__results__game"},swe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__title"},"Partidos",-1)),owe=["onClick"],lwe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__results__result__icon"},[s.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M21.3057 20.0167L18.3107 17.0217C19.7585 15.2432 20.4679 12.9765 20.2923 10.69C20.1168 8.40341 19.0697 6.27161 17.3674 4.73492C15.6652 3.19823 13.4377 2.37404 11.1451 2.43261C8.8526 2.49117 6.67012 3.42801 5.04852 5.04962C3.42692 6.67122 2.49007 8.8537 2.43151 11.1462C2.37294 13.4388 3.19713 15.6663 4.73382 17.3685C6.27051 19.0708 8.40231 20.1179 10.6889 20.2934C12.9754 20.469 15.2421 19.7596 17.0206 18.3118L20.0156 21.3068C20.1878 21.4757 20.4194 21.5703 20.6607 21.5703C20.9019 21.5703 21.1335 21.4757 21.3057 21.3068C21.4759 21.1353 21.5714 20.9034 21.5714 20.6618C21.5714 20.4201 21.4759 20.1883 21.3057 20.0167ZM4.25581 11.3798C4.25581 9.97099 4.67356 8.59386 5.45623 7.42252C6.2389 6.25117 7.35133 5.33822 8.65286 4.79911C9.95439 4.25999 11.3866 4.11894 12.7683 4.39377C14.15 4.66861 15.4191 5.347 16.4153 6.34314C17.4114 7.33929 18.0898 8.60846 18.3646 9.99016C18.6395 11.3719 18.4984 12.804 17.9593 14.1055C17.4202 15.4071 16.5072 16.5195 15.3359 17.3022C14.1646 18.0849 12.7874 18.5026 11.3787 18.5026C9.4905 18.4996 7.68055 17.7481 6.34541 16.413C5.01028 15.0779 4.25886 13.2679 4.25581 11.3798Z",fill:"#98A2B3"})])],-1)),cwe={class:"video-search__menu__results__result__description"},dwe={class:"video-search__menu__categories"},uwe=Fn(()=>s.createElementVNode("div",{class:"video-search__menu__categories__title"},"Buscar por categoría:",-1)),hwe={class:"video-search__menu__categories__buttons"},pwe=["onClick"],mwe="https://7dnlmh3q0m.execute-api.us-west-2.amazonaws.com/dev/search",fwe={__name:"VideoSearch",props:{clientWidth:{type:Number,default:0}},emits:["update:search-result","click-advanced-filter-type"],setup(e,{emit:t}){const a=e,i=s.computed(()=>{let p=[];return a.clientWidth>0&&(a.clientWidth<=472?p.push("video-search__472"):a.clientWidth<=752?p.push("video-search__752"):a.clientWidth<=1280?p.push("video-search__1280"):p.push("video-search")),p}),n=s.ref({team:[],team_by_game:[],player:[],player_by_game:[],game:[]}),r=s.ref(!1),o=s.ref(null);async function l(p){try{const f=await(await fetch(mwe,{method:"POST",body:p})).json();n.value.player=[...f.players||[]],n.value.player_by_game=[...f.players_by_game||[]],n.value.team=[...f.teams||[]],n.value.team_by_game=[...f.teams_by_game||[]],n.value.game=[...f.games||[]],r.value=!0}catch(f){throw new Error(f)}}function c(p=!1){p&&(o.value.value=""),n.value.player=[],n.value.player_by_game=[],n.value.team=[],n.value.team_by_game=[],n.value.game=[],r.value=!1}function d(p,f){const y={categoryIds:p.stats.categories};p.season_id&&(y.seasonId=p.season_id),p.game&&(y.game={id:p.game.game_id},y.seasonId=p.game.season_id),f==="player"?(y.player={id:p.player_id,positionId:p.position_id},y.team={id:p.team_id}):y.team={id:p.team_id,acronym:p.team_short_name,colloquialName:p.team_colloquial_name,name:p.team},t("update:search-result",y)}function u(p){d(p,p.player&&p.player_id?"player":"team"),c(!0)}function h(p){p.target.value.length<4?c():l(p.target.value)}function m(p){t("click-advanced-filter-type",p),c(!0)}return(p,f)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["video-search",i.value])},[s.createVNode(s.unref(JA),{modelValue:r.value,"onUpdate:modelValue":f[0]||(f[0]=y=>r.value=y),"menu-margin-top":8},{trigger:s.withCtx(()=>[s.createElementVNode("div",BSe,[DSe,s.createElementVNode("input",{ref_key:"searchInput",ref:o,placeholder:"¿Qué video quieres ver hoy?",type:"text",onKeyup:h},null,544)])]),menu:s.withCtx(()=>[n.value.player.length||n.value.team.length||n.value.game.length?(s.openBlock(),s.createElementBlock("div",MSe,[s.createElementVNode("div",LSe,[n.value.player.length>0||n.value.player_by_game.length>0?(s.openBlock(),s.createElementBlock("div",RSe,VSe)):s.createCommentVNode("",!0),n.value.player.length>0?(s.openBlock(),s.createElementBlock("div",USe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.player,(y,b)=>(s.openBlock(),s.createElementBlock("div",{key:b,class:"video-search__menu__results__result",onClick:E=>u(y)},[zSe,s.createElementVNode("div",HSe,s.toDisplayString(y.player)+" "+s.toDisplayString(y.stats.name)+" "+s.toDisplayString(y.season),1)],8,jSe))),128))])):s.createCommentVNode("",!0),n.value.player_by_game.length>0?(s.openBlock(),s.createElementBlock("div",qSe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.player_by_game,(y,b)=>(s.openBlock(),s.createElementBlock("div",{key:b,class:"video-search__menu__results__result",onClick:E=>u(y)},[GSe,s.createElementVNode("div",KSe,s.toDisplayString(y.player)+" "+s.toDisplayString(y.stats.name)+" "+s.toDisplayString(y.game.season)+" ("+s.toDisplayString(y.game.home_team.colloquial_name)+" "+s.toDisplayString(y.game.score)+" "+s.toDisplayString(y.game.away_team.colloquial_name)+") ",1)],8,WSe))),128))])):s.createCommentVNode("",!0),n.value.team.length>0||n.value.team_by_game.length>0?(s.openBlock(),s.createElementBlock("div",XSe,YSe)):s.createCommentVNode("",!0),n.value.team.length>0?(s.openBlock(),s.createElementBlock("div",QSe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.team,(y,b)=>(s.openBlock(),s.createElementBlock("div",{key:b,class:"video-search__menu__results__result",onClick:E=>u(y)},[$Se,s.createElementVNode("div",ewe,s.toDisplayString(y.team)+" "+s.toDisplayString(y.stats.name)+" "+s.toDisplayString(y.season),1)],8,ZSe))),128))])):s.createCommentVNode("",!0),n.value.team_by_game.length>0?(s.openBlock(),s.createElementBlock("div",twe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.team_by_game,(y,b)=>(s.openBlock(),s.createElementBlock("div",{key:b,class:"video-search__menu__results__result",onClick:E=>u(y)},[iwe,s.createElementVNode("div",nwe,s.toDisplayString(y.team)+" "+s.toDisplayString(y.stats.name)+" "+s.toDisplayString(y.game.season)+" ("+s.toDisplayString(y.game.home_team.colloquial_name)+" "+s.toDisplayString(y.game.score)+" "+s.toDisplayString(y.game.away_team.colloquial_name)+") ",1)],8,awe))),128))])):s.createCommentVNode("",!0),n.value.game.length>0?(s.openBlock(),s.createElementBlock("div",rwe,[swe,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.game,(y,b)=>(s.openBlock(),s.createElementBlock("div",{key:b,class:"video-search__menu__results__result",onClick:E=>u(y)},[lwe,s.createElementVNode("div",cwe,s.toDisplayString(y.season)+" "+s.toDisplayString(y.home_team.colloquial_name)+" "+s.toDisplayString(y.score)+" "+s.toDisplayString(y.away_team.colloquial_name)+" "+s.toDisplayString(y.stats.name),1)],8,owe))),128))])):s.createCommentVNode("",!0)]),s.createElementVNode("div",dwe,[uwe,s.createElementVNode("div",hwe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(YA),y=>(s.openBlock(),s.createElementBlock("button",{key:y.id,class:"video-search__menu__categories__buttons__button",onClick:b=>m(y)},s.toDisplayString(y.name),9,pwe))),128))])])])):s.createCommentVNode("",!0)]),_:1},8,["modelValue"])],2))}},gwe=bt(fwe,[["__scopeId","data-v-c62b28bf"]]),ywe={__name:"ButtonCustom",props:{text:{type:String,default:""},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},padding:{type:String,default:"0px"},borderRadius:{type:String,default:"0px"},borderWidth:{type:String,default:"1px"},borderColor:{type:String,default:"#d9d9d9"},backgroundColor:{type:String,default:"#FFFFFF"},activeBackgroundColor:{type:String,default:""},activeBorderColor:{type:String,default:""},activeFontColor:{type:String,default:""},fontColor:{type:String,default:"#000000"},fontSize:{type:String,default:"16px"},fontFamily:{type:String,default:"Poppins-Regular, sans-serif"},isActive:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const a=e,i=s.computed(()=>({"--height":a.height,"--width":a.width,"--padding":a.padding,"--border-radius":a.borderRadius,"--border":`solid ${a.borderWidth} ${a.borderColor}`,"--background-color":a.backgroundColor,"--font-color":a.fontColor,"--font-size":a.fontSize,"--font-family":a.fontFamily,"--active-background-color":a.activeBackgroundColor||a.backgroundColor,"--active-border-color":a.activeBorderColor||a.borderColor,"--active-font-color":a.activeFontColor||a.fontColor}));function n(){t("click")}return(r,o)=>(s.openBlock(),s.createElementBlock("button",{class:s.normalizeClass(["button",{active:e.isActive}]),style:s.normalizeStyle(i.value),onClick:n},s.toDisplayString(e.text),7))}},Xl=bt(ywe,[["__scopeId","data-v-3a5141c4"]]),_we={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},QA={DF:"Dieciseisavos",OF:"Octavos",CF:"Cuartos",SF:"Semifinales","3ER":"Tercer lugar",FINAL:"Final"},bwe={4:"Octavos",5:"Cuartos",6:"Semifinales",7:"Final"},vwe={4:"OF",5:"Cf",6:"S",7:"F"};function tv(e=""){return e?localStorage.getItem(e):localStorage.getItem("user_token")||localStorage.getItem("token")}const Swe=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},av={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},ZA=()=>{s.useCssVars(e=>({"1c960139":e.height,b2f635d8:e.borderWidthBtn,"06e99898":e.borderType,"55555c76":e.borderColor,"23b6d320":e.borderRadius,"22c97374":e.width,"22bb09fa":e.backgroundColor,c148da7c:e.cursorType,cce756fc:e.fontSize,cff98d60:e.fontStyle,"5123b3a5":e.fontFamily,"47bf58db":e.marginLeftStat,cadc8414:e.fontSizeStat}))},$A=av.setup;av.setup=$A?(e,t)=>(ZA(),$A(e,t)):ZA;const wwe=e=>(s.pushScopeId("data-v-fb269a1e"),e=e(),s.popScopeId(),e),Twe=["src"],Cwe={key:1,class:"text"},kwe=["src"],Ewe={class:"stats"},Iwe=wwe(()=>s.createElementVNode("img",{class:"iconstats",src:"https://az755631.vo.msecnd.net/todoelfut/playdes.png"},null,-1)),xwe={class:"numstats"},Nwe={class:"leyend"};function Awe(e,t,a,i,n,r){return s.openBlock(),s.createElementBlock("div",null,[a.type==0?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["button",n.status&&a.typeOnOff&&"button-active"]),style:s.normalizeStyle([r.customStyle,n.status&&a.typeOnOff&&r.customActive]),onClick:t[0]||(t[0]=(...o)=>r.btnClick&&r.btnClick(...o))},[a.icon&&a.iconPosition.toLowerCase()==="left"?(s.openBlock(),s.createElementBlock("img",{key:0,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,Twe)):s.createCommentVNode("",!0),a.textValue?(s.openBlock(),s.createElementBlock("div",Cwe,s.toDisplayString(a.textValue),1)):s.createCommentVNode("",!0),a.icon&&a.iconPosition.toLowerCase()==="right"?(s.openBlock(),s.createElementBlock("img",{key:2,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,kwe)):s.createCommentVNode("",!0)],6)):s.createCommentVNode("",!0),a.type==1?(s.openBlock(),s.createElementBlock("div",{key:1,class:"button-target",onClick:t[1]||(t[1]=(...o)=>r.btnClick&&r.btnClick(...o))},[s.createElementVNode("div",Ewe,[Iwe,s.createElementVNode("div",xwe,s.toDisplayString(a.textStat),1)]),s.createElementVNode("div",Nwe,s.toDisplayString(a.textCategory),1)])):s.createCommentVNode("",!0)])}const Pwe=Swe(av,[["render",Awe],["__scopeId","data-v-fb269a1e"]]),Owe={class:"gsc-dropdown__main-container__item-selected"},Bwe=["height","width"],Dwe=["stroke"],Mwe={class:"gsc-dropdown__items-container"},Lwe=["onClick"],Rwe={key:0,class:"gsc-dropdown__items-footer"},iv={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(t=>t in e)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listItemPadding:{type:String,default:"10px 12px"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1}},emits:["input","click-ready","update:modelValue"],setup(e,{emit:t}){const a=e,i=s.ref({}),n=s.ref(null),r=s.ref(a.isMultipleOption?-1:0),o=s.ref(!1);s.watch(()=>a.items,(p,f)=>{if(!a.modelValue&&(!a.onlyFirstTime||!f||!f.length)&&p&&p.length){if(a.defaultItemByProp){const y=a.items.findIndex(b=>b[a.defaultItemByProp.propName]===a.defaultItemByProp.value);y!==-1?(r.value=y,i.value=p[y]):(r.value=0,i.value=p[0])}else i.value=p[a.defaultItemByIndex];t("input",i.value)}},{immediate:!0}),s.watch(()=>a.modelValue,p=>{if(p){const f=a.items.findIndex(y=>typeof p=="object"?JSON.stringify(y)===JSON.stringify(p):y===p);f!==-1&&(r.value=f,i.value=a.items[f],t("update:modelValue",i.value))}},{immediate:!0});const l=s.computed(()=>({height:a.height,width:a.width,backgroundColor:a.backgroundColor,borderRadius:`${a.borderRadius}px`,border:`${a.borderType} ${a.borderWidth}px ${a.borderColor}`,color:a.color,"--hover-background-color":a.hoverBackgroundColor,"--list-item-padding":a.listItemPadding,"--list-background-color":a.listBackgroundColor,"--list-height":a.listHeight,"--list-item-selected-color":a.listItemSelectedColor,"--list-item-selected-background-color":a.listItemSelectedBackgroundColor,"--list-item-color":a.listItemColor,"--list-border-radius":`${a.listBorderRadius}`,"--list-border-color":a.listBorderColor,"--list-width":a.isListSameWidth?a.width:"fit-content","--list-border-width":`${a.listBorderWidth}px`,"--footer-border":`${a.footerBorderWidth}px solid ${a.footerBorderColor}`,"--dropdown-opacity":a.isDisabled?"0.5":"1","--dropdown-cursor":a.isDisabled?"not-allowed":"pointer","--dropdown-font-size":a.fontSize?a.fontSize:"14px"})),c=s.computed(()=>({height:`${a.arrowHeight}px`,width:`${a.arrowWidth}px`}));function d(){a.isDisabled||(o.value=!o.value)}function u(p){n.value.contains(p.target)||(o.value=!1)}function h(p,f){a.isMultipleOption?r.value=-1:(r.value=f,o.value=!1),i.value=p,t("input",i.value),t("update:modelValue",i.value)}function m(){o.value=!1,t("click-ready")}return s.onMounted(()=>{document.addEventListener("click",u)}),s.onBeforeMount(()=>{document.removeEventListener("click",u)}),(p,f)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"dropDown",ref:n,class:"gsc-dropdown",style:s.normalizeStyle(l.value)},[s.createElementVNode("div",{class:"gsc-dropdown__main-container",style:s.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:d},[s.createElementVNode("div",Owe,[s.renderSlot(p.$slots,"default",{selectedItem:i.value})]),s.createElementVNode("div",{class:s.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":o.value}]),style:s.normalizeStyle(c.value)},[(s.openBlock(),s.createElementBlock("svg",{height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:e.arrowColor},null,8,Dwe)],8,Bwe))],6)],4),s.createVNode(s.Transition,null,{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",Mwe,[s.createElementVNode("div",null,[s.createElementVNode("div",{class:"gsc-dropdown__items",style:s.normalizeStyle({"margin-top":`${a.borderWidth}px`})},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.items,(y,b)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["gsc-dropdown__items__item",{selected:b===r.value}]),key:b,onClick:E=>h(y,b)},[s.renderSlot(p.$slots,"availableItem",{item:y})],10,Lwe))),128))],4),e.isFooterVisible?(s.openBlock(),s.createElementBlock("div",Rwe,[s.createVNode(s.unref(Pwe),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:m})])):s.createCommentVNode("",!0)])],512),[[s.vShow,o.value]])]),_:3})],4))}},nv={borderType:"solid",listBackgroundColor:"#2E3B46",listBorderColor:"rgba(255, 255, 255, 0.2)",listBorderRadius:"5px",height:"38px",borderWidth:.8,borderColor:"white",backgroundColor:"#2E3B46",color:"white",listItemColor:"white",listItemSelectedBackgroundColor:"#2E3B46",arrowColor:"#fff",width:"100%",listHeight:"200px",isListSameWidth:!0,isFooterVisible:!0,hoverBackgroundColor:"#2E3B46"},Fwe={class:"dropdown"},Vwe={class:"selected-item"},Uwe={__name:"DropdownTextOnly",props:{items:{type:Array,default:()=>[]},itemTextKey:{type:String,default:""},isListSameWidth:{type:Boolean,default:!0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(t=>t in e)}},emits:["input"],setup(e,{emit:t}){function a(i){t("input",i)}return(i,n)=>(s.openBlock(),s.createElementBlock("div",Fwe,[s.createVNode(s.unref(iv),s.mergeProps(s.unref(nv),{"is-list-same-width":e.isListSameWidth,items:e.items,"default-item-by-prop":e.defaultItemByProp,onInput:a}),{default:s.withCtx(({selectedItem:r})=>[s.createElementVNode("div",Vwe,s.toDisplayString(e.itemTextKey?r[e.itemTextKey]:r),1)]),availableItem:s.withCtx(({item:r})=>[s.createElementVNode("div",null,s.toDisplayString(e.itemTextKey?r[e.itemTextKey]:r),1)]),_:1},16,["is-list-same-width","items","default-item-by-prop"])]))}},ei=bt(Uwe,[["__scopeId","data-v-57f6e06e"]]),jwe={class:"dropdown"},zwe={class:"game-item"},Hwe={key:0,class:"item-game"},qwe={class:"match-day"},Wwe={class:"team-logo"},Gwe=["src"],Kwe={class:"text"},Xwe={class:"text score"},Jwe={class:"text"},Ywe={class:"team-logo"},Qwe=["src"],Zwe={class:"item-game"},$we={class:"team-logo"},eTe=["src"],tTe={class:"text"},aTe={class:"text score"},iTe={class:"text"},nTe={class:"team-logo"},rTe=["src"],sTe={__name:"DropdownGame",props:{items:{type:Array,default:()=>[]}},emits:["input"],setup(e,{emit:t}){function a(i){t("input",i)}return(i,n)=>(s.openBlock(),s.createElementBlock("div",jwe,[s.createVNode(s.unref(iv),s.mergeProps(s.unref(nv),{items:e.items,onInput:a}),{default:s.withCtx(({selectedItem:r})=>[s.createElementVNode("div",zwe,[r.homeTeam?(s.openBlock(),s.createElementBlock("div",Hwe,[s.createElementVNode("div",qwe,s.toDisplayString(r.roundAbbreviation),1),s.createElementVNode("div",Wwe,[s.createElementVNode("img",{src:r.homeTeam.logo,alt:""},null,8,Gwe)]),s.createElementVNode("div",Kwe,s.toDisplayString(r.homeTeam.acronym),1),s.createElementVNode("div",Xwe,s.toDisplayString(r.score[0])+" - "+s.toDisplayString(r.score[1]),1),s.createElementVNode("div",Jwe,s.toDisplayString(r.awayTeam.acronym),1),s.createElementVNode("div",Ywe,[s.createElementVNode("img",{src:r.awayTeam.logo,alt:""},null,8,Qwe)])])):s.createCommentVNode("",!0)])]),availableItem:s.withCtx(({item:r})=>[s.createElementVNode("div",Zwe,[s.createElementVNode("div",null,s.toDisplayString(r.roundAbbreviation),1),s.createElementVNode("div",$we,[s.createElementVNode("img",{src:r.homeTeam.logo,alt:""},null,8,eTe)]),s.createElementVNode("div",tTe,s.toDisplayString(r.homeTeam.acronym),1),s.createElementVNode("div",aTe,s.toDisplayString(r.score[0])+" - "+s.toDisplayString(r.score[1]),1),s.createElementVNode("div",iTe,s.toDisplayString(r.awayTeam.acronym),1),s.createElementVNode("div",nTe,[s.createElementVNode("img",{src:r.awayTeam.logo,alt:""},null,8,rTe)])])]),_:1},16,["items"])]))}},Sf=bt(sTe,[["__scopeId","data-v-eb1a6125"]]),oTe={class:"empty-plays"},lTe=s.createStaticVNode('<div class="empty-plays__icon" data-v-7ed695b3><svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-7ed695b3><g clip-path="url(#clip0_4365_291310)" data-v-7ed695b3><path d="M30 0C13.4176 0 0 13.4188 0 30C0 46.5824 13.4188 60 30 60C46.5824 60 60 46.5812 60 30C60 13.4176 46.5812 0 30 0ZM30 55.3125C16.0086 55.3125 4.6875 43.9904 4.6875 30C4.6875 16.0086 16.0096 4.6875 30 4.6875C43.9914 4.6875 55.3125 16.0096 55.3125 30C55.3125 43.9914 43.9904 55.3125 30 55.3125Z" fill="white" data-v-7ed695b3></path><path d="M30 15.1025C28.7055 15.1025 27.6562 16.1518 27.6562 17.4463V32.5392C27.6562 33.8337 28.7055 34.883 30 34.883C31.2945 34.883 32.3438 33.8337 32.3438 32.5392V17.4463C32.3438 16.1518 31.2945 15.1025 30 15.1025Z" fill="white" data-v-7ed695b3></path><path d="M30 44.0811C31.7475 44.0811 33.1641 42.6645 33.1641 40.917C33.1641 39.1695 31.7475 37.7529 30 37.7529C28.2525 37.7529 26.8359 39.1695 26.8359 40.917C26.8359 42.6645 28.2525 44.0811 30 44.0811Z" fill="white" data-v-7ed695b3></path></g><defs data-v-7ed695b3><clipPath id="clip0_4365_291310" data-v-7ed695b3><rect width="60" height="60" fill="white" data-v-7ed695b3></rect></clipPath></defs></svg></div><div class="empty-plays__text" data-v-7ed695b3><div data-v-7ed695b3><span data-v-7ed695b3>No existen resultados para esta búsqueda</span></div></div>',2),cTe={class:"empty-plays__actions"},dTe={__name:"EmptyPlays",emits:["cancel","modify-filters"],setup(e,{emit:t}){const a={borderRadius:"20px",padding:"6px 0",width:"130px",fontSize:"12px"},i=s.ref([{label:"Cancelar",props:{...a,borderColor:"white",borderWidth:"1px",backgroundColor:"#16313b",fontColor:"grey"},fn:()=>{t("cancel")}},{label:"Modificar filtros",props:{...a,backgroundColor:"#CBEE6B",fontColor:"#0E1725"},fn:()=>{t("modify-filters")}}]);function n(r){r()}return(r,o)=>(s.openBlock(),s.createElementBlock("div",oTe,[lTe,s.createElementVNode("div",cTe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.value,(l,c)=>(s.openBlock(),s.createBlock(Xl,s.mergeProps(l.props,{key:c,text:l.label,onClick:d=>n(l.fn)}),null,16,["text","onClick"]))),128))])]))}},wf=bt(dTe,[["__scopeId","data-v-7ed695b3"]]),Tf=e=>(s.pushScopeId("data-v-4433b6aa"),e=e(),s.popScopeId(),e),uTe={class:"container"},hTe={class:"container__row"},pTe={class:"container__row__wrapper"},mTe=Tf(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"1. Elige la liga",-1)),fTe={class:"container__row__wrapper__input"},gTe={class:"container__row two-items"},yTe={class:"container__row__wrapper"},_Te=Tf(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"2. Elige el torneo",-1)),bTe={key:0,class:"container__row__wrapper__input"},vTe={class:"container__row__wrapper"},STe=Tf(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"3. Elige la jornada",-1)),wTe={key:0,class:"container__row__wrapper__input"},TTe={class:"container__row"},CTe={class:"container__row__wrapper"},kTe=Tf(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"4. Elige el partido",-1)),ETe={key:0,class:"container__row__wrapper__input"},ITe={class:"container__action"},xTe={__name:"VideosGoals",props:{tournaments:{type:Array,required:!0},advancedFilterCategories:{type:Object,default:()=>({team:[]})},actionId:{type:Number,required:!0}},emits:["update:tournament","update:season","apply-filters","cancel"],setup(e,{emit:t}){const a=e,i={text:"Buscar",width:"100%",padding:"12px 0",borderRadius:"34px",backgroundColor:"#CBEE6B",borderColor:"#CBEE6B",fontColor:"#132634"},n=s.ref(null),r=s.ref(null),o=s.ref(null),l=s.ref(null),c=s.ref(null),d=s.ref(null),u=s.ref(null);function h(K){n.value=K,t("update:tournament",K)}function m(K){r.value=K,t("update:season",K)}function p(K){o.value=K}function f(K){l.value=K}const y=Kd();let b=null;const E=s.ref(null),D=s.ref([]),M=s.ref([]),N=s.ref([]),P=s.ref([]),L=s.ref(null),V=s.ref(!1),$=s.computed(()=>a.actionId===4&&u.value&&u.value.position_id===1);s.watch(()=>a.advancedFilterCategories,K=>{K.team&&(d.value=K.team[0])},{immediate:!0});function U(K){const ue=K.indexOf(".")>-1?K.substring(0,K.indexOf(".")):K,[ie,ne,fe]=ue.split(":").reverse();return(fe?Number(fe)*60*60:0)+Number(ne)*60+Number(ie)}function ae(K,ue){let ie="",ne=0;switch(K.matchLapse){case 1:ie=K.syncStartFirstTime;break;case 2:ie=K.syncStartSecondTime,ne=45;break;case 3:ie=K.syncStartFirstExtraTime,ne=90;break;case 4:ie=K.syncStartSecondExtraTime,ne=105;break;case 5:ie=K.syncStartPenals,ne=120;break}return(!ie||ie==="0")&&(ie="00:00"),U(ie)+(U(K[ue])-ne*60)}function oe(K){L.value=new Map,b=new Map,K.forEach(ie=>{const ne=ie.reduce((re,X,R)=>(re[y[R]]=X,re),{});ne.playRaw=ie,ne.stringMainCategoryName=d.value.name;let fe=null,me=null,ye=null,ee=0;if(ye=r.value.mapTeams,ee=r.value.maxGameId,fe=r.value.mapGames.get(ne.gameId),me=r.value.mapPlayers.get(ne.playerId),me&&fe&&ne.gameId<=ee){ne.game=fe,ne.game.awayTeam.id===ne.teamId?(ne.teamName=ne.game.awayTeam.name,ne.rivalName=ne.game.homeTeam.name):(ne.teamName=ne.game.homeTeam.name,ne.rivalName=ne.game.awayTeam.name),ne.playingAs=ne.teamId===ne.game.homeTeam.id?1:2,ne.player=me,ne.playerTeamLogo=ye.get(ne.player.teamId).logo,ne.rivalTeamLogo=ye.get(ne.player.teamId===ne.game.homeTeam.id?ne.game.awayTeam.id:ne.game.homeTeam.id).logo,ne.startSeconds=ae(ne,"startTime"),ne.endSeconds=ae(ne,"endTime");const re=new Date(ne.gameDate),[X,R]=ne.gameHour.split(":");re.setHours(X),re.setMinutes(R),ne.dateTimeMillis=re.valueOf(),b.has(ne.gameId)?b.get(ne.gameId).plays.push(ne):b.set(ne.gameId,{dateTimeMillis:re.valueOf(),plays:[ne]})}});const ue=Array.from(b.values());return ue.sort((ie,ne)=>ne.dateTimeMillis-ie.dateTimeMillis),ue.reduce((ie,ne)=>(ne.plays.sort((fe,me)=>+`${fe.matchLapse}${fe.startTime.replace(/:*\.*/g,"")}`-+`${me.matchLapse}${me.startTime.replace(/:*\.*/g,"")}`),ie.push(...ne.plays),ie),[])}function Y(K,ue,ie){const ne=oe(K).reduce((fe,me)=>{if(E.value){let ye=!0;if(E.value.requiresRivalTransform&&c.value&&(ye=me.rivalTeamId===c.value.team_id),ye&&E.value.arrayPlayingAs&&([3,4].includes(a.actionId)?ye=!(E.value.requiresRivalTransform&&E.value.arrayPlayingAs.length===1&&me.teamId!==c.value.team_id?E.value.arrayPlayingAs.includes(me.playingAs):!E.value.arrayPlayingAs.includes(me.playingAs)):ye=E.value.arrayPlayingAs.includes(me.playingAs)),ye&&E.value.arrayTimeSections&&(ye=E.value.arrayTimeSections.includes(me.section)),ye&&E.value.coordinatePoint&&E.value.arrayFieldSections){const ee=`${vl(me[`x${E.value.coordinatePoint}`],me[`y${E.value.coordinatePoint}`])+1}`,re=Qi[ee],X=E.value.requiresRivalTransform&&P.value.includes(`${me.categoryId}_r`)?Qi[`${yu[ee]}`]:re;ye=!!E.value.arrayFieldSections.find(R=>R.num===X&&R.isSelected)}ye&&fe.push(me)}else fe.push(me);return fe},[]);if(V.value=ne.length===0,!V.value){let fe=-1;E.value.gameId&&(fe=ne.findIndex(me=>E.value.gameId===me.gameId)),V.value=fe===-1,V.value||t("apply-filters",{filterData:{arrayFormattedPlays:ne,arrayCategoriesIds:[...D.value],arrayRivalCategoriesIds:[...M.value],arrayCategoriesIdsRaw:[...N.value],objectTournamentSelected:{...n.value},objectGameSelected:{...l.value},objectSeasonSelected:{...r.value},stringQueryCategoryIds:ue,stringQueryParams:ie,objectFilters:{numberActionId:a.actionId,numberMediaPlayerType:a.actionId===3?3:a.actionId===4?2:1,objectCategorySelected:{...d.value},objectAdvancedFilters:{booleanIsPlayerGoalKeeper:$,arraySelectedSubcategoryIds:P.value?[...P.value]:null,booleanRequiresRivalTransform:E.value.requiresRivalTransform,numberCoordinatePoint:E.value.coordinatePoint,numberTeamId:a.actionId===3?c.value.team_id:null,numberPlayerId:a.actionId===4?u.value.player_id:null,arrayPlayingAs:E.value.arrayPlayingAs?[...E.value.arrayPlayingAs]:null,arrayTimeSections:E.value.arrayTimeSections?[...E.value.arrayTimeSections]:null,arrayFieldSections:E.value.arrayFieldSections?[...E.value.arrayFieldSections]:null}},numberPlaylistIndex:fe},categoryName:"Goles"})}}async function de(K,ue){try{const ie=await Ei.get(`https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/videos/plays/seasons/${r.value.id}?${K}${ue}`);if(ie.data&&ie.data.plays){const ne=[...ie.data.plays];return ie.data.plays_rival?ne.concat(ie.data.plays_rival):ne}return[]}catch(ie){throw new Error(ie)}}async function we(){try{E.value=null,D.value=[12,55],M.value=[54,35],N.value=["12","55","54_r","35_r"];const K="categories=12&categories=55&rcategories=54&rcategories=35",ue=await de(K,"");E.value={gameId:l.value.game_id},Y(ue,K,"")}catch(K){throw new Error(K)}}function Se(){we()}function pe(){V.value=!1}function z(){V.value=!1,t("cancel")}return(K,ue)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.withDirectives(s.createVNode(wf,{onModifyFilters:pe,onCancel:z},null,512),[[s.vShow,V.value]]),s.withDirectives(s.createElementVNode("div",uTe,[s.createElementVNode("div",hTe,[s.createElementVNode("div",pTe,[mTe,s.createElementVNode("div",fTe,[s.createVNode(ei,{items:e.tournaments,"default-item-by-prop":{propName:"id",value:1},"item-text-key":"name",onInput:h},null,8,["items"])])])]),s.createElementVNode("div",gTe,[s.createElementVNode("div",yTe,[_Te,n.value&&n.value.seasons?(s.openBlock(),s.createElementBlock("div",bTe,[s.createVNode(ei,{items:n.value.seasons,itemTextKey:"name",onInput:m},null,8,["items"])])):s.createCommentVNode("",!0)]),s.createElementVNode("div",vTe,[STe,r.value&&r.value.arrayMatchDays?(s.openBlock(),s.createElementBlock("div",wTe,[s.createVNode(ei,{items:r.value.arrayMatchDays,itemTextKey:"stringMatchDayAbbreviation",onInput:p},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",TTe,[s.createElementVNode("div",CTe,[kTe,o.value&&o.value.arrayGames?(s.openBlock(),s.createElementBlock("div",ETe,[s.createVNode(Sf,{items:o.value.arrayGames,onInput:f},null,8,["items"])])):s.createCommentVNode("",!0)])])],512),[[s.vShow,!V.value]]),s.withDirectives(s.createElementVNode("div",ITe,[s.createVNode(Xl,s.mergeProps(i,{onClick:Se}),null,16)],512),[[s.vShow,!V.value]])],64))}},NTe=bt(xTe,[["__scopeId","data-v-4433b6aa"]]),ATe={class:"dropdown"},PTe={class:"item-team"},OTe={class:"team-logo"},BTe=["src"],DTe={class:"team-acronym"},MTe={class:"item-team"},LTe={class:"team-logo"},RTe=["src"],FTe={class:"team-acronym"},VTe={__name:"DropdownTeam",props:{items:{type:Array,default:()=>[]}},emits:["input"],setup(e,{emit:t}){function a(i){t("input",i)}return(i,n)=>(s.openBlock(),s.createElementBlock("div",ATe,[s.createVNode(s.unref(iv),s.mergeProps(s.unref(nv),{items:e.items,onInput:a}),{default:s.withCtx(({selectedItem:r})=>[s.createElementVNode("div",PTe,[s.createElementVNode("div",OTe,[s.createElementVNode("img",{src:r.logo,alt:""},null,8,BTe)]),s.createElementVNode("div",DTe,s.toDisplayString(r.acronym),1)])]),availableItem:s.withCtx(({item:r})=>[s.createElementVNode("div",MTe,[s.createElementVNode("div",LTe,[s.createElementVNode("img",{src:r.logo,alt:""},null,8,RTe)]),s.createElementVNode("div",FTe,s.toDisplayString(r.acronym),1)])]),_:1},16,["items"])]))}},eP=bt(VTe,[["__scopeId","data-v-38339a09"]]),UTe={__name:"SwitchCustom",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,i=s.ref(null);s.watch(()=>a.modelValue,()=>{n()},{immediate:!0});function n(){i.value&&(i.value.checked=a.modelValue)}function r(o){t("update:modelValue",o.target.checked)}return s.onMounted(()=>{n()}),(o,l)=>(s.openBlock(),s.createElementBlock("input",{ref_key:"switchCustom",ref:i,id:"toggle",class:"toggle",type:"checkbox",role:"switch",name:"toggle",onInput:r},null,544))}},rv=bt(UTe,[["__scopeId","data-v-caefc67f"]]),jTe={class:"advanced-filters"},zTe={class:"advanced-filters__buttons"},HTe=["onClick"],qTe={class:"advanced-filters__filters"},WTe={__name:"AdvancedFilters",props:{selectedCategory:{type:Object,default:()=>({})},conditions:{type:Object,default:()=>({playingAs:[{name:"Local",value:1,isSelected:!0},{name:"Visitante",value:2,isSelected:!0}],gameSections:[{text:"0-15",value:1,isSelected:!0},{text:"16-30",value:2,isSelected:!0},{text:"31-45",value:3,isSelected:!0},{text:"46-60",value:4,isSelected:!0},{text:"61-75",value:5,isSelected:!0},{text:"76-90",value:6,isSelected:!0}]})}},emits:["apply-filters"],setup(e,{emit:t}){const a=e,i=s.defineAsyncComponent(()=>Promise.resolve().then(()=>B4e)),n=s.defineAsyncComponent(()=>Promise.resolve().then(()=>Q4e)),r=s.defineAsyncComponent(()=>Promise.resolve().then(()=>Z3e)),o=[{name:"Sub categorías",component:s.shallowRef(i)},{name:"Cancha",component:s.shallowRef(r)},{name:"Condiciones",component:s.shallowRef(n)}],l=s.ref(o[0]),c=s.computed(()=>a.selectedCategory?a.selectedCategory.subcategoryGroups||[]:[]);function d(h){l.value=h}function u(h){t("apply-filters",h)}return(h,m)=>(s.openBlock(),s.createElementBlock("div",jTe,[s.createElementVNode("div",zTe,[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(o,p=>s.createElementVNode("div",{key:p.name,role:"button",class:s.normalizeClass(["advanced-filters__buttons__button",{active:l.value.name===p.name}]),onClick:f=>d(p)},s.toDisplayString(p.name),11,HTe)),64))]),s.createElementVNode("div",qTe,[(s.openBlock(),s.createBlock(s.KeepAlive,null,[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(l.value.component),{"subcategory-groups":c.value,conditions:e.conditions,onApplyFilters:u},null,40,["subcategory-groups","conditions"]))],1024))])]))}},sv=bt(WTe,[["__scopeId","data-v-aab43cfa"]]);function ov(){return{playingAs:[{name:"Local",value:1,isSelected:!0},{name:"Visitante",value:2,isSelected:!0}],gameSections:[{text:"0-15",value:1,isSelected:!0},{text:"16-30",value:2,isSelected:!0},{text:"31-45",value:3,isSelected:!0},{text:"46-60",value:4,isSelected:!0},{text:"61-75",value:5,isSelected:!0},{text:"76-90",value:6,isSelected:!0}]}}function lv(){return Array.from({length:16},(e,t)=>t+1)}const Vs=e=>(s.pushScopeId("data-v-f598ad6f"),e=e(),s.popScopeId(),e),GTe={class:"container"},KTe={class:"container__row"},XTe={class:"container__row__wrapper"},JTe=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"1. Elige la liga",-1)),YTe={class:"container__row__wrapper__input"},QTe={class:"container__row two-items"},ZTe={class:"container__row__wrapper"},$Te=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"2. Elige el torneo",-1)),eCe={key:0,class:"container__row__wrapper__input"},tCe={class:"container__row__wrapper"},aCe=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"3. En que equipo juega?",-1)),iCe={key:0,class:"container__row__wrapper__input"},nCe={class:"container__row"},rCe={class:"container__row__wrapper"},sCe=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"4. Nombre del jugador",-1)),oCe={key:0,class:"container__row__wrapper__input"},lCe={class:"container__row"},cCe={class:"container__row__wrapper"},dCe=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"5. Elige el partido",-1)),uCe={key:0,class:"container__row__wrapper__input"},hCe={class:"container__row type-and-advanced"},pCe={class:"container__row__wrapper"},mCe=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"6. Elige el tipo de video",-1)),fCe={class:"container__row__wrapper__input"},gCe={class:"container__row__wrapper center"},yCe=Vs(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"Filtrado avanzado",-1)),_Ce={class:"container__row__wrapper__input"},bCe={class:"container__row"},vCe={class:"container__action"},SCe={__name:"VideosPlayer",props:{tournaments:{type:Array,required:!0},advancedFilterCategories:{type:Object,default:()=>({player:[],goalkeeper:[]})},actionId:{type:Number,required:!0}},emits:["update:tournament","update:season","update:team","apply-filters","cancel"],setup(e,{emit:t}){const a=e,i={text:"Buscar",width:"100%",padding:"12px 0",borderRadius:"34px",backgroundColor:"#CBEE6B",borderColor:"#CBEE6B",fontColor:"#132634"},n=s.ref(null),r=s.ref(null);s.ref(null);const o=s.ref(null),l=s.ref(null),c=s.ref(null),d=s.ref(null),u=s.ref(!1),h=s.computed(()=>c.value?c.value.position_id===1?a.advancedFilterCategories.goalkeeper:a.advancedFilterCategories.player:[]);function m(ee){n.value=ee}function p(ee){r.value=ee,t("update:season",ee)}function f(ee){l.value=ee,t("update:team",ee)}function y(ee){c.value=ee}function b(ee){o.value=ee}function E(ee){d.value=ee}const D=s.ref(ov()),M=s.ref(lv()),N=Kd();let P=null;const L=s.ref(null),V=s.ref([]),$=s.ref([]),U=s.ref([]),ae=s.ref([]),oe=s.ref(null),Y=s.ref(!1),de=s.computed(()=>a.actionId===4&&c.value&&c.value.position_id===1);s.watch(()=>a.advancedFilterCategories,ee=>{ee.team&&(d.value=ee.team[0])},{immediate:!0});function we(ee){const re=ee.indexOf(".")>-1?ee.substring(0,ee.indexOf(".")):ee,[X,R,he]=re.split(":").reverse();return(he?Number(he)*60*60:0)+Number(R)*60+Number(X)}function Se(ee,re){let X="",R=0;switch(ee.matchLapse){case 1:X=ee.syncStartFirstTime;break;case 2:X=ee.syncStartSecondTime,R=45;break;case 3:X=ee.syncStartFirstExtraTime,R=90;break;case 4:X=ee.syncStartSecondExtraTime,R=105;break;case 5:X=ee.syncStartPenals,R=120;break}return(!X||X==="0")&&(X="00:00"),we(X)+(we(ee[re])-R*60)}function pe(ee){oe.value=new Map,P=new Map,ee.forEach(X=>{const R=X.reduce((Ge,J,De)=>(Ge[N[De]]=J,Ge),{});R.playRaw=X,R.stringMainCategoryName=d.value.name;let he=null,ve=null,Le=null,qe=0;if(Le=r.value.mapTeams,qe=r.value.maxGameId,he=r.value.mapGames.get(R.gameId),ve=r.value.mapPlayers.get(R.playerId),ve&&he&&R.gameId<=qe){R.game=he,R.game.awayTeam.id===R.teamId?(R.teamName=R.game.awayTeam.name,R.rivalName=R.game.homeTeam.name):(R.teamName=R.game.homeTeam.name,R.rivalName=R.game.awayTeam.name),R.playingAs=R.teamId===R.game.homeTeam.id?1:2,R.player=ve,R.playerTeamLogo=Le.get(R.player.teamId).logo,R.rivalTeamLogo=Le.get(R.player.teamId===R.game.homeTeam.id?R.game.awayTeam.id:R.game.homeTeam.id).logo,R.startSeconds=Se(R,"startTime"),R.endSeconds=Se(R,"endTime");const Ge=new Date(R.gameDate),[J,De]=R.gameHour.split(":");Ge.setHours(J),Ge.setMinutes(De),R.dateTimeMillis=Ge.valueOf(),P.has(R.gameId)?P.get(R.gameId).plays.push(R):P.set(R.gameId,{dateTimeMillis:Ge.valueOf(),plays:[R]})}});const re=Array.from(P.values());return re.sort((X,R)=>R.dateTimeMillis-X.dateTimeMillis),re.reduce((X,R)=>(R.plays.sort((he,ve)=>+`${he.matchLapse}${he.startTime.replace(/:*\.*/g,"")}`-+`${ve.matchLapse}${ve.startTime.replace(/:*\.*/g,"")}`),X.push(...R.plays),X),[])}function z(ee,re,X){const R=pe(ee).reduce((he,ve)=>{if(L.value){let Le=!0;if(L.value.requiresRivalTransform&&l.value&&(Le=ve.rivalTeamId===l.value.team_id),Le&&L.value.arrayPlayingAs&&([3,4].includes(a.actionId)?Le=!(L.value.requiresRivalTransform&&L.value.arrayPlayingAs.length===1&&ve.teamId!==l.value.team_id?L.value.arrayPlayingAs.includes(ve.playingAs):!L.value.arrayPlayingAs.includes(ve.playingAs)):Le=L.value.arrayPlayingAs.includes(ve.playingAs)),Le&&L.value.arrayTimeSections&&(Le=L.value.arrayTimeSections.includes(ve.section)),Le&&L.value.coordinatePoint&&L.value.arrayFieldSections){const qe=`${vl(ve[`x${L.value.coordinatePoint}`],ve[`y${L.value.coordinatePoint}`])+1}`,Ge=Qi[qe],J=L.value.requiresRivalTransform&&ae.value.includes(`${ve.categoryId}_r`)?Qi[`${yu[qe]}`]:Ge;Le=L.value.arrayFieldSections.includes(J)}Le&&he.push(ve)}else he.push(ve);return he},[]);if(Y.value=R.length===0,!Y.value){let he=-1;L.value.gameId&&(he=R.findIndex(ve=>L.value.gameId===ve.gameId)),Y.value=he===-1,Y.value||t("apply-filters",{filterData:{arrayFormattedPlays:R,arrayCategoriesIds:[...V.value],arrayRivalCategoriesIds:[...$.value],arrayCategoriesIdsRaw:[...U.value],objectTournamentSelected:{...n.value},objectGameSelected:{...o.value},objectSeasonSelected:{...r.value},stringQueryCategoryIds:re,stringQueryParams:X,objectFilters:{numberActionId:a.actionId,numberMediaPlayerType:a.actionId===3?3:a.actionId===4?2:1,objectCategorySelected:{...d.value},objectAdvancedFilters:{booleanIsPlayerGoalKeeper:de,arraySelectedSubcategoryIds:ae.value?[...ae.value]:null,booleanRequiresRivalTransform:L.value.requiresRivalTransform,numberCoordinatePoint:L.value.coordinatePoint,numberTeamId:a.actionId===3?l.value.team_id:null,numberPlayerId:a.actionId===4?c.value.player_id:null,arrayPlayingAs:L.value.arrayPlayingAs?[...L.value.arrayPlayingAs]:null,arrayTimeSections:L.value.arrayTimeSections?[...L.value.arrayTimeSections]:null,arrayFieldSections:L.value.arrayFieldSections?[...L.value.arrayFieldSections]:null}},numberPlaylistIndex:he},categoryName:d.value.name})}}async function K(ee,re){try{const X=await Ei.get(`https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/videos/plays/seasons/${r.value.id}?${ee}${re}`);if(X.data&&X.data.plays){const R=[...X.data.plays];return X.data.plays_rival?R.concat(X.data.plays_rival):R}return[]}catch(X){throw new Error(X)}}function ue(ee){const re=ee||d.value;if(!re)return;if(re.booleanIsBestPlays)return re.arrayCategoriesIds;const X={total:[],toRemove:[]};if(re.subcategoryGroups&&re.subcategoryGroups.length?re.subcategoryGroups[0].forEach(R=>{ie(R,null,X)}):(re.ids&&X.total.push(...re.ids),re.rival_ids&&re.rival_ids.forEach(R=>{X.total.push(`${R}_r`)})),X.total=X.total.reduce((R,he)=>(X.toRemove.includes(he)||R.push(he),R),[]),!ee){const R=re.name.toLowerCase().includes("recibid");L.value.isRivalSubject=R,L.value.avoidCategorySingleName=R,L.value.coordinatePoint=re.coordinatePoint,L.value.requiresRivalTransform=re.requiresRivalTransform}return X.total}function ie(ee,re=[],X={total:[],toRemove:[]}){ee.isSelected?ee.childCategories?ee.childCategories.forEach(R=>{const he=re?Object.entries(ee.idsByFatherCategory).reduce((ve,[Le,qe])=>(re.includes(Number(Le))&&qe.forEach(Ge=>{typeof Ge=="string"&&Ge.endsWith("_r")?ve.push(Number(Ge.split("_")[0])):ve.push(Ge)}),ve),[]):[ee.id];ie(R,he,X)}):re?Object.entries(ee.idsByFatherCategory).forEach(([R,he])=>{re.includes(Number(R))&&he.forEach(ve=>{X.total.push(ve)})}):ee.level===1?Object.entries(ee.idsByFatherCategory).forEach(([R,he])=>{he.forEach(ve=>{X.total.push(ve)})}):X.total.push(ee.id):ee.childCategories||ee.ids.forEach(R=>{X.toRemove.push(R)})}async function ne(){try{L.value=null,L.value={arrayPlayingAs:D.value.playingAs.reduce((R,he)=>(he.isSelected&&R.push(he.value),R),[]),arrayTimeSections:D.value.gameSections.reduce((R,he)=>(he.isSelected&&R.push(he.value),R),[]),arrayFieldSections:M},L.value.gameId=o.value.game_id,L.value.requiresRivalTransform=d.value.requiresRivalTransform,ae.value=d.value.booleanIsMinutesPlayed?d.value.arrayCategoriesIds:ue(),V.value=[],$.value=[],U.value=[];const ee=ae.value.reduce((R,he,ve)=>{U.value.push(he);let Le=he;const qe=typeof he=="string"&&he.includes("_");return qe?(Le=Number(he.split("_")[0]),$.value.push(Le)):V.value.push(Le),`${R}${ve>0?"&":""}${qe?"r":""}categories=${Le}`},""),re=a.actionId===3?`&team=${l.value.team_id}`:a.actionId===4?`&player=${c.value.player_id}`:"",X=await K(ee,re);z(X)}catch(ee){throw new Error(ee)}}function fe(){ne()}function me(){Y.value=!1}function ye(){Y.value=!1,t("cancel")}return(ee,re)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.withDirectives(s.createVNode(wf,{onModifyFilters:me,onCancel:ye},null,512),[[s.vShow,Y.value]]),s.withDirectives(s.createElementVNode("div",GTe,[s.createElementVNode("div",KTe,[s.createElementVNode("div",XTe,[JTe,s.createElementVNode("div",YTe,[s.createVNode(ei,{items:e.tournaments,"default-item-by-prop":{propName:"id",value:1},itemTextKey:"name",onInput:m},null,8,["items"])])])]),s.createElementVNode("div",QTe,[s.createElementVNode("div",ZTe,[$Te,n.value&&n.value.seasons?(s.openBlock(),s.createElementBlock("div",eCe,[s.createVNode(ei,{items:n.value.seasons,itemTextKey:"name",onInput:p},null,8,["items"])])):s.createCommentVNode("",!0)]),s.createElementVNode("div",tCe,[aCe,r.value&&r.value.arrayTeams?(s.openBlock(),s.createElementBlock("div",iCe,[s.createVNode(eP,{items:r.value.arrayTeams,itemTextKey:"stringMatchDayAbbreviation",onInput:f},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",nCe,[s.createElementVNode("div",rCe,[sCe,l.value&&l.value.arrayPlayers?(s.openBlock(),s.createElementBlock("div",oCe,[s.createVNode(ei,{items:l.value.arrayPlayers,itemTextKey:"player_name",onInput:y},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",lCe,[s.createElementVNode("div",cCe,[dCe,r.value&&r.value.mapGamesByTeam&&l.value?(s.openBlock(),s.createElementBlock("div",uCe,[s.createVNode(Sf,{items:r.value.mapGamesByTeam.get(l.value.team_id),onInput:b},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",hCe,[s.createElementVNode("div",pCe,[mCe,s.createElementVNode("div",fCe,[s.createVNode(ei,{items:h.value,itemTextKey:"name","is-list-same-width":!1,onInput:E},null,8,["items"])])]),s.createElementVNode("div",gCe,[yCe,s.createElementVNode("div",_Ce,[s.createVNode(rv,{modelValue:u.value,"onUpdate:modelValue":re[0]||(re[0]=X=>u.value=X)},null,8,["modelValue"])])])]),s.createElementVNode("div",bCe,[s.createVNode(s.Transition,null,{default:s.withCtx(()=>[u.value?(s.openBlock(),s.createBlock(sv,{key:0,"selected-category":d.value,conditions:D.value,"field-areas":M.value},null,8,["selected-category","conditions","field-areas"])):s.createCommentVNode("",!0)]),_:1})])],512),[[s.vShow,!Y.value]]),s.withDirectives(s.createElementVNode("div",vCe,[s.createVNode(Xl,s.mergeProps(i,{onClick:fe}),null,16)],512),[[s.vShow,!Y.value]])],64))}},wCe=bt(SCe,[["__scopeId","data-v-f598ad6f"]]),Jl=e=>(s.pushScopeId("data-v-0e429f76"),e=e(),s.popScopeId(),e),TCe={class:"container"},CCe={class:"container__row"},kCe={class:"container__row__wrapper"},ECe=Jl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"1. Elige la liga",-1)),ICe={class:"container__row__wrapper__input"},xCe={class:"container__row two-items"},NCe={class:"container__row__wrapper"},ACe=Jl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"2. Elige el torneo",-1)),PCe={key:0,class:"container__row__wrapper__input"},OCe={class:"container__row__wrapper"},BCe=Jl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"3. Elige el equipo",-1)),DCe={key:0,class:"container__row__wrapper__input"},MCe={class:"container__row"},LCe={class:"container__row__wrapper"},RCe=Jl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"4. Elige el partido",-1)),FCe={key:0,class:"container__row__wrapper__input"},VCe={class:"container__row type-and-advanced"},UCe={class:"container__row__wrapper"},jCe=Jl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"5. Elige el tipo de video",-1)),zCe={class:"container__row__wrapper__input"},HCe={class:"container__row__wrapper center"},qCe=Jl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"Filtrado avanzado",-1)),WCe={class:"container__row__wrapper__input"},GCe={class:"container__row"},KCe={class:"container__action"},XCe={__name:"VideosTeam",props:{tournaments:{type:Array,required:!0},advancedFilterCategories:{type:Object,default:()=>({team:[]})},actionId:{type:Number,required:!0}},emits:["update:tournament","update:season","update:team","click-apply-filters"],setup(e,{emit:t}){const a=e,i={text:"Buscar",width:"100%",padding:"12px 0",borderRadius:"34px",backgroundColor:"#CBEE6B",borderColor:"#CBEE6B",fontColor:"#132634"},n=s.ref(null),r=s.ref(null);s.ref(null);const o=s.ref(null),l=s.ref(null),c=s.ref(null),d=s.ref(null),u=s.ref(!1),h=s.computed(()=>a.advancedFilterCategories.team);function m(ye){n.value=ye,t("update:tournament",ye)}function p(ye){r.value=ye,t("update:season",ye)}function f(ye){l.value=ye,t("update:team",ye)}function y(ye){o.value=ye}function b(ye){c.value=ye}const E=s.ref(ov()),D=s.ref(lv()),M=Kd();let N=null;const P=s.ref(null),L=s.ref([]),V=s.ref([]),$=s.ref([]),U=s.ref([]),ae=s.ref(null),oe=s.ref(!1),Y=s.computed(()=>a.actionId===4&&d.value&&d.value.position_id===1);s.watch(()=>a.advancedFilterCategories,ye=>{ye.team&&(c.value=ye.team[0])},{immediate:!0});function de(ye){const ee=ye.indexOf(".")>-1?ye.substring(0,ye.indexOf(".")):ye,[re,X,R]=ee.split(":").reverse();return(R?Number(R)*60*60:0)+Number(X)*60+Number(re)}function we(ye,ee){let re="",X=0;switch(ye.matchLapse){case 1:re=ye.syncStartFirstTime;break;case 2:re=ye.syncStartSecondTime,X=45;break;case 3:re=ye.syncStartFirstExtraTime,X=90;break;case 4:re=ye.syncStartSecondExtraTime,X=105;break;case 5:re=ye.syncStartPenals,X=120;break}return(!re||re==="0")&&(re="00:00"),de(re)+(de(ye[ee])-X*60)}function Se(ye){ae.value=new Map,N=new Map,ye.forEach(re=>{const X=re.reduce((qe,Ge,J)=>(qe[M[J]]=Ge,qe),{});X.playRaw=re,X.stringMainCategoryName=c.value.name;let R=null,he=null,ve=null,Le=0;if(ve=r.value.mapTeams,Le=r.value.maxGameId,R=r.value.mapGames.get(X.gameId),he=r.value.mapPlayers.get(X.playerId),he&&R&&X.gameId<=Le){X.game=R,X.game.awayTeam.id===X.teamId?(X.teamName=X.game.awayTeam.name,X.rivalName=X.game.homeTeam.name):(X.teamName=X.game.homeTeam.name,X.rivalName=X.game.awayTeam.name),X.playingAs=X.teamId===X.game.homeTeam.id?1:2,X.player=he,X.playerTeamLogo=ve.get(X.player.teamId).logo,X.rivalTeamLogo=ve.get(X.player.teamId===X.game.homeTeam.id?X.game.awayTeam.id:X.game.homeTeam.id).logo,X.startSeconds=we(X,"startTime"),X.endSeconds=we(X,"endTime");const qe=new Date(X.gameDate),[Ge,J]=X.gameHour.split(":");qe.setHours(Ge),qe.setMinutes(J),X.dateTimeMillis=qe.valueOf(),N.has(X.gameId)?N.get(X.gameId).plays.push(X):N.set(X.gameId,{dateTimeMillis:qe.valueOf(),plays:[X]})}});const ee=Array.from(N.values());return ee.sort((re,X)=>X.dateTimeMillis-re.dateTimeMillis),ee.reduce((re,X)=>(X.plays.sort((R,he)=>+`${R.matchLapse}${R.startTime.replace(/:*\.*/g,"")}`-+`${he.matchLapse}${he.startTime.replace(/:*\.*/g,"")}`),re.push(...X.plays),re),[])}function pe(ye,ee,re){const X=Se(ye).reduce((R,he)=>{if(P.value){let ve=!0;if(P.value.requiresRivalTransform&&l.value&&(ve=he.rivalTeamId===l.value.team_id),ve&&P.value.arrayPlayingAs&&([3,4].includes(a.actionId)?ve=!(P.value.requiresRivalTransform&&P.value.arrayPlayingAs.length===1&&he.teamId!==l.value.team_id?P.value.arrayPlayingAs.includes(he.playingAs):!P.value.arrayPlayingAs.includes(he.playingAs)):ve=P.value.arrayPlayingAs.includes(he.playingAs)),ve&&P.value.arrayTimeSections&&(ve=P.value.arrayTimeSections.includes(he.section)),ve&&P.value.coordinatePoint&&P.value.arrayFieldSections){const Le=`${vl(he[`x${P.value.coordinatePoint}`],he[`y${P.value.coordinatePoint}`])+1}`,qe=Qi[Le],Ge=P.value.requiresRivalTransform&&U.value.includes(`${he.categoryId}_r`)?Qi[`${yu[Le]}`]:qe;ve=P.value.arrayFieldSections.includes(Ge)}ve&&R.push(he)}else R.push(he);return R},[]);if(oe.value=X.length===0,!oe.value){let R=-1;P.value.gameId&&(R=X.findIndex(he=>P.value.gameId===he.gameId)),oe.value=R===-1,oe.value||t("apply-filters",{filterData:{arrayFormattedPlays:X,arrayCategoriesIds:[...L.value],arrayRivalCategoriesIds:[...V.value],arrayCategoriesIdsRaw:[...$.value],objectTournamentSelected:{...n.value},objectGameSelected:{...o.value},objectSeasonSelected:{...r.value},stringQueryCategoryIds:ee,stringQueryParams:re,objectFilters:{numberActionId:a.actionId,numberMediaPlayerType:a.actionId===3?3:a.actionId===4?2:1,objectCategorySelected:{...c.value},objectAdvancedFilters:{booleanIsPlayerGoalKeeper:Y,arraySelectedSubcategoryIds:U.value?[...U.value]:null,booleanRequiresRivalTransform:P.value.requiresRivalTransform,numberCoordinatePoint:P.value.coordinatePoint,numberTeamId:a.actionId===3?l.value.team_id:null,numberPlayerId:a.actionId===4?d.value.player_id:null,arrayPlayingAs:P.value.arrayPlayingAs?[...P.value.arrayPlayingAs]:null,arrayTimeSections:P.value.arrayTimeSections?[...P.value.arrayTimeSections]:null,arrayFieldSections:P.value.arrayFieldSections?[...P.value.arrayFieldSections]:null}},numberPlaylistIndex:R},categoryName:c.value.name})}}async function z(ye,ee){try{const re=await Ei.get(`https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/videos/plays/seasons/${r.value.id}?${ye}${ee}`);if(re.data&&re.data.plays){const X=[...re.data.plays];return re.data.plays_rival?X.concat(re.data.plays_rival):X}return[]}catch(re){throw new Error(re)}}function K(ye){const ee=ye||c.value;if(!ee)return;if(ee.booleanIsBestPlays)return ee.arrayCategoriesIds;const re={total:[],toRemove:[]};if(ee.subcategoryGroups&&ee.subcategoryGroups.length?ee.subcategoryGroups[0].forEach(X=>{ue(X,null,re)}):(ee.ids&&re.total.push(...ee.ids),ee.rival_ids&&ee.rival_ids.forEach(X=>{re.total.push(`${X}_r`)})),re.total=re.total.reduce((X,R)=>(re.toRemove.includes(R)||X.push(R),X),[]),!ye){const X=ee.name.toLowerCase().includes("recibid");P.value.isRivalSubject=X,P.value.avoidCategorySingleName=X,P.value.coordinatePoint=ee.coordinatePoint,P.value.requiresRivalTransform=ee.requiresRivalTransform}return re.total}function ue(ye,ee=[],re={total:[],toRemove:[]}){ye.isSelected?ye.childCategories?ye.childCategories.forEach(X=>{const R=ee?Object.entries(ye.idsByFatherCategory).reduce((he,[ve,Le])=>(ee.includes(Number(ve))&&Le.forEach(qe=>{typeof qe=="string"&&qe.endsWith("_r")?he.push(Number(qe.split("_")[0])):he.push(qe)}),he),[]):[ye.id];ue(X,R,re)}):ee?Object.entries(ye.idsByFatherCategory).forEach(([X,R])=>{ee.includes(Number(X))&&R.forEach(he=>{re.total.push(he)})}):ye.level===1?Object.entries(ye.idsByFatherCategory).forEach(([X,R])=>{R.forEach(he=>{re.total.push(he)})}):re.total.push(ye.id):ye.childCategories||ye.ids.forEach(X=>{re.toRemove.push(X)})}async function ie(){try{P.value=null,P.value={arrayPlayingAs:E.value.playingAs.reduce((X,R)=>(R.isSelected&&X.push(R.value),X),[]),arrayTimeSections:E.value.gameSections.reduce((X,R)=>(R.isSelected&&X.push(R.value),X),[]),arrayFieldSections:D},P.value.gameId=o.value.game_id,P.value.requiresRivalTransform=c.value.requiresRivalTransform,U.value=c.value.booleanIsMinutesPlayed?c.value.arrayCategoriesIds:K(),L.value=[],V.value=[],$.value=[];const ye=U.value.reduce((X,R,he)=>{$.value.push(R);let ve=R;const Le=typeof R=="string"&&R.includes("_");return Le?(ve=Number(R.split("_")[0]),V.value.push(ve)):L.value.push(ve),`${X}${he>0?"&":""}${Le?"r":""}categories=${ve}`},""),ee=a.actionId===3?`&team=${l.value.team_id}`:a.actionId===4?`&player=${d.value.player_id}`:"",re=await z(ye,ee);pe(re)}catch(ye){throw new Error(ye)}}function ne(){ie()}function fe(){oe.value=!1}function me(){oe.value=!1,t("cancel")}return(ye,ee)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.withDirectives(s.createVNode(wf,{onModifyFilters:fe,onCancel:me},null,512),[[s.vShow,oe.value]]),s.withDirectives(s.createElementVNode("div",TCe,[s.createElementVNode("div",CCe,[s.createElementVNode("div",kCe,[ECe,s.createElementVNode("div",ICe,[s.createVNode(ei,{items:e.tournaments,"default-item-by-prop":{propName:"id",value:1},itemTextKey:"name",onInput:m},null,8,["items"])])])]),s.createElementVNode("div",xCe,[s.createElementVNode("div",NCe,[ACe,n.value&&n.value.seasons?(s.openBlock(),s.createElementBlock("div",PCe,[s.createVNode(ei,{items:n.value.seasons,itemTextKey:"name",onInput:p},null,8,["items"])])):s.createCommentVNode("",!0)]),s.createElementVNode("div",OCe,[BCe,r.value&&r.value.arrayTeams?(s.openBlock(),s.createElementBlock("div",DCe,[s.createVNode(eP,{items:r.value.arrayTeams,itemTextKey:"stringMatchDayAbbreviation",onInput:f},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",MCe,[s.createElementVNode("div",LCe,[RCe,r.value&&r.value.mapGamesByTeam&&l.value?(s.openBlock(),s.createElementBlock("div",FCe,[s.createVNode(Sf,{items:r.value.mapGamesByTeam.get(l.value.team_id),onInput:y},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",VCe,[s.createElementVNode("div",UCe,[jCe,s.createElementVNode("div",zCe,[s.createVNode(ei,{items:h.value,itemTextKey:"name","is-list-same-width":!1,onInput:b},null,8,["items"])])]),s.createElementVNode("div",HCe,[qCe,s.createElementVNode("div",WCe,[s.createVNode(rv,{modelValue:u.value,"onUpdate:modelValue":ee[0]||(ee[0]=re=>u.value=re)},null,8,["modelValue"])])])]),s.createElementVNode("div",GCe,[s.createVNode(s.Transition,null,{default:s.withCtx(()=>[u.value?(s.openBlock(),s.createBlock(sv,{key:0,"selected-category":c.value,conditions:E.value,"field-areas":D.value},null,8,["selected-category","conditions","field-areas"])):s.createCommentVNode("",!0)]),_:1})])],512),[[s.vShow,!oe.value]]),s.withDirectives(s.createElementVNode("div",KCe,[s.createVNode(Xl,s.mergeProps(i,{onClick:ne}),null,16)],512),[[s.vShow,!oe.value]])],64))}},JCe=bt(XCe,[["__scopeId","data-v-0e429f76"]]),Yl=e=>(s.pushScopeId("data-v-1967b860"),e=e(),s.popScopeId(),e),YCe={class:"container"},QCe={class:"container__row"},ZCe={class:"container__row__wrapper"},$Ce=Yl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"1. Elige la liga",-1)),eke={class:"container__row__wrapper__input"},tke={class:"container__row two-items"},ake={class:"container__row__wrapper"},ike=Yl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"2. Elige el torneo",-1)),nke={key:0,class:"container__row__wrapper__input"},rke={class:"container__row__wrapper"},ske=Yl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"3. Elige la jornada",-1)),oke={key:0,class:"container__row__wrapper__input"},lke={class:"container__row"},cke={class:"container__row__wrapper"},dke=Yl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"4. Elige el partido",-1)),uke={key:0,class:"container__row__wrapper__input"},hke={class:"container__row type-and-advanced"},pke={class:"container__row__wrapper"},mke=Yl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"6. Elige el tipo de video",-1)),fke={class:"container__row__wrapper__input"},gke={class:"container__row__wrapper center"},yke=Yl(()=>s.createElementVNode("div",{class:"container__row__wrapper__label"},"Filtrado avanzado",-1)),_ke={class:"container__row__wrapper__input",style:{width:"fit-content"}},bke={class:"container__row"},vke={class:"container__action"},Ske={__name:"VideosGame",props:{tournaments:{type:Array,required:!0},advancedFilterCategories:{type:Object,default:()=>({games:[]})},actionId:{type:Number,required:!0}},emits:["update:tournament","update:season","click-apply-filters"],setup(e,{emit:t}){const a=e,i={text:"Buscar",width:"100%",padding:"12px 0",borderRadius:"34px",backgroundColor:"#CBEE6B",borderColor:"#CBEE6B",fontColor:"#132634"},n=s.ref(null),r=s.ref(null),o=s.ref(null),l=s.ref(null),c=s.ref(null),d=s.ref(null),u=s.ref(null),h=s.ref(!1),m=s.computed(()=>a.advancedFilterCategories.games);function p(ee){n.value=ee,t("update:tournament",ee)}function f(ee){r.value=ee,t("update:season",ee)}function y(ee){o.value=ee}function b(ee){l.value=ee}function E(ee){c.value=ee}const D=s.ref(ov()),M=s.ref(lv()),N=Kd();let P=null;const L=s.ref(null),V=s.ref([]),$=s.ref([]),U=s.ref([]),ae=s.ref([]),oe=s.ref(null),Y=s.ref(!1),de=s.computed(()=>a.actionId===4&&d.value&&d.value.position_id===1);s.watch(()=>a.advancedFilterCategories,ee=>{ee.team&&(c.value=ee.team[0])},{immediate:!0});function we(ee){const re=ee.indexOf(".")>-1?ee.substring(0,ee.indexOf(".")):ee,[X,R,he]=re.split(":").reverse();return(he?Number(he)*60*60:0)+Number(R)*60+Number(X)}function Se(ee,re){let X="",R=0;switch(ee.matchLapse){case 1:X=ee.syncStartFirstTime;break;case 2:X=ee.syncStartSecondTime,R=45;break;case 3:X=ee.syncStartFirstExtraTime,R=90;break;case 4:X=ee.syncStartSecondExtraTime,R=105;break;case 5:X=ee.syncStartPenals,R=120;break}return(!X||X==="0")&&(X="00:00"),we(X)+(we(ee[re])-R*60)}function pe(ee){oe.value=new Map,P=new Map,ee.forEach(X=>{const R=X.reduce((Ge,J,De)=>(Ge[N[De]]=J,Ge),{});R.playRaw=X,R.stringMainCategoryName=c.value.name;let he=null,ve=null,Le=null,qe=0;if(Le=r.value.mapTeams,qe=r.value.maxGameId,he=r.value.mapGames.get(R.gameId),ve=r.value.mapPlayers.get(R.playerId),ve&&he&&R.gameId<=qe){R.game=he,R.game.awayTeam.id===R.teamId?(R.teamName=R.game.awayTeam.name,R.rivalName=R.game.homeTeam.name):(R.teamName=R.game.homeTeam.name,R.rivalName=R.game.awayTeam.name),R.playingAs=R.teamId===R.game.homeTeam.id?1:2,R.player=ve,R.playerTeamLogo=Le.get(R.player.teamId).logo,R.rivalTeamLogo=Le.get(R.player.teamId===R.game.homeTeam.id?R.game.awayTeam.id:R.game.homeTeam.id).logo,R.startSeconds=Se(R,"startTime"),R.endSeconds=Se(R,"endTime");const Ge=new Date(R.gameDate),[J,De]=R.gameHour.split(":");Ge.setHours(J),Ge.setMinutes(De),R.dateTimeMillis=Ge.valueOf(),P.has(R.gameId)?P.get(R.gameId).plays.push(R):P.set(R.gameId,{dateTimeMillis:Ge.valueOf(),plays:[R]})}});const re=Array.from(P.values());return re.sort((X,R)=>R.dateTimeMillis-X.dateTimeMillis),re.reduce((X,R)=>(R.plays.sort((he,ve)=>+`${he.matchLapse}${he.startTime.replace(/:*\.*/g,"")}`-+`${ve.matchLapse}${ve.startTime.replace(/:*\.*/g,"")}`),X.push(...R.plays),X),[])}function z(ee,re,X){const R=pe(ee).reduce((he,ve)=>{if(L.value){let Le=!0;if(L.value.requiresRivalTransform&&u.value&&(Le=ve.rivalTeamId===u.value.team_id),Le&&L.value.arrayPlayingAs&&([3,4].includes(a.actionId)?Le=!(L.value.requiresRivalTransform&&L.value.arrayPlayingAs.length===1&&ve.teamId!==u.value.team_id?L.value.arrayPlayingAs.includes(ve.playingAs):!L.value.arrayPlayingAs.includes(ve.playingAs)):Le=L.value.arrayPlayingAs.includes(ve.playingAs)),Le&&L.value.arrayTimeSections&&(Le=L.value.arrayTimeSections.includes(ve.section)),Le&&L.value.coordinatePoint&&L.value.arrayFieldSections){const qe=`${vl(ve[`x${L.value.coordinatePoint}`],ve[`y${L.value.coordinatePoint}`])+1}`,Ge=Qi[qe],J=L.value.requiresRivalTransform&&ae.value.includes(`${ve.categoryId}_r`)?Qi[`${yu[qe]}`]:Ge;Le=L.value.arrayFieldSections.includes(J)}Le&&he.push(ve)}else he.push(ve);return he},[]);if(Y.value=R.length===0,!Y.value){let he=-1;L.value.gameId&&(he=R.findIndex(ve=>L.value.gameId===ve.gameId)),Y.value=he===-1,Y.value||t("apply-filters",{filterData:{arrayFormattedPlays:R,arrayCategoriesIds:[...V.value],arrayRivalCategoriesIds:[...$.value],arrayCategoriesIdsRaw:[...U.value],objectTournamentSelected:{...n.value},objectGameSelected:{...l.value},objectSeasonSelected:{...r.value},stringQueryCategoryIds:re,stringQueryParams:X,objectFilters:{numberActionId:a.actionId,numberMediaPlayerType:a.actionId===3?3:a.actionId===4?2:1,objectCategorySelected:{...c.value},objectAdvancedFilters:{booleanIsPlayerGoalKeeper:de,arraySelectedSubcategoryIds:ae.value?[...ae.value]:null,booleanRequiresRivalTransform:L.value.requiresRivalTransform,numberCoordinatePoint:L.value.coordinatePoint,numberTeamId:a.actionId===3?u.value.team_id:null,numberPlayerId:a.actionId===4?d.value.player_id:null,arrayPlayingAs:L.value.arrayPlayingAs?[...L.value.arrayPlayingAs]:null,arrayTimeSections:L.value.arrayTimeSections?[...L.value.arrayTimeSections]:null,arrayFieldSections:L.value.arrayFieldSections?[...L.value.arrayFieldSections]:null}},numberPlaylistIndex:he},categoryName:c.value.name})}}async function K(ee,re){try{const X=await Ei.get(`https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/videos/plays/seasons/${r.value.id}?${ee}${re}`);if(X.data&&X.data.plays){const R=[...X.data.plays];return X.data.plays_rival?R.concat(X.data.plays_rival):R}return[]}catch(X){throw new Error(X)}}function ue(ee){const re=ee||c.value;if(!re)return;if(re.booleanIsBestPlays)return re.arrayCategoriesIds;const X={total:[],toRemove:[]};if(re.subcategoryGroups&&re.subcategoryGroups.length?re.subcategoryGroups[0].forEach(R=>{ie(R,null,X)}):(re.ids&&X.total.push(...re.ids),re.rival_ids&&re.rival_ids.forEach(R=>{X.total.push(`${R}_r`)})),X.total=X.total.reduce((R,he)=>(X.toRemove.includes(he)||R.push(he),R),[]),!ee){const R=re.name.toLowerCase().includes("recibid");L.value.isRivalSubject=R,L.value.avoidCategorySingleName=R,L.value.coordinatePoint=re.coordinatePoint,L.value.requiresRivalTransform=re.requiresRivalTransform}return X.total}function ie(ee,re=[],X={total:[],toRemove:[]}){ee.isSelected?ee.childCategories?ee.childCategories.forEach(R=>{const he=re?Object.entries(ee.idsByFatherCategory).reduce((ve,[Le,qe])=>(re.includes(Number(Le))&&qe.forEach(Ge=>{typeof Ge=="string"&&Ge.endsWith("_r")?ve.push(Number(Ge.split("_")[0])):ve.push(Ge)}),ve),[]):[ee.id];ie(R,he,X)}):re?Object.entries(ee.idsByFatherCategory).forEach(([R,he])=>{re.includes(Number(R))&&he.forEach(ve=>{X.total.push(ve)})}):ee.level===1?Object.entries(ee.idsByFatherCategory).forEach(([R,he])=>{he.forEach(ve=>{X.total.push(ve)})}):X.total.push(ee.id):ee.childCategories||ee.ids.forEach(R=>{X.toRemove.push(R)})}async function ne(){try{L.value=null,L.value={arrayPlayingAs:D.value.playingAs.reduce((R,he)=>(he.isSelected&&R.push(he.value),R),[]),arrayTimeSections:D.value.gameSections.reduce((R,he)=>(he.isSelected&&R.push(he.value),R),[]),arrayFieldSections:M},L.value.gameId=l.value.game_id,L.value.requiresRivalTransform=c.value.requiresRivalTransform,ae.value=c.value.booleanIsMinutesPlayed?c.value.arrayCategoriesIds:ue(),V.value=[],$.value=[],U.value=[];const ee=ae.value.reduce((R,he,ve)=>{U.value.push(he);let Le=he;const qe=typeof he=="string"&&he.includes("_");return qe?(Le=Number(he.split("_")[0]),$.value.push(Le)):V.value.push(Le),`${R}${ve>0?"&":""}${qe?"r":""}categories=${Le}`},""),re=a.actionId===3?`&team=${u.value.team_id}`:a.actionId===4?`&player=${d.value.player_id}`:"",X=await K(ee,re);z(X)}catch(ee){throw new Error(ee)}}function fe(){ne()}function me(){Y.value=!1}function ye(){Y.value=!1,t("cancel")}return(ee,re)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.withDirectives(s.createVNode(wf,{onModifyFilters:me,onCancel:ye},null,512),[[s.vShow,Y.value]]),s.withDirectives(s.createElementVNode("div",YCe,[s.createElementVNode("div",QCe,[s.createElementVNode("div",ZCe,[$Ce,s.createElementVNode("div",eke,[s.createVNode(ei,{items:e.tournaments,"default-item-by-prop":{propName:"id",value:1},itemTextKey:"name",onInput:p},null,8,["items"])])])]),s.createElementVNode("div",tke,[s.createElementVNode("div",ake,[ike,n.value&&n.value.seasons?(s.openBlock(),s.createElementBlock("div",nke,[s.createVNode(ei,{items:n.value.seasons,itemTextKey:"name",onInput:f},null,8,["items"])])):s.createCommentVNode("",!0)]),s.createElementVNode("div",rke,[ske,r.value&&r.value.arrayMatchDays?(s.openBlock(),s.createElementBlock("div",oke,[s.createVNode(ei,{items:r.value.arrayMatchDays,itemTextKey:"stringMatchDayAbbreviation",onInput:y},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",lke,[s.createElementVNode("div",cke,[dke,o.value&&o.value.arrayGames?(s.openBlock(),s.createElementBlock("div",uke,[s.createVNode(Sf,{items:o.value.arrayGames,onInput:b},null,8,["items"])])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",hke,[s.createElementVNode("div",pke,[mke,s.createElementVNode("div",fke,[s.createVNode(ei,{items:m.value,itemTextKey:"name","is-list-same-width":!1,onInput:E},null,8,["items"])])]),s.createElementVNode("div",gke,[yke,s.createElementVNode("div",_ke,[s.createVNode(rv,{modelValue:h.value,"onUpdate:modelValue":re[0]||(re[0]=X=>h.value=X)},null,8,["modelValue"])])])]),s.createElementVNode("div",bke,[s.createVNode(s.Transition,null,{default:s.withCtx(()=>[h.value?(s.openBlock(),s.createBlock(sv,{key:0,"selected-category":c.value,conditions:D.value,"field-areas":M.value},null,8,["selected-category","conditions","field-areas"])):s.createCommentVNode("",!0)]),_:1})])],512),[[s.vShow,!Y.value]]),s.withDirectives(s.createElementVNode("div",vke,[s.createVNode(Xl,s.mergeProps(i,{onClick:fe}),null,16)],512),[[s.vShow,!Y.value]])],64))}},wke=bt(Ske,[["__scopeId","data-v-1967b860"]]),Tke={class:"template-videos"},Cke={class:"template-videos__header"},kke={class:"template-videos__body"},Eke=s.defineComponent({name:"TemplateVideos",components:{VideosGoals:NTe,VideosPlayer:wCe,VideosTeam:JCe,VideosGame:wke}}),Ike=Object.assign(Eke,{props:{gamesUrl:{type:String,default:"https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?"},tournamentsUrl:{type:String,default:"https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/tournaments"},playersUrl:{type:String,default:"https://ts7thxzaik.execute-api.us-west-2.amazonaws.com/prod/players/seasons/"},token:{type:String,default:""},filterTypeToSetUp:{type:Object,default:null}},emits:["loading-data","apply-filters","cancel"],setup(e,{emit:t}){const a=e,i={padding:"4px 18px",borderRadius:"160px",backgroundColor:"#3A4851",borderColor:"#3A4851",activeBorderColor:"#CBEE6B",fontSize:"11px",fontColor:"#FFFFFF"},n=[],r=["g-23","g-24","g-25"],o={games:[607,608,12,55,54,35,14,52,15,53,466,477],team:[607,608,12,55,54,35,14,52,15,53,466,477,40,257,39],player:{regular:[12,35,10,27,607,61,519,98,101,109,112,121,122,127,128,135,136,141,142,161,170,179,702,730,466,217,211,232,235,239,242,282,284,289,291,296,485,486,487,488,14,15,257],goalkeeper:[55,324,323,608,39,774,802,52,53,40,54]}},l={player:1,team:2,goalkeeper:3},c=s.ref(YA),d=s.ref([]),u=s.ref(c.value[0]),h=s.ref({}),m=s.ref({}),p=s.ref({}),f=s.ref({}),y=s.ref({games:[],player:[],team:[],goalkeeper:[],isEmpty:!0}),b=s.ref([]);s.ref({});const E=s.ref(null);s.ref(null),s.watch(h,ie=>{m.value.numberSeasonSelectedIndex=m.value.seasons.findIndex(ne=>ne.id===ie.id),ie.arrayMatchDays?(f.value=ie.arrayMatchDays[0]||{},p.value=ie.arrayTeams[0]||{}):(L(ie),V(ie))}),s.watch(p,()=>{setTimeout(()=>{h.value.mapPlayersByTeam&&(!p.value.arrayPlayers||!p.value.arrayPlayers.length)&&(p.value.arrayPlayers=h.value.mapPlayersByTeam.get(p.value.team_id))},700)}),s.watch(()=>a.filterTypeToSetUp,ie=>{ie&&(u.value=ie)},{immediate:!0});async function D(){try{d.value=await M()}catch(ie){throw new Error(ie)}}async function M(){try{const ie={Authorization:tv()||a.token},ne={}.API_TOURNAMENTS||a.tournamentsUrl,fe=await Ei.get(ne,{headers:ie});return fe.data?fe.data.map(me=>({...me.tournament,seasons:me.seasons})):[]}catch(ie){return Promise.reject(ie)}}async function N(ie,ne,fe=""){t("loading-data");let me=fe;try{me||(me={}.API_CALENDAR_GAMES_BY_SEASON||a.gamesUrl,ie.forEach((X,R)=>{me+=`${R===0?"":"&"}seasons=${X}`}));const ye={Authorization:tv()||a.token},{data:{data:ee,teams:re}}=await Ei.get(me,{headers:ye});return{seasonsAndGames:ee,seasonsAndTeams:re}}catch(ye){if(ne>0)return N(ie,ne-1,me);throw new Error(ye)}finally{t("loading-data")}}async function P(ie){try{const ne={Authorization:tv()||a.token},fe=` ${{}.API_PLAYERS_BY_SEASON||a.playersUrl}${ie.seasonId}`,me=await Ei.get(fe,{headers:ne});return me.data?me.data.players:[]}catch(ne){return Promise.reject(ne)}}async function L(ie){try{const{seasonsAndGames:ne,seasonsAndTeams:fe}=await N([ie.id,...ie.related_seasons.map(re=>re.id)],3),me=fe.find(re=>re._id===ie.id);h.value.arrayTeams=[],h.value.mapTeams=new Map;const ye=me.teams.reduce((re,X)=>(h.value.arrayTeams.push(X),h.value.mapTeams.set(X.team_id,{name:X.colloquial_name,acronym:X.acronym,logo:X.logo,id:X.team_id}),re.set(X.team_id,X),re),new Map);p.value=h.value.arrayTeams[0],h.value.mapGames=new Map,h.value.mapGamesByTeam=new Map;const ee=Array.from(ne.reduce((re,X)=>(X.games.forEach(R=>{if(R.game_status===1&&R.has_video){(!h.value.maxGameId||R.game_id>h.value.maxGameId)&&(h.value.maxGameId=R.game_id);let he=R.matchday_abbreviation.replace("M","J"),ve=R.matchday_abbreviation.replace("M","Jornada ");const Le=R.matchday_abbreviation.replace("M","");X.season_type===0?m.value.tournament_type===1&&(R.seasonId===881?(he=vwe[Le]||he,ve=bwe[Le]||ve):(he=QA[R.matchday_abbreviation]?R.matchday_abbreviation:he,ve=QA[R.matchday_abbreviation]||ve,he==="FINAL"&&(he="F"))):X.season_type===1?(he=_we[R.matchday_abbreviation],ve=he):(he=R.matchday_abbreviation.replace("PO","R"),ve="Repechaje"),R.roundAbbreviation=he,R.roundName=ve,h.value.mapGames.set(R.game_id,{id:R.game_id,date:R.date,dateTimeMillis:new Date(R.date_time_utc).valueOf(),homeTeam:h.value.mapTeams.get(R.home_team),awayTeam:h.value.mapTeams.get(R.visiting_team),roundAbbreviation:R.roundAbbreviation,roundName:R.roundName,score:R.score,gameResult:R.score[0]>R.score[1]?1:R.score[0]<R.score[1]?2:3,seasonId:X.season_id});const qe=re.get(R.roundAbbreviation);R.numberDateTimeMillis=new Date(R.date_time_utc).getTime(),R.homeTeam=ye.get(R.home_team),R.awayTeam=ye.get(R.visiting_team);const Ge=h.value.mapGamesByTeam.get(R.home_team),J=h.value.mapGamesByTeam.get(R.visiting_team);Ge?Ge.push(R):h.value.mapGamesByTeam.set(R.home_team,[R]),J?J.push(R):h.value.mapGamesByTeam.set(R.visiting_team,[R]),qe?qe.arrayGames.push(R):re.set(R.roundAbbreviation,{stringMatchDayAbbreviation:R.roundAbbreviation,stringMatchDayName:R.roundName,arrayGames:[R]})}}),re),new Map).values());ee.reverse(),ee.forEach(re=>{re.arrayGames.sort((X,R)=>X.numberDateTimeMillis-R.numberDateTimeMillis)}),h.value.arrayMatchDays=ee,f.value=ee[0]||{}}catch(ne){throw new Error(ne)}}async function V(ie){try{const ne=await Y(ie.id);h.value.mapPlayers=new Map,h.value.mapPlayersByTeam=ne.reduce((fe,me)=>{h.value.mapPlayers.set(me.player_id,{id:me.player_id,name:me.player_name,shortName:me.shortName,photo:me.player_photo,teamId:me.team_id,positionId:me.position_id});const ye=fe.get(me.team_id);return ye?ye.push(me):fe.set(me.team_id,[me]),fe},new Map)}catch(ne){throw new Error(ne)}}async function $(){try{let ie=[];y.value.isEmpty?(ie=await de(),b.value={...ie}):ie=b.value;const ne=[];if(ie&&ie.length){y.value=ie.reduce((X,R)=>{if(R.group_id!=="g-55"){const he={idAux:R.group_id,ids:[...R.ids?R.ids:[],...R.rival_Ids?R.rival_Ids:[]],type:R.type,name:R.name,coordinatePoint:R.coordinate_point,requiresRivalTransform:r.includes(R.group_id)};he.idsAux=[...he.ids],he.subcategoryGroups=R.group_id==="g-12"?[]:U(R,0,new Map,!1,{},he.idsAux),ne.push(he),he.type.includes(l.player)&&X.player.push(he),he.type.includes(l.team)&&(he.idAux!=="g-2"&&X.games.push(he),X.team.push(he)),he.type.includes(l.goalkeeper)&&X.goalkeeper.push(he)}return X},{games:[],player:[],team:[],goalkeeper:[],isEmpty:!1});const fe=new Map,me="Resumen",ye="Todas sus jugadas",ee=y.value.player.reduce((X,R)=>{const he=ae(R);return he.forEach(ve=>{fe.set(ve,R.name)}),X.push(...he),X},[]),re=y.value.goalkeeper.reduce((X,R)=>{const he=ae(R);return he.forEach(ve=>{fe.set(ve,R.name)}),X.push(...he),X},[]);y.value.games.unshift({name:me,arrayCategoriesIds:o.games,booleanIsBestPlays:!0}),y.value.team.unshift({name:me,arrayCategoriesIds:o.team,booleanIsBestPlays:!0}),y.value.player.unshift({name:me,arrayCategoriesIds:o.player.regular,booleanIsBestPlays:!0},{name:ye,arrayCategoriesIds:ee,booleanIsMinutesPlayed:!0}),y.value.goalkeeper.unshift({name:me,arrayCategoriesIds:o.player.goalkeeper,booleanIsBestPlays:!0},{name:ye,arrayCategoriesIds:re,booleanIsMinutesPlayed:!0})}}catch(ie){throw new Error(ie)}}function U(ie,ne=0,fe=new Map,me=!1,ye={},ee=[]){if(!ie.group_id)return;let re=fe.get(ne);const X=me?`${ie.id_category}_r`:ie.id_category;ie.id_category&&ee.push(ie.id_category);let R={ids:[X],groupId:ie.group_id,level:ne,name:ie.name,isSelected:!0,fatherCategories:ne>0?[ye]:[],idsByFatherCategory:{[ie.category_father]:[X]}};if(ne>0&&ne===1&&(R.id=ie.id_category),re&&ne!==0){const he=ie.group_id.charAt(ie.group_id.length-1),ve=re.find(Le=>Le.groupId.endsWith(he));ve&&!n.includes(R.groupId)?(R=ve,ve.ids.push(X),ve.fatherCategories.push(ye),ve.fatherCategories.forEach(Le=>{Le.childCategories?Le.childCategories.find(qe=>qe.groupId===R.groupId)||Le.childCategories.push(R):Le.childCategories=[R]}),ve.idsByFatherCategory[ie.category_father]?ve.idsByFatherCategory[ie.category_father].push(X):ve.idsByFatherCategory[ie.category_father]=[X]):(R.fatherCategories.forEach(Le=>{Le.childCategories?Le.childCategories.find(qe=>qe.groupId===R.groupId)||Le.childCategories.push(R):Le.childCategories=[R]}),re.push(R))}else ne!==0&&(ye.childCategories?ye.childCategories.push(R):ye.childCategories=[R],re=[R],fe.set(ne,re));if(ie.categories&&ie.categories.length?ie.categories.forEach(he=>{U(he,ne+1,fe,me,R,ee)}):ie.rival_categories&&ie.rival_categories.length&&ie.rival_categories.forEach(he=>{U(he,ne+1,fe,!0,R,ee)}),ne===0)return Array.from(fe.values())}function ae(ie){const ne=ie||ie;if(ne.booleanIsBestPlays)return ne.arrayCategoriesIds;const fe={total:[],toRemove:[]};if(ne.subcategoryGroups&&ne.subcategoryGroups.length?ne.subcategoryGroups[0].forEach(me=>{oe(me,null,fe)}):(ne.ids&&fe.total.push(...ne.ids),ne.rival_ids&&ne.rival_ids.forEach(me=>{fe.total.push(`${me}_r`)})),fe.total=fe.total.reduce((me,ye)=>(fe.toRemove.includes(ye)||me.push(ye),me),[]),!ie){const me=ne.name.toLowerCase().includes("recibid");E.value.isRivalSubject=me,E.value.avoidCategorySingleName=me,E.value.coordinatePoint=ne.coordinatePoint,E.value.requiresRivalTransform=ne.requiresRivalTransform}return fe.total}function oe(ie,ne=[],fe={total:[],toRemove:[]}){ie.isSelected?ie.childCategories?ie.childCategories.forEach(me=>{const ye=ne?Object.entries(ie.idsByFatherCategory).reduce((ee,[re,X])=>(ne.includes(Number(re))&&X.forEach(R=>{typeof R=="string"&&R.endsWith("_r")?ee.push(Number(R.split("_")[0])):ee.push(R)}),ee),[]):[ie.id];oe(me,ye,fe)}):ne?Object.entries(ie.idsByFatherCategory).forEach(([me,ye])=>{ne.includes(Number(me))&&ye.forEach(ee=>{fe.total.push(ee)})}):ie.level===1?Object.entries(ie.idsByFatherCategory).forEach(([me,ye])=>{ye.forEach(ee=>{fe.total.push(ee)})}):fe.total.push(ie.id):ie.childCategories||ie.ids.forEach(me=>{fe.toRemove.push(me)})}async function Y(ie){try{const ne=await P({seasonId:ie});return ne.forEach(fe=>{const[me,ye]=fe.player_name.split(","),ee=me.split(" ");let re="";for(const X of ee)if(re+=` ${X}`,X.length>3)break;fe.shortName=ye&&me?`${ye.trim().charAt(0)}.${re}`:""}),ne}catch(ne){return Promise.reject(ne)}}async function de(){try{const ie={Authorization:localStorage.getItem("user_token")||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"};return(await Ei.get("https://2gfppi9wb6.execute-api.us-east-2.amazonaws.com/prod/videos/categories",{headers:ie})).data||[]}catch(ie){return Promise.reject(ie)}}function we(ie){u.value=ie}function Se(ie){m.value=ie}function pe(ie){h.value=ie}function z(ie){p.value=ie}function K(ie){t("apply-filters",ie)}function ue(){u.value=c.value[0],t("cancel")}return D(),$(),(ie,ne)=>(s.openBlock(),s.createElementBlock("div",Tke,[s.createElementVNode("div",Cke,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.value,fe=>(s.openBlock(),s.createBlock(Xl,s.mergeProps({key:fe.name},i,{text:fe.name,"is-active":u.value.componentName===fe.componentName,tournaments:d.value,onClick:me=>we(fe)}),null,16,["text","is-active","tournaments","onClick"]))),128))]),s.createElementVNode("div",kke,[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(u.value.componentName),{tournaments:d.value,"advanced-filter-categories":y.value,"action-id":u.value.actionId,onApplyFilters:K,onCancel:ue,"onUpdate:tournament":Se,"onUpdate:season":pe,"onUpdate:team":z},null,40,["tournaments","advanced-filter-categories","action-id"]))])]))}}),xke=bt(Ike,[["__scopeId","data-v-6a7442aa"]]),Nke=e=>(s.pushScopeId("data-v-b3e59e8c"),e=e(),s.popScopeId(),e),Ake={class:"search-filters__input"},Pke=Nke(()=>s.createElementVNode("div",{class:"search-filters__input__icon"},[s.createElementVNode("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),s.createElementVNode("path",{d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),s.createElementVNode("path",{d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})])],-1)),Oke=["value"],Bke={ref:"categoryInput",class:"search-input-icon",type:"text",readonly:""},Dke={class:"search-filters__menu"},Mke={__name:"SearchFilters",props:{clientWidth:{type:Number,default:0},filterTypeToSetUp:{type:Object,default:null}},emits:["apply-filters"],setup(e,{emit:t}){const a=e,i=s.ref("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"),n=s.ref(!1),r=s.ref("");s.ref(null);const o=s.computed(()=>"Por categoría"),l=s.computed(()=>{let u=[];return a.clientWidth>0&&(a.clientWidth<=560?u.push("search-filters__480"):a.clientWidth<=1280?u.push("search-filters__1280"):u.push("search-filters")),u});s.watch(()=>a.filterTypeToSetUp,u=>{u&&(n.value=!0)});function c(u){r.value=u.categoryName,t("apply-filters",u.filterData),n.value=!1}function d(){r.value="",n.value=!1}return(u,h)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["search-filters",l.value])},[s.createVNode(s.unref(JA),{modelValue:n.value,"onUpdate:modelValue":h[0]||(h[0]=m=>n.value=m),"menu-margin-top":8},{trigger:s.withCtx(()=>[s.createElementVNode("div",Ake,[Pke,s.createElementVNode("input",{ref:"categoryInput",class:"search-input-name",value:o.value,type:"text",readonly:""},null,8,Oke),s.createElementVNode("input",Bke,null,512)])]),menu:s.withCtx(()=>[s.createElementVNode("div",Dke,[s.createVNode(xke,{"filter-type-to-set-up":e.filterTypeToSetUp,token:i.value,onApplyFilters:c,onCancel:d},null,8,["filter-type-to-set-up","token"])])]),_:1},8,["modelValue"])],2))}},Lke=bt(Mke,[["__scopeId","data-v-b3e59e8c"]]);/**
305
305
  * Vue 3 Carousel 0.3.1
306
306
  * (c) 2023
307
307
  * @license MIT
308
- */const Sa={itemsToShow:1,itemsToScroll:1,modelValue:0,transition:300,autoplay:0,snapAlign:"center",wrapAround:!1,throttle:16,pauseAutoplayOnHover:!1,mouseDrag:!0,touchDrag:!0,dir:"ltr",breakpoints:void 0,i18n:{ariaNextSlide:"Navigate to next slide",ariaPreviousSlide:"Navigate to previous slide",ariaNavigateToSlide:"Navigate to slide {slideNumber}",ariaGallery:"Gallery",itemXofY:"Item {currentSlide} of {slidesCount}",iconArrowUp:"Arrow pointing upwards",iconArrowDown:"Arrow pointing downwards",iconArrowRight:"Arrow pointing to the right",iconArrowLeft:"Arrow pointing to the left"}},tP={itemsToShow:{default:Sa.itemsToShow,type:Number},itemsToScroll:{default:Sa.itemsToScroll,type:Number},wrapAround:{default:Sa.wrapAround,type:Boolean},throttle:{default:Sa.throttle,type:Number},snapAlign:{default:Sa.snapAlign,validator(e){return["start","end","center","center-even","center-odd"].includes(e)}},transition:{default:Sa.transition,type:Number},breakpoints:{default:Sa.breakpoints,type:Object},autoplay:{default:Sa.autoplay,type:Number},pauseAutoplayOnHover:{default:Sa.pauseAutoplayOnHover,type:Boolean},modelValue:{default:void 0,type:Number},mouseDrag:{default:Sa.mouseDrag,type:Boolean},touchDrag:{default:Sa.touchDrag,type:Boolean},dir:{default:Sa.dir,validator(e){return["rtl","ltr"].includes(e)}},i18n:{default:Sa.i18n,type:Object},settings:{default(){return{}},type:Object}};function Rke({config:e,slidesCount:t}){const{snapAlign:a,wrapAround:i,itemsToShow:n=1}=e;if(i)return Math.max(t-1,0);let r;switch(a){case"start":r=t-n;break;case"end":r=t-1;break;case"center":case"center-odd":r=t-Math.ceil((n-.5)/2);break;case"center-even":r=t-Math.ceil(n/2);break;default:r=0;break}return Math.max(r,0)}function Fke({config:e,slidesCount:t}){const{wrapAround:a,snapAlign:i,itemsToShow:n=1}=e;let r=0;if(a||n>t)return r;switch(i){case"start":r=0;break;case"end":r=n-1;break;case"center":case"center-odd":r=Math.floor((n-1)/2);break;case"center-even":r=Math.floor((n-2)/2);break;default:r=0;break}return r}function cv({val:e,max:t,min:a}){return t<a?e:Math.min(Math.max(e,a),t)}function Vke({config:e,currentSlide:t,slidesCount:a}){const{snapAlign:i,wrapAround:n,itemsToShow:r=1}=e;let o=t;switch(i){case"center":case"center-odd":o-=(r-1)/2;break;case"center-even":o-=(r-2)/2;break;case"end":o-=r-1;break}return n?o:cv({val:o,max:a-r,min:0})}function aP(e){return e?e.reduce((t,a)=>{var i;return a.type===s.Fragment?[...t,...aP(a.children)]:((i=a.type)===null||i===void 0?void 0:i.name)==="CarouselSlide"?[...t,a]:t},[]):[]}function dv({val:e,max:t,min:a=0}){return e>t?dv({val:e-(t+1),max:t,min:a}):e<a?dv({val:e+(t+1),max:t,min:a}):e}function Uke(e,t){let a;return t?function(...i){const n=this;a||(e.apply(n,i),a=!0,setTimeout(()=>a=!1,t))}:e}function jke(e,t){let a;return function(...i){a&&clearTimeout(a),a=setTimeout(()=>{e(...i),a=null},t)}}function zke(e="",t={}){return Object.entries(t).reduce((a,[i,n])=>a.replace(`{${i}}`,String(n)),e)}var Hke=s.defineComponent({name:"ARIA",setup(){const e=s.inject("config",s.reactive(Object.assign({},Sa))),t=s.inject("currentSlide",s.ref(0)),a=s.inject("slidesCount",s.ref(0));return()=>s.h("div",{class:["carousel__liveregion","carousel__sr-only"],"aria-live":"polite","aria-atomic":"true"},zke(e.i18n.itemXofY,{currentSlide:t.value+1,slidesCount:a.value}))}}),qke=s.defineComponent({name:"Carousel",props:tP,setup(e,{slots:t,emit:a,expose:i}){var n;const r=s.ref(null),o=s.ref([]),l=s.ref(0),c=s.ref(0),d=s.reactive(Object.assign({},Sa));let u=Object.assign({},Sa),h;const m=s.ref((n=e.modelValue)!==null&&n!==void 0?n:0),p=s.ref(0),f=s.ref(0),y=s.ref(0),b=s.ref(0);let E,D;s.provide("config",d),s.provide("slidesCount",c),s.provide("currentSlide",m),s.provide("maxSlide",y),s.provide("minSlide",b),s.provide("slideWidth",l);function M(){h=Object.assign({},e.breakpoints),u=Object.assign(Object.assign(Object.assign({},u),e),{i18n:Object.assign(Object.assign({},u.i18n),e.i18n),breakpoints:void 0}),P(u)}function N(){if(!h||!Object.keys(h).length)return;const J=Object.keys(h).map(Oe=>Number(Oe)).sort((Oe,We)=>+We-+Oe);let De=Object.assign({},u);J.some(Oe=>{const We=window.matchMedia(`(min-width: ${Oe}px)`).matches;return We&&(De=Object.assign(Object.assign({},De),h[Oe])),We}),P(De)}function P(J){Object.entries(J).forEach(([De,Oe])=>d[De]=Oe)}const L=jke(()=>{N(),V()},16);function V(){if(!r.value)return;const J=r.value.getBoundingClientRect();l.value=J.width/d.itemsToShow}function $(){c.value<=0||(f.value=Math.ceil((c.value-1)/2),y.value=Rke({config:d,slidesCount:c.value}),b.value=Fke({config:d,slidesCount:c.value}),d.wrapAround||(m.value=cv({val:m.value,max:y.value,min:b.value})))}s.onMounted(()=>{s.nextTick(()=>V()),setTimeout(()=>V(),1e3),N(),ie(),window.addEventListener("resize",L,{passive:!0}),a("init")}),s.onUnmounted(()=>{D&&clearTimeout(D),E&&clearInterval(E),window.removeEventListener("resize",L,{passive:!0})});let U=!1;const ae={x:0,y:0},oe={x:0,y:0},Y=s.reactive({x:0,y:0}),de=s.ref(!1),we=s.ref(!1),Se=()=>{de.value=!0},pe=()=>{de.value=!1};function z(J){["INPUT","TEXTAREA","SELECT"].includes(J.target.tagName)||(U=J.type==="touchstart",U||J.preventDefault(),!(!U&&J.button!==0||fe.value)&&(ae.x=U?J.touches[0].clientX:J.clientX,ae.y=U?J.touches[0].clientY:J.clientY,document.addEventListener(U?"touchmove":"mousemove",K,!0),document.addEventListener(U?"touchend":"mouseup",ue,!0)))}const K=Uke(J=>{we.value=!0,oe.x=U?J.touches[0].clientX:J.clientX,oe.y=U?J.touches[0].clientY:J.clientY;const De=oe.x-ae.x,Oe=oe.y-ae.y;Y.y=Oe,Y.x=De},d.throttle);function ue(){const J=d.dir==="rtl"?-1:1,De=Math.sign(Y.x)*.4,Oe=Math.round(Y.x/l.value+De)*J;if(Oe&&!U){const We=gt=>{gt.stopPropagation(),window.removeEventListener("click",We,!0)};window.addEventListener("click",We,!0)}me(m.value-Oe),Y.x=0,Y.y=0,we.value=!1,document.removeEventListener(U?"touchmove":"mousemove",K,!0),document.removeEventListener(U?"touchend":"mouseup",ue,!0)}function ie(){!d.autoplay||d.autoplay<=0||(E=setInterval(()=>{d.pauseAutoplayOnHover&&de.value||ye()},d.autoplay))}function ne(){E&&(clearInterval(E),E=null),ie()}const fe=s.ref(!1);function me(J){const De=d.wrapAround?J:cv({val:J,max:y.value,min:b.value});m.value===De||fe.value||(a("slide-start",{slidingToIndex:J,currentSlideIndex:m.value,prevSlideIndex:p.value,slidesCount:c.value}),fe.value=!0,p.value=m.value,m.value=De,D=setTimeout(()=>{if(d.wrapAround){const Oe=dv({val:De,max:y.value,min:0});Oe!==m.value&&(m.value=Oe,a("loop",{currentSlideIndex:m.value,slidingToIndex:J}))}a("update:modelValue",m.value),a("slide-end",{currentSlideIndex:m.value,prevSlideIndex:p.value,slidesCount:c.value}),fe.value=!1,ne()},d.transition))}function ye(){me(m.value+d.itemsToScroll)}function ee(){me(m.value-d.itemsToScroll)}const re={slideTo:me,next:ye,prev:ee};s.provide("nav",re),s.provide("isSliding",fe);const X=s.computed(()=>Vke({config:d,currentSlide:m.value,slidesCount:c.value}));s.provide("slidesToScroll",X);const R=s.computed(()=>{const J=d.dir==="rtl"?-1:1,De=X.value*l.value*J;return{transform:`translateX(${Y.x-De}px)`,transition:`${fe.value?d.transition:0}ms`,margin:d.wrapAround?`0 -${c.value*l.value}px`:"",width:"100%"}});function he(){M(),N(),$(),V(),ne()}Object.keys(tP).forEach(J=>{["modelValue"].includes(J)||s.watch(()=>e[J],he)}),s.watch(()=>e.modelValue,J=>{J!==m.value&&me(Number(J))}),s.watch(c,$),a("before-init"),M();const ve={config:d,slidesCount:c,slideWidth:l,next:ye,prev:ee,slideTo:me,currentSlide:m,maxSlide:y,minSlide:b,middleSlide:f};i({updateBreakpointsConfigs:N,updateSlidesData:$,updateSlideWidth:V,initDefaultConfigs:M,restartCarousel:he,slideTo:me,next:ye,prev:ee,nav:re,data:ve});const Le=t.default||t.slides,qe=t.addons,Ge=s.reactive(ve);return()=>{const J=aP(Le==null?void 0:Le(Ge)),De=(qe==null?void 0:qe(Ge))||[];J.forEach((Ye,Ze)=>Ye.props.index=Ze);let Oe=J;if(d.wrapAround){const Ye=J.map((Bt,rt)=>s.cloneVNode(Bt,{index:-J.length+rt,isClone:!0,key:`clone-before-${rt}`})),Ze=J.map((Bt,rt)=>s.cloneVNode(Bt,{index:J.length+rt,isClone:!0,key:`clone-after-${rt}`}));Oe=[...Ye,...J,...Ze]}o.value=J,c.value=Math.max(J.length,1);const We=s.h("ol",{class:"carousel__track",style:R.value,onMousedownCapture:d.mouseDrag?z:null,onTouchstartPassiveCapture:d.touchDrag?z:null},Oe),gt=s.h("div",{class:"carousel__viewport"},We);return s.h("section",{ref:r,class:{carousel:!0,"is-sliding":fe.value,"is-dragging":we.value,"is-hover":de.value,"carousel--rtl":d.dir==="rtl"},dir:d.dir,"aria-label":d.i18n.ariaGallery,tabindex:"0",onMouseenter:Se,onMouseleave:pe},[gt,De,s.h(Hke)])}}}),iP;(function(e){e.arrowUp="arrowUp",e.arrowDown="arrowDown",e.arrowRight="arrowRight",e.arrowLeft="arrowLeft"})(iP||(iP={}));var Wke=s.defineComponent({name:"CarouselSlide",props:{index:{type:Number,default:1},isClone:{type:Boolean,default:!1}},setup(e,{slots:t}){const a=s.inject("config",s.reactive(Object.assign({},Sa))),i=s.inject("currentSlide",s.ref(0)),n=s.inject("slidesToScroll",s.ref(0)),r=s.inject("isSliding",s.ref(!1)),o=()=>e.index===i.value,l=()=>e.index===i.value-1,c=()=>e.index===i.value+1,d=()=>{const u=Math.floor(n.value),h=Math.ceil(n.value+a.itemsToShow-1);return e.index>=u&&e.index<=h};return()=>{var u;return s.h("li",{style:{width:`${100/a.itemsToShow}%`},class:{carousel__slide:!0,"carousel__slide--clone":e.isClone,"carousel__slide--visible":d(),"carousel__slide--active":o(),"carousel__slide--prev":l(),"carousel__slide--next":c(),"carousel__slide--sliding":r.value},"aria-hidden":!d()},(u=t.default)===null||u===void 0?void 0:u.call(t))}}});const Gke=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},Kke=e=>(s.pushScopeId("data-v-dd3cbf69"),e=e(),s.popScopeId(),e),Xke={class:"gsc-carousel"},Jke={key:0},Yke=Kke(()=>s.createElementVNode("div",null,"no hay",-1)),Qke=[Yke],Zke={class:"gsc-carousel__2d__slides"},$ke={width:"9",height:"18",viewBox:"0 0 9 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eEe=["fill"],tEe={width:"9",height:"18",viewBox:"0 0 9 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},aEe=["fill"],iEe={class:"gsc-carousel__2d__navigation"},nEe={width:"8",height:"15",viewBox:"0 0 8 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rEe=["stroke"],sEe={key:1,class:"gsc-carousel__2d__navigation__pagination"},oEe=["onClick"],lEe={width:"7",height:"15",viewBox:"0 0 7 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cEe=["stroke"],dEe={__name:"GSC-Carousel",props:{currentItemIndex:{type:Number,default:0},items:{type:Array,default:()=>[]},is3d:{type:Boolean,default:!1},isPaginationVisible:{type:Boolean,default:!1},areNavigationArrowsVisible:{type:Boolean,default:!0},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(t=>t in e)},navigationHeight:{type:Number,default:4},navigationBorderRadius:{type:Number,default:4},navigationColor:{type:String,default:"rgba(255, 255, 255, 0.4)"},navigationActiveColor:{type:String,default:"#cbee6b"},navigationActiveWidth:{type:Number,default:30},arrowsColor:{type:String,default:"#cbee6b"},wrapAround:{type:Boolean,default:!1},itemsToShow:{type:Number,default:1},isMainSlidePriority:{type:Boolean,default:!1},areSlidesArrowsVisible:{type:Boolean,default:!1},slideLeftArrowBackgroundImage:{type:String,default:"linear-gradient(to right, rgba(13, 29, 41, 1), rgba(0, 0, 0, 0))"},slideRightArrowBackgroundImage:{type:String,default:"linear-gradient(to left, rgba(13, 29, 41, 1), rgba(0, 0, 0, 0))"},areSlidesArrowsRounded:{type:Boolean,default:!1},slidesArrowsLeftAndRight:{type:String,default:"20px"},secondarySlidesOpacity:{type:Number,default:.8},marginTop:{type:String,default:"0"}},emits:["input","update:currentItemIndex"],setup(e,{expose:t,emit:a}){const i=e;s.useCssVars(y=>({"0d808f0f":e.slideLeftArrowBackgroundImage,"1e0ef2e5":e.slidesArrowsLeftAndRight,"66d12b5c":e.slideRightArrowBackgroundImage,"2b22a85a":e.marginTop,"1a842b02":e.secondarySlidesOpacity}));const n=s.ref(null),r=s.ref({}),o=s.ref(0),l=s.ref(!1);s.watch(n,y=>{y&&l.value?(l.value=!1,c(i.items)):y&&y.slideTo&&y.slideTo(o.value)},{deep:!0}),s.watch(()=>i.currentItemIndex,y=>{o.value!==y&&m(y)}),s.watch(()=>i.items,y=>{n.value?c(y):l.value=!0},{immediate:!0});function c(y){if(y&&y.length&&n.value){if(i.defaultItemByProp){const b=i.items.findIndex(E=>E[i.defaultItemByProp.propName]===i.defaultItemByProp.value);b!==-1?(o.value=b,r.value=y[b]):(o.value=0,r.value=y[0])}else o.value=i.defaultItemByIndex,r.value=y[i.defaultItemByIndex];n.value.slideTo&&n.value.slideTo(o.value),a("input",{selectedItem:r.value,selectedItemIndex:o.value})}}function d(){n.value&&n.value.next()}function u(){n.value&&n.value.prev()}function h(){n.value&&n.value.updateSlideWidth()}function m(y){n.value&&n.value.slideTo(y)}function p(y){n.value.slideTo(y)}function f(y){const b=y.slidingToIndex<0?i.items.length-1:y.slidingToIndex===i.items.length?0:y.slidingToIndex;o.value=b,r.value=i.items[b],a("update:currentItemIndex",b),a("input",{selectedItem:r.value,selectedItemIndex:o.value})}return t({prev:u,next:d,updateSlideWidth:h,slideTo:m}),(y,b)=>(s.openBlock(),s.createElementBlock("div",Xke,[i.is3d?(s.openBlock(),s.createElementBlock("div",Jke,Qke)):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["gsc-carousel__2d",{"main-slide-priority":e.isMainSlidePriority}])},[s.createElementVNode("div",Zke,[s.createVNode(s.unref(qke),{ref_key:"carousel2d",ref:n,"items-to-show":e.itemsToShow,"wrap-around":e.wrapAround,onSlideStart:f},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.items,(E,D)=>(s.openBlock(),s.createBlock(s.unref(Wke),{key:D},{default:s.withCtx(()=>[s.renderSlot(y.$slots,"default",{item:E},void 0,!0)]),_:2},1024))),128))]),_:3},8,["items-to-show","wrap-around"])]),e.areSlidesArrowsVisible?(s.openBlock(),s.createElementBlock("div",{key:0,class:"gsc-carousel__2d__arrow-left",onClick:b[0]||(b[0]=E=>n.value.prev())},[s.createElementVNode("div",{class:s.normalizeClass(["gsc-carousel__2d__slide-button",{rounded:e.areSlidesArrowsRounded}])},[(s.openBlock(),s.createElementBlock("svg",$ke,[s.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.10399 9L8.62342 15.4393C9.12552 16.0251 9.12552 16.9749 8.62342 17.5607C8.12132 18.1464 7.30725 18.1464 6.80514 17.5607L0.376575 10.0607C-0.125528 9.47487 -0.125528 8.52512 0.376575 7.93934L6.80515 0.439339C7.30725 -0.146447 8.12132 -0.146447 8.62342 0.43934C9.12553 1.02513 9.12553 1.97487 8.62342 2.56066L3.10399 9Z",fill:e.arrowsColor},null,8,eEe)]))],2)])):s.createCommentVNode("",!0),e.areSlidesArrowsVisible?(s.openBlock(),s.createElementBlock("div",{key:1,class:"gsc-carousel__2d__arrow-right",onClick:b[1]||(b[1]=E=>d())},[s.createElementVNode("div",{class:s.normalizeClass(["gsc-carousel__2d__slide-button",{rounded:e.areSlidesArrowsRounded}])},[(s.openBlock(),s.createElementBlock("svg",tEe,[s.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.89601 9L0.376575 2.56066C-0.125528 1.97487 -0.125528 1.02513 0.376575 0.439339C0.878675 -0.146447 1.69275 -0.146447 2.19486 0.43934L8.62343 7.93934C9.12553 8.52513 9.12553 9.47487 8.62343 10.0607L2.19486 17.5607C1.69275 18.1464 0.878675 18.1464 0.376575 17.5607C-0.125528 16.9749 -0.125528 16.0251 0.376575 15.4393L5.89601 9Z",fill:e.arrowsColor},null,8,aEe)]))],2)])):s.createCommentVNode("",!0),s.createElementVNode("div",iEe,[e.areNavigationArrowsVisible?(s.openBlock(),s.createElementBlock("div",{key:0,class:"gsc-carousel__2d__navigation__arrow-left",onClick:b[2]||(b[2]=E=>u())},[(s.openBlock(),s.createElementBlock("svg",nEe,[s.createElementVNode("path",{d:"M6.72998 13.894L1.46621 8.63028C0.84457 8.00863 0.84457 6.9914 1.46621 6.36976L6.72998 1.10599",stroke:i.arrowsColor},null,8,rEe)]))])):s.createCommentVNode("",!0),e.isPaginationVisible?(s.openBlock(),s.createElementBlock("div",sEe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.items,(E,D)=>(s.openBlock(),s.createElementBlock("div",{key:`i-${D}`,class:"gsc-carousel__2d__navigation__pagination__item",style:s.normalizeStyle({height:`${i.navigationHeight}px`,width:`${o.value===D?i.navigationActiveWidth:i.navigationActiveWidth/2}px`,borderRadius:`${i.navigationBorderRadius}px`,backgroundColor:`${o.value===D?i.navigationActiveColor:i.navigationColor}`,transition:"all 0.1s ease-in-out"}),onClick:M=>p(D)},null,12,oEe))),128))])):s.createCommentVNode("",!0),e.areNavigationArrowsVisible?(s.openBlock(),s.createElementBlock("div",{key:2,class:"gsc-carousel__2d__navigation__arrow-right",onClick:b[3]||(b[3]=E=>n.value.next())},[(s.openBlock(),s.createElementBlock("svg",lEe,[s.createElementVNode("path",{d:"M0.72998 1.10599L5.99375 6.36975C6.61539 6.9914 6.61539 8.00863 5.99375 8.63027L0.72998 13.894",stroke:i.arrowsColor},null,8,cEe)]))])):s.createCommentVNode("",!0)])],2))]))}},uEe=Gke(dEe,[["__scopeId","data-v-dd3cbf69"]]),hEe={class:"carousel-video-player"},pEe={class:"video-container"},mEe=["id"],fEe={__name:"CarouselVideoPlayer",props:{play:{type:Object,required:!0},videojs:{type:Function,required:!0}},emits:["play-ended"],setup(e,{emit:t}){const a=e,i=s.ref(null),n=s.computed(()=>`p-${a.play.playId}`);function r(){i.value=a.videojs(n.value,{controlBar:{fullscreenToggle:!1},playsinline:!0}),i.value.src({type:"video/mp4",src:`https://golstatsbets.blob.core.windows.net/video-player/${a.play.gameId}_1.mp4`}),i.value.offset({start:a.play.startSeconds,end:a.play.endSeconds}),i.value.on("ended",()=>{t("play-ended")}),a.play.videoPlayer=i}return s.onMounted(()=>{setTimeout(()=>{r()},10)}),(o,l)=>(s.openBlock(),s.createElementBlock("div",hEe,[s.createElementVNode("div",pEe,[s.createElementVNode("video",{id:n.value,class:"video-js",controls:"",preload:"auto","data-setup":"{}"},null,8,mEe)])]))}},gEe=bt(fEe,[["__scopeId","data-v-e4d57431"]]),yEe=e=>(s.pushScopeId("data-v-bf6136c0"),e=e(),s.popScopeId(),e),_Ee=yEe(()=>s.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[s.createElementVNode("path",{d:"M5 15L15 5",stroke:"white","stroke-width":"1.7","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),s.createElementVNode("path",{d:"M15 15L5 5",stroke:"white","stroke-width":"1.7","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),bEe=[_Ee],vEe={class:"carousel-full-screen__carousel"},SEe={class:"carousel-full-screen__carousel__video-player"},wEe={__name:"CarouselFullScreen",props:{playerQueue:{type:Array,default:()=>[]},playlistIndex:{type:Number,default:0},initialPlay:{type:Object,default:()=>({})},videojs:{type:Function,required:!0}},emits:["close"],setup(e,{emit:t}){const a=e,i=s.ref({wrapAround:!1,itemsToShow:1.2,isMainSlidePriority:!0,areSlidesArrowsVisible:!0,areNavigationArrowsVisible:!1,slideLeftArrowBackgroundImage:"none",slideRightArrowBackgroundImage:"none"}),n=s.ref(0),r=s.ref(0),o=s.ref(null);function l(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function c(){return/iPhone|iPad/i.test(navigator.userAgent)}function d(){const y=document.getElementById("carousel-swipe"),b=window.screen.orientation;b.angle==90&&l()||window.innerWidth<window.innerHeight&&l()?y.classList.remove("landscape"):(b.angle==0&&l()||window.innerWidth>window.innerHeight&&l())&&y.classList.add("landscape")}function u(){const y=document.getElementById("carousel-swipe"),b=window.screen.orientation;b.angle==90&&l()||window.innerWidth>window.innerHeight&&l()?y.classList.remove("landscape"):(b.angle==0&&l()||window.innerWidth<window.innerHeight&&l())&&y.classList.add("landscape")}function h(){const y=document.getElementById("carousel-swipe");window.innerWidth>window.innerHeight&&l()?y.classList.remove("landscape"):window.innerWidth<window.innerHeight&&l()&&y.classList.add("landscape")}function m({selectedItemIndex:y}){const b=y-n.value;r.value+=b;const E=a.playerQueue[n.value],D=a.playerQueue[y];E.videoPlayer&&E.videoPlayer.pause(),D.videoPlayer&&D.videoPlayer.play(),n.value=y}function p(){o.value&&o.value.next()}function f(){const y=a.playlistIndex+r.value;r.value=0,n.value=0,t("close",y)}return s.onMounted(()=>{c()?(window.addEventListener("resize",h),h()):(window.addEventListener("orientationchange",d),u()),setTimeout(()=>{const y=document.getElementsByClassName("video-element");y&&y.length&&Array.from(y).forEach((b,E)=>{b.id=`plyrFS${E+1}`})},100)}),s.onBeforeUnmount(()=>{c()?window.removeEventListener("resize",h):window.removeEventListener("orientationchange",d),a.playerQueue.forEach(y=>{y.videoPlayer&&(y.videoPlayer.pause(),y.videoPlayer.dispose())})}),(y,b)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["carousel-full-screen",{landscape:l()}]),id:"carousel-swipe"},[s.createElementVNode("div",{class:"carousel-full-screen__close",onClick:f},bEe),s.createElementVNode("div",vEe,[s.createVNode(s.unref(uEe),s.mergeProps({ref_key:"gscCarousel",ref:o},i.value,{items:e.playerQueue,"default-item-by-prop":{propName:"playId",value:e.initialPlay.playId},onInput:m}),{default:s.withCtx(({item:E})=>[s.createElementVNode("div",SEe,[s.createVNode(gEe,{videojs:e.videojs,play:E,onPlayEnded:p},null,8,["videojs","play"])])]),_:1},16,["items","default-item-by-prop"])])],2))}},TEe=bt(wEe,[["__scopeId","data-v-bf6136c0"]]),CEe=Kd(),Zi=y0e();let _u=null;const bu=["goals","bestPlays"],je={1:{name:"Oportunidad de Gol",weighing:3},2:{name:"Gol",weighing:1},3:{name:"Autogol",weighing:2},4:{name:"Tarjeta Amarilla",weighing:5},5:{name:"Tarjeta Roja",weighing:4},6:{name:"Penal Recibido",weighing:6},7:{name:"Atajada",weighing:8},8:{name:"Asistencia",weighing:9},9:{name:"Participación en Gol",weighing:14},10:{name:"Sobresaliente",weighing:20},11:{name:"Centro Rematado",weighing:11},12:{name:"Corner Rematado",weighing:12},13:{name:"Tiro Libre Rematado",weighing:13},14:{name:"1vs1 Exitoso Ofensivo",weighing:16},15:{name:"1vs1 Exitoso Defensivo",weighing:18},16:{name:"Pase Filtrado",weighing:15},17:{name:"Balón ganado en Área Propia",weighing:19},18:{name:"Balón Recuperado",weighing:17},19:{name:"Gol Recibido",weighing:7},20:{name:"Pases acertados",weighing:100},21:{name:"Balones recuperados en disputa",weighing:100},22:{name:"Asistencias",weighing:100},23:{name:"Participaciones en gol",weighing:100},24:{name:"Tiros a gol",weighing:100},25:{name:"Tiros a gol que llegaron a la portería",weighing:100},26:{name:"Cabeceos en área rival",weighing:100},27:{name:"Cabeceos en área propia",weighing:100},28:{name:"Centros",weighing:100},29:{name:"Centros acertados",weighing:100},30:{name:"1vs1 exitosos ofensivo",weighing:100},31:{name:"1vs1 exitosos ofensivo que terminaron en gol",weighing:100},32:{name:"1vs1 defensivos exitoso",weighing:100},33:{name:"Rechaces",weighing:100},34:{name:"Balones ganados en área rival",weighing:100},35:{name:"Balones ganados en área propia",weighing:100},36:{name:"Faltas cometidas",weighing:100},37:{name:"Faltas recibidas",weighing:100},38:{name:"Tarjetas amarillas",weighing:100},39:{name:"Tarjetas rojas",weighing:100},40:{name:"Atajadas",weighing:100},41:{name:"Tiros de Esquina",weighing:100,bluer:!0},42:{name:"Balones recuperados en cancha rival",weighing:100},43:{name:"Origen de gol",weighing:10}},Cf={player:{"12-55":je[2]},gamesAndTeams:{"12-55":je[2],"54_r-35_r":je[3]}},$i={games:{"607-608":je[1],"12-55":je[2],"54-35":je[3],"14-52":je[4],"15-53":je[5],"466-477":je[6]},team:{"607-608":je[1],"12-55":je[2],"54-35":je[3],"14-52":je[4],"15-53":je[5],"466-477":je[6],"40-257":je[19],39:je[7]},player:{regular:{12:je[2],35:je[3],10:je[8],27:je[9],607:je[1],61:je[43],519:je[10],"98-101-109-112":je[11],"121-122-127-128-135-136-141-142":je[12],"161-170-179":je[13],702:je[14],730:je[15],466:je[6],217:je[16],"211-232-235-239-242-282-284-289-291-296":je[17],"485-486-487-488":je[18],14:je[4],15:je[5],257:je[19]},goalkeeper:{55:je[2],324:je[8],323:je[9],608:je[1],39:je[7],774:je[14],802:je[15],52:je[4],53:je[5],40:je[19],54:je[3]}}},kEe={"2-20":je[20],483:je[21],10:je[22],27:je[23],510:je[24],"537-540-544-547":je[25],328:je[26],"231-280-238-287-406-294":je[27],"13-25":je[28],"98-101-104-105-109-112-115-116":je[29],4:je[30],88:je[31],5:je[32],34:je[33],11:je[34],23:je[35],17:je[36],18:je[37],14:je[38],15:je[39],39:je[40],"31-32":je[41],"225-224":je[42]},nP=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],EEe=1,uv={components:{CarouselFullScreen:TEe,SearchFilters:Lke,VideoSearch:gwe,VideoPlayerControls:Lde,VideoPlayer:_ue,CurrentMatch:Coe,MatchesList:Eoe,GSCPlayerTeamGame:Ede,GscSwitchComponent:ME},props:{section:{type:Boolean,default:!0},componentWidth:{type:Number,default:767,validator(e){return e>0}},backgroundColor:{type:String,default:"#172531"},user:{type:Object,default:()=>({})},userForDiscoverVideos:{type:Object,default:()=>({})},token:{type:String,default:""},isGSUser:{type:Boolean,default:!0},tournamentSelectedId:{type:Number,default:0},seasonSelectedId:{type:Number,default:0},tournamentsForMediaPlayer:{type:[Map],default:()=>new Map},isFromMexico:{type:Boolean,default:!0},gsData:{type:[Object,null],default:null},isFirstRow:{type:Boolean,default:!1},custom:{type:[Object,null],default:null},autoFillVideos:{type:Boolean,default:!1},isPlayerUser:{type:Boolean,default:!1},isGoalkeeper:{type:[Boolean,Number],default:!1},playerId:{type:Number,default:0},isModalMode:{type:Boolean,default:!0},modalInitialData:{type:Object,default:null},isModal:{type:Boolean,default:!1},isGoalsOnly:{type:Boolean,default:!1},nextRivalTeam:{type:Object,default:()=>({team_id:0})}},data(){return{filterToSetUp:null,videojsLocal:null,player:null,lastSearchResult:null,mobileClass:!1,isMobileTabsActive:!1,currentMobileTab:"Estás viendo",currentTabMoreVideos:"Resumen",booleanIsFirstIteration:!0,numberCurrentSeasonId:0,numberLastActionId:0,numberPlayerSpeed:1,numberOptionsMenuTop:0,numberOptionsMenuLeft:0,booleanIsVideoPlayerPlaying:!1,booleanIsOptionsMenuVisible:!1,booleanIsSpeedModalVisible:!1,showModalConfirm:!1,showConfirmPlaylist:!0,showModal:!1,seasonId:0,plays:[],playerQueue:[],playsType:bu[0],playsTypeOptions:bu,playInfo:{},teamsMap:new Map,gamesMap:new Map,roundsMap:new Map,mediaPlayerMode:"games",playerPosition:0,playlistTournament:null,showImage:!1,seasonName:"",playlistSeasonIndex:0,playlistSeasonIndexAux:0,playerModeSelected:1,currentTournament:{seasons:[]},mediaPlayerResizeObserver:null,mediaPlayerWidth:0,mediaPlayerInfoHeight:598,lastMediaPlayerWidth:0,selectedType:1,roundsAndGamesWithPlaysMap:null,gameIdSelected:0,seasonSearchingCount:0,hasPlayerActivityInTournament:!1,isAutoPlay:!1,storeModule:this.isModalMode?"mediaModal":"mediaGeneral",isFirstTypeChange:!0,rivalCategories:[],counterAux:0,useIdsFromAdvancedFilter:!1,maxGameId:0,tournamentsForModalLauncher:new Map,lastGameIdWatched:0,isSomeListSelected:!1,booleanIsModesModalOpen:!1,arrayCategoriesIdsToFilter:null,arrayRivalCategoriesIdsToFilter:null,arrayCategoriesIdsRaw:null,booleanIsFilterApplied:!1,stringModeTitle:"Estas viendo: Goles de la jornada",objectMediaPlayerModeFilters:this.getEmptyMediaPlayerModeFilters(),playSeekerPlays:[],geoOptions:{enableHighAccuracy:!0,timeout:5e3,maximumAge:0},coords:null,concatPlays:!1,currentPlayIndex:0,firstInteractionToken:"",firstInteractionUrl:"https://playseeker-api-fi.golstats.com",userBehaviorUrl:"https://playseeker-api-ub.golstats.com",gamesUrl:"https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?",booleanIsPlaySeekerMode:!1,objectLastDataToFilter:null,objectPlaySeekerLastPlay:null,objectPlaySync:null,isCarouselFullScreenVisible:!1}},computed:{...mC("mediaModal",["currentPlaylistPlays","modalSectionSelected","isModalOpen","playlistGameId"]),...mC("mediaGeneral",["playersMapMyPlaylists","teamsMapMyPlaylists","gamesMapMyPlaylists","maxGameIdMyPlaylists","player","mapMinutesPlayedCategoryNames","playSeekerUserId","playSeekerCurrentSessionId"]),...gC("mediaModal",["currentPlayerQueueByGames"]),...gC("mediaGeneral",["userPlaylistsSeasonIds"]),currentMatch(){return this.currentPlayerQueueByGames&&this.currentPlayerQueueByGames.length&&this.playlistGameId?this.currentPlayerQueueByGames.find(e=>e.id===this.playlistGameId):null},dynamicClasses(){let e=[];return this.isModal&&e.push("modal-class"),this.mediaPlayerWidth>0&&(this.mediaPlayerWidth<=420?e.push("modal-video__420"):this.mediaPlayerWidth<=470&&e.push("modal-video__470"),this.mediaPlayerWidth<=750?e.push("modal-video__750"):this.mediaPlayerWidth<=850?e.push("modal-video__850"):this.mediaPlayerWidth<=1024?e.push("modal-video__1024"):this.mediaPlayerWidth<=1100?e.push("modal-video__1100"):this.mediaPlayerWidth<=1280?e.push("modal-video__1280"):this.mediaPlayerWidth<=1520&&e.push("modal-video__1520")),e},carouselPlayerQueue(){return this.playerQueue?this.playerQueue.filter(e=>e.gameId===this.currentMatch.id):[]},mediaPlayerType(){return"general"},extraCategories(){return[...sSe,...oSe,...mSe,...ySe,...SSe,...kSe,...NSe,...uSe].reduce((e,t)=>(t.categories.forEach(a=>{e.set(a,{id:a,name:this.$t&&t.translationKey&&this.$t(t.translationKey)||t.singleName})}),e),new Map)},isMyPlaylistsActive(){return this.isModalMode&&this.modalSectionSelected===2&&this.isSomeListSelected},modalInitialState(){return this.isModalMode?this.$store.state.mediaModal.modalInitialState:{}},modalSectionSelected(){return this.isModalMode?this.$store.state.mediaModal.modalSectionSelected:{}},playerType(){return this.isModalMode?this.$store.state.mediaModal.playerType:0},advancedFilter(){return this.isModalMode?this.$store.state.mediaModal.advancedFilter:{}},applyAdvancedFilterCounter(){return this.isModalMode?this.$store.state.mediaModal.applyAdvancedFilterCounter:0},selectedSubcategoryIds(){return this.isModalMode?this.$store.state.mediaModal.selectedSubcategoryIds:[]},getSeasonIdOnly(){return this.$store.getters[`${this.storeModule}/getSeasonIdOnly`]},getTeamId(){return this.$store.getters[`${this.storeModule}/getTeamId`]},getPlayerId(){return this.$store.getters[`${this.storeModule}/getPlayerId`]},seasonPlayers(){return this.$store.getters[`${this.storeModule}/seasonPlayers`]},selectedTournament(){return this.$store.getters[`${this.storeModule}/selectedTournament`]},isPlayerGoalkeeper(){return this.$store.getters[`${this.storeModule}/isPlayerGoalkeeper`]},hasPlayerPositionId(){return this.$store.getters[`${this.storeModule}/hasPlayerPositionId`]},playersByTeam(){return this.$store.getters[`${this.storeModule}/playersByTeam`]},tournaments(){return this.$store.state[`${this.storeModule}`].tournaments},seasonID(){return this.$store.state[`${this.storeModule}`].seasonID},playlistIndex(){return this.$store.state[`${this.storeModule}`].playlistIndex},retroSeason(){return this.$store.state[`${this.storeModule}`].retroSeason},objectMediaData(){return this.$store.state[`${this.storeModule}`].objectMediaData},playsSaved(){return this.$store.getters["mediaGeneral/playsSaved"]},summaryData(){return null},isSummaryData(){return!!this.summaryData},profilesSeasonId(){return this.isModalMode?0:this.$store.getters["filterGeneral/getSeasonId"]},currentCategories(){return this.isModalMode?this.modalSectionSelected===1?this.isGoalsOnly?Object.keys(Cf.gamesAndTeams).reduce((e,t)=>(t.split("-").forEach(a=>{e.push(a)}),e),[]):this.modalInitialState?this.modalInitialState.categoryIds&&this.modalInitialState.categoryIds.length?this.modalInitialState.categoryIds:this.getBestCategoriesIds():[]:this.useIdsFromAdvancedFilter?this.selectedSubcategoryIds:this.modalInitialState?this.modalInitialState.categoryIds:[]:this.summaryData?Object.keys(this.summaryData.isTeam?Cf.gamesAndTeams:this.summaryData.positionId===1?$i.player.goalkeeper:$i.player.regular).reduce((e,t)=>(t.split("-").forEach(a=>{e.push(a)}),e),[]):Object.keys(this.user&&this.user.is_player&&this.hasUserPlayerSelectedSeason?this.user.is_goalkeeper?$i.player.goalkeeper:$i.player.regular:Cf.gamesAndTeams).reduce((e,t)=>(t.split("-").forEach(a=>{e.push(a)}),e),[])},allCategories(){const e=new Map,t={...Cf.gamesAndTeams,...kEe};return Object.entries(t).forEach(([a,i])=>{a.split("-").forEach(n=>{e.set(n.includes("_r")?n:Number(n),i)})}),this.setBestCategoriesNames(e),e},queryCategories(){let e="";const t=[];return this.currentCategories.forEach((a,i)=>{let n=typeof a=="string"?a:a.toString(),r=!1;n.includes("_")&&(r=!0,n=Number(n.split("_")[0]),t.push(n)),e+=`${i>0?"&":""}${r?"r":""}categories=${n}`}),this.setRivalCategories(t),e},gamesByRound(){const e={};if(this.roundsAndGamesWithPlaysMap)for(const[t,a]of this.roundsAndGamesWithPlaysMap){const[i,n]=t.split(","),r=Array.from(a.values());r.sort((o,l)=>l.dateTimeMillis-o.dateTimeMillis),e[n]={name:i,games:r}}return e},teams(){return this.teamsMap?Array.from(this.teamsMap.values()):[]},isGoalsActive(){return this.playsType===bu[0]},headerResponsiveClass(){const e=[];return this.mediaPlayerWidth<354?e.push("header--width-354"):this.mediaPlayerWidth<440?e.push("header--width-400"):this.mediaPlayerWidth<541?e.push("header--width-540"):this.mediaPlayerWidth<626?e.push("header--width-626"):this.isFirstRow&&this.mediaPlayerWidth<610&&e.push("header--first-row"),e},playInfoStyle(){return!this.gsData&&this.mediaPlayerWidth<871?{padding:"0 0.5em"}:this.isFirstRow?{"margin-top":"0.3em"}:{}},headerIcon(){return this.custom!=null&&Object.keys(this.custom).length?this.custom.logo:"https://az755631.vo.msecnd.net/content/shieldLogoPc.png"},isUserTournament(){return this.gsData&&this.gsData.tournamentId===this.currentTournament._id},hasUserPlayerSelectedSeason(){return this.user.is_player?this.user.related_seasons.includes(this.numberCurrentSeasonId||this.seasonSelectedId):!1},hasUserTeamSelectedTournament(){return!this.user.is_player&&this.user.team?this.user.related_seasons.includes(this.numberCurrentSeasonId||this.seasonSelectedId):!1}},watch:{isModalOpen(e){e||this.applyObjectMediaData()},seasonSelected(){this.setInitialTitle()},tournamentSelectedId(){this.setInitialTitle()},seasonSelectedId:{handler(e){this.setUpData(e)},immediate:!0},selectedTournament:{deep:!0,handler(e){e&&(this.playlistTournament=e,this.playlistSeasonIndex=0)}},seasonID:{deep:!0,handler(e){e&&(this.playlistSeasonIndexAux=e.index)}},playsType(e){this.isModalMode||this.setPlaysType({mediaPlayerType:this.mediaPlayerType,playsType:e}),this.fetchInfo(!0,this.playlistTournament)},modalSectionSelected(e){e!==1&&(this.isSomeListSelected=!1),[0,1].includes(e)&&(this.playsType!==bu[e]?this.playsType=bu[e]:this.fetchInfo(!0,this.playlistTournament)),this.modalInitialState&&this.modalInitialState.mainSectionType-1===this.modalSectionSelected&&this.checkSeason()},selectedSubcategoryIds(e){e&&e.length&&this.applyAdvancedFilter()},seasonPlayers(e){if(this.getPlayerId&&!this.hasPlayerPositionId){const t=e.get(this.getPlayerId);t&&this.$store.commit(`${this.storeModule}/setPlayer`,t)}},profilesSeasonId:{handler(e){this.setUpData(e)}},tournamentsForMediaPlayer(e){this.seasonSelectedId&&e.size>0&&!this.isModalMode&&this.setUpData(this.seasonSelectedId)},currentPlaylistPlays(e){this.isModalMode&&this.modalSectionSelected===2&&this.setPlaylistPlays(e)},userPlaylistsSeasonIds(e){this.fillMyPlaylistsData(Array.from(e.values()))},seasonId:{immediate:!0,handler(e){this.isModalMode||this.setSeasonId({mediaPlayerType:this.mediaPlayerType,seasonId:e})}},currentCategories:{immediate:!0,handler(e){this.isModalMode||this.setCurrentCategories({mediaPlayerType:this.mediaPlayerType,currentCategories:e})}},selectedType:{immediate:!0,handler(e){this.isModalMode||this.setSelectedType({mediaPlayerType:this.mediaPlayerType,selectedType:e})}},getTeamId:{immediate:!0,handler(e){this.isModalMode||this.setTeamId({mediaPlayerType:this.mediaPlayerType,teamId:e})}},player:{immediate:!0,handler(e){this.isModalMode||this.setModalPlayer({mediaPlayerType:this.mediaPlayerType,player:e})}}},methods:{...fC("mediaModal",["setPlaylistGameId","setPlayerType","setModalInitialState","setIsModalOpen","setIsModalCreatePlayListOpen"]),...fC("mediaGeneral",["setPlayersMapMyPlaylists","setTeamsMapMyPlaylists","setGamesMapMyPlaylists","setMaxGameIdMyPlaylists","setSeasonId","setPlaysType","setCurrentCategories","setSelectedType","setTournamentsForModalLauncher","setTeamId","setModalPlayer","setPlaysToSaveAsFavorites","setPlaySeekerUserId","setPlaySeekerCurrentSessionId"]),applyObjectMediaData(){!this.objectMediaData||this.objectMediaData.booleanAvoidApply||(this.objectMediaData.numberMainSectionType&&this.$store.commit("mediaModal/setModalSectionSelected",this.objectMediaData.numberMainSectionType),this.objectPlaySync=this.objectMediaData.objectPlaySync?{...this.objectMediaData.objectPlaySync,booleanIsApplied:!1}:null,this.stringModeTitle=this.objectMediaData.stringModeTitle,this.playerQueue=[...this.objectMediaData.arrayPlayerQueue],this.$store.commit(`${this.storeModule}/setPlaylistIndex`,{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:this.objectMediaData.numberPlaylistIndex}),this.$store.commit(`${this.storeModule}/setCurrentPlayerQueue`,this.playerQueue),this.playlistSeasonIndex=this.objectMediaData.numberPlaylistSeasonIndex,this.booleanIsPlaySeekerMode=this.objectMediaData.booleanIsPlaySeekerMode,this.booleanIsFilterApplied=this.objectMediaData.booleanIsFilterApplied,this.objectMediaData.objectLastDataToFilter&&this.fillDataToFilterData(this.objectMediaData.objectLastDataToFilter))},setPlaylistPlays(e){const t=this.getFormattedPlays(e,!0);this.generatePlayerQueue(null,t,!0)},formatDate(e){if(e){const t=e.split("-");return`${Number(t[2])} ${nP[Number(t[1])-1]}, ${t[0]}`}},applyAdvancedFilter(){this.useIdsFromAdvancedFilter=!0,this.fetchInfo(!0,this.playlistTournament)},setRivalCategories(e){this.rivalCategories=e},setUpData(e,t=!1){if(!this.isFromMexico&&!this.isGSUser){this.$emit("finish");return}let a=!1;const i=this.tournamentsForMediaPlayer;e||(a=!0,e=this.seasonSelectedId);const n=Number(e);let r=i.get(n);if(this.tournamentsForModalLauncher=i,this.isModalMode||this.setTournamentsForModalLauncher({mediaPlayerType:this.mediaPlayerType,tournamentsForModalLauncher:i}),!r&&this.isModalMode&&this.modalInitialState&&this.modalInitialState.tournamentsLastClashes&&(r=this.modalInitialState.tournamentsLastClashes.get(e)),this.playlistTournament=r,r){if(this.summaryData&&(this.stringModeTitle=this.summaryData.isTeam?"Estas viendo: Resumen equipo":"Estas viendo: Resumen jugador"),this.playlistSeasonIndex=r.seasons.findIndex(o=>o.id===n),this.playlistSeasonIndexAux=this.playlistSeasonIndex,!t&&!this.summaryData)if(this.isPlayerUser){if(this.hasPlayerActivityInTournament=!!this.getPlayerTournamentBySelectedSeason(n,i),this.hasPlayerActivityInTournament){const o={id:Number(this.user.player)};this.isGoalkeeper&&(o.positionId=1),this.seasonSearchingCount=0,this.$store.commit(`${this.storeModule}/setPlayer`,o),this.$store.commit(`${this.storeModule}/setTeam`,this.gsData.teamId),this.onPlayerSelected();return}!this.hasPlayerActivityInTournament&&this.selectedType!==1&&(this.$store.commit(`${this.storeModule}/setPlayer`,null),this.$store.commit(`${this.storeModule}/setTeam`,null))}else if(this.gsData&&this.gsData.tournamentId===this.playlistTournament._id&&this.gsData.teamId){this.seasonSearchingCount=0,this.$store.commit(`${this.storeModule}/setPlayer`,null),this.$store.commit(`${this.storeModule}/setTeam`,this.gsData.teamId),this.onTeamSelected();return}else this.seasonSearchingCount=0,this.$store.commit(`${this.storeModule}/setPlayer`,null),this.$store.commit(`${this.storeModule}/setTeam`,null);this.fillSeasons([r],a)}},setInitialTitle(){!this.summaryData&&!this.booleanIsFilterApplied&&this.hasUserPlayerSelectedSeason?this.stringModeTitle="Estas viendo: Resumen de jugador":!this.summaryData&&!this.booleanIsFilterApplied&&this.hasUserTeamSelectedTournament?this.stringModeTitle="Estas viendo: Resumen de equipo":this.stringModeTitle="Estas viendo: Goles de la jornada"},closeModalConfirm(){this.showModalConfirm=!1},onModalSpeedClose(){this.booleanIsSpeedModalVisible=!1},onClickSpeed(e){this.numberPlayerSpeed=e,this.$refs.videoPlayer.setSpeedToAllPlayers(e),this.booleanIsSpeedModalVisible=!1},confirmModalConfirm(){this.showModalConfirm=!1,this.$refs.videoPlayer.playCurrentVideoPlayer()},openmodal(){this.$refs.videoPlayer.setAutoPlaysCount(0),this.showModal=!0},closeModal(){this.showModal=!1},getBestCategoriesIds(){let e=null;return this.mediaPlayerMode==="player"?this.isPlayerGoalkeeper?e=Object.keys($i.player.goalkeeper):e=Object.keys($i.player.regular):e=Object.keys($i[this.mediaPlayerMode]),e.reduce((t,a)=>(a.split("-").forEach(i=>{t.push(i)}),t),[])},setBestCategoriesNames(e){[...Object.entries($i.player.goalkeeper),...Object.entries($i.player.regular),...Object.entries($i[this.mediaPlayerMode])].forEach(([t,a])=>{t.split("-").forEach(i=>{e.set(Number(i),a)})})},onPlaysTypeClicked(e){this.playsType=e},getPlayTime(e,t){let a="",i=0;switch(e.matchLapse){case 1:a=e.syncStartFirstTime;break;case 2:a=e.syncStartSecondTime,i=45;break;case 3:a=e.syncStartFirstExtraTime,i=90;break;case 4:a=e.syncStartSecondExtraTime,i=105;break;case 5:a=e.syncStartPenals,i=120;break}return(!a||a==="0")&&(a="00:00"),this.getTimeToSeconds(a)+(this.getTimeToSeconds(e[t])-i*60)},getTimeToSeconds(e){const t=e.indexOf(".")>-1?e.substring(0,e.indexOf(".")):e,[a,i,n]=t.split(":").reverse();return(n?Number(n)*60*60:0)+Number(i)*60+Number(a)},getFormattedPlays(e,t=!1,a=null){this.roundsAndGamesWithPlaysMap=new Map,_u=new Map,e.forEach(n=>{const r=n.reduce((u,h,m)=>(u[CEe[m]]=h,u),{});r.playRaw=n;let o=null,l=null,c=null,d=0;if(t?(c=this.teamsMapMyPlaylists,d=this.maxGameIdMyPlaylists,o=this.gamesMapMyPlaylists.get(r.gameId),l=this.playersMapMyPlaylists.get(r.playerId),r.booleanIsFromMyPlaylists=!0):(c=a?a.mapTeams:this.teamsMap,d=a?a.maxGameId:this.maxGameId,o=a?a.mapGames.get(r.gameId):this.gamesMap.get(r.gameId),l=a?a.mapPlayers.get(r.playerId):this.seasonPlayers.get(r.playerId)),l&&o&&r.gameId<=d){const u=`${o.roundName},${o.roundAbbreviation},${o.seasonId}`,h=this.roundsAndGamesWithPlaysMap.get(u);h?h.set(o.id,o):this.roundsAndGamesWithPlaysMap.set(u,new Map().set(o.id,o)),r.game=o,r.game.awayTeam.id===r.teamId?(r.teamName=r.game.awayTeam.name,r.teamAcronym=r.game.awayTeam.acronym,r.rivalName=r.game.homeTeam.name):(r.teamName=r.game.homeTeam.name,r.teamAcronym=r.game.homeTeam.acronym,r.rivalName=r.game.awayTeam.name),r.playingAs=r.teamId===r.game.homeTeam.id?1:2,r.player=l,r.playerTeamLogo=c.get(r.player.teamId).logo,r.rivalTeamLogo=c.get(r.player.teamId===r.game.homeTeam.id?r.game.awayTeam.id:r.game.homeTeam.id).logo,r.startSeconds=this.getPlayTime(r,"startTime"),r.endSeconds=this.getPlayTime(r,"endTime");const m=new Date(r.gameDate),[p,f]=r.gameHour.split(":");m.setHours(p),m.setMinutes(f),r.dateTimeMillis=m.valueOf(),_u.has(r.gameId)?_u.get(r.gameId).plays.push(r):_u.set(r.gameId,{dateTimeMillis:m.valueOf(),plays:[r]})}});const i=Array.from(_u.values());return i.sort((n,r)=>r.dateTimeMillis-n.dateTimeMillis),i.reduce((n,r)=>(r.plays.sort((o,l)=>+`${o.matchLapse}${o.startTime.replace(/:*\.*/g,"")}`-+`${l.matchLapse}${l.startTime.replace(/:*\.*/g,"")}`),n.push(...r.plays),n),[])},generatePlayerQueue(e,t,a=!1,i=0,n){if(!t.length)return;const r=new Map,o=this.modalInitialState?this.modalInitialState.advancedFilter||{}:{};o&&o.fieldSections&&(o.fieldSectors=o.fieldSections.map(d=>Qi[`${d}`]));let l=0,c=0;if(this.lastSearchResult&&t.filter(d=>{const u=d.game.homeTeam.id===this.lastSearchResult.team.id||d.game.awayTeam.id===this.lastSearchResult.team.id;return u&&console.count("valid team"),u}).filter(d=>{const u=!this.lastSearchResult.game||d.gameId===this.lastSearchResult.game.id;return u&&console.count("valid game"),u}).filter(d=>!this.lastSearchResult.player||d.playerId===this.lastSearchResult.player.id),this.$store.commit("mediaGeneral/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:0}),this.playerQueue=t.reduce((d,u)=>{const h=`${u.gameId}-${u.playerId}-${u.startTime}`;let m=!1;if(this.modalInitialState&&this.modalInitialState.playsIds)m=!this.modalInitialState.playsIds.has(u.playId);else if(this.lastSearchResult)u.game.homeTeam.id===this.lastSearchResult.team.id||(u.game.awayTeam.id,this.lastSearchResult.team.id),this.lastSearchResult.team&&(m=u.game.homeTeam.id!==this.lastSearchResult.team.id&&u.game.awayTeam.id!==this.lastSearchResult.team.id),!m&&this.lastSearchResult.game&&(m=u.gameId!==this.lastSearchResult.game.id),!m&&this.lastSearchResult.player&&(m=u.playerId!==this.lastSearchResult.player.id);else if(this.isModalMode&&!a&&!n){this.modalInitialState.lastClashesGameId&&(m=u.gameId!==this.modalInitialState.lastClashesGameId);const y=this.getTeamId||this.modalInitialState.teamId;if(y&&(m=u.game.homeTeam.id!==y&&u.game.awayTeam.id!==y),!m&&this.selectedType===2&&(m=(this.modalInitialState&&this.modalInitialState.playerIds?this.modalInitialState.playerIds[0]:this.getPlayerId)!==u.playerId),!m&&o&&(o.playingAs&&o.playingAs.length&&(m=o.requiresRivalTransform&&o.playingAs.length===1&&u.teamId!==y?o.playingAs.includes(u.playingAs):!o.playingAs.includes(u.playingAs)),!m&&o.timeSections&&o.timeSections.length&&(m=!o.timeSections.includes(u.section)),!m&&o.coordinatePoint&&o.fieldSectors)){const b=vl(u[`x${o.coordinatePoint}`],u[`y${o.coordinatePoint}`])+1;m=!o.fieldSectors.includes(b)}if(!m&&y&&this.modalInitialState.matchResult&&this.modalInitialState.matchResult.length){const b=u.game.gameResult===3?3:u.game.gameResult===1&&y===u.game.homeTeam.id||u.game.gameResult===2&&y===u.game.awayTeam.id?1:2;m=!this.modalInitialState.matchResult.includes(b)}}const p=this.lastSearchResult?this.lastSearchResult.categoryIds:this.arrayCategoriesIdsToFilter||e,f=this.arrayRivalCategoriesIdsToFilter||this.rivalCategories;if(a||(n||!m)&&(p.includes(u.categoryId)||f.includes(u.categoryId)&&(this.booleanIsFilterApplied||!this.getTeamId||u.rivalTeamId===this.getTeamId))&&u.startSeconds!==u.endSeconds){const y=r.get(h);let b=this.modalInitialState&&this.modalInitialState.mainSectionType===this.modalSectionSelected+1&&this.modalInitialState.categorySingleName&&!this.modalInitialState.avoidCategorySingleName&&![35,54].includes(u.categoryId)?{name:this.modalInitialState.categorySingleName}:this.allCategories.get(u.categoryId)||this.allCategories.get(`${u.categoryId}_r`)||this.extraCategories.get(u.categoryId)||this.extraCategories.get(`${u.categoryId}_r`);this.modalInitialState&&this.modalInitialState.avoidCategorySingleName?b={name:this.modalInitialState.categorySingleName,weighing:1}:this.isModalMode&&u.categoryId===33&&(b={name:"Fuera de lugar",weighing:1});let E="";b||(E=this.mapMinutesPlayedCategoryNames.get(u.categoryId),E?b={name:E,weighing:1}:!b&&o&&(b={name:o.playListTitle,weighing:100})),b||(b=this.allCategories.get(u.categoryId)||this.allCategories.get(`${u.categoryId}_r`)||this.extraCategories.get(u.categoryId)||this.extraCategories.get(`${u.categoryId}_r`)),c||(this.lastGameIdWatched===u.gameId&&(c=l),l++),y?(b.weighing<y.mainCategory.weighing&&(y.mainCategory=b),y.categoriesNames.add(b.name)):(u.isSaved=this.playsSaved.has(u.playId),u.mainCategory=b,u.categoriesNames=new Set,u.categoriesNames.add(b.name),r.set(h,u),d.push(u))}return d},[]),this.lastSearchResult=null,this.showImage=!1,this.isModalMode){if(a)this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:0});else if(this.playerQueue.length)if(n&&this.objectMediaPlayerModeFilters.objectGameSelected){const d=this.playerQueue.findIndex(u=>this.objectMediaPlayerModeFilters.objectGameSelected.game_id===u.game.id);d!==-1&&this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:d})}else if(this.selectedType===1&&c)this.$store.commit("mediaGeneral/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:c});else if(this.modalInitialState&&!this.modalInitialState.lastClashesGameId&&this.modalInitialState.gameIds){const d=this.playerQueue.findIndex(u=>this.modalInitialState.gameIds.includes(u.game.id));d!==-1?this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:d}):this.playerQueue=[]}else if(this.modalInitialState&&this.modalInitialState.playData&&this.modalInitialState.playData.playId){const d=this.playerQueue.findIndex(u=>u.playId===this.modalInitialState.playData.playId);d!==-1&&this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:d})}else this.modalInitialState&&this.modalInitialState.currentPlayIndex?this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:this.modalInitialState.currentPlayIndex}):this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:i});this.$store.commit(`${this.storeModule}/setCurrentPlayerQueue`,this.playerQueue)}this.playerQueue.length||this.emptyListDecision(),this.booleanIsFirstIteration&&(this.booleanIsFirstIteration=!1,this.$emit("finish"))},emptyListDecision(){this.summaryData&&this.summaryData.isTeam&&this.playsType===this.playsTypeOptions[0]?this.playsType=this.playsTypeOptions[1]:!this.summaryData&&!this.isModalMode&&this.onTypeChanged(1)},getGeneralName(e){return e.split(" ").reduce((t,a,i)=>{if(i===0)if(a.includes("."))t.push(a);else{const n=a.toLowerCase().split("");n[0]=n[0].toUpperCase(),t.push(n.join(""))}else t.push(a.toLowerCase());return t},[]).join(" ")},getSingleName(e){return e.split(" ").reduce((t,a)=>{let i=a;return a.endsWith("ciones")?i=a.replace("ciones","ción"):a.endsWith("nales")?i=a.replace("nales","nal"):a.endsWith("vocan")?i=a.replace("vocan","voca"):a.endsWith("lones")?i=a.replace("lones","lón"):a.endsWith("oles")?i=a.replace("oles","ol"):(a.endsWith("os")||a.endsWith("as")||a.endsWith("es"))&&(i=a.slice(0,a.length-1)),t.push(i),t},[]).join(" ")},getCategoryFormat(e=""){const t=this.getGeneralName(e);return this.getSingleName(t)},getPlayerTournamentBySelectedSeason(e,t){const a=this.user.related_seasons.reduce((n,r)=>{const o=t.get(r);return o&&n.push(o._id),n},[]),i=t.get(e);return a.includes(i._id)?i:null},changeTournament(e){},changeSeason(e){},getFilteredPlays(e){return e.reduce((t,a)=>{if(this.objectMediaPlayerModeFilters.objectFilters.numberActionId>1){let i=!0;if(i&&this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs&&([3,4].includes(this.actionId)?i=!(this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.booleanRequiresRivalTransform&&this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs.length===1?a.teamId!==this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.numberTeamId?this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs.includes(a.playingAs):!this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs.includes(a.playingAs):!this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs.includes(a.playingAs)):i=this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs.includes(a.playingAs)),i&&this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayTimeSections&&(i=this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayTimeSections.includes(a.section)),i&&this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.coordinatePoint&&this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayFieldSections){const n=`${vl(a[`x${this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.coordinatePoint}`],a[`y${this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.coordinatePoint}`])+1}`,r=Qi[n],o=this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.requiresRivalTransform&&this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arraySelectedSubcategoryIds.includes(`${a.categoryId}_r`)?Qi[`${yu[n]}`]:r;i=!!this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayFieldSections.find(l=>l.num===o&&l.status)}i&&t.push(a)}else t.push(a);return t},[])},async fillSeasonPlayers(e){try{const t=await this.$store.dispatch("mediaGeneral/getPlayersBySeasons",{seasonId:e.id,returnData:!0});e.mapPlayers=new Map,e.mapPlayersByTeam=t.reduce((a,i)=>{e.mapPlayers.set(i.player_id,{id:i.player_id,name:i.player_name,shortName:i.shortName,photo:i.player_photo,teamId:i.team_id,positionId:i.position_id});const n=a.get(i.team_id);return n?n.push(i):a.set(i.team_id,[i]),a},new Map)}catch(t){throw new Error(t)}},async fillMatchDaysAndGamesV2(e){try{const{seasonsAndGames:t,seasonsAndTeams:a}=await this.fetchSeasonsGamesAndTeamsV2([e.id,...e.related_seasons.map(o=>o.id)],3),i=a.find(o=>o._id===e.id);e.arrayTeams=[],e.mapTeams=new Map;const n=i.teams.reduce((o,l)=>(e.arrayTeams.push(l),e.mapTeams.set(l.team_id,{name:l.colloquial_name,acronym:l.acronym,logo:l.logo,id:l.team_id}),o.set(l.team_id,l),o),new Map);e.mapGames=new Map,e.mapGamesByTeam=new Map;const r=Array.from(t.reduce((o,l)=>(l.games.forEach(c=>{if(c.game_status===1&&c.has_video){(!e.maxGameId||c.game_id>e.maxGameId)&&(e.maxGameId=c.game_id);let d=c.matchday_abbreviation.replace("M","J"),u=c.matchday_abbreviation.replace("M","Jornada ");const h=c.matchday_abbreviation.replace("M","");l.season_type===0?this.objectMediaPlayerModeFilters.objectTournamentSelected.id===33&&(c.seasonId===881?(d=w6[h]||d,u=S6[h]||u):(d=Cm[c.matchday_abbreviation]?c.matchday_abbreviation:d,u=Cm[c.matchday_abbreviation]||u,d==="FINAL"&&(d="F"))):l.season_type===1?(d=v6[c.matchday_abbreviation],u=d):c.matchday_id===182?(d="PI1",u="Play In 1"):c.matchday_id===183?(d="PI2",u="Play In 2"):(d=c.matchday_abbreviation.replace("PO","R"),u="Repechaje"),c.roundAbbreviation=d,c.roundName=u,e.mapGames.set(c.game_id,{id:c.game_id,date:c.date,dateTimeMillis:new Date(c.date_time_utc).valueOf(),homeTeam:e.mapTeams.get(c.home_team),awayTeam:e.mapTeams.get(c.visiting_team),roundAbbreviation:c.roundAbbreviation,roundName:c.roundName,score:c.score,gameResult:c.score[0]>c.score[1]?1:c.score[0]<c.score[1]?2:3,seasonId:l.season_id});const m=o.get(c.roundAbbreviation);c.numberDateTimeMillis=new Date(c.date_time_utc).getTime(),c.homeTeam=n.get(c.home_team),c.awayTeam=n.get(c.visiting_team);const p=e.mapGamesByTeam.get(c.home_team),f=e.mapGamesByTeam.get(c.visiting_team);p?p.push(c):e.mapGamesByTeam.set(c.home_team,[c]),f?f.push(c):e.mapGamesByTeam.set(c.visiting_team,[c]),m?m.arrayGames.push(c):o.set(c.roundAbbreviation,{stringMatchDayAbbreviation:c.roundAbbreviation,stringMatchDayName:c.roundName,arrayGames:[c]})}}),o),new Map).values());r.reverse(),r.forEach(o=>{o.arrayGames.sort((l,c)=>l.numberDateTimeMillis-c.numberDateTimeMillis)}),e.arrayMatchDays=r,this.objectMatchDaySelected=r[0]||{}}catch(t){throw new Error(t)}},async fetchSeasonsGamesAndTeamsV2(e,t,a=""){let i=a;try{i||(i=this.gamesUrl,e.forEach((o,l)=>{i+=`${l===0?"":"&"}seasons=${o}`}));const{data:{data:n,teams:r}}=await Ei.get(i);return{seasonsAndGames:n,seasonsAndTeams:r}}catch(n){if(t>0)return this.fetchSeasonsGamesAndTeamsV2(e,t-1,i);throw new Error(n)}},async fillNextSeasonPlays(){try{this.showImage=!0,this.playlistSeasonIndex++,this.seasonName=this.objectMediaPlayerModeFilters.objectTournamentSelected.arraySeasons[this.playlistSeasonIndex].name,this.playlistSeasonIndex>this.objectMediaPlayerModeFilters.objectTournamentSelected.arraySeasons.length-1&&(this.playlistSeasonIndex=0);const e=this.objectMediaPlayerModeFilters.objectTournamentSelected.arraySeasons[this.playlistSeasonIndex];e.arrayMatchDays||(await this.fillMatchDaysAndGamesV2(e),await this.fillSeasonPlayers(e));const t=await this.fetchPlays(e.id,this.objectMediaPlayerModeFilters.stringQueryCategoryIds,this.objectMediaPlayerModeFilters.stringQueryParams),a=this.getFormattedPlays(t,!1,e),i=this.getFilteredPlays(a);this.generatePlayerQueue(null,i,!1,0,!0)}catch(e){throw new Error(e)}},onPlaylistEnded(){this.booleanIsPlaySeekerMode||(this.isMyPlaylistsActive?this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:0}):this.booleanIsFilterApplied?this.fillNextSeasonPlays():(this.playlistSeasonIndex++,this.playlistSeasonIndex>this.playlistTournament.seasons.length-1&&(this.playlistSeasonIndex=0),this.seasonName=this.playlistTournament.seasons[this.playlistSeasonIndex].name,this.showImage=!0,setTimeout(()=>{this.fetchInfo(!1,this.playlistTournament)},4e3)))},onFullScreenChange(){this.isCarouselFullScreenVisible=!0},onTypeChanged(e=1){if((e!==this.selectedType||this.isModalMode)&&(this.isModalMode&&this.setPlayerType(e),this.selectedType!==e||this.isModalMode&&e===1)){if(this.selectedType=e,this.selectedType===2){this.mediaPlayerMode="player";const t=this.summaryData?{id:this.summaryData.id}:this.isModalMode?this.isFirstTypeChange?this.modalInitialState&&this.modalInitialState.goalkeeperIds?{id:this.modalInitialState.goalkeeperIds[0],positionId:1}:{id:this.modalInitialState.playerIds[0]}:this.playInfo.player:this.isUserTournament?null:this.playInfo.player;this.$store.commit(`${this.storeModule}/setPlayer`,t),this.$store.commit(`${this.storeModule}/setTeam`,this.isModalMode?this.playInfo.teamId:this.isUserTournament?this.gsData.teamId:this.playInfo.teamId),this.onPlayerSelected()}else if(this.selectedType===3){this.mediaPlayerMode="team";const t=this.summaryData?this.summaryData.id:this.isModalMode?this.isFirstTypeChange?this.modalInitialState&&this.modalInitialState.teamId:this.playInfo.teamId:this.hasPlayerActivityInTournament||this.isUserTournament?this.gsData.teamId:this.playInfo.teamId;this.$store.commit(`${this.storeModule}/setPlayer`,null),this.$store.commit(`${this.storeModule}/setTeam`,t),this.onTeamSelected()}else this.selectedType===1&&(this.mediaPlayerMode="games",this.$store.commit(`${this.storeModule}/setPlayer`,null),this.$store.commit(`${this.storeModule}/setTeam`,null),this.checkSeason());e!==0&&(this.isFirstTypeChange=!1)}},onMaxInactivityReached(){this.showModalConfirm=!0},checkSeason(){this.gsData||(this.playlistSeasonIndex=this.playlistSeasonIndexAux);const e=this.getSeasonIdOnly===this.seasonId;this.fetchInfo(e,this.playlistTournament)},onPlayerSelected(){this.mediaPlayerMode="player",this.checkSeason()},onTeamSelected(){this.mediaPlayerMode="team",this.checkSeason()},onGameIdSelected(e){this.gameIdSelected=e},onPlaying(){this.isAutoPlay=!0},onPlayChanged(e){if(this.lastGameIdWatched=e.gameId,e.isPlaySeeker)this.playInfo=e,this.objectPlaySeekerLastPlay={playListId:e.payloadData.playlist_id,groupPlayListId:e.payloadData.group_playlist_id,groupId:e.payloadData.group_id,playIndex:e.payloadData.play_number-1},window.localStorage.setItem("playSeekerLastPlay",JSON.stringify(this.objectPlaySeekerLastPlay));else if(e.booleanIsFullGame)this.playInfo={playId:e.playId,booleanIsFullGame:!0,homeTeamLogo:e.objectGame.homeTeam.logo,homeTeamName:e.objectGame.homeTeam.colloquial_name,awayTeamLogo:e.objectGame.awayTeam.logo,awayTeamName:e.objectGame.awayTeam.colloquial_name,arrayScore:e.objectGame.score,gameId:e.gameId,seasonId:e.objectGame.season_id,teamLogo:e.playerTeamLogo,playerLogo:e.player.photo,dateTimeMillis:new Date(e.objectGame.date_time_utc).getTime()};else if(this.summaryData)this.playInfo={playId:e.playId,homeTeamLogo:e.game.homeTeam.logo,homeTeamName:e.game.homeTeam.colloquial_name||e.game.homeTeam.name,awayTeamLogo:e.game.awayTeam.logo,awayTeamName:e.game.awayTeam.colloquial_name||e.game.awayTeam.name,arrayScore:e.game.score,gameId:e.gameId,seasonId:e.seasonId,mainCategoryName:C0(e.mainCategory.name),playerShortName:e.player.shortName,dateTimeMillis:e.dateTimeMillis,playRaw:e.playRaw,startSeconds:e.startSeconds,endSeconds:e.endSeconds};else{if(this.isModalMode){this.setPlaylistGameId(e.game.id);const t=this.playerType===2?e.player.shortName:this.playerType===3?this.modalInitialState&&this.modalInitialState.isRivalSubject&&this.modalInitialState.mainSectionType===this.modalSectionSelected+1?[35,54].includes(e.categoryId)?e.teamname:e.rivalName:[35,54].includes(e.categoryId)?e.rivalName:e.teamName:"";this.$emit("subject-change",t?` - ${t}`:"")}this.playInfo={playId:e.playId,date:e.gameDate,dateTimeMillis:e.dateTimeMillis,arrayScore:e.game.score,objectHomeTeam:e.game.homeTeam,objectAwayTeam:e.game.awayTeam,playerId:e.player.id,playerName:e.player.name,playerShortName:e.player.shortName,playCategory:e.categoryName,teams:`${e.game.homeTeam.name} vs ${e.game.awayTeam.name}`,playerPhoto:e.player.photo,teamLogo:e.playerTeamLogo,rivalLogo:e.rivalTeamLogo,teamId:e.teamId,categoryId:e.categoryId,jersey:e.jersey,mainCategoryName:C0(e.mainCategory.name||e.stringMainCategoryName||""),categoriesNames:Array.from(e.categoriesNames.values()).reduce((t,a,i)=>(t+=`${i===0?"":", "}${a}`,t),""),gameId:e.game.id,roundAbbreviation:e.game.roundAbbreviation,player:e.player,asLocal:e.game.homeTeam.id===e.teamId,momentOfPlay:e.momentOfPlay,seasonId:e.seasonId,playRaw:e.playRaw,startSeconds:e.startSeconds,endSeconds:e.endSeconds,booleanIsFromMyPlaylists:e.booleanIsFromMyPlaylists,tvStations:e.game.tvStations}}},async fetchPlays(e=null,t=null,a=null){try{this.lastGameIdWatched=0;let i="";if(a===null){const r=this.modalInitialState&&this.modalInitialState.playerIds&&this.modalInitialState.playerIds.length;this.modalInitialState.isFeaturedPlayers?(this.modalInitialState.playerIds.forEach(o=>{i+=`&player=${o}`}),this.modalInitialState.isFeaturedPlayers=!1):this.getPlayerId?(this.hasUserPlayerSelectedSeason&&this.getPlayerId===this.user.player||!this.user.is_player)&&(i+=`&player=${this.getPlayerId}`):r?this.modalInitialState.playerIds.forEach(o=>{i+=`&player=${o}`}):(this.getTeamId||this.modalInitialState.teamId)&&(i+=`&team=${this.getTeamId||this.modalInitialState.teamId}`),this.modalInitialState&&this.modalInitialState.isPost&&(i+="&isPost=1")}const n=await Ei.get(`https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/videos/plays/seasons/${e||this.seasonId}?${t||this.queryCategories}${a||i}`);if(n.data&&n.data.plays){const r=[...n.data.plays];return n.data.plays_rival?r.concat(n.data.plays_rival):r}return[]}catch(i){throw new Error(i)}},async fetchInfo(e,t){try{if(!t)return;let a=this.playlistSeasonIndex;this.playlistTournament=t,this.seasonId=t.seasons[a].id;let i=null,n=null;this.lastSearchResult&&(i="",this.lastSearchResult.player?i+=`&player=${this.lastSearchResult.player.id}`:this.lastSearchResult.team&&(i+=`&team=${this.lastSearchResult.team.id}`),n=this.lastSearchResult.categoryIds.reduce((d,u,h)=>(d+=`${h>0?"&":""}categories=${u}`,d),""));const r=[this.fetchPlays(null,n,i)];if(!e&&t.seasons[a]){const d=[this.seasonId];t.seasons[a].related_seasons&&t.seasons[a].related_seasons.length&&d.push(...t.seasons[a].related_seasons.map(u=>u.id)),r.push(this.$store.dispatch(`${this.storeModule}/fetchSeasonsGamesAndTeams`,{seasons:d})),r.push(this.$store.dispatch(`${this.storeModule}/getPlayersBySeasons`,{seasonId:this.seasonId}))}const[o,l]=await Promise.all(r);if(this.plays=o||[],this.hasPlayerActivityInTournament&&!this.plays.length)if(this.playlistSeasonIndex<this.playlistTournament.seasons.length-1&&this.seasonSearchingCount<1)this.playlistSeasonIndex++,this.seasonSearchingCount++,await this.fetchInfo(!1,t);else return;e||this.formatGamesAndTeams(l);const c=this.getFormattedPlays(this.plays);this.generatePlayerQueue(this.currentCategories.reduce((d,u)=>(typeof u=="string"&&u.includes("_")||d.push(Number(u)),d),[]),c),this.showImage=!1}catch(a){throw new Error(a)}},async fillSeasons(e,t=!1){try{if(e){let a=null;if(this.autoFillVideos?a=e.find(i=>i._id===1):a=e[0],a){if(this.currentTournament=a,this.isModalMode&&!t&&!this.lastSearchResult)return;await this.fetchInfo(!1,this.currentTournament)}}}catch(a){throw new Error(a)}},async fillMyPlaylistsData(e){if(e.length){const t=[this.$store.dispatch("mediaGeneral/fetchSeasonsGamesAndTeams",{seasons:e})];e.forEach(r=>{t.push(this.$store.dispatch("mediaGeneral/getPlayersBySeasons",{seasonId:r,returnData:!0}))});const a=await Promise.all(t),i=a.shift();this.formatGamesAndTeamsForMyPlaylists(i);const n=a.reduce((r,o)=>(o.forEach(l=>{r.set(l.player_id,{id:l.player_id,name:l.player_name,shortName:l.shortName,photo:l.player_photo,teamId:l.team_id,positionId:l.position_id})}),r),new Map);this.setPlayersMapMyPlaylists(n)}},getBestPlaysCategoriesIds(){return Object.keys($i[this.mediaPlayerMode]).reduce((e,t)=>(t.split("-").forEach(a=>{e.push(Number(a))}),e),[])},setUpMediaGeneralData(){const{objectCurrentPlay:e,numberCurrentTime:t}=this.$refs.videoPlayer.getCurrentPlayerPlayInfo(),a={numberPlayId:e.playId,numberCurrentTime:t},i={arrayPlayerQueue:[...this.playerQueue],stringModeTitle:this.stringModeTitle,numberPlaylistIndex:this.playlistIndex,numberPlaylistSeasonIndex:this.playlistSeasonIndex,booleanIsFilterApplied:this.booleanIsFilterApplied,booleanIsPlaySeekerMode:this.booleanIsPlaySeekerMode,booleanAvoidApply:this.isModalMode&&this.modalInitialState&&this.modalInitialState.avoidApply&&!this.booleanIsFilterApplied,objectPlaySync:a};this.booleanIsFilterApplied&&(i.objectLastDataToFilter=this.objectLastDataToFilter),this.$store.commit("mediaGeneral/setObjectMediaData",i)},formatGamesAndTeams(e){this.roundsMap=new Map,this.teamsMap=e.seasonsAndTeams.reduce((t,a)=>(a&&a.teams.forEach(i=>{t.has(i.team_id)||t.set(i.team_id,{name:i.colloquial_name,acronym:i.acronym,logo:i.logo,id:i.team_id,players:this.playersByTeam.get(i.team_id)})}),t),new Map),this.gamesMap=e.seasonsAndGames.reduce((t,a)=>{const i=!!(this.currentTournament&&this.currentTournament.tournament&&this.currentTournament.tournament.tournament_type);return a.games.forEach(n=>{n.seasonType=a.season_type,n.seasonId=a.season_id,n.game_id>this.maxGameId&&(this.maxGameId=n.game_id);let r=n.matchday_abbreviation.replace("M","J"),o=n.matchday_abbreviation.replace("M","Jornada ");const l=n.matchday_abbreviation.replace("M","");n.seasonType===0?i&&(n.seasonId===881?(r=w6[l]||r,o=S6[l]||o):(r=Cm[n.matchday_abbreviation]?n.matchday_abbreviation:r,o=Cm[n.matchday_abbreviation]||o,r==="FINAL"&&(r="F"))):n.seasonType===1?(r=v6[n.matchday_abbreviation],o=r):n.matchday_id===182?(r="PI1",o="Play In 1"):n.matchday_id===183?(r="PI2",o="Play In 2"):(r=n.matchday_abbreviation.replace("PO","R"),o="Repechaje"),n.roundAbbreviation=r,n.roundName=o;const c=n.date.split("-"),d={id:n.game_id,date:n.date,dateTimeMillis:new Date(n.date_time_utc).valueOf(),homeTeam:this.teamsMap.get(n.home_team),awayTeam:this.teamsMap.get(n.visiting_team),roundAbbreviation:n.roundAbbreviation,roundName:n.roundName,score:n.score,gameResult:n.score[0]>n.score[1]?1:n.score[0]<n.score[1]?2:3,seasonId:a.season_id,dateFormatted:`${Number(c[2])} ${nP[Number(c[1])-1]}, ${c[0]}`,tvStations:n.tv_stations?n.tv_stations.join(", "):null},u=this.roundsMap.get(n.roundAbbreviation);u?u.push(d):this.roundsMap.set(n.roundAbbreviation,[d]),t.has(n.game_id)||t.set(n.game_id,d)}),t},new Map)},formatGamesAndTeamsForMyPlaylists(e){const t=e.seasonsAndTeams.reduce((n,r)=>(r&&r.teams.forEach(o=>{n.has(o.team_id)||n.set(o.team_id,{name:o.colloquial_name,acronym:o.acronym,logo:o.logo,id:o.team_id,players:this.playersByTeam.get(o.team_id)})}),n),new Map);let a=0;const i=e.seasonsAndGames.reduce((n,r)=>(r.games.forEach(o=>{o.seasonType=r.season_type,o.seasonId=r.season_id,o.game_id>a&&(a=o.game_id);const l={id:o.game_id,date:o.date,dateTimeMillis:new Date(o.date_time_utc).valueOf(),homeTeam:t.get(o.home_team),awayTeam:t.get(o.visiting_team),roundAbbreviation:o.matchday_abbreviation,roundName:o.matchday_abbreviation.replace("M","MatchDay "),score:o.score,gameResult:o.score[0]>o.score[1]?1:o.score[0]<o.score[1]?2:3,seasonId:r.season_id};n.has(o.game_id)||n.set(o.game_id,l)}),n),new Map);this.setTeamsMapMyPlaylists(t),this.setGamesMapMyPlaylists(i),this.setMaxGameIdMyPlaylists(a)},onPlayerModeClicked(e){this.playerModeSelected=e},onClickModalLauncher(e=1){const{objectCurrentPlay:t,numberCurrentTime:a}=this.$refs.videoPlayer.getCurrentPlayerPlayInfo(),i={numberPlayId:t.playId,numberCurrentTime:a};this.$refs.videoPlayer.pausePlayers();let n=null;if(!e&&this.booleanIsFilterApplied||this.objectMediaPlayerModeFilters.objectSeasonSelected||this.booleanIsPlaySeekerMode||this.booleanIsFilterApplied){const r={arrayPlayerQueue:[...this.playerQueue],stringModeTitle:this.stringModeTitle,numberPlaylistIndex:this.playlistIndex,numberPlaylistSeasonIndex:this.playlistSeasonIndex,booleanIsPlaySeekerMode:this.booleanIsPlaySeekerMode,numberMainSectionType:e,objectPlaySync:i};r.booleanIsFilterApplied=this.booleanIsFilterApplied,this.booleanIsFilterApplied&&(r.objectLastDataToFilter=this.objectLastDataToFilter),this.$store.commit("mediaModal/setModalInitialState",null),this.$store.commit("mediaModal/setObjectMediaData",r)}else n={seasonId:this.seasonId,tournaments:this.tournamentsForModalLauncher,categoryIds:[...this.currentCategories],mainSectionType:e,matchResult:[1,2,3],currentPlayIndex:this.playlistIndex,objectPlaySync:i},this.getPlayerId?this.isPlayerGoalkeeper?n.goalkeeperIds=[this.getPlayerId]:n.playerIds=[this.getPlayerId]:this.getTeamId&&(n.teamId=this.getTeamId),this.$store.commit("mediaModal/setObjectMediaData",null),this.$store.commit("mediaModal/setModalInitialState",n);this.$store.commit("mediaModal/setIsModalOpen",!0)},setUpResizeObserver(){if(window.ResizeObserver)this.mediaPlayerResizeObserver=new window.ResizeObserver(()=>{this.mediaPlayerWidth=this.$refs.mediaPlayer.clientWidth,this.mediaPlayerInfoHeight=this.$refs.mediaContainerInfo.clientHeight,this.mediaPlayerWidth<=1024?this.mobileClass=!0:this.mobileClass=!1,this.mediaPlayerWidth<=750?this.isMobileTabsActive=!0:(this.isMobileTabsActive=!1,this.currentMobileTab="Estás viendo")}),this.mediaPlayerResizeObserver.observe(this.$refs.mediaPlayer),this.mediaPlayerResizeObserver.observe(this.$refs.mediaContainerInfo);else throw new Error("Resize observer not supported!")},onClickMyPlaylists(){this.isModalMode?this.$store.commit("mediaModal/setModalSectionSelected",2):this.onClickModalLauncher(2)},getEmptyMediaPlayerModeFilters(){return{objectTournamentSelected:null,objectSeasonSelected:null,stringQueryCategoryIds:"",stringQueryParams:"",objectFilters:{numberActionId:0,numberMediaPlayerType:null,objectCategorySelected:null,objectAdvancedFilters:{numberTeamId:null,numberPlayerId:null,arraySelectedSubcategoryIds:[],booleanRequiresRivalTransform:!1,numberCoordinatePoint:2,arrayPlayingAs:[],arrayTimeSections:[],arrayFieldSections:[]}}}},fillDataToFilterData(e){this.objectLastDataToFilter=e,this.arrayCategoriesIdsToFilter=e.arrayCategoriesIds,this.arrayRivalCategoriesIdsToFilter=e.arrayRivalCategoriesIds,this.arrayCategoriesIdsRaw=e.arrayCategoriesIdsRaw,this.objectMediaPlayerModeFilters.stringQueryCategoryIds=e.stringQueryCategoryIds,this.objectMediaPlayerModeFilters.stringQueryParams=e.stringQueryParams,this.objectMediaPlayerModeFilters.objectTournamentSelected=e.objectTournamentSelected,this.objectMediaPlayerModeFilters.objectSeasonSelected=e.objectSeasonSelected,this.objectMediaPlayerModeFilters.objectGameSelected=e.objectGameSelected,this.objectMediaPlayerModeFilters.objectFilters.numberMediaPlayerType=e.objectFilters.numberMediaPlayerType,this.objectMediaPlayerModeFilters.objectFilters.objectCategorySelected=e.objectFilters.objectCategorySelected,this.objectMediaPlayerModeFilters.objectFilters.numberActionId=e.objectFilters.numberActionId,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.numberTeamId=e.objectFilters.objectAdvancedFilters.numberTeamId,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.numberPlayerId=e.objectFilters.objectAdvancedFilters.numberPlayerId,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.booleanIsPlayerGoalKeeper=e.objectFilters.objectAdvancedFilters.booleanIsPlayerGoalKeeper,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arraySelectedSubcategoryIds=e.objectFilters.objectAdvancedFilters.arraySelectedSubcategoryIds,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.booleanRequiresRivalTransform=e.objectFilters.objectAdvancedFilters.booleanRequiresRivalTransform,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.numberCoordinatePoint=e.objectFilters.objectAdvancedFilters.numberCoordinatePoint,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs=e.objectFilters.objectAdvancedFilters.arrayPlayingAs,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayTimeSections=e.objectFilters.objectAdvancedFilters.arrayTimeSections,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayFieldSections=e.objectFilters.objectAdvancedFilters.arrayFieldSections,this.selectedType=e.numberSelectedType},onApplyFilters(e){this.stringModeTitle=`Estas viendo: ${e.stringControlsTitle}`,this.booleanIsPlaySeekerMode=!1,this.booleanIsFilterApplied=!0,this.fillDataToFilterData(e),this.playlistSeasonIndex=e.objectTournamentSelected.numberSeasonSelectedIndex,this.generatePlayerQueue(null,e.arrayFormattedPlays,!1,e.numberPlaylistIndex,!0)},onClickOptions(e){this.booleanIsOptionsMenuVisible=!0,this.numberOptionsMenuTop=e.numberY,this.numberOptionsMenuLeft=e.numberX},onClickOpenModes(){this.$refs.videoPlayer.pausePlayers(),this.booleanIsModesModalOpen=!0},onClickFullGame(e){this.booleanIsPlaySeekerMode=!1,this.booleanIsFilterApplied=!0;const t=e.arrayMatchDayGames.findIndex(a=>a.game_id===e.objectGame.game_id);t!==-1&&(this.stringModeTitle=`Estas viendo: ${e.stringControlsTitle}`,this.booleanIsPlaySeekerMode=!1,this.playerQueue=e.arrayMatchDayGames.map(a=>(a.homeTeam.name=a.homeTeam.colloquial_name,a.awayTeam.name=a.awayTeam.colloquial_name,{booleanIsFullGame:!0,objectGame:a,gameId:a.game_id,startSeconds:0,endSeconds:null})),this.$store.commit(`${this.storeModule}/setPlaylistIndex`,{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:t}),this.$store.commit(`${this.storeModule}/setCurrentPlayerQueue`,this.playerQueue))},onModesModalClose(){this.booleanIsModesModalOpen=!1,this.onClickSpeed(1)},onClickMode(){this.$refs.videoPlayer.setSpeedToAllPlayers(1)},onClickSurpriseMe(){this.booleanIsFilterApplied=!1,this.booleanIsPlaySeekerMode=!0,this.fillPlaySeekerPlays()},getPlaySeekerCategoryName(e){if(e.categoryId===33)return"Fuera de lugar";if([35,54].includes(e.categoryId))return"Auto gol";{const t=this.allCategories.get(e.categoryId)||this.allCategories.get(`${e.categoryId}_r`)||this.extraCategories.get(e.categoryId)||this.extraCategories.get(`${e.categoryId}_r`);return t?t.name:"S/N"}},async setUpTokens(){try{const e=await(await fetch(`${this.firstInteractionUrl}/token`,{method:"POST",mode:"cors",headers:{Authorization:"Basic bXN1c2VyQWRtaW46bXN1c2VycGFzc3dvcmRBZG1pbg=="},referrerPolicy:"no-referrer"})).json();this.firstInteractionToken=e.token}catch(e){throw new Error(e)}},async fillPlaySeekerPlays(){try{if(this.stringModeTitle="Sorpréndeme",this.booleanIsPlaySeekerMode){const e=await(await fetch(`${this.firstInteractionUrl}/firstInteraction/${EEe}/${this.user.username}/playlist`,{method:"GET",headers:{Authorization:`Bearer ${this.firstInteractionToken}`},referrerPolicy:"no-referrer"})).json();e&&(this.setPlaySeekerUserId(e.user_id),this.setPlaySeekerCurrentSessionId(this.getPlaySeekerSessionId(this.playSeekerUserId)),this.$emit("change-user-id",this.playSeekerUserId),window.localStorage.setItem("playSeekerUserId",this.playSeekerUserId),this.formatPlaySeekerPlays(e))}}catch(e){throw new Error(e)}},formatPlaySeekerPlays(e){let t=[];e&&e.playlist&&e.playlist.length&&(t=e.playlist.reduce((i,n,r)=>{const o={...Object.entries(Zi).reduce((h,[m,p])=>(h[m]=n[p],h),{}),isPlaySeeker:!0,startSeconds:n[Zi.startTime],endSeconds:n[Zi.endTime],totalSeconds:Math.floor(n[Zi.endTime]-n[Zi.startTime]),payloadData:{play_id:n[Zi.playId],total_plays:e.total_plays,play_number:r+1,group_playlist_id:e.group_playlist_id,playlist_id:e.playlist_id,group_id:e.group_id,moment_of_play:n[Zi.momentOfPlay],play_type:n[Zi.categoryId],viewer_second_start:Math.floor(n[Zi.startTime]),intended_second_start:Math.floor(n[Zi.startTime]),intended_second_end:Math.floor(n[Zi.endTime]),latitude_of_user:null,longitude_of_user:null}},[l,c]=o.playerName.split(","),d=l.split(" ");let u="";for(const h of d)if(u+=` ${h}`,h.length>3)break;if(o.playerShortName=c&&l?`${c.trim().charAt(0)}.${u}`:"",!o.mainCategoryName){o.mainCategoryName=C0(this.getPlaySeekerCategoryName(o));const[h,m]=o.finalScore.split(" - ");o.arrayScore=[Number(h),Number(m)]}return i.push(o),i},[]));let a=[];this.concatPlays?a=[...this.playerQueue.splice(0,this.currentPlayIndex+1),...t]:a=t,this.playerQueue=a,this.objectPlaySeekerLastPlay&&this.objectPlaySeekerLastPlay.playListId===e.playlist_id&&this.objectPlaySeekerLastPlay.groupPlayListId===e.group_playlist_id&&this.objectPlaySeekerLastPlay.groupId===e.group_id&&this.$store.commit(`${this.storeModule}/setPlaylistIndex`,{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:this.objectPlaySeekerLastPlay.playIndex}),this.$store.commit(`${this.storeModule}/setCurrentPlayerQueue`,this.playerQueue)},getPlaySeekerSessionId(e){return e?`S_${e}${Date.now()}`:null},getRandomPercentage(){return Math.floor(Math.random()*60+20)},async sendUserBehavior(e,t,a){try{if(this.playInfo.isPlaySeeker){const i={user_id:this.playSeekerUserId,current_session_id:this.playSeekerCurrentSessionId,last_play:{...this.playInfo.payloadData}};i&&(i.last_play.action=t,i.last_play.percentage_viewed=t===1?100:this.getRandomPercentage(),i.last_play.viewer_second_end=e||this.playInfo.endSeconds,i.last_play.date_time_of_user_action=a,this.coords&&(i.last_play.latitude_of_user=this.coords.latitude,i.last_play.longitude_of_user=this.coords.latitude));const n=await fetch(`${this.userBehaviorUrl}/user-behavior`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(n.status===200){const r=await n.json();r&&(this.concatPlays=!0,this.formatPlaySeekerPlays(r))}else this.concatPlays=!1}}catch(i){throw new Error(i)}},onGeoSuccess(e){this.coords=e.coords},onGeoError(e){throw new Error(e)},onClickTimeButton(e){e.numberType===1?this.$refs.videoPlayer.addSecondsToCurrentPlayer(e.numberValue*e.numberValueFactor):e.numberType===2?this.booleanIsSpeedModalVisible=!0:this.booleanIsVideoPlayerPlaying?this.$refs.videoPlayer.pausePlayers():this.$refs.videoPlayer.playCurrentPlayer()},onClickOption(e){this.$refs.videoPlayer.pausePlayers(),e===1?up.emit("click-game",{gameId:this.playInfo.gameId,gameStatus:1,dateTimeUTC:new Date(this.playInfo.dateTimeMillis).toISOString(),seasonId:this.playInfo.seasonId,stringSectionName:"lineups"}):e===2?this.onClickDownload():e===3?(this.setPlaysToSaveAsFavorites([this.playInfo.playRaw]),this.setIsModalCreatePlayListOpen(!0)):e===4&&(this.isModalMode?this.$emit("show-list"):this.onClickModalLauncher())},onClickNextBack(e){this.$refs.videoPlayer.onMoveToPlayClicked(e)},onPlayIteration({iterationTime:e,userAction:t,dateTimeIsoString:a}){this.booleanIsPlaySeekerMode&&this.sendUserBehavior(e,t,a)},onClickAnalyst(){this.onClickModalLauncher()},onClickFullscreen(){this.isCarouselFullScreenVisible=!0},onClickAdvnacedFilterType(e){},onChangeSeason(e){this.numberCurrentSeasonId=Number(e),this.isAutoPlay=!1,this.objectMediaPlayerModeFilters=this.getEmptyMediaPlayerModeFilters(),this.setUpData(e)},onUpdateSearchResult(e){this.lastSearchResult=e,this.setUpData(e.seasonId)},onClickClose(){this.$emit("close")},onClickCloseCarousel(e){e&&this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:null,playlistIndex:e}),this.isCarouselFullScreenVisible=!1},getPlayerOptions(){return{playbackRates:[.5,1,1.5,2],autoplay:!1,controls:!0,controlBar:{children:["playToggle","volumePanel","playbackRateMenuButton","CurrentTimeDisplay","progressControl","remainingTimeDisplay","fullscreenToggle"],pictureInPictureToggle:!1,volumePanel:{inline:!1}},liveui:!0,preload:"auto",fluid:!0}},videoJsInit(){ge.registerPlugin("offset",ev),this.videojsLocal=ge},onClickAdvancedFilterType(e){this.filterToSetUp=e,setTimeout(()=>{this.filterToSetUp=null},100)}},async created(){try{this.videoJsInit(),Ei.defaults.headers.common.Authorization=this.token,this.modalInitialData&&this.$store.commit("mediaModal/setModalInitialState",this.modalInitialData),up.on("change-season",this.onChangeSeason),up.on("some-list-selected",()=>{this.isSomeListSelected=!0}),this.autoFillVideos&&await this.$store.dispatch(`${this.storeModule}/fetchTournaments`)}catch(e){throw new Error(e)}},mounted(){this.isModalMode?setTimeout(()=>{this.modalInitialState?(this.objectPlaySync=this.modalInitialState.objectPlaySync?{...this.modalInitialState.objectPlaySync,booleanIsApplied:!1}:null,this.setUpData(this.modalInitialState.seasonId),this.onTypeChanged(this.modalInitialState.playListType),this.$store.commit("mediaModal/setModalSectionSelected",this.modalInitialState.mainSectionType||1),this.stringModeTitle=`Estas viendo: ${this.modalInitialState.teamId?"Resumen de equipo":this.modalInitialState.playerIds&&this.modalInitialState.playerIds.length?"Resumen de jugador":this.modalInitialState.gameIds&&this.modalInitialState.gameIds.length?"Resumen de partido":""}`):this.objectMediaData&&(this.$store.commit("mediaModal/setModalSectionSelected",1),this.applyObjectMediaData())},100):this.seasonSelectedId&&this.tournamentsForMediaPlayer.size>0&&(this.setUpData(this.seasonSelectedId),this.setInitialTitle()),setTimeout(()=>{this.setUpResizeObserver()},1e3)},beforeUnmount(){this.isSomeListSelected=!1,this.mediaPlayerResizeObserver&&(this.mediaPlayerResizeObserver.disconnect(),this.mediaPlayerResizeObserver=null),this.$store.commit(`${this.storeModule}/setPlayer`,null),this.$store.commit(`${this.storeModule}/setTeam`,null),this.setPlaylistGameId(0)}},rP=()=>{s.useCssVars(e=>({c4dcc094:e.backgroundColor}))},sP=uv.setup;uv.setup=sP?(e,t)=>(rP(),sP(e,t)):rP;const vu=e=>(s.pushScopeId("data-v-ef1a8ac2"),e=e(),s.popScopeId(),e),IEe={class:"modal-video__videos"},xEe=vu(()=>s.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[s.createElementVNode("path",{d:"M5 15L15 5",stroke:"white","stroke-width":"1.7","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),s.createElementVNode("path",{d:"M15 15L5 5",stroke:"white","stroke-width":"1.7","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),NEe=[xEe],AEe={class:"modal-video__videos__search-and-filters"},PEe={class:"modal-video__search-and-filters__search"},OEe={class:"modal-video__search-and-filters__advanced"},BEe={class:"modal-video__videos__mobile"},DEe=vu(()=>s.createElementVNode("span",{class:"watching"},"Estás viendo: ",-1)),MEe={key:0,class:"category-name"},LEe={class:"modal-video__videos__video",ref:"mediaContainerInfo"},REe={key:1,class:"modal-video__detail"},FEe={class:"modal-video__img-container"},VEe=["src"],UEe={class:"modal-video__img-container overlap"},jEe=["src"],zEe={class:"modal-video__description"},HEe={key:2,class:"modal-video__date"},qEe={class:"discover-container"},WEe=vu(()=>s.createElementVNode("div",{class:"title-value"},"Descubre videos",-1)),GEe={class:"modal-video__matches"},KEe={class:"current-match-info"},XEe=vu(()=>s.createElementVNode("h4",null,"Estás viendo:",-1)),JEe={key:0},YEe={class:"modal-video__game-list"},QEe={class:"modal-video__game-list__title"},ZEe={key:0,class:"discover-videos"},$Ee=vu(()=>s.createElementVNode("div",{class:"title-value"},"Descubre videos",-1));function e5e(e,t,a,i,n,r){const o=s.resolveComponent("CarouselFullScreen"),l=s.resolveComponent("VideoSearch"),c=s.resolveComponent("SearchFilters"),d=s.resolveComponent("VideoPlayer"),u=s.resolveComponent("VideoPlayerControls"),h=s.resolveComponent("GscSwitchComponent"),m=s.resolveComponent("GSCPlayerTeamGame"),p=s.resolveComponent("CurrentMatch"),f=s.resolveComponent("MatchesList");return s.openBlock(),s.createElementBlock(s.Fragment,null,[n.isCarouselFullScreenVisible?(s.openBlock(),s.createBlock(o,{key:0,videojs:n.videojsLocal,"player-queue":r.carouselPlayerQueue,"playlist-index":r.playlistIndex,"initial-play":n.playInfo,onClose:r.onClickCloseCarousel},null,8,["videojs","player-queue","playlist-index","initial-play","onClose"])):s.createCommentVNode("",!0),s.createElementVNode("div",{ref:"mediaPlayer",class:s.normalizeClass(["modal-video",r.dynamicClasses])},[s.createElementVNode("div",IEe,[a.isModal?(s.openBlock(),s.createElementBlock("div",{key:0,class:"modal-video__close",onClick:t[0]||(t[0]=(...y)=>r.onClickClose&&r.onClickClose(...y))},NEe)):s.createCommentVNode("",!0),s.createElementVNode("div",AEe,[s.createElementVNode("div",PEe,[s.createVNode(l,{clientWidth:this.mediaPlayerWidth,onClickAdvancedFilterType:r.onClickAdvancedFilterType,"onUpdate:searchResult":r.onUpdateSearchResult},null,8,["clientWidth","onClickAdvancedFilterType","onUpdate:searchResult"])]),s.createElementVNode("div",OEe,[s.createVNode(c,{ref:"searchFilters",clientWidth:this.mediaPlayerWidth,"filter-type-to-set-up":n.filterToSetUp,onApplyFilters:r.onApplyFilters},null,8,["clientWidth","filter-type-to-set-up","onApplyFilters"])])]),s.createElementVNode("div",BEe,[n.mobileClass?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[DEe,n.playInfo?(s.openBlock(),s.createElementBlock("span",MEe,s.toDisplayString(n.playInfo.mainCategoryName),1)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)]),s.createElementVNode("div",LEe,[s.createVNode(d,{ref:"videoPlayer","player-queue":n.playerQueue,"is-v2":"","is-gs":"","is-from-mexico":a.isFromMexico,"is-gs-user":a.isGSUser,"container-width":n.mediaPlayerWidth,"game-id-selected":n.gameIdSelected,"is-first-row":!1,"plays-type-selected":n.selectedType,"is-auto-play":n.isAutoPlay,"is-modal-mode":a.isModalMode,"are-types-hidden":r.isSummaryData||r.isMyPlaylistsActive,"is-play-seeker-mode":n.booleanIsPlaySeekerMode,"play-sync":n.objectPlaySync,onPlayIteration:r.onPlayIteration,onPlaying:r.onPlaying,onPlayChanged:r.onPlayChanged,onMaxInactivityReached:r.onMaxInactivityReached,onPlaylistEnded:r.onPlaylistEnded,onChangeType:r.onTypeChanged,onPlay:t[1]||(t[1]=y=>n.booleanIsVideoPlayerPlaying=!0),onPause:t[2]||(t[2]=y=>n.booleanIsVideoPlayerPlaying=!1),onClickFullScreen:r.onClickFullscreen},null,8,["player-queue","is-from-mexico","is-gs-user","container-width","game-id-selected","plays-type-selected","is-auto-play","is-modal-mode","are-types-hidden","is-play-seeker-mode","play-sync","onPlayIteration","onPlaying","onPlayChanged","onMaxInactivityReached","onPlaylistEnded","onChangeType","onClickFullScreen"]),s.createVNode(u,{"play-info":n.playInfo,onClickNextBack:r.onClickNextBack,clientWidth:this.mediaPlayerWidth},null,8,["play-info","onClickNextBack","clientWidth"])],512),n.playInfo&&n.playInfo.objectHomeTeam?(s.openBlock(),s.createElementBlock("div",REe,[s.createElementVNode("div",FEe,[s.createElementVNode("img",{class:"modal-video__img",src:n.playInfo.teamLogo},null,8,VEe)]),s.createElementVNode("div",UEe,[s.createElementVNode("img",{class:"modal-video__img",src:n.playInfo.playerPhoto},null,8,jEe)]),s.createElementVNode("div",zEe,s.toDisplayString(n.playInfo.objectHomeTeam.acronym)+" "+s.toDisplayString(n.playInfo.arrayScore[0])+" : "+s.toDisplayString(n.playInfo.arrayScore[1])+" "+s.toDisplayString(n.playInfo.objectAwayTeam.acronym)+" I "+s.toDisplayString(n.playInfo.roundAbbreviation),1)])):s.createCommentVNode("",!0),!n.mobileClass&&n.playInfo?(s.openBlock(),s.createElementBlock("div",HEe,s.toDisplayString(r.formatDate(n.playInfo.date)),1)):s.createCommentVNode("",!0),s.createElementVNode("div",qEe,[a.userForDiscoverVideos&&a.nextRivalTeam?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[WEe,n.mobileClass?(s.openBlock(),s.createBlock(h,{key:0,buttons:["Estás viendo","Otros partidos","Descubre videos"],class:"current-match__tabs",selectedOption:n.currentMobileTab,arrow:!1,height:"26px",borderRadius:"32px",fontSize:"14px","font-family":"Poppins-Light",backgroundOptionActive:"transparent",borderWidth:"2px",onInput:t[3]||(t[3]=y=>n.currentMobileTab=y)},null,8,["selectedOption"])):s.createCommentVNode("",!0),a.section?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[!n.mobileClass||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(h,{key:0,style:{"margin-left":"0px"},buttons:["Resumen","Proximo rival"],onInput:t[4]||(t[4]=y=>n.currentTabMoreVideos=y),background:"trasparent",height:"28px",width:"160px",fontSize:"14px","font-family":"Poppins-Light",backgroundOptionActive:"transparent",borderWidth:"2px",type:2,arrow:!1,selectedOption:n.currentTabMoreVideos},null,8,["selectedOption"])):s.createCommentVNode("",!0),this.userForDiscoverVideos.is_player?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[n.currentTabMoreVideos=="Resumen"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:8,style:{"margin-top":"-30px"},title:"",backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,player:a.userForDiscoverVideos.player,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:8,style:{"margin-top":"-30px"},title:"",backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,player:a.userForDiscoverVideos.player,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[n.currentTabMoreVideos=="Resumen"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:7,title:"",style:{"margin-top":"-30px"},backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,team:a.userForDiscoverVideos.team,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:7,style:{"margin-top":"-30px"},title:"",backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,team:a.nextRivalTeam.team_id,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64))],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,style:{"margin-top":"-30px"},type:13,data:{season:a.userForDiscoverVideos.season,category:1255e3},width:"100%",backgroundColor:"#172531",title:""},null,8,["data"])):s.createCommentVNode("",!0)],64))],64)):s.createCommentVNode("",!0)])]),s.createElementVNode("div",GEe,[s.createElementVNode("div",KEe,[n.mobileClass?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[XEe,n.playInfo?(s.openBlock(),s.createElementBlock("h3",JEe,s.toDisplayString(n.playInfo.mainCategoryName),1)):s.createCommentVNode("",!0)],64)),r.currentMatch&&(!n.mobileClass||n.currentMobileTab==="Estás viendo")?(s.openBlock(),s.createBlock(p,{key:1,currentMatch:r.currentMatch,mobileClass:"",isMobile:this.mobileClass,isMobileTabsActive:this.isMobileTabsActive,clientWidth:this.mediaPlayerWidth,videoPlayerHeight:this.mediaPlayerInfoHeight},null,8,["currentMatch","isMobile","isMobileTabsActive","clientWidth","videoPlayerHeight"])):s.createCommentVNode("",!0)]),s.createElementVNode("div",YEe,[s.withDirectives(s.createElementVNode("div",QEe,"Otros partidos",512),[[s.vShow,(!n.mobileClass||!n.isMobileTabsActive)&&e.currentPlayerQueueByGames.length>1||!n.isMobileTabsActive]]),!n.mobileClass||n.currentMobileTab==="Otros partidos"||!n.isMobileTabsActive?(s.openBlock(),s.createBlock(f,{key:0,matches:e.currentPlayerQueueByGames,mobileClass:"",isMobileTabsActive:this.isMobileTabsActive,clientWidth:this.mediaPlayerWidth},null,8,["matches","isMobileTabsActive","clientWidth"])):s.createCommentVNode("",!0)])]),a.userForDiscoverVideos&&a.nextRivalTeam?(s.openBlock(),s.createElementBlock("div",ZEe,[$Ee,n.mobileClass?(s.openBlock(),s.createBlock(h,{key:0,buttons:["Estás viendo","Otros partidos","Descubre videos"],class:"current-match__tabs",selectedOption:n.currentMobileTab,arrow:!1,borderRadius:"32px",height:"28px",fontSize:"14px","font-family":"Poppins-Light",backgroundOptionActive:"transparent",borderWidth:"2px",onInput:t[5]||(t[5]=y=>n.currentMobileTab=y)},null,8,["selectedOption"])):s.createCommentVNode("",!0),a.section?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(h,{style:{"margin-left":"0px"},buttons:["Resumen","Proximo rival"],onInput:t[6]||(t[6]=y=>n.currentTabMoreVideos=y),background:"trasparent",height:"28px",width:"160px",fontSize:"14px","font-family":"Poppins-Light",backgroundOptionActive:"transparent",borderWidth:"2px",type:2,arrow:!1,selectedOption:n.currentTabMoreVideos},null,8,["selectedOption"]),this.userForDiscoverVideos.is_player?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[n.currentTabMoreVideos=="Resumen"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:8,style:{"margin-top":"-30px"},title:"",backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,player:a.userForDiscoverVideos.player,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:8,style:{"margin-top":"-30px"},title:"",backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,player:a.userForDiscoverVideos.player,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[n.currentTabMoreVideos=="Resumen"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:7,title:"",style:{"margin-top":"-30px"},backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,team:a.userForDiscoverVideos.team,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:7,style:{"margin-top":"-30px"},title:"",backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,team:a.nextRivalTeam.team_id,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64))],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,style:{"margin-top":"-30px"},type:13,data:{season:a.userForDiscoverVideos.season,category:1255e3},width:"100%",backgroundColor:"#172531",title:""},null,8,["data"])):s.createCommentVNode("",!0)],64))])):s.createCommentVNode("",!0)],2)],64)}const t5e=bt(uv,[["render",e5e],["__scopeId","data-v-ef1a8ac2"]]);f0e();const a5e={class:"container"},i5e=!1,n5e=si({__name:"GSCMediaPlayer",setup(e){const t=s.ref("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE");wc.defaults.headers.common.Authorization=t.value;const a=[{_id:44,seasons:[{name:"Clausura 2023",related_seasons:[{type:1,id:1752}],id:1713,type:0},{name:"Apertura 2022",related_seasons:[{type:1,id:1592}],id:1542,type:0},{name:"Grita Mexico C22",related_seasons:[{type:1,id:1521}],id:1486,type:0}],tournament:{show_logos:0,tournament_type:0,name:"Sub-20",logo:null,id:44,tournament_status:0,order:5}},{_id:1095,seasons:[{name:"Apertura 2023",related_seasons:[{type:1,id:1831}],id:1783,type:0},{name:"Clausura 2023",related_seasons:[{type:1,id:1750}],id:1715,type:0},{name:"Apertura 2022",related_seasons:[{type:1,id:1652}],id:1541,type:0},{name:"Grita Mexico C22",related_seasons:[{type:1,id:1527}],id:1488,type:0}],tournament:{show_logos:0,tournament_type:0,name:"Sub-16",logo:null,id:1095,tournament_status:0,order:7}},{_id:1001,seasons:[{name:"Clausura 2024",related_seasons:[],id:1838,type:0},{name:"Apertura 2023",related_seasons:[{type:1,id:1825}],id:1777,type:0},{name:"Clausura 2023",related_seasons:[{type:1,id:1747}],id:1696,type:0},{name:"Apertura 2022",related_seasons:[{type:1,id:1655}],id:1539,type:0},{name:"Grita Mexico C22",related_seasons:[{type:1,id:1523}],id:1485,type:0},{name:"Grita Mexico A21",related_seasons:[{type:1,id:1458}],id:1402,type:0},{name:"Guard1anes Clausura 2021",related_seasons:[{type:1,id:1384}],id:1323,type:0},{name:"Guard1anes 2020",related_seasons:[{type:1,id:1318}],id:1283,type:0},{name:"Clausura 2020",related_seasons:[],id:1241,type:0},{name:"Apertura 2019",related_seasons:[{type:1,id:1227}],id:1157,type:0},{name:"Clausura 2019",related_seasons:[{type:1,id:1132}],id:1095,type:0},{name:"Apertura 2018",related_seasons:[{type:1,id:1072}],id:1004,type:0},{name:"Clausura 2018",related_seasons:[{type:1,id:1237}],id:1236,type:0}],tournament:{show_logos:1,tournament_type:0,name:"Liga MX Femenil",logo:"https://az755631.vo.msecnd.net/tournaments/femenil_mx.png",id:1001,tournament_status:0,order:2}},{_id:1143,seasons:[{name:"Apertura 2023",related_seasons:[{type:1,id:1829}],id:1785,type:0}],tournament:{show_logos:0,tournament_type:0,name:"Sub-23",logo:null,id:1143,tournament_status:0,order:4}},{_id:1,seasons:[{name:"Clausura 2024",related_seasons:[],id:1836,type:0},{name:"Apertura 2023",related_seasons:[{type:2,id:1826},{type:1,id:1827}],id:1772,type:0},{name:"Clausura 2023",related_seasons:[{type:2,id:1745},{type:1,id:1746}],id:1694,type:0},{name:"Apertura 2022",related_seasons:[{type:2,id:1591},{type:1,id:1594}],id:1535,type:0},{name:"Grita Mexico C22",related_seasons:[{type:2,id:1520},{type:1,id:1525}],id:1476,type:0},{name:"Grita Mexico A21",related_seasons:[{type:2,id:1446},{type:1,id:1456}],id:1401,type:0},{name:"Guard1anes Clausura 2021",related_seasons:[{type:2,id:1382},{type:1,id:1383}],id:1325,type:0},{name:"Guard1anes 2020",related_seasons:[{type:2,id:1311},{type:1,id:1316}],id:1275,type:0},{name:"Clausura 2020",related_seasons:[],id:1239,type:0},{name:"Apertura 2019",related_seasons:[{type:1,id:1231}],id:1155,type:0},{name:"Clausura 2019",related_seasons:[{type:1,id:1135}],id:1093,type:0},{name:"Apertura 2018",related_seasons:[{type:1,id:1075}],id:1002,type:0}],tournament:{show_logos:1,tournament_type:0,name:"Liga MX",logo:"https://az755631.vo.msecnd.net/tournaments/liga_mx.png",id:1,tournament_status:0,order:1}},{_id:1071,seasons:[{name:"Clausura 2024",related_seasons:[],id:1837,type:0},{name:"Apertura 2023",related_seasons:[{type:2,id:1822},{type:1,id:1828}],id:1776,type:0},{name:"Clausura 2023",related_seasons:[{type:2,id:1742},{type:1,id:1748}],id:1695,type:0},{name:"Apertura 2022",related_seasons:[{type:2,id:1598},{type:1,id:1618}],id:1544,type:0},{name:"Grita Mexico C22",related_seasons:[{type:2,id:1515},{type:1,id:1519}],id:1484,type:0},{name:"Grita Mexico A21",related_seasons:[{type:2,id:1454},{type:1,id:1463}],id:1408,type:0},{name:"Guard1anes Clausura 2021",related_seasons:[{type:2,id:1378},{type:1,id:1380}],id:1327,type:0},{name:"Guard1anes 2020",related_seasons:[{type:2,id:1315},{type:1,id:1317}],id:1287,type:0}],tournament:{show_logos:1,tournament_type:0,name:"Liga Expansion MX",logo:"https://az755631.vo.msecnd.net/tournaments/expansion_mx.png",id:1071,tournament_status:0,order:3}},{_id:1096,seasons:[{name:"Apertura 2023",related_seasons:[{type:1,id:1830}],id:1782,type:0},{name:"Clausura 2023",related_seasons:[{type:1,id:1751}],id:1714,type:0},{name:"Apertura 2022",related_seasons:[{type:1,id:1593}],id:1543,type:0},{name:"Grita Mexico C22",related_seasons:[{type:1,id:1522}],id:1487,type:0}],tournament:{show_logos:0,tournament_type:0,name:"Sub-18",logo:null,id:1096,tournament_status:0,order:6}}],i={token:"",token_b2c:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MjQyNTQsIm5hbWUiOiJHb2xTdGF0cyIsInVzZXJuYW1lIjoiZ29sdGVzdGluZyIsImVtYWlsIjoiIiwicHJvdmlkZXJfaWQiOjEsImxvZ2luX2dvbHN0YXRzIjoxLCJpYXQiOjE3MDA3ODkyNTcsImV4cCI6MTczMjMyNTI1N30.4iVGU3Q8rcNFRkYiPEmEYj1pB_UoYr1L5virEIpmGhs",id:24254,username:"goltesting",name:"GolStats",team:1,player:0,tournament:1,type_system:"presidents",language:"es",active_time:1,season:1772,is_player:0,related_seasons:[],is_goalkeeper:0,show_dashboard:1,user_type:1,premiumAccount:!0,userType:1,accessVideos:!0,sessionExpiration:1701869305930},n=s.computed(()=>a.reduce((r,o)=>{const l={...o.tournament,seasons:o.seasons};return l.seasons.forEach(c=>{r.set(c.id,l)}),r},new Map));return(r,o)=>(s.openBlock(),s.createElementBlock("div",a5e,[s.createVNode(s.unref(t5e),{"season-selected-id":1772,user:i,section:i5e,token:t.value,"tournaments-for-media-player":n.value,"background-color":""},null,8,["token","tournaments-for-media-player"])]))}},[["__scopeId","data-v-6fdc2bb3"]]),r5e={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},s5e={DF:"Dieciseisavos",OF:"Octavos",CF:"Cuartos",SF:"Semifinales","3ER":"Tercer lugar",FINAL:"Final"},o5e={4:"Octavos",5:"Cuartos",6:"Semifinales",7:"Final"},l5e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},hv={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},oP=()=>{s.useCssVars(e=>({"1c960139":e.height,b2f635d8:e.borderWidthBtn,"06e99898":e.borderType,"55555c76":e.borderColor,"23b6d320":e.borderRadius,"22c97374":e.width,"22bb09fa":e.backgroundColor,c148da7c:e.cursorType,cce756fc:e.fontSize,cff98d60:e.fontStyle,"5123b3a5":e.fontFamily,"47bf58db":e.marginLeftStat,cadc8414:e.fontSizeStat}))},lP=hv.setup;hv.setup=lP?(e,t)=>(oP(),lP(e,t)):oP;const c5e=e=>(s.pushScopeId("data-v-fb269a1e"),e=e(),s.popScopeId(),e),d5e=["src"],u5e={key:1,class:"text"},h5e=["src"],p5e={class:"stats"},m5e=c5e(()=>s.createElementVNode("img",{class:"iconstats",src:"https://az755631.vo.msecnd.net/todoelfut/playdes.png"},null,-1)),f5e={class:"numstats"},g5e={class:"leyend"};function y5e(e,t,a,i,n,r){return s.openBlock(),s.createElementBlock("div",null,[a.type==0?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["button",n.status&&a.typeOnOff&&"button-active"]),style:s.normalizeStyle([r.customStyle,n.status&&a.typeOnOff&&r.customActive]),onClick:t[0]||(t[0]=(...o)=>r.btnClick&&r.btnClick(...o))},[a.icon&&a.iconPosition.toLowerCase()==="left"?(s.openBlock(),s.createElementBlock("img",{key:0,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,d5e)):s.createCommentVNode("",!0),a.textValue?(s.openBlock(),s.createElementBlock("div",u5e,s.toDisplayString(a.textValue),1)):s.createCommentVNode("",!0),a.icon&&a.iconPosition.toLowerCase()==="right"?(s.openBlock(),s.createElementBlock("img",{key:2,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,h5e)):s.createCommentVNode("",!0)],6)):s.createCommentVNode("",!0),a.type==1?(s.openBlock(),s.createElementBlock("div",{key:1,class:"button-target",onClick:t[1]||(t[1]=(...o)=>r.btnClick&&r.btnClick(...o))},[s.createElementVNode("div",p5e,[m5e,s.createElementVNode("div",f5e,s.toDisplayString(a.textStat),1)]),s.createElementVNode("div",g5e,s.toDisplayString(a.textCategory),1)])):s.createCommentVNode("",!0)])}const _5e=l5e(hv,[["render",y5e],["__scopeId","data-v-fb269a1e"]]),b5e={class:"gsc-dropdown__main-container__item-selected"},v5e=["height","width"],S5e=["stroke"],w5e={class:"gsc-dropdown__items-container"},T5e=["onClick"],C5e={key:0,class:"gsc-dropdown__items-footer"},k5e={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(t=>t in e)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listItemPadding:{type:String,default:"10px 12px"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1}},emits:["input","click-ready","update:modelValue"],setup(e,{emit:t}){const a=e,i=s.ref({}),n=s.ref(null),r=s.ref(a.isMultipleOption?-1:0),o=s.ref(!1);s.watch(()=>a.items,(p,f)=>{if(!a.modelValue&&(!a.onlyFirstTime||!f||!f.length)&&p&&p.length){if(a.defaultItemByProp){const y=a.items.findIndex(b=>b[a.defaultItemByProp.propName]===a.defaultItemByProp.value);y!==-1?(r.value=y,i.value=p[y]):(r.value=0,i.value=p[0])}else i.value=p[a.defaultItemByIndex];t("input",i.value)}},{immediate:!0}),s.watch(()=>a.modelValue,p=>{if(p){const f=a.items.findIndex(y=>typeof p=="object"?JSON.stringify(y)===JSON.stringify(p):y===p);f!==-1&&(r.value=f,i.value=a.items[f],t("update:modelValue",i.value))}},{immediate:!0});const l=s.computed(()=>({height:a.height,width:a.width,backgroundColor:a.backgroundColor,borderRadius:`${a.borderRadius}px`,border:`${a.borderType} ${a.borderWidth}px ${a.borderColor}`,color:a.color,"--hover-background-color":a.hoverBackgroundColor,"--list-item-padding":a.listItemPadding,"--list-background-color":a.listBackgroundColor,"--list-height":a.listHeight,"--list-item-selected-color":a.listItemSelectedColor,"--list-item-selected-background-color":a.listItemSelectedBackgroundColor,"--list-item-color":a.listItemColor,"--list-border-radius":`${a.listBorderRadius}`,"--list-border-color":a.listBorderColor,"--list-width":a.isListSameWidth?a.width:"fit-content","--list-border-width":`${a.listBorderWidth}px`,"--footer-border":`${a.footerBorderWidth}px solid ${a.footerBorderColor}`,"--dropdown-opacity":a.isDisabled?"0.5":"1","--dropdown-cursor":a.isDisabled?"not-allowed":"pointer","--dropdown-font-size":a.fontSize?a.fontSize:"14px"})),c=s.computed(()=>({height:`${a.arrowHeight}px`,width:`${a.arrowWidth}px`}));function d(){a.isDisabled||(o.value=!o.value)}function u(p){n.value.contains(p.target)||(o.value=!1)}function h(p,f){a.isMultipleOption?r.value=-1:(r.value=f,o.value=!1),i.value=p,t("input",i.value),t("update:modelValue",i.value)}function m(){o.value=!1,t("click-ready")}return s.onMounted(()=>{document.addEventListener("click",u)}),s.onBeforeMount(()=>{document.removeEventListener("click",u)}),(p,f)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"dropDown",ref:n,class:"gsc-dropdown",style:s.normalizeStyle(l.value)},[s.createElementVNode("div",{class:"gsc-dropdown__main-container",style:s.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:d},[s.createElementVNode("div",b5e,[s.renderSlot(p.$slots,"default",{selectedItem:i.value})]),s.createElementVNode("div",{class:s.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":o.value}]),style:s.normalizeStyle(c.value)},[(s.openBlock(),s.createElementBlock("svg",{height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:e.arrowColor},null,8,S5e)],8,v5e))],6)],4),s.createVNode(s.Transition,null,{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",w5e,[s.createElementVNode("div",null,[s.createElementVNode("div",{class:"gsc-dropdown__items",style:s.normalizeStyle({"margin-top":`${a.borderWidth}px`})},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.items,(y,b)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["gsc-dropdown__items__item",{selected:b===r.value}]),key:b,onClick:E=>h(y,b)},[s.renderSlot(p.$slots,"availableItem",{item:y})],10,T5e))),128))],4),e.isFooterVisible?(s.openBlock(),s.createElementBlock("div",C5e,[s.createVNode(s.unref(_5e),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:m})])):s.createCommentVNode("",!0)])],512),[[s.vShow,o.value]])]),_:3})],4))}},E5e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},I5e={class:"tournament-select__selected-tournament"},x5e={class:"tournament-select__selected-tournament__logo"},N5e=["src"],A5e={class:"tournament-select__selected-tournament__name"},P5e={__name:"GSCTournamentSelect",props:{apiUrl:{type:String,default:"https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/gs3/tournaments"},fontFamily:{type:String,default:"sans-serif"},logosUrl:{type:String,default:"https://az755631.vo.msecnd.net/todoelfut/"},logoFileType:{type:String,default:"png"},height:{type:String,default:"40px"},width:{type:String,default:"179px"},borderRadius:{type:Number,default:8},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"rgba(255, 255, 255, 0.2)"},backgroundColor:{type:String,default:"#0d1d29"},color:{type:String,default:"white"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(t=>t in e)},currentSeasonId:{type:Number,default:0}},emits:["input"],setup(e,{emit:t}){const a=e,i=s.ref([]),n=s.computed(()=>{const h={};return a.fontFamily&&(h["font-family"]=`${a.fontFamily}`),h}),r=s.computed(()=>i.value.find(h=>h.seasonsIds.has(a.currentSeasonId))||i.value[0]);async function o(){try{if(a.items&&a.items.length)i.value=[...a.items];else if(a.apiUrl){const h=await c();i.value=h.map(m=>({...m.tournament,seasons:m.seasons,seasonsIds:m.seasons.reduce((p,f)=>(p.add(f.id),p),new Set)})).sort((m,p)=>m.order-p.order)}}catch(h){throw new Error(h)}}function l(h){const m=new XMLHttpRequest,p=`${a.logosUrl}${h}.${a.logoFileType}`;return m.open("HEAD",p,!1),m.send(),m.status!==404}async function c(){try{return(await fetch(a.apiUrl)).json()}catch(h){return Promise.reject(h)}}function d(h){t("input",h)}function u(h){t("input",h)}return s.onMounted(()=>{o()}),(h,m)=>(s.openBlock(),s.createElementBlock("div",{class:"tournament-select",style:s.normalizeStyle(n.value)},[s.createVNode(s.unref(k5e),s.mergeProps(a,{"model-value":r.value,items:i.value,onInput:d,"onUpdate:modelValue":u}),{default:s.withCtx(({selectedItem:p})=>[s.createElementVNode("div",I5e,[s.createElementVNode("div",x5e,[l(p.id)?(s.openBlock(),s.createElementBlock("img",{key:0,src:`${a.logosUrl}${p.id}.${a.logoFileType}`,alt:""},null,8,N5e)):s.createCommentVNode("",!0)]),s.createElementVNode("div",A5e,s.toDisplayString(p.name),1)])]),availableItem:s.withCtx(({item:p})=>[s.createElementVNode("div",null,s.toDisplayString(p.name),1)]),_:1},16,["model-value","items"])],4))}},O5e=E5e(P5e,[["__scopeId","data-v-44050d64"]]),B5e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},pv={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},cP=()=>{s.useCssVars(e=>({"1c960139":e.height,b2f635d8:e.borderWidthBtn,"06e99898":e.borderType,"55555c76":e.borderColor,"23b6d320":e.borderRadius,"22c97374":e.width,"22bb09fa":e.backgroundColor,c148da7c:e.cursorType,cce756fc:e.fontSize,cff98d60:e.fontStyle,"5123b3a5":e.fontFamily,"47bf58db":e.marginLeftStat,cadc8414:e.fontSizeStat}))},dP=pv.setup;pv.setup=dP?(e,t)=>(cP(),dP(e,t)):cP;const D5e=e=>(s.pushScopeId("data-v-fb269a1e"),e=e(),s.popScopeId(),e),M5e=["src"],L5e={key:1,class:"text"},R5e=["src"],F5e={class:"stats"},V5e=D5e(()=>s.createElementVNode("img",{class:"iconstats",src:"https://az755631.vo.msecnd.net/todoelfut/playdes.png"},null,-1)),U5e={class:"numstats"},j5e={class:"leyend"};function z5e(e,t,a,i,n,r){return s.openBlock(),s.createElementBlock("div",null,[a.type==0?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["button",n.status&&a.typeOnOff&&"button-active"]),style:s.normalizeStyle([r.customStyle,n.status&&a.typeOnOff&&r.customActive]),onClick:t[0]||(t[0]=(...o)=>r.btnClick&&r.btnClick(...o))},[a.icon&&a.iconPosition.toLowerCase()==="left"?(s.openBlock(),s.createElementBlock("img",{key:0,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,M5e)):s.createCommentVNode("",!0),a.textValue?(s.openBlock(),s.createElementBlock("div",L5e,s.toDisplayString(a.textValue),1)):s.createCommentVNode("",!0),a.icon&&a.iconPosition.toLowerCase()==="right"?(s.openBlock(),s.createElementBlock("img",{key:2,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,R5e)):s.createCommentVNode("",!0)],6)):s.createCommentVNode("",!0),a.type==1?(s.openBlock(),s.createElementBlock("div",{key:1,class:"button-target",onClick:t[1]||(t[1]=(...o)=>r.btnClick&&r.btnClick(...o))},[s.createElementVNode("div",F5e,[V5e,s.createElementVNode("div",U5e,s.toDisplayString(a.textStat),1)]),s.createElementVNode("div",j5e,s.toDisplayString(a.textCategory),1)])):s.createCommentVNode("",!0)])}const H5e=B5e(pv,[["render",z5e],["__scopeId","data-v-fb269a1e"]]),q5e={class:"gsc-dropdown__main-container__item-selected"},W5e=["height","width"],G5e=["stroke"],K5e={class:"gsc-dropdown__items-container"},X5e=["onClick"],J5e={key:0,class:"gsc-dropdown__items-footer"},Y5e={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(t=>t in e)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listItemPadding:{type:String,default:"10px 12px"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1}},emits:["input","click-ready","update:modelValue"],setup(e,{emit:t}){const a=e,i=s.ref({}),n=s.ref(null),r=s.ref(a.isMultipleOption?-1:0),o=s.ref(!1);s.watch(()=>a.items,(p,f)=>{if(!a.modelValue&&(!a.onlyFirstTime||!f||!f.length)&&p&&p.length){if(a.defaultItemByProp){const y=a.items.findIndex(b=>b[a.defaultItemByProp.propName]===a.defaultItemByProp.value);y!==-1?(r.value=y,i.value=p[y]):(r.value=0,i.value=p[0])}else i.value=p[a.defaultItemByIndex];t("input",i.value)}},{immediate:!0}),s.watch(()=>a.modelValue,p=>{if(p){const f=a.items.findIndex(y=>typeof p=="object"?JSON.stringify(y)===JSON.stringify(p):y===p);f!==-1&&(r.value=f,i.value=a.items[f],t("update:modelValue",i.value))}},{immediate:!0});const l=s.computed(()=>({height:a.height,width:a.width,backgroundColor:a.backgroundColor,borderRadius:`${a.borderRadius}px`,border:`${a.borderType} ${a.borderWidth}px ${a.borderColor}`,color:a.color,"--hover-background-color":a.hoverBackgroundColor,"--list-item-padding":a.listItemPadding,"--list-background-color":a.listBackgroundColor,"--list-height":a.listHeight,"--list-item-selected-color":a.listItemSelectedColor,"--list-item-selected-background-color":a.listItemSelectedBackgroundColor,"--list-item-color":a.listItemColor,"--list-border-radius":`${a.listBorderRadius}`,"--list-border-color":a.listBorderColor,"--list-width":a.isListSameWidth?a.width:"fit-content","--list-border-width":`${a.listBorderWidth}px`,"--footer-border":`${a.footerBorderWidth}px solid ${a.footerBorderColor}`,"--dropdown-opacity":a.isDisabled?"0.5":"1","--dropdown-cursor":a.isDisabled?"not-allowed":"pointer","--dropdown-font-size":a.fontSize?a.fontSize:"14px"})),c=s.computed(()=>({height:`${a.arrowHeight}px`,width:`${a.arrowWidth}px`}));function d(){a.isDisabled||(o.value=!o.value)}function u(p){n.value.contains(p.target)||(o.value=!1)}function h(p,f){a.isMultipleOption?r.value=-1:(r.value=f,o.value=!1),i.value=p,t("input",i.value),t("update:modelValue",i.value)}function m(){o.value=!1,t("click-ready")}return s.onMounted(()=>{document.addEventListener("click",u)}),s.onBeforeMount(()=>{document.removeEventListener("click",u)}),(p,f)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"dropDown",ref:n,class:"gsc-dropdown",style:s.normalizeStyle(l.value)},[s.createElementVNode("div",{class:"gsc-dropdown__main-container",style:s.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:d},[s.createElementVNode("div",q5e,[s.renderSlot(p.$slots,"default",{selectedItem:i.value})]),s.createElementVNode("div",{class:s.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":o.value}]),style:s.normalizeStyle(c.value)},[(s.openBlock(),s.createElementBlock("svg",{height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:e.arrowColor},null,8,G5e)],8,W5e))],6)],4),s.createVNode(s.Transition,null,{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",K5e,[s.createElementVNode("div",null,[s.createElementVNode("div",{class:"gsc-dropdown__items",style:s.normalizeStyle({"margin-top":`${a.borderWidth}px`})},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.items,(y,b)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["gsc-dropdown__items__item",{selected:b===r.value}]),key:b,onClick:E=>h(y,b)},[s.renderSlot(p.$slots,"availableItem",{item:y})],10,X5e))),128))],4),e.isFooterVisible?(s.openBlock(),s.createElementBlock("div",J5e,[s.createVNode(s.unref(H5e),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:m})])):s.createCommentVNode("",!0)])],512),[[s.vShow,o.value]])]),_:3})],4))}},Q5e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},Z5e={class:"season-name"},$5e={components:{GSCSeasonSelect:Q5e({__name:"GSC-SeasonSelect",props:{seasons:{type:Array,default:()=>[]},currentSeasonId:{type:Number,default:0}},emits:["input"],setup(e,{emit:t}){const a=e,i=s.computed(()=>a.seasons.find(o=>o.id===a.currentSeasonId));function n(o){t("input",o)}function r(o){t("input",o)}return(o,l)=>(s.openBlock(),s.createBlock(s.unref(Y5e),{items:e.seasons,"model-value":i.value,height:"40px",width:"179px","background-color":"#0d1d29",color:"white","border-color":"rgba(255, 255, 255, 0.2)","font-family":"Poppins-Regular","border-radius":8,onInput:r,"onUpdate:modelValue":n},{default:s.withCtx(({selectedItem:c})=>[s.createElementVNode("div",Z5e,[s.createElementVNode("span",null,s.toDisplayString(c.name),1)])]),availableItem:s.withCtx(({item:c})=>[s.createElementVNode("span",null,s.toDisplayString(c.name),1)]),_:1},8,["items","model-value"]))}},[["__scopeId","data-v-a372361a"]]),GSCTournamentSelect:O5e,GSCGames:sj,GSCGridTeamsMatches:mB,GSCPlayersLanding:oB,GSCTops:oz,GSCTableCalendar:aU,GSCMediaPlayer:n5e},setup(){const e=s.ref("landingref"),{elementSize:t}=LO(e);return{landingref:e,elementSize:t}},watch:{team:{immediate:!0,deep:!0,async handler(e){if(Object.keys(this.seasonSelected).length!==0){const t=await this.generateSeasons(this.seasonSelected);this.seasonsSelected=t,this.fetchGames(e,t)}}},closestRound(e){this.selectedRoundKeyIndex=this.tournamentScheduleKeys.findIndex(t=>t===e),this.selectedRound=e}},props:{currentSeasonId:{type:Number,default:0},season:{type:Number,default:1772},isplayer:{type:Boolean,default:!1},user:{type:Object,default:()=>{}},team:{type:Number,default:0},player:{type:Number,default:0},gamesPerMatchDay:{type:Number,default:0,validator(e){return!Number.isNaN(e)&&e>=0}}},data(){return{defaultGameId:0,lastSeasonsIds:[],gamesPages:new Map,selectedRoundKeyIndex:0,selectedRound:0,fullTournamentScheduleFull:[],defaultMatchDayKey:null,isCupTournament:!1,retries:3,userTeamGames:[],isCupLegacyTournament:!1,tournamentScheduleKeys:[],currentTournamentGames:null,currentTournamentTeams:null,gamesUrl:"https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason/",gamesUrl2:"https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?",seasonSelected:{},seasonSelectedDropDowns:{},seasonsSelected:[],fullTournamentSchedule:{},tournamentSelected:{},tournamentSelectedDropDowns:{seasons:[]},playersLength:0,tokenFree:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},computed:{gamesFullLeague(){var e=[];for(let t=0;t<this.fullTournamentScheduleFull[this.selectedRound].length;t++)for(let a=0;a<this.fullTournamentScheduleFull[this.selectedRound][t].games.length;a++)e.push(this.fullTournamentScheduleFull[this.selectedRound][t].games[a]);return e},closestRound(){return this.userTeamGames&&this.userTeamGames.length?this.getUserTeamClosestRound(this.fullTournamentScheduleFull):this.getNormalClosestRound(this.fullTournamentScheduleFull)},containerGridCalendarTable(){return this.elementSize.width<=1e3?"container-grid-calendar-table-mobile":"container-grid-calendar-table"},containerbackground(){return this.elementSize.width<=680?"container-background-movil":"container-background"},containerdata(){return this.elementSize.width<=680?"container-data-movil":"container-data"}},methods:{onAction(e){this.$emit("action",e)},onOpenMedia(e){this.$emit("openmedia",e)},onOpenProfile(e){this.$emit("onOpenProfile",e)},onClickMatch(e){this.$emit("openGame",e)},onClickCalendar(){const e={type:this.tournamentSelected.id==this.user.tournament?1:0,team:this.team,season:this.seasonSelectedDropDowns};this.$emit("onClickMyCalendar",e)},moreTops(){const e={team:this.team,season:this.seasonSelectedDropDowns};this.$emit("openTops",e)},clickProfileBtn(e){this.$emit("openProfile",e)},viewAll(){const e={team:this.team,season:this.seasonSelectedDropDowns};this.$emit("openAllPlayers",e)},getTotalPlayers(e){this.playersLength=e},clickCard(e){const t={data:e,isPlayer:this.isplayer};this.$emit("clickOnMainCards",t)},async fetchGames(e,t){const a=t.map(n=>`seasons=${n.id}`).join("&"),i=wc.create({headers:{Authorization:`${this.tokenFree}`}});this.fullTournamentSchedule=await i.get(this.gamesUrl+e+"?"+a)},async generateSeasons(e){const t=[{id:e.id,type:e.type}];return e.related_seasons&&e.related_seasons.length&&t.push(...e.related_seasons.map(a=>({id:a.id,type:a.type}))),t},async onInputTournament(e){this.tournamentSelected=e,this.tournamentSelectedDropDowns.id!==e.id&&(this.tournamentSelectedDropDowns=e)},async onInputSeason(e){if(this.seasonSelected=e,this.tournamentSelected.id!=this.user.tournament){const t=await this.generateSeasons(this.seasonSelected);this.seasonsSelected=t,await this.createFullTournamentScheme(t,!1)}else{const t=await this.generateSeasons(this.seasonSelected);this.seasonsSelected=t,await this.fetchGames(this.user.team,t)}this.seasonSelectedDropDowns!==e.id&&(this.seasonSelectedDropDowns=e.id,this.$emit("change-season-id",e.id))},async fetchTournaments(e){try{const{data:t}=await wc.get("https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/tournaments");return t}catch(t){if(e>0)return this.fetchTournaments(e-1);throw new Error(t)}},async fetchSeasonsGamesAndTeams(e,t,a=""){let i=a;try{i||(i=this.gamesUrl2,e.forEach((l,c)=>{i+=`${c===0?"":"&"}seasons=${l}`}));const n=wc.create({headers:{Authorization:`${this.tokenFree}`}}),{data:{data:r,teams:o}}=await n.get(i);return{seasonsAndGames:r,seasonsAndTeams:o}}catch(n){if(t>0)return this.fetchSeasonsGamesAndTeams(e,t-1,i);throw new Error(n)}},areSeasonsDifferent(e){for(const t of e)if(!this.lastSeasonsIds.includes(t.season_id))return!0;return!1},async createFullTournamentScheme(e,t){try{this.fullTournamentSchedule={},this.userTeamGames=[];let a=0;const{seasonsAndGames:i,seasonsAndTeams:n}=await this.fetchSeasonsGamesAndTeams(e.map(c=>c.id),3);if(t&&this.areSeasonsDifferent(i))return;i.forEach(c=>{const{type:d}=e.find(u=>u.id===c.season_id);c.type=d,c.games.forEach(u=>{u.season_id=c.season_id}),d===0&&(a=c.season_id)});const r={seasonsGames:i},{teams:o}=n.find(c=>c.season_id===a),l=r&&r.seasonsGames?r.seasonsGames.map(c=>{const d=c.games.reduce((u,h)=>{const m={...h};return m.dateTimeMillis=new Date(m.date_time_utc).valueOf(),m.home_team=o.find(p=>p.team_id===h.home_team),m.visiting_team=o.find(p=>p.team_id===h.visiting_team),u[h.matchday_abbreviation]?u[h.matchday_abbreviation][h.game_status===3?"canceled":h.date]?u[h.matchday_abbreviation][h.game_status===3?"canceled":h.date].push(m):u[h.matchday_abbreviation][h.game_status===3?"canceled":h.date]=[m]:u[h.matchday_abbreviation]={[h.game_status===3?"canceled":h.date]:[m]},this.gsData&&this.gsData.teamId&&m.game_status===4&&(m.home_team.team_id===this.gsData.teamId||m.visiting_team.team_id===this.gsData.teamId)&&this.userTeamGames.push(m),u},{});this.userTeamGames.sort((u,h)=>u.dateTimeMillis-h.dateTimeMillis);for(let[u,h]of Object.entries(d))d[u]=Object.entries(h).map(([m,p])=>({date:m,games:p.sort((f,y)=>f.dateTimeMillis-y.dateTimeMillis)})),d[u].sort((m,p)=>m.date<p.date?-1:m.date>p.date?1:0);return{type:c.type,weight:c.type===0?0:c.type===2?1:2,schedule:d}}):[];l.sort((c,d)=>c.weight-d.weight),this.fullTournamentScheduleFull=l.reduce((c,d)=>{for(const[u,h]of Object.entries(d.schedule))if(d.type===0)if(this.isCup){const m=u.replace("M",""),p=`Jornada ${m}`;this.isCupLegacy?c[o5e[m]||p]=h:c[s5e[u]||p]=h}else c[Number(u.replace("M","")).toString()]=h;else d.type===2?["PI1","PI2"].includes(u)?c[u]=h:c[`R${Number(u.replace("PO",""))}`]=h:d.type===1&&(c[r5e[u]]=h);return c},{}),this.tournamentScheduleKeys=Object.keys(this.fullTournamentScheduleFull)}catch(a){throw new Error(a)}finally{this.loadingFlag=!1}},getNormalClosestRound(e){const a=Object.entries(Object.entries(e).reduce((r,[o,l])=>(r[o]=[],l.forEach(c=>{c.games.forEach(d=>{const u=new Date(d.date_time_utc).getTime()+66e5;r[o].push(u)})}),r),{}));if(!a.length)return"1";const i=new Date().getTime(),n=a.reduce((r,[o,l])=>{let c=null;return l.forEach(d=>{const u=d-i;u>=0&&(c===null||u<c)&&(c=u)}),c&&(r.shortestTime===null||c<r.shortestTime)&&(r.round=o,r.shortestTime=c),r},{round:"",shortestTime:null});return n.shortestTime!==null?n.round:a[a.length-1][0]},getUserTeamClosestRound(e){let t=1;if(this.userTeamGames.length){const a=this.userTeamGames[0];for(const[i,n]of Object.entries(e))for(const r of n)if(r.games.find(l=>l.game_id===a.game_id))return i}return t}},async created(){const a=(await this.fetchTournaments(3)).find(n=>n._id===1).seasons[1],i=[{id:a.id,type:a.type}];a.related_seasons&&a.related_seasons.length&&i.push(...a.related_seasons.map(n=>({id:n.id,type:n.type}))),await this.createFullTournamentScheme(i,!1)}},e4e=e=>(s.pushScopeId("data-v-1d1c7fb4"),e=e(),s.popScopeId(),e),t4e={class:"gsclanding",ref:"landingref"},a4e={key:0,class:"container-selectors-mobile"},i4e={class:"container-selectors-mobile-tournament"},n4e={class:"container-selectors-mobile-season"},r4e={key:0,class:"home-item-movil"},s4e=e4e(()=>s.createElementVNode("div",{class:"home-movil"},"Inicio",-1)),o4e={class:"name-user-movil"},l4e={key:1,class:"home-item"},c4e={key:2,class:"bar-settings"},d4e={class:"name-user"},u4e={class:"container-selectors"},h4e={class:"selector-tournament"},p4e={class:"selector-seasons"},m4e={key:3,class:"container-games"},f4e={key:4,class:"container-players"},g4e={class:"container-tops"},y4e={class:"container-vr"};function _4e(e,t,a,i,n,r){const o=s.resolveComponent("GSCTournamentSelect"),l=s.resolveComponent("GSCSeasonSelect"),c=s.resolveComponent("GSCGames"),d=s.resolveComponent("GSCGridTeamsMatches"),u=s.resolveComponent("GSCTableCalendar"),h=s.resolveComponent("GSCPlayersLanding"),m=s.resolveComponent("GSCTops"),p=s.resolveComponent("GSCMediaPlayer");return s.openBlock(),s.createElementBlock("div",t4e,[i.elementSize.width<=680?(s.openBlock(),s.createElementBlock("div",a4e,[s.createElementVNode("div",i4e,[s.createVNode(o,{"current-season-id":a.currentSeasonId,width:"100%",onInput:r.onInputTournament},null,8,["current-season-id","onInput"])]),s.createElementVNode("div",n4e,[s.createVNode(l,{"current-season-id":a.currentSeasonId,width:"100%",seasons:n.tournamentSelectedDropDowns.seasons,onInput:r.onInputSeason},null,8,["current-season-id","seasons","onInput"])])])):s.createCommentVNode("",!0),s.createElementVNode("div",{class:s.normalizeClass(r.containerbackground)},[s.createElementVNode("div",{class:s.normalizeClass(r.containerdata)},[i.elementSize.width<=680?(s.openBlock(),s.createElementBlock("div",r4e,[s4e,s.createElementVNode("div",o4e,[s.createTextVNode("Bienvenido "),a.user.name.split(",").length!=0?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[a.user.name.split(",").length==1?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[a.user.name.split(",")[0]!=""?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(", ")],64)):s.createCommentVNode("",!0),s.createTextVNode(s.toDisplayString(a.user.name.split(",")[0]),1)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[a.user.name.split(",")[0]!=""?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(", ")],64)):s.createCommentVNode("",!0),s.createTextVNode(s.toDisplayString(a.user.name.split(",")[1]),1)],64))],64)):s.createCommentVNode("",!0)])])):s.createCommentVNode("",!0),i.elementSize.width>680?(s.openBlock(),s.createElementBlock("div",l4e,"Inicio")):s.createCommentVNode("",!0),i.elementSize.width>680?(s.openBlock(),s.createElementBlock("div",c4e,[s.createElementVNode("div",d4e,[s.createTextVNode("Bienvenido "),a.user.name.split(",").length!=0?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[a.user.name.split(",").length==1?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[a.user.name.split(",")[0]!=""?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(", ")],64)):s.createCommentVNode("",!0),s.createTextVNode(s.toDisplayString(a.user.name.split(",")[0]),1)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[a.user.name.split(",")[0]!=""?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(", ")],64)):s.createCommentVNode("",!0),s.createTextVNode(s.toDisplayString(a.user.name.split(",")[1]),1)],64))],64)):s.createCommentVNode("",!0)]),s.createElementVNode("div",u4e,[s.createElementVNode("div",h4e,[s.createVNode(o,{"current-season-id":a.currentSeasonId,onInput:r.onInputTournament},null,8,["current-season-id","onInput"])]),s.createElementVNode("div",p4e,[s.createVNode(l,{"current-season-id":a.currentSeasonId,seasons:n.tournamentSelectedDropDowns.seasons,onInput:r.onInputSeason},null,8,["current-season-id","seasons","onInput"])])])])):s.createCommentVNode("",!0),Object.keys(n.tournamentSelected).length>0?(s.openBlock(),s.createElementBlock("div",m4e,[s.createVNode(c,{"component-width":i.elementSize.width,isplayer:a.isplayer,"is-full":n.tournamentSelected.id!=a.user.tournament,onClickMatch:r.onClickMatch,onClickCalendar:r.onClickCalendar,data:n.tournamentSelected.id==a.user.tournament?n.fullTournamentSchedule:r.gamesFullLeague},null,8,["component-width","isplayer","is-full","onClickMatch","onClickCalendar","data"])])):s.createCommentVNode("",!0),s.createElementVNode("div",{class:s.normalizeClass(r.containerGridCalendarTable)},[s.createElementVNode("div",{class:"container-grid",style:s.normalizeStyle(i.elementSize.width<1e3?"width: 100%":"")},[s.createVNode(d,{isPlayer:a.isplayer?n.tournamentSelected.id==a.user.tournament:!1,"player-id":a.user.player,"team-id":a.user.team,"season-selected":n.seasonSelected.id,"next-rival-id":Object.keys(n.fullTournamentSchedule).length>0?a.user.team==n.fullTournamentSchedule.data.prematch.home_team?n.fullTournamentSchedule.data.prematch.visiting_team:n.fullTournamentSchedule.data.prematch.home_team:0,"team-img":"https://az755631.vo.msecnd.net/teams-150/"+a.user.team+".png","player-img":"https://az755631.vo.msecnd.net/players-profile/"+a.user.player+".png","rival-img":Object.keys(n.fullTournamentSchedule).length>0?a.user.team==n.fullTournamentSchedule.data.prematch.home_team?"https://az755631.vo.msecnd.net/teams-150/"+n.fullTournamentSchedule.data.prematch.visiting_team+".png":"https://az755631.vo.msecnd.net/teams-150/"+n.fullTournamentSchedule.data.prematch.home_team+".png":"","has-team":a.isplayer?!1:n.tournamentSelected.id==a.user.tournament,"component-width":i.elementSize.width,onAction:r.clickCard},null,8,["isPlayer","player-id","team-id","season-selected","next-rival-id","team-img","player-img","rival-img","has-team","component-width","onAction"])],4),s.createElementVNode("div",{class:"container-calendar-table",style:s.normalizeStyle(i.elementSize.width<1e3?"width: 100%; margin-top: 30px;":"")},[s.createVNode(u,{onAction:r.onAction,season:n.seasonSelected,seasons:n.seasonsSelected,onOpenmedia:r.onOpenMedia,onOnOpenProfile:r.onOpenProfile,componentWidth:i.elementSize.width},null,8,["onAction","season","seasons","onOpenmedia","onOnOpenProfile","componentWidth"])],4)],2),n.tournamentSelected.id==a.user.tournament?s.withDirectives((s.openBlock(),s.createElementBlock("div",f4e,[s.createVNode(h,{onClickProfileBtn:r.clickProfileBtn,onViewAll:r.viewAll,onTotalPlayers:r.getTotalPlayers,"team-id":a.user.team,"season-id":n.seasonSelected.id,"is-player":a.user.player!=0},null,8,["onClickProfileBtn","onViewAll","onTotalPlayers","team-id","season-id","is-player"])],512)),[[s.vShow,n.playersLength>0]]):s.createCommentVNode("",!0),s.createElementVNode("div",g4e,[s.createVNode(m,{onMore:r.moreTops,"show-switch":n.tournamentSelected.id==a.user.tournament,season:n.seasonSelected.id,"team-id":a.user.team,onOpenmedia:r.onOpenMedia},null,8,["onMore","show-switch","season","team-id","onOpenmedia"])]),s.createElementVNode("div",y4e,[s.createVNode(p)])],2)],2)],512)}const b4e=si($5e,[["render",_4e],["__scopeId","data-v-1d1c7fb4"]]),v4e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},S4e={key:1},w4e={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T4e=["fill"],C4e={key:0,class:"checkbox__teams"},k4e={class:"checkbox__teams__logo"},E4e=["src"],I4e={class:"checkbox__teams__logo"},x4e=["src"],N4e={__name:"GSC-Checkbox",props:{width:{type:String,default:"fit-content"},height:{type:String,default:"fit-content"},label:{type:String,default:""},labelWhiteSpace:{type:String,default:"normal"},labelColor:{type:String,default:"white"},fontFamily:{type:String,default:"sans-serif"},labelFontSize:{type:String,default:"12px"},modelValue:{type:Boolean,default:!1},justifyContent:{type:String,default:"flex-start"},alignItems:{type:String,default:"center"},boxBackgroundColor:{type:String,default:"#CBEE6B"},boxValueColor:{type:String,default:"#0d1d29"},boxValue:{type:[String,Number],default:""},boxPosition:{type:String,default:"left",validator(e){return["left","right","top","bottom"].includes(e)}},boxMarginTop:{type:String,default:"0.2em"},boxWidthAndHeight:{type:String,default:"16px"},boxBorderColor:{type:String,default:"#969da2"},boxBorderWidth:{type:String,default:"2px"},boxBorderRadius:{type:String,default:"4px"},boxValueFontSize:{type:String,default:"10px"},boxValueFontFamily:{type:String,default:"sans-serif"},avoidInteraction:{type:Boolean,default:!1},avoidToCheck:{type:Boolean,default:!1},isBoxOnly:{type:Boolean,default:!1},teamsIds:{type:Array,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e;s.useCssVars(d=>({"6582e90e":e.width,"310b3edf":e.height}));const i=s.ref(!1),n=s.computed(()=>{const d={color:a.boxValueColor,"font-family":a.fontFamily,height:a.boxWidthAndHeight,width:a.boxWidthAndHeight,minWidth:a.boxWidthAndHeight,"border-radius":a.boxBorderRadius,"margin-top":a.boxMarginTop};return i.value?(d["background-color"]=a.boxBackgroundColor,d.border=`solid ${a.boxBorderWidth} ${a.boxBackgroundColor}`):d.border=`solid ${a.boxBorderWidth} ${a.boxBorderColor}`,d}),r=s.computed(()=>({"font-family":a.boxValueFontFamily,"font-size":a.boxValueFontSize,color:a.boxValueColor,"line-height":1})),o=s.computed(()=>{const d={color:a.labelColor,"font-family":a.fontFamily,"font-size":a.labelFontSize,"white-space":a.labelWhiteSpace,"text-align":a.boxPosition==="top"||a.boxPosition==="bottom"?"center":a.boxPosition};return(a.boxPosition==="left"||a.boxPosition==="right")&&(d[`margin-${a.boxPosition}`]=a.isBoxOnly?"0":a.teamsIds?"8px":"10px"),d});s.watch(()=>a.modelValue,d=>{d!==i.value&&(i.value=d)},{immediate:!0});function l(){a.avoidInteraction||!i.value&&a.avoidToCheck||(i.value=!i.value,t("update:modelValue",i.value))}function c(d){return`${{}.TEAM_LOGOS_URL||"https://az755631.vo.msecnd.net/teams-80/"}${d}.png`}return(d,u)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:l},[s.createElementVNode("div",{class:"checkbox__box",style:s.normalizeStyle(n.value)},[i.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[a.boxValue?(s.openBlock(),s.createElementBlock("div",{key:0,class:"checkbox__box__value",style:s.normalizeStyle(r.value)},s.toDisplayString(e.boxValue),5)):(s.openBlock(),s.createElementBlock("div",S4e,[(s.openBlock(),s.createElementBlock("svg",w4e,[s.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:e.boxValueColor},null,8,T4e)]))]))],64)):s.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(s.openBlock(),s.createElementBlock("div",C4e,[s.createElementVNode("div",k4e,[s.createElementVNode("img",{src:c(e.teamsIds[0]),alt:""},null,8,E4e)]),s.createElementVNode("div",I4e,[s.createElementVNode("img",{src:c(e.teamsIds[1]),alt:""},null,8,x4e)])])):s.createCommentVNode("",!0),s.createElementVNode("div",{class:"checkbox__label",style:s.normalizeStyle(o.value)},s.toDisplayString(e.label),5)],2))}},mv=v4e(N4e,[["__scopeId","data-v-bcf3bcc6"]]),A4e={class:"subcategory-group"},P4e={__name:"SubcategoryGroup",props:{subcategoryGroup:{type:Array,default:()=>[]}},setup(e){return(t,a)=>(s.openBlock(),s.createElementBlock("div",A4e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.subcategoryGroup,i=>(s.openBlock(),s.createBlock(s.unref(mv),{key:i.id,modelValue:i.isSelected,"onUpdate:modelValue":n=>i.isSelected=n,label:i.name},null,8,["modelValue","onUpdate:modelValue","label"]))),128))]))}},O4e=bt(P4e,[["__scopeId","data-v-6c6e0261"]]),B4e={class:"filter-subcategories"},D4e=Object.freeze(Object.defineProperty({__proto__:null,default:bt({__name:"FilterSubcategories",props:{subcategoryGroups:{type:Array,default:()=>[]}},setup(e){return(t,a)=>(s.openBlock(),s.createElementBlock("div",B4e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.subcategoryGroups,i=>(s.openBlock(),s.createElementBlock("div",{key:i.id,class:"filter-subcategories__group"},[s.createVNode(O4e,{subcategoryGroup:i},null,8,["subcategoryGroup"])]))),128))]))}},[["__scopeId","data-v-feeb6f0d"]])},Symbol.toStringTag,{value:"Module"})),kf=e=>(s.pushScopeId("data-v-f22f11b6"),e=e(),s.popScopeId(),e),M4e={class:"details__header"},L4e=kf(()=>s.createElementVNode("div",{class:"details__header__title"},"Jugando como",-1)),R4e={class:"details__header__checkbox"},F4e={class:"details__body"},V4e={class:"details__body__playing-as"},U4e=["onClick"],j4e={class:"details__header"},z4e=kf(()=>s.createElementVNode("div",{class:"details__header__title"},"En: (Elige el lapso de tiempo)",-1)),H4e={class:"details__header__checkbox"},q4e={class:"details__body"},W4e=kf(()=>s.createElementVNode("div",{class:"details__body__title"},"1er tiempo",-1)),G4e={class:"details__body__game-section"},K4e=["onClick"],X4e={class:"details__body"},J4e=kf(()=>s.createElementVNode("div",{class:"details__body__title"},"2do tiempo",-1)),Y4e={class:"details__body__game-section"},Q4e=["onClick"],Z4e=Object.freeze(Object.defineProperty({__proto__:null,default:bt({__name:"FilterConditions",props:{conditions:{type:Object,default:()=>({playingAs:[{name:"Local",value:1,isSelected:!0},{name:"Visitante",value:2,isSelected:!0}],gameSections:[{text:"0-15",value:1,isSelected:!0},{text:"16-30",value:2,isSelected:!0},{text:"31-45",value:3,isSelected:!0},{text:"46-60",value:4,isSelected:!0},{text:"61-75",value:5,isSelected:!0},{text:"76-90",value:6,isSelected:!0}]})},playingAs:{type:Array,default:()=>[{name:"Local",isSelected:!0},{name:"Visitante",isSelected:!0}]},gameSections:{type:Array,default:()=>[{text:"0-15",value:1,isSelected:!0},{text:"16-30",value:2,isSelected:!0},{text:"31-45",value:3,isSelected:!0},{text:"46-60",value:4,isSelected:!0},{text:"61-75",value:5,isSelected:!0},{text:"76-90",value:6,isSelected:!0}]},buttonsBackgroundColor:{type:String,default:"rgba(255, 255, 255, 0)"},buttonsBackgroundColorActive:{type:String,default:"rgba(203, 238, 107, 0.05)"},buttonsTextColor:{type:String,default:"rgba(255, 255, 255, 0.8)"},buttonsTextColorActive:{type:String,default:"rgba(255, 255, 255, 1)"},buttonsBorderColor:{type:String,default:"#8ea2ab"},buttonsBorderColorActive:{type:String,default:"#cbee6b"},buttonsBorderWidth:{type:String,default:"0.8px"},buttonsBorderWidthActive:{type:String,default:"1px"},buttonsBorderRadius:{type:String,default:"4px"}},setup(e){const t=e;s.useCssVars(u=>({"7fb261be":e.buttonsBackgroundColor,"2ed63bdf":e.buttonsTextColor,"104a673a":e.buttonsBorderWidth,12786400:e.buttonsBorderColor,"661a0664":e.buttonsBackgroundColorActive,"61bff876":e.buttonsTextColorActive,e5a1bd6e:e.buttonsBorderWidthActive,"50c5b926":e.buttonsBorderColorActive}));const a=s.computed(()=>t.conditions.playingAs.every(u=>u.isSelected)),i=s.computed(()=>t.conditions.gameSections.every(u=>u.isSelected)),n=s.computed(()=>t.conditions.gameSections.reduce((u,h)=>(h.value<=3?u.firstHalf.push(h):u.secondHalf.push(h),u),{firstHalf:[],secondHalf:[]})),r=s.computed(()=>({"--border-radius-first-button":`${t.buttonsBorderRadius} 0 0 ${t.buttonsBorderRadius}`,"--border-radius-last-button":`0 ${t.buttonsBorderRadius} ${t.buttonsBorderRadius} 0`}));function o(u){u?t.conditions.playingAs.forEach(h=>{h.isSelected=!0}):t.conditions.playingAs.forEach((h,m)=>{h.isSelected=m===0})}function l(u){t.conditions.playingAs.filter(h=>h.isSelected).length===1&&u.isSelected||(u.isSelected=!u.isSelected)}function c(u){t.conditions.gameSections.filter(h=>h.isSelected).length===1&&u.isSelected||(u.isSelected=!u.isSelected)}function d(u){u?t.conditions.gameSections.forEach(h=>{h.isSelected=!0}):t.conditions.gameSections.forEach((h,m)=>{h.isSelected=m===0})}return(u,h)=>(s.openBlock(),s.createElementBlock("div",{class:"details",style:s.normalizeStyle(r.value)},[s.createElementVNode("div",M4e,[L4e,s.createElementVNode("div",R4e,[s.createVNode(s.unref(mv),{label:"Todos","model-value":a.value,"onUpdate:modelValue":o},null,8,["model-value"])])]),s.createElementVNode("div",F4e,[s.createElementVNode("div",V4e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.conditions.playingAs,(m,p)=>(s.openBlock(),s.createElementBlock("div",{key:`pa${p}`,class:s.normalizeClass(["details__body__button",{active:m.isSelected}]),onClick:f=>l(m)},s.toDisplayString(m.name),11,U4e))),128))])]),s.createElementVNode("div",j4e,[z4e,s.createElementVNode("div",H4e,[s.createVNode(s.unref(mv),{label:"Todos","model-value":i.value,"onUpdate:modelValue":d},null,8,["model-value"])])]),s.createElementVNode("div",q4e,[W4e,s.createElementVNode("div",G4e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.firstHalf,(m,p)=>(s.openBlock(),s.createElementBlock("div",{key:`pa${p}`,class:s.normalizeClass(["details__body__button",{active:m.isSelected}]),onClick:f=>c(m)},s.toDisplayString(m.text),11,K4e))),128))])]),s.createElementVNode("div",X4e,[J4e,s.createElementVNode("div",Y4e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.secondHalf,(m,p)=>(s.openBlock(),s.createElementBlock("div",{key:`pa${p}`,class:s.normalizeClass(["details__body__button",{active:m.isSelected}]),onClick:f=>c(m)},s.toDisplayString(m.text),11,Q4e))),128))])])],4))}},[["__scopeId","data-v-f22f11b6"]])},Symbol.toStringTag,{value:"Module"})),$4e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},fv={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},uP=()=>{s.useCssVars(e=>({"1c960139":e.height,b2f635d8:e.borderWidthBtn,"06e99898":e.borderType,"55555c76":e.borderColor,"23b6d320":e.borderRadius,"22c97374":e.width,"22bb09fa":e.backgroundColor,c148da7c:e.cursorType,cce756fc:e.fontSize,cff98d60:e.fontStyle,"5123b3a5":e.fontFamily,"47bf58db":e.marginLeftStat,cadc8414:e.fontSizeStat}))},hP=fv.setup;fv.setup=hP?(e,t)=>(uP(),hP(e,t)):uP;const e3e=e=>(s.pushScopeId("data-v-fb269a1e"),e=e(),s.popScopeId(),e),t3e=["src"],a3e={key:1,class:"text"},i3e=["src"],n3e={class:"stats"},r3e=e3e(()=>s.createElementVNode("img",{class:"iconstats",src:"https://az755631.vo.msecnd.net/todoelfut/playdes.png"},null,-1)),s3e={class:"numstats"},o3e={class:"leyend"};function l3e(e,t,a,i,n,r){return s.openBlock(),s.createElementBlock("div",null,[a.type==0?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["button",n.status&&a.typeOnOff&&"button-active"]),style:s.normalizeStyle([r.customStyle,n.status&&a.typeOnOff&&r.customActive]),onClick:t[0]||(t[0]=(...o)=>r.btnClick&&r.btnClick(...o))},[a.icon&&a.iconPosition.toLowerCase()==="left"?(s.openBlock(),s.createElementBlock("img",{key:0,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,t3e)):s.createCommentVNode("",!0),a.textValue?(s.openBlock(),s.createElementBlock("div",a3e,s.toDisplayString(a.textValue),1)):s.createCommentVNode("",!0),a.icon&&a.iconPosition.toLowerCase()==="right"?(s.openBlock(),s.createElementBlock("img",{key:2,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,i3e)):s.createCommentVNode("",!0)],6)):s.createCommentVNode("",!0),a.type==1?(s.openBlock(),s.createElementBlock("div",{key:1,class:"button-target",onClick:t[1]||(t[1]=(...o)=>r.btnClick&&r.btnClick(...o))},[s.createElementVNode("div",n3e,[r3e,s.createElementVNode("div",s3e,s.toDisplayString(a.textStat),1)]),s.createElementVNode("div",o3e,s.toDisplayString(a.textCategory),1)])):s.createCommentVNode("",!0)])}const c3e=$4e(fv,[["render",l3e],["__scopeId","data-v-fb269a1e"]]),d3e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},u3e={key:1},h3e={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p3e=["fill"],m3e={key:0,class:"checkbox__teams"},f3e={class:"checkbox__teams__logo"},g3e=["src"],y3e={class:"checkbox__teams__logo"},_3e=["src"],b3e={__name:"GSC-Checkbox",props:{width:{type:String,default:"fit-content"},height:{type:String,default:"fit-content"},label:{type:String,default:""},labelWhiteSpace:{type:String,default:"normal"},labelColor:{type:String,default:"white"},fontFamily:{type:String,default:"sans-serif"},labelFontSize:{type:String,default:"12px"},modelValue:{type:Boolean,default:!1},justifyContent:{type:String,default:"flex-start"},alignItems:{type:String,default:"center"},boxBackgroundColor:{type:String,default:"#CBEE6B"},boxValueColor:{type:String,default:"#0d1d29"},boxValue:{type:[String,Number],default:""},boxPosition:{type:String,default:"left",validator(e){return["left","right","top","bottom"].includes(e)}},boxMarginTop:{type:String,default:"0.2em"},boxWidthAndHeight:{type:String,default:"16px"},boxBorderColor:{type:String,default:"#969da2"},boxBorderWidth:{type:String,default:"2px"},boxBorderRadius:{type:String,default:"4px"},boxValueFontSize:{type:String,default:"10px"},boxValueFontFamily:{type:String,default:"sans-serif"},avoidInteraction:{type:Boolean,default:!1},avoidToCheck:{type:Boolean,default:!1},isBoxOnly:{type:Boolean,default:!1},teamsIds:{type:Array,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e;s.useCssVars(d=>({"6582e90e":e.width,"310b3edf":e.height}));const i=s.ref(!1),n=s.computed(()=>{const d={color:a.boxValueColor,"font-family":a.fontFamily,height:a.boxWidthAndHeight,width:a.boxWidthAndHeight,minWidth:a.boxWidthAndHeight,"border-radius":a.boxBorderRadius,"margin-top":a.boxMarginTop};return i.value?(d["background-color"]=a.boxBackgroundColor,d.border=`solid ${a.boxBorderWidth} ${a.boxBackgroundColor}`):d.border=`solid ${a.boxBorderWidth} ${a.boxBorderColor}`,d}),r=s.computed(()=>({"font-family":a.boxValueFontFamily,"font-size":a.boxValueFontSize,color:a.boxValueColor,"line-height":1})),o=s.computed(()=>{const d={color:a.labelColor,"font-family":a.fontFamily,"font-size":a.labelFontSize,"white-space":a.labelWhiteSpace,"text-align":a.boxPosition==="top"||a.boxPosition==="bottom"?"center":a.boxPosition};return(a.boxPosition==="left"||a.boxPosition==="right")&&(d[`margin-${a.boxPosition}`]=a.isBoxOnly?"0":a.teamsIds?"8px":"10px"),d});s.watch(()=>a.modelValue,d=>{d!==i.value&&(i.value=d)},{immediate:!0});function l(){a.avoidInteraction||!i.value&&a.avoidToCheck||(i.value=!i.value,t("update:modelValue",i.value))}function c(d){return`${{}.TEAM_LOGOS_URL||"https://az755631.vo.msecnd.net/teams-80/"}${d}.png`}return(d,u)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:l},[s.createElementVNode("div",{class:"checkbox__box",style:s.normalizeStyle(n.value)},[i.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[a.boxValue?(s.openBlock(),s.createElementBlock("div",{key:0,class:"checkbox__box__value",style:s.normalizeStyle(r.value)},s.toDisplayString(e.boxValue),5)):(s.openBlock(),s.createElementBlock("div",u3e,[(s.openBlock(),s.createElementBlock("svg",h3e,[s.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:e.boxValueColor},null,8,p3e)]))]))],64)):s.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(s.openBlock(),s.createElementBlock("div",m3e,[s.createElementVNode("div",f3e,[s.createElementVNode("img",{src:c(e.teamsIds[0]),alt:""},null,8,g3e)]),s.createElementVNode("div",y3e,[s.createElementVNode("img",{src:c(e.teamsIds[1]),alt:""},null,8,_3e)])])):s.createCommentVNode("",!0),s.createElementVNode("div",{class:"checkbox__label",style:s.normalizeStyle(o.value)},s.toDisplayString(e.label),5)],2))}},v3e=d3e(b3e,[["__scopeId","data-v-bcf3bcc6"]]),S3e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},gv={components:{GSCButton:c3e,GSCCheckbox:v3e},data(){return{update:0,all:!1,refreshBtn14:0,refreshBtn24:0,refreshBtn34:0,refreshBtn44:0,sectors:Array.from({length:16},(e,t)=>({sector:t+1,active:!1})),lastUpdatedValue:[]}},props:{backgroundColor:{type:String,default:"#2e3b46"},heightContainer:{type:String,default:"340px"},widthContainer:{type:String,default:"455px"},heightField:{type:Number,default:230},widthField:{type:Number,default:350},heightFieldGrid:{type:String,default:"230px"},widthFieldGrid:{type:String,default:"350px"},backgroundSectorActive:{type:String,default:"#cbee6b"},backgroundSectorDisabled:{type:String,default:"#2e3b46"},borderWidth:{type:Number,default:1},opacitySector:{type:Number,default:.5},borderColor:{type:String,default:"#FFFFFF"},colorLineField:{type:String,default:"#bfc2c5"},borderWidthLineField:{type:Number,default:2},value:{type:Array,default:()=>[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]},title:{type:String,default:"Pase(s) desde la(s) zona(s):"},titleFontSize:{type:String,default:"14px"}},watch:{value:{deep:!0,immediate:!0,handler(e){const t=e.sort();JSON.stringify(t)!==JSON.stringify(this.lastUpdatedValue)&&(this.lastUpdatedValue=t,this.sectors.forEach((a,i)=>{a.active=e.includes(i+1),this.validateField(i)}),this.$emit("update:modelValue",e))}},sectors:{handler(e){var t=[];for(let a=0;a<e.length;a++)e[a].active&&t.push(a+1);this.$emit("update:modelValue",t)},deep:!0}},computed:{translx(){var e=0;return this.widthField>305?e=this.widthField-305:this.widthField==268&&(e=-36),e},transly(){var e=0;return this.heightField>195?(e=this.heightField-195,e=e/2):this.heightField==180&&(e=-7),e},translxcircle(){var e=0;return this.widthField>305?(e=this.widthField-305,e=e/2):this.widthField==268&&(e=-18),e}},methods:{clickAll(e){if(e){for(let t=0;t<this.sectors.length;t++)this.sectors[t].active=!0,this.validateField(t);this.status14=!0,this.status24=!0,this.status34=!0,this.status44=!0,this.refreshBtn14+=1,this.refreshBtn24+=1,this.refreshBtn34+=1,this.refreshBtn44+=1}else for(let t=0;t<this.sectors.length;t++)this.sectors[t].active=!1,this.validateField(t),this.status14=!1,this.status24=!1,this.status34=!1,this.status44=!1,this.refreshBtn14=0,this.refreshBtn24=0,this.refreshBtn34=0,this.refreshBtn44=0},selectSector(e){var t=0;this.sectors[e].active=!this.sectors[e].active;for(let a=0;a<this.sectors.length;a++)this.sectors[a].active&&(t+=1);t==0&&(this.sectors[e].active=!0),this.validateField(e)},btn14(e){this.sectors[0].active=e?this.sectors[0].active=!0:this.sectors[0].active=!1,this.sectors[1].active=e?this.sectors[1].active=!0:this.sectors[1].active=!1,this.sectors[2].active=e?this.sectors[2].active=!0:this.sectors[2].active=!1,this.sectors[3].active=e?this.sectors[3].active=!0:this.sectors[3].active=!1;var t=0;for(let a=0;a<this.sectors.length;a++)this.sectors[a].active&&(t+=1);t==0?(this.sectors[0].active=!0,this.sectors[1].active=!0,this.sectors[2].active=!0,this.sectors[3].active=!0,this.status14=!0,this.refreshBtn14+=1):this.status14=!1,t==16&&(this.all=!0,this.update+=1)},btn24(e){this.sectors[4].active=e?this.sectors[4].active=!0:this.sectors[4].active=!1,this.sectors[5].active=e?this.sectors[5].active=!0:this.sectors[5].active=!1,this.sectors[6].active=e?this.sectors[6].active=!0:this.sectors[6].active=!1,this.sectors[7].active=e?this.sectors[7].active=!0:this.sectors[7].active=!1;var t=0;for(let a=0;a<this.sectors.length;a++)this.sectors[a].active&&(t+=1);t==0?(this.sectors[4].active=!0,this.sectors[5].active=!0,this.sectors[6].active=!0,this.sectors[7].active=!0,this.status24=!0,this.refreshBtn24+=1):this.status24=!1,t==16&&(this.all=!0,this.update+=1)},btn34(e){this.sectors[8].active=e?this.sectors[8].active=!0:this.sectors[8].active=!1,this.sectors[9].active=e?this.sectors[9].active=!0:this.sectors[9].active=!1,this.sectors[10].active=e?this.sectors[10].active=!0:this.sectors[10].active=!1,this.sectors[11].active=e?this.sectors[11].active=!0:this.sectors[11].active=!1;var t=0;for(let a=0;a<this.sectors.length;a++)this.sectors[a].active&&(t+=1);t==0?(this.sectors[8].active=!0,this.sectors[9].active=!0,this.sectors[10].active=!0,this.sectors[11].active=!0,this.status34=!0,this.refreshBtn34+=1):this.status34=!1,t==16&&(this.all=!0,this.update+=1)},btn44(e){this.sectors[12].active=e?this.sectors[12].active=!0:this.sectors[12].active=!1,this.sectors[13].active=e?this.sectors[13].active=!0:this.sectors[13].active=!1,this.sectors[14].active=e?this.sectors[14].active=!0:this.sectors[14].active=!1,this.sectors[15].active=e?this.sectors[15].active=!0:this.sectors[15].active=!1;var t=0;for(let a=0;a<this.sectors.length;a++)this.sectors[a].active&&(t+=1);t==0?(this.sectors[12].active=!0,this.sectors[13].active=!0,this.sectors[14].active=!0,this.sectors[15].active=!0,this.status44=!0,this.refreshBtn44+=1):this.status44=!1,t==16&&(this.all=!0,this.update+=1)},validateField(e){(e===0||e===1||e===2||e===3)&&(this.status14=!!(this.sectors[0].active&&this.sectors[1].active&&this.sectors[2].active&&this.sectors[3].active)),(e===4||e===5||e===6||e===7)&&(this.status24=!!(this.sectors[4].active&&this.sectors[5].active&&this.sectors[6].active&&this.sectors[7].active)),(e===8||e===9||e===10||e===11)&&(this.status34=!!(this.sectors[8].active&&this.sectors[9].active&&this.sectors[10].active&&this.sectors[11].active)),(e===12||e===13||e===14||e===15)&&(this.status44=!!(this.sectors[12].active&&this.sectors[13].active&&this.sectors[14].active&&this.sectors[15].active)),this.all=!!(this.status14&&this.status34&&this.status24&&this.status44),this.update+=1,this.status14&&(this.refreshBtn14+=1),this.status24&&(this.refreshBtn24+=1),this.status34&&(this.refreshBtn34+=1),this.status44&&(this.refreshBtn44+=1)}}},pP=()=>{s.useCssVars(e=>({ff70d60a:e.widthContainer,daba190c:e.heightContainer,"6f469996":e.backgroundColor,"4ee5a3c8":e.titleFontSize,"37ac484c":e.widthFieldGrid,"12f58b4e":e.heightFieldGrid}))},mP=gv.setup;gv.setup=mP?(e,t)=>(pP(),mP(e,t)):pP;const w3e={class:"gsc-field"},T3e={class:"gsc-field__title-checked"},C3e={class:"gsc-field__title-checked__title"},k3e={class:"gsc-field__title-checked__check-cont"},E3e={class:"gsc-field__container-field"},I3e={class:"gsc-field__container-field__field"},x3e={width:"100%",height:"100%",fill:"#2e3b46",xmlns:"http://www.w3.org/2000/svg"},N3e=["stroke"],A3e=["stroke","stroke-width"],P3e=["stroke","stroke-width"],O3e=["stroke-width","stroke"],B3e=["fill","fill-opacity","stroke","stroke-width"],D3e=["fill","fill-opacity","stroke","stroke-width"],M3e=["fill","fill-opacity","stroke","stroke-width"],L3e=["fill","fill-opacity","stroke","stroke-width"],R3e=["fill","fill-opacity","stroke","stroke-width"],F3e=["fill","fill-opacity","stroke","stroke-width"],V3e=["fill","fill-opacity","stroke","stroke-width"],U3e=["fill","fill-opacity","stroke","stroke-width"],j3e=["fill","fill-opacity","stroke","stroke-width"],z3e=["fill","fill-opacity","stroke","stroke-width"],H3e=["fill","fill-opacity","stroke","stroke-width"],q3e=["fill","fill-opacity","stroke","stroke-width"],W3e=["fill","fill-opacity","stroke","stroke-width"],G3e=["fill","fill-opacity","stroke","stroke-width"],K3e=["fill","fill-opacity","stroke","stroke-width"],X3e=["fill","fill-opacity","stroke","stroke-width"],J3e={class:"gsc-field__container-field__bar-buttons"};function Y3e(e,t,a,i,n,r){const o=s.resolveComponent("GSCCheckbox"),l=s.resolveComponent("GSCButton");return s.openBlock(),s.createElementBlock("div",w3e,[s.createElementVNode("div",T3e,[s.createElementVNode("div",C3e,s.toDisplayString(a.title),1),s.createElementVNode("div",k3e,[(s.openBlock(),s.createBlock(o,{label:"Todas las zonas","font-family":"Poppins-Regular","box-value-font-family":"Poppins-Regular","box-position":"right","label-font-size":a.titleFontSize,"label-white-space":"nowrap","box-margin-top":"0.4em",value:n.all,key:n.update,"model-value":n.all,"onUpdate:modelValue":r.clickAll},null,8,["label-font-size","value","model-value","onUpdate:modelValue"]))])]),s.createElementVNode("div",E3e,[s.createElementVNode("div",I3e,[(s.openBlock(),s.createElementBlock("svg",x3e,[s.createElementVNode("rect",{x:"1.5",y:"0.5",width:"100%",height:"100%",rx:"1.5",stroke:a.colorLineField},null,8,N3e),s.createElementVNode("path",{style:s.normalizeStyle("transform: translate("+r.translx+"px, "+r.transly+"px);"),d:"M303.597 39.9799H263.371C262.817 39.9799 262.369 40.4301 262.371 40.984L262.842 155.176C262.845 155.726 263.292 156.172 263.842 156.172H302.884",stroke:a.colorLineField,"stroke-width":a.borderWidthLineField,"stroke-linecap":"square"},null,12,A3e),s.createElementVNode("path",{style:s.normalizeStyle("transform: translateY("+r.transly+"px);"),class:"porteria1",d:"M1.09097 156.172L41.3162 156.172C41.8701 156.172 42.3185 155.722 42.3162 155.168L41.845 40.9758C41.8427 40.4252 41.3957 39.98 40.845 39.98L1.80338 39.98",stroke:a.colorLineField,"stroke-width":a.borderWidthLineField,"stroke-linecap":"square"},null,12,P3e),s.createElementVNode("path",{style:s.normalizeStyle("transform: translate("+r.translxcircle+"px, "+r.transly+"px);"),class:"circle",d:"M182.911 97.4512C182.911 113.726 169.44 126.936 152.801 126.936C136.162 126.936 122.691 113.726 122.691 97.4512C122.691 81.1767 136.162 67.9662 152.801 67.9662C169.44 67.9662 182.911 81.1767 182.911 97.4512Z","stroke-width":a.borderWidthLineField,stroke:a.colorLineField},null,12,O3e),s.createElementVNode("rect",{x:"0%",y:"0%",width:"25%",height:"25%",fill:n.sectors[0].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[0]||(t[0]=c=>r.selectSector(0))},null,8,B3e),s.createElementVNode("rect",{x:"0%",y:"25%",width:"25%",height:"25%",fill:n.sectors[1].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[1]||(t[1]=c=>r.selectSector(1))},null,8,D3e),s.createElementVNode("rect",{x:"0%",y:"50%",width:"25%",height:"25%",fill:n.sectors[2].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[2]||(t[2]=c=>r.selectSector(2))},null,8,M3e),s.createElementVNode("rect",{x:"0%",y:"75%",width:"25%",height:"25%",fill:n.sectors[3].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[3]||(t[3]=c=>r.selectSector(3))},null,8,L3e),s.createElementVNode("rect",{x:"25%",y:"0%",width:"25%",height:"25%",fill:n.sectors[4].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[4]||(t[4]=c=>r.selectSector(4))},null,8,R3e),s.createElementVNode("rect",{x:"25%",y:"25%",width:"25%",height:"25%",fill:n.sectors[5].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[5]||(t[5]=c=>r.selectSector(5))},null,8,F3e),s.createElementVNode("rect",{x:"25%",y:"50%",width:"25%",height:"25%",fill:n.sectors[6].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[6]||(t[6]=c=>r.selectSector(6))},null,8,V3e),s.createElementVNode("rect",{x:"25%",y:"75%",width:"25%",height:"25%",fill:n.sectors[7].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[7]||(t[7]=c=>r.selectSector(7))},null,8,U3e),s.createElementVNode("rect",{x:"50%",y:"0%",width:"25%",height:"25%",fill:n.sectors[8].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[8]||(t[8]=c=>r.selectSector(8))},null,8,j3e),s.createElementVNode("rect",{x:"50%",y:"25%",width:"25%",height:"25%",fill:n.sectors[9].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[9]||(t[9]=c=>r.selectSector(9))},null,8,z3e),s.createElementVNode("rect",{x:"50%",y:"50%",width:"25%",height:"25%",fill:n.sectors[10].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[10]||(t[10]=c=>r.selectSector(10))},null,8,H3e),s.createElementVNode("rect",{x:"50%",y:"75%",width:"25%",height:"25%",fill:n.sectors[11].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[11]||(t[11]=c=>r.selectSector(11))},null,8,q3e),s.createElementVNode("rect",{x:"75%",y:"0%",width:"25%",height:"25%",fill:n.sectors[12].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[12]||(t[12]=c=>r.selectSector(12))},null,8,W3e),s.createElementVNode("rect",{x:"75%",y:"25%",width:"25%",height:"25%",fill:n.sectors[13].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[13]||(t[13]=c=>r.selectSector(13))},null,8,G3e),s.createElementVNode("rect",{x:"75%",y:"50%",width:"25%",height:"25%",fill:n.sectors[14].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[14]||(t[14]=c=>r.selectSector(14))},null,8,K3e),s.createElementVNode("rect",{x:"75%",y:"75%",width:"25%",height:"25%",fill:n.sectors[15].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[15]||(t[15]=c=>r.selectSector(15))},null,8,X3e)]))]),s.createElementVNode("div",J3e,[(s.openBlock(),s.createBlock(l,{"text-value":"1/4 tos","font-size":"12px",height:"26px",width:"65px","type-on-off":!0,"border-width":1,"font-color":"#bfc2c5","border-color":"#8c9399","border-radius":"4px","font-family":"Poppins-Medium","active-border-width":1,"background-color":"","active-background-color":"#cbee6b33",ref:"btn14",onStatus:r.btn14,key:n.refreshBtn14,value:e.status14},null,8,["onStatus","value"])),(s.openBlock(),s.createBlock(l,{"text-value":"2/4 tos","font-size":"12px",height:"26px",width:"65px","type-on-off":!0,"border-width":1,"font-color":"#bfc2c5","border-color":"#8c9399","border-radius":"4px","font-family":"Poppins-Medium","active-border-width":1,"background-color":"","active-background-color":"#cbee6b33",ref:"btn24",onStatus:r.btn24,key:n.refreshBtn24,value:e.status24},null,8,["onStatus","value"])),(s.openBlock(),s.createBlock(l,{"text-value":"3/4 tos","font-size":"12px",height:"26px",width:"65px","type-on-off":!0,"border-width":1,"font-color":"#bfc2c5","border-color":"#8c9399","border-radius":"4px","font-family":"Poppins-Medium","active-border-width":1,"background-color":"","active-background-color":"#cbee6b33",ref:"btn34",onStatus:r.btn34,key:n.refreshBtn34,value:e.status34},null,8,["onStatus","value"])),(s.openBlock(),s.createBlock(l,{"text-value":"4/4 tos","font-size":"12px",height:"26px",width:"65px","type-on-off":!0,"border-width":1,"font-color":"#bfc2c5","border-color":"#8c9399","border-radius":"4px","font-family":"Poppins-Medium","active-border-width":1,"background-color":"","active-background-color":"#cbee6b33",ref:"btn44",onStatus:r.btn44,key:n.refreshBtn44,value:e.status44},null,8,["onStatus","value"]))])])])}const Q3e=S3e(gv,[["render",Y3e],["__scopeId","data-v-f9923331"]]),Z3e={class:"filter-field"},$3e=Object.freeze(Object.defineProperty({__proto__:null,default:bt({__name:"FilterField",setup(e){const t=s.ref(Array.from({length:16},(i,n)=>n+1));function a(i){}return(i,n)=>(s.openBlock(),s.createElementBlock("div",Z3e,[s.createVNode(s.unref(Q3e),{width:"100%","background-color":"#2E3B46",value:t.value,"onUpdate:modelValue":a},null,8,["value"])]))}},[["__scopeId","data-v-dc8a3bf4"]])},Symbol.toStringTag,{value:"Module"}));fs.GSCLanding=b4e,Object.defineProperty(fs,Symbol.toStringTag,{value:"Module"})});
308
+ */const Sa={itemsToShow:1,itemsToScroll:1,modelValue:0,transition:300,autoplay:0,snapAlign:"center",wrapAround:!1,throttle:16,pauseAutoplayOnHover:!1,mouseDrag:!0,touchDrag:!0,dir:"ltr",breakpoints:void 0,i18n:{ariaNextSlide:"Navigate to next slide",ariaPreviousSlide:"Navigate to previous slide",ariaNavigateToSlide:"Navigate to slide {slideNumber}",ariaGallery:"Gallery",itemXofY:"Item {currentSlide} of {slidesCount}",iconArrowUp:"Arrow pointing upwards",iconArrowDown:"Arrow pointing downwards",iconArrowRight:"Arrow pointing to the right",iconArrowLeft:"Arrow pointing to the left"}},tP={itemsToShow:{default:Sa.itemsToShow,type:Number},itemsToScroll:{default:Sa.itemsToScroll,type:Number},wrapAround:{default:Sa.wrapAround,type:Boolean},throttle:{default:Sa.throttle,type:Number},snapAlign:{default:Sa.snapAlign,validator(e){return["start","end","center","center-even","center-odd"].includes(e)}},transition:{default:Sa.transition,type:Number},breakpoints:{default:Sa.breakpoints,type:Object},autoplay:{default:Sa.autoplay,type:Number},pauseAutoplayOnHover:{default:Sa.pauseAutoplayOnHover,type:Boolean},modelValue:{default:void 0,type:Number},mouseDrag:{default:Sa.mouseDrag,type:Boolean},touchDrag:{default:Sa.touchDrag,type:Boolean},dir:{default:Sa.dir,validator(e){return["rtl","ltr"].includes(e)}},i18n:{default:Sa.i18n,type:Object},settings:{default(){return{}},type:Object}};function Rke({config:e,slidesCount:t}){const{snapAlign:a,wrapAround:i,itemsToShow:n=1}=e;if(i)return Math.max(t-1,0);let r;switch(a){case"start":r=t-n;break;case"end":r=t-1;break;case"center":case"center-odd":r=t-Math.ceil((n-.5)/2);break;case"center-even":r=t-Math.ceil(n/2);break;default:r=0;break}return Math.max(r,0)}function Fke({config:e,slidesCount:t}){const{wrapAround:a,snapAlign:i,itemsToShow:n=1}=e;let r=0;if(a||n>t)return r;switch(i){case"start":r=0;break;case"end":r=n-1;break;case"center":case"center-odd":r=Math.floor((n-1)/2);break;case"center-even":r=Math.floor((n-2)/2);break;default:r=0;break}return r}function cv({val:e,max:t,min:a}){return t<a?e:Math.min(Math.max(e,a),t)}function Vke({config:e,currentSlide:t,slidesCount:a}){const{snapAlign:i,wrapAround:n,itemsToShow:r=1}=e;let o=t;switch(i){case"center":case"center-odd":o-=(r-1)/2;break;case"center-even":o-=(r-2)/2;break;case"end":o-=r-1;break}return n?o:cv({val:o,max:a-r,min:0})}function aP(e){return e?e.reduce((t,a)=>{var i;return a.type===s.Fragment?[...t,...aP(a.children)]:((i=a.type)===null||i===void 0?void 0:i.name)==="CarouselSlide"?[...t,a]:t},[]):[]}function dv({val:e,max:t,min:a=0}){return e>t?dv({val:e-(t+1),max:t,min:a}):e<a?dv({val:e+(t+1),max:t,min:a}):e}function Uke(e,t){let a;return t?function(...i){const n=this;a||(e.apply(n,i),a=!0,setTimeout(()=>a=!1,t))}:e}function jke(e,t){let a;return function(...i){a&&clearTimeout(a),a=setTimeout(()=>{e(...i),a=null},t)}}function zke(e="",t={}){return Object.entries(t).reduce((a,[i,n])=>a.replace(`{${i}}`,String(n)),e)}var Hke=s.defineComponent({name:"ARIA",setup(){const e=s.inject("config",s.reactive(Object.assign({},Sa))),t=s.inject("currentSlide",s.ref(0)),a=s.inject("slidesCount",s.ref(0));return()=>s.h("div",{class:["carousel__liveregion","carousel__sr-only"],"aria-live":"polite","aria-atomic":"true"},zke(e.i18n.itemXofY,{currentSlide:t.value+1,slidesCount:a.value}))}}),qke=s.defineComponent({name:"Carousel",props:tP,setup(e,{slots:t,emit:a,expose:i}){var n;const r=s.ref(null),o=s.ref([]),l=s.ref(0),c=s.ref(0),d=s.reactive(Object.assign({},Sa));let u=Object.assign({},Sa),h;const m=s.ref((n=e.modelValue)!==null&&n!==void 0?n:0),p=s.ref(0),f=s.ref(0),y=s.ref(0),b=s.ref(0);let E,D;s.provide("config",d),s.provide("slidesCount",c),s.provide("currentSlide",m),s.provide("maxSlide",y),s.provide("minSlide",b),s.provide("slideWidth",l);function M(){h=Object.assign({},e.breakpoints),u=Object.assign(Object.assign(Object.assign({},u),e),{i18n:Object.assign(Object.assign({},u.i18n),e.i18n),breakpoints:void 0}),P(u)}function N(){if(!h||!Object.keys(h).length)return;const J=Object.keys(h).map(Oe=>Number(Oe)).sort((Oe,We)=>+We-+Oe);let De=Object.assign({},u);J.some(Oe=>{const We=window.matchMedia(`(min-width: ${Oe}px)`).matches;return We&&(De=Object.assign(Object.assign({},De),h[Oe])),We}),P(De)}function P(J){Object.entries(J).forEach(([De,Oe])=>d[De]=Oe)}const L=jke(()=>{N(),V()},16);function V(){if(!r.value)return;const J=r.value.getBoundingClientRect();l.value=J.width/d.itemsToShow}function $(){c.value<=0||(f.value=Math.ceil((c.value-1)/2),y.value=Rke({config:d,slidesCount:c.value}),b.value=Fke({config:d,slidesCount:c.value}),d.wrapAround||(m.value=cv({val:m.value,max:y.value,min:b.value})))}s.onMounted(()=>{s.nextTick(()=>V()),setTimeout(()=>V(),1e3),N(),ie(),window.addEventListener("resize",L,{passive:!0}),a("init")}),s.onUnmounted(()=>{D&&clearTimeout(D),E&&clearInterval(E),window.removeEventListener("resize",L,{passive:!0})});let U=!1;const ae={x:0,y:0},oe={x:0,y:0},Y=s.reactive({x:0,y:0}),de=s.ref(!1),we=s.ref(!1),Se=()=>{de.value=!0},pe=()=>{de.value=!1};function z(J){["INPUT","TEXTAREA","SELECT"].includes(J.target.tagName)||(U=J.type==="touchstart",U||J.preventDefault(),!(!U&&J.button!==0||fe.value)&&(ae.x=U?J.touches[0].clientX:J.clientX,ae.y=U?J.touches[0].clientY:J.clientY,document.addEventListener(U?"touchmove":"mousemove",K,!0),document.addEventListener(U?"touchend":"mouseup",ue,!0)))}const K=Uke(J=>{we.value=!0,oe.x=U?J.touches[0].clientX:J.clientX,oe.y=U?J.touches[0].clientY:J.clientY;const De=oe.x-ae.x,Oe=oe.y-ae.y;Y.y=Oe,Y.x=De},d.throttle);function ue(){const J=d.dir==="rtl"?-1:1,De=Math.sign(Y.x)*.4,Oe=Math.round(Y.x/l.value+De)*J;if(Oe&&!U){const We=gt=>{gt.stopPropagation(),window.removeEventListener("click",We,!0)};window.addEventListener("click",We,!0)}me(m.value-Oe),Y.x=0,Y.y=0,we.value=!1,document.removeEventListener(U?"touchmove":"mousemove",K,!0),document.removeEventListener(U?"touchend":"mouseup",ue,!0)}function ie(){!d.autoplay||d.autoplay<=0||(E=setInterval(()=>{d.pauseAutoplayOnHover&&de.value||ye()},d.autoplay))}function ne(){E&&(clearInterval(E),E=null),ie()}const fe=s.ref(!1);function me(J){const De=d.wrapAround?J:cv({val:J,max:y.value,min:b.value});m.value===De||fe.value||(a("slide-start",{slidingToIndex:J,currentSlideIndex:m.value,prevSlideIndex:p.value,slidesCount:c.value}),fe.value=!0,p.value=m.value,m.value=De,D=setTimeout(()=>{if(d.wrapAround){const Oe=dv({val:De,max:y.value,min:0});Oe!==m.value&&(m.value=Oe,a("loop",{currentSlideIndex:m.value,slidingToIndex:J}))}a("update:modelValue",m.value),a("slide-end",{currentSlideIndex:m.value,prevSlideIndex:p.value,slidesCount:c.value}),fe.value=!1,ne()},d.transition))}function ye(){me(m.value+d.itemsToScroll)}function ee(){me(m.value-d.itemsToScroll)}const re={slideTo:me,next:ye,prev:ee};s.provide("nav",re),s.provide("isSliding",fe);const X=s.computed(()=>Vke({config:d,currentSlide:m.value,slidesCount:c.value}));s.provide("slidesToScroll",X);const R=s.computed(()=>{const J=d.dir==="rtl"?-1:1,De=X.value*l.value*J;return{transform:`translateX(${Y.x-De}px)`,transition:`${fe.value?d.transition:0}ms`,margin:d.wrapAround?`0 -${c.value*l.value}px`:"",width:"100%"}});function he(){M(),N(),$(),V(),ne()}Object.keys(tP).forEach(J=>{["modelValue"].includes(J)||s.watch(()=>e[J],he)}),s.watch(()=>e.modelValue,J=>{J!==m.value&&me(Number(J))}),s.watch(c,$),a("before-init"),M();const ve={config:d,slidesCount:c,slideWidth:l,next:ye,prev:ee,slideTo:me,currentSlide:m,maxSlide:y,minSlide:b,middleSlide:f};i({updateBreakpointsConfigs:N,updateSlidesData:$,updateSlideWidth:V,initDefaultConfigs:M,restartCarousel:he,slideTo:me,next:ye,prev:ee,nav:re,data:ve});const Le=t.default||t.slides,qe=t.addons,Ge=s.reactive(ve);return()=>{const J=aP(Le==null?void 0:Le(Ge)),De=(qe==null?void 0:qe(Ge))||[];J.forEach((Ye,Ze)=>Ye.props.index=Ze);let Oe=J;if(d.wrapAround){const Ye=J.map((Bt,rt)=>s.cloneVNode(Bt,{index:-J.length+rt,isClone:!0,key:`clone-before-${rt}`})),Ze=J.map((Bt,rt)=>s.cloneVNode(Bt,{index:J.length+rt,isClone:!0,key:`clone-after-${rt}`}));Oe=[...Ye,...J,...Ze]}o.value=J,c.value=Math.max(J.length,1);const We=s.h("ol",{class:"carousel__track",style:R.value,onMousedownCapture:d.mouseDrag?z:null,onTouchstartPassiveCapture:d.touchDrag?z:null},Oe),gt=s.h("div",{class:"carousel__viewport"},We);return s.h("section",{ref:r,class:{carousel:!0,"is-sliding":fe.value,"is-dragging":we.value,"is-hover":de.value,"carousel--rtl":d.dir==="rtl"},dir:d.dir,"aria-label":d.i18n.ariaGallery,tabindex:"0",onMouseenter:Se,onMouseleave:pe},[gt,De,s.h(Hke)])}}}),iP;(function(e){e.arrowUp="arrowUp",e.arrowDown="arrowDown",e.arrowRight="arrowRight",e.arrowLeft="arrowLeft"})(iP||(iP={}));var Wke=s.defineComponent({name:"CarouselSlide",props:{index:{type:Number,default:1},isClone:{type:Boolean,default:!1}},setup(e,{slots:t}){const a=s.inject("config",s.reactive(Object.assign({},Sa))),i=s.inject("currentSlide",s.ref(0)),n=s.inject("slidesToScroll",s.ref(0)),r=s.inject("isSliding",s.ref(!1)),o=()=>e.index===i.value,l=()=>e.index===i.value-1,c=()=>e.index===i.value+1,d=()=>{const u=Math.floor(n.value),h=Math.ceil(n.value+a.itemsToShow-1);return e.index>=u&&e.index<=h};return()=>{var u;return s.h("li",{style:{width:`${100/a.itemsToShow}%`},class:{carousel__slide:!0,"carousel__slide--clone":e.isClone,"carousel__slide--visible":d(),"carousel__slide--active":o(),"carousel__slide--prev":l(),"carousel__slide--next":c(),"carousel__slide--sliding":r.value},"aria-hidden":!d()},(u=t.default)===null||u===void 0?void 0:u.call(t))}}});const Gke=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},Kke=e=>(s.pushScopeId("data-v-dd3cbf69"),e=e(),s.popScopeId(),e),Xke={class:"gsc-carousel"},Jke={key:0},Yke=Kke(()=>s.createElementVNode("div",null,"no hay",-1)),Qke=[Yke],Zke={class:"gsc-carousel__2d__slides"},$ke={width:"9",height:"18",viewBox:"0 0 9 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eEe=["fill"],tEe={width:"9",height:"18",viewBox:"0 0 9 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},aEe=["fill"],iEe={class:"gsc-carousel__2d__navigation"},nEe={width:"8",height:"15",viewBox:"0 0 8 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rEe=["stroke"],sEe={key:1,class:"gsc-carousel__2d__navigation__pagination"},oEe=["onClick"],lEe={width:"7",height:"15",viewBox:"0 0 7 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cEe=["stroke"],dEe={__name:"GSC-Carousel",props:{currentItemIndex:{type:Number,default:0},items:{type:Array,default:()=>[]},is3d:{type:Boolean,default:!1},isPaginationVisible:{type:Boolean,default:!1},areNavigationArrowsVisible:{type:Boolean,default:!0},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(t=>t in e)},navigationHeight:{type:Number,default:4},navigationBorderRadius:{type:Number,default:4},navigationColor:{type:String,default:"rgba(255, 255, 255, 0.4)"},navigationActiveColor:{type:String,default:"#cbee6b"},navigationActiveWidth:{type:Number,default:30},arrowsColor:{type:String,default:"#cbee6b"},wrapAround:{type:Boolean,default:!1},itemsToShow:{type:Number,default:1},isMainSlidePriority:{type:Boolean,default:!1},areSlidesArrowsVisible:{type:Boolean,default:!1},slideLeftArrowBackgroundImage:{type:String,default:"linear-gradient(to right, rgba(13, 29, 41, 1), rgba(0, 0, 0, 0))"},slideRightArrowBackgroundImage:{type:String,default:"linear-gradient(to left, rgba(13, 29, 41, 1), rgba(0, 0, 0, 0))"},areSlidesArrowsRounded:{type:Boolean,default:!1},slidesArrowsLeftAndRight:{type:String,default:"20px"},secondarySlidesOpacity:{type:Number,default:.8},marginTop:{type:String,default:"0"}},emits:["input","update:currentItemIndex"],setup(e,{expose:t,emit:a}){const i=e;s.useCssVars(y=>({"0d808f0f":e.slideLeftArrowBackgroundImage,"1e0ef2e5":e.slidesArrowsLeftAndRight,"66d12b5c":e.slideRightArrowBackgroundImage,"2b22a85a":e.marginTop,"1a842b02":e.secondarySlidesOpacity}));const n=s.ref(null),r=s.ref({}),o=s.ref(0),l=s.ref(!1);s.watch(n,y=>{y&&l.value?(l.value=!1,c(i.items)):y&&y.slideTo&&y.slideTo(o.value)},{deep:!0}),s.watch(()=>i.currentItemIndex,y=>{o.value!==y&&m(y)}),s.watch(()=>i.items,y=>{n.value?c(y):l.value=!0},{immediate:!0});function c(y){if(y&&y.length&&n.value){if(i.defaultItemByProp){const b=i.items.findIndex(E=>E[i.defaultItemByProp.propName]===i.defaultItemByProp.value);b!==-1?(o.value=b,r.value=y[b]):(o.value=0,r.value=y[0])}else o.value=i.defaultItemByIndex,r.value=y[i.defaultItemByIndex];n.value.slideTo&&n.value.slideTo(o.value),a("input",{selectedItem:r.value,selectedItemIndex:o.value})}}function d(){n.value&&n.value.next()}function u(){n.value&&n.value.prev()}function h(){n.value&&n.value.updateSlideWidth()}function m(y){n.value&&n.value.slideTo(y)}function p(y){n.value.slideTo(y)}function f(y){const b=y.slidingToIndex<0?i.items.length-1:y.slidingToIndex===i.items.length?0:y.slidingToIndex;o.value=b,r.value=i.items[b],a("update:currentItemIndex",b),a("input",{selectedItem:r.value,selectedItemIndex:o.value})}return t({prev:u,next:d,updateSlideWidth:h,slideTo:m}),(y,b)=>(s.openBlock(),s.createElementBlock("div",Xke,[i.is3d?(s.openBlock(),s.createElementBlock("div",Jke,Qke)):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["gsc-carousel__2d",{"main-slide-priority":e.isMainSlidePriority}])},[s.createElementVNode("div",Zke,[s.createVNode(s.unref(qke),{ref_key:"carousel2d",ref:n,"items-to-show":e.itemsToShow,"wrap-around":e.wrapAround,onSlideStart:f},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.items,(E,D)=>(s.openBlock(),s.createBlock(s.unref(Wke),{key:D},{default:s.withCtx(()=>[s.renderSlot(y.$slots,"default",{item:E},void 0,!0)]),_:2},1024))),128))]),_:3},8,["items-to-show","wrap-around"])]),e.areSlidesArrowsVisible?(s.openBlock(),s.createElementBlock("div",{key:0,class:"gsc-carousel__2d__arrow-left",onClick:b[0]||(b[0]=E=>n.value.prev())},[s.createElementVNode("div",{class:s.normalizeClass(["gsc-carousel__2d__slide-button",{rounded:e.areSlidesArrowsRounded}])},[(s.openBlock(),s.createElementBlock("svg",$ke,[s.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.10399 9L8.62342 15.4393C9.12552 16.0251 9.12552 16.9749 8.62342 17.5607C8.12132 18.1464 7.30725 18.1464 6.80514 17.5607L0.376575 10.0607C-0.125528 9.47487 -0.125528 8.52512 0.376575 7.93934L6.80515 0.439339C7.30725 -0.146447 8.12132 -0.146447 8.62342 0.43934C9.12553 1.02513 9.12553 1.97487 8.62342 2.56066L3.10399 9Z",fill:e.arrowsColor},null,8,eEe)]))],2)])):s.createCommentVNode("",!0),e.areSlidesArrowsVisible?(s.openBlock(),s.createElementBlock("div",{key:1,class:"gsc-carousel__2d__arrow-right",onClick:b[1]||(b[1]=E=>d())},[s.createElementVNode("div",{class:s.normalizeClass(["gsc-carousel__2d__slide-button",{rounded:e.areSlidesArrowsRounded}])},[(s.openBlock(),s.createElementBlock("svg",tEe,[s.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.89601 9L0.376575 2.56066C-0.125528 1.97487 -0.125528 1.02513 0.376575 0.439339C0.878675 -0.146447 1.69275 -0.146447 2.19486 0.43934L8.62343 7.93934C9.12553 8.52513 9.12553 9.47487 8.62343 10.0607L2.19486 17.5607C1.69275 18.1464 0.878675 18.1464 0.376575 17.5607C-0.125528 16.9749 -0.125528 16.0251 0.376575 15.4393L5.89601 9Z",fill:e.arrowsColor},null,8,aEe)]))],2)])):s.createCommentVNode("",!0),s.createElementVNode("div",iEe,[e.areNavigationArrowsVisible?(s.openBlock(),s.createElementBlock("div",{key:0,class:"gsc-carousel__2d__navigation__arrow-left",onClick:b[2]||(b[2]=E=>u())},[(s.openBlock(),s.createElementBlock("svg",nEe,[s.createElementVNode("path",{d:"M6.72998 13.894L1.46621 8.63028C0.84457 8.00863 0.84457 6.9914 1.46621 6.36976L6.72998 1.10599",stroke:i.arrowsColor},null,8,rEe)]))])):s.createCommentVNode("",!0),e.isPaginationVisible?(s.openBlock(),s.createElementBlock("div",sEe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.items,(E,D)=>(s.openBlock(),s.createElementBlock("div",{key:`i-${D}`,class:"gsc-carousel__2d__navigation__pagination__item",style:s.normalizeStyle({height:`${i.navigationHeight}px`,width:`${o.value===D?i.navigationActiveWidth:i.navigationActiveWidth/2}px`,borderRadius:`${i.navigationBorderRadius}px`,backgroundColor:`${o.value===D?i.navigationActiveColor:i.navigationColor}`,transition:"all 0.1s ease-in-out"}),onClick:M=>p(D)},null,12,oEe))),128))])):s.createCommentVNode("",!0),e.areNavigationArrowsVisible?(s.openBlock(),s.createElementBlock("div",{key:2,class:"gsc-carousel__2d__navigation__arrow-right",onClick:b[3]||(b[3]=E=>n.value.next())},[(s.openBlock(),s.createElementBlock("svg",lEe,[s.createElementVNode("path",{d:"M0.72998 1.10599L5.99375 6.36975C6.61539 6.9914 6.61539 8.00863 5.99375 8.63027L0.72998 13.894",stroke:i.arrowsColor},null,8,cEe)]))])):s.createCommentVNode("",!0)])],2))]))}},uEe=Gke(dEe,[["__scopeId","data-v-dd3cbf69"]]),hEe={class:"carousel-video-player"},pEe={class:"video-container"},mEe=["id"],fEe={__name:"CarouselVideoPlayer",props:{play:{type:Object,required:!0},videojs:{type:Function,required:!0}},emits:["play-ended"],setup(e,{emit:t}){const a=e,i=s.ref(null),n=s.computed(()=>`p-${a.play.playId}`);function r(){i.value=a.videojs(n.value,{controlBar:{fullscreenToggle:!1},playsinline:!0}),i.value.src({type:"video/mp4",src:`https://golstatsbets.blob.core.windows.net/video-player/${a.play.gameId}_1.mp4`}),i.value.offset({start:a.play.startSeconds,end:a.play.endSeconds}),i.value.on("ended",()=>{t("play-ended")}),a.play.videoPlayer=i}return s.onMounted(()=>{setTimeout(()=>{r()},10)}),(o,l)=>(s.openBlock(),s.createElementBlock("div",hEe,[s.createElementVNode("div",pEe,[s.createElementVNode("video",{id:n.value,class:"video-js",controls:"",preload:"auto","data-setup":"{}"},null,8,mEe)])]))}},gEe=bt(fEe,[["__scopeId","data-v-e4d57431"]]),yEe=e=>(s.pushScopeId("data-v-bf6136c0"),e=e(),s.popScopeId(),e),_Ee=yEe(()=>s.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[s.createElementVNode("path",{d:"M5 15L15 5",stroke:"white","stroke-width":"1.7","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),s.createElementVNode("path",{d:"M15 15L5 5",stroke:"white","stroke-width":"1.7","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),bEe=[_Ee],vEe={class:"carousel-full-screen__carousel"},SEe={class:"carousel-full-screen__carousel__video-player"},wEe={__name:"CarouselFullScreen",props:{playerQueue:{type:Array,default:()=>[]},playlistIndex:{type:Number,default:0},initialPlay:{type:Object,default:()=>({})},videojs:{type:Function,required:!0}},emits:["close"],setup(e,{emit:t}){const a=e,i=s.ref({wrapAround:!1,itemsToShow:1.2,isMainSlidePriority:!0,areSlidesArrowsVisible:!0,areNavigationArrowsVisible:!1,slideLeftArrowBackgroundImage:"none",slideRightArrowBackgroundImage:"none"}),n=s.ref(0),r=s.ref(0),o=s.ref(null);function l(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function c(){return/iPhone|iPad/i.test(navigator.userAgent)}function d(){const y=document.getElementById("carousel-swipe"),b=window.screen.orientation;b.angle==90&&l()||window.innerWidth<window.innerHeight&&l()?y.classList.remove("landscape"):(b.angle==0&&l()||window.innerWidth>window.innerHeight&&l())&&y.classList.add("landscape")}function u(){const y=document.getElementById("carousel-swipe"),b=window.screen.orientation;b.angle==90&&l()||window.innerWidth>window.innerHeight&&l()?y.classList.remove("landscape"):(b.angle==0&&l()||window.innerWidth<window.innerHeight&&l())&&y.classList.add("landscape")}function h(){const y=document.getElementById("carousel-swipe");window.innerWidth>window.innerHeight&&l()?y.classList.remove("landscape"):window.innerWidth<window.innerHeight&&l()&&y.classList.add("landscape")}function m({selectedItemIndex:y}){const b=y-n.value;r.value+=b;const E=a.playerQueue[n.value],D=a.playerQueue[y];E.videoPlayer&&E.videoPlayer.pause(),D.videoPlayer&&D.videoPlayer.play(),n.value=y}function p(){o.value&&o.value.next()}function f(){const y=a.playlistIndex+r.value;r.value=0,n.value=0,t("close",y)}return s.onMounted(()=>{c()?(window.addEventListener("resize",h),h()):(window.addEventListener("orientationchange",d),u()),setTimeout(()=>{const y=document.getElementsByClassName("video-element");y&&y.length&&Array.from(y).forEach((b,E)=>{b.id=`plyrFS${E+1}`})},100)}),s.onBeforeUnmount(()=>{c()?window.removeEventListener("resize",h):window.removeEventListener("orientationchange",d),a.playerQueue.forEach(y=>{y.videoPlayer&&(y.videoPlayer.pause(),y.videoPlayer.dispose())})}),(y,b)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["carousel-full-screen",{landscape:l()}]),id:"carousel-swipe"},[s.createElementVNode("div",{class:"carousel-full-screen__close",onClick:f},bEe),s.createElementVNode("div",vEe,[s.createVNode(s.unref(uEe),s.mergeProps({ref_key:"gscCarousel",ref:o},i.value,{items:e.playerQueue,"default-item-by-prop":{propName:"playId",value:e.initialPlay.playId},onInput:m}),{default:s.withCtx(({item:E})=>[s.createElementVNode("div",SEe,[s.createVNode(gEe,{videojs:e.videojs,play:E,onPlayEnded:p},null,8,["videojs","play"])])]),_:1},16,["items","default-item-by-prop"])])],2))}},TEe=bt(wEe,[["__scopeId","data-v-bf6136c0"]]),CEe=Kd(),Zi=y0e();let _u=null;const bu=["goals","bestPlays"],je={1:{name:"Oportunidad de Gol",weighing:3},2:{name:"Gol",weighing:1},3:{name:"Autogol",weighing:2},4:{name:"Tarjeta Amarilla",weighing:5},5:{name:"Tarjeta Roja",weighing:4},6:{name:"Penal Recibido",weighing:6},7:{name:"Atajada",weighing:8},8:{name:"Asistencia",weighing:9},9:{name:"Participación en Gol",weighing:14},10:{name:"Sobresaliente",weighing:20},11:{name:"Centro Rematado",weighing:11},12:{name:"Corner Rematado",weighing:12},13:{name:"Tiro Libre Rematado",weighing:13},14:{name:"1vs1 Exitoso Ofensivo",weighing:16},15:{name:"1vs1 Exitoso Defensivo",weighing:18},16:{name:"Pase Filtrado",weighing:15},17:{name:"Balón ganado en Área Propia",weighing:19},18:{name:"Balón Recuperado",weighing:17},19:{name:"Gol Recibido",weighing:7},20:{name:"Pases acertados",weighing:100},21:{name:"Balones recuperados en disputa",weighing:100},22:{name:"Asistencias",weighing:100},23:{name:"Participaciones en gol",weighing:100},24:{name:"Tiros a gol",weighing:100},25:{name:"Tiros a gol que llegaron a la portería",weighing:100},26:{name:"Cabeceos en área rival",weighing:100},27:{name:"Cabeceos en área propia",weighing:100},28:{name:"Centros",weighing:100},29:{name:"Centros acertados",weighing:100},30:{name:"1vs1 exitosos ofensivo",weighing:100},31:{name:"1vs1 exitosos ofensivo que terminaron en gol",weighing:100},32:{name:"1vs1 defensivos exitoso",weighing:100},33:{name:"Rechaces",weighing:100},34:{name:"Balones ganados en área rival",weighing:100},35:{name:"Balones ganados en área propia",weighing:100},36:{name:"Faltas cometidas",weighing:100},37:{name:"Faltas recibidas",weighing:100},38:{name:"Tarjetas amarillas",weighing:100},39:{name:"Tarjetas rojas",weighing:100},40:{name:"Atajadas",weighing:100},41:{name:"Tiros de Esquina",weighing:100,bluer:!0},42:{name:"Balones recuperados en cancha rival",weighing:100},43:{name:"Origen de gol",weighing:10}},Cf={player:{"12-55":je[2]},gamesAndTeams:{"12-55":je[2],"54_r-35_r":je[3]}},$i={games:{"607-608":je[1],"12-55":je[2],"54-35":je[3],"14-52":je[4],"15-53":je[5],"466-477":je[6]},team:{"607-608":je[1],"12-55":je[2],"54-35":je[3],"14-52":je[4],"15-53":je[5],"466-477":je[6],"40-257":je[19],39:je[7]},player:{regular:{12:je[2],35:je[3],10:je[8],27:je[9],607:je[1],61:je[43],519:je[10],"98-101-109-112":je[11],"121-122-127-128-135-136-141-142":je[12],"161-170-179":je[13],702:je[14],730:je[15],466:je[6],217:je[16],"211-232-235-239-242-282-284-289-291-296":je[17],"485-486-487-488":je[18],14:je[4],15:je[5],257:je[19]},goalkeeper:{55:je[2],324:je[8],323:je[9],608:je[1],39:je[7],774:je[14],802:je[15],52:je[4],53:je[5],40:je[19],54:je[3]}}},kEe={"2-20":je[20],483:je[21],10:je[22],27:je[23],510:je[24],"537-540-544-547":je[25],328:je[26],"231-280-238-287-406-294":je[27],"13-25":je[28],"98-101-104-105-109-112-115-116":je[29],4:je[30],88:je[31],5:je[32],34:je[33],11:je[34],23:je[35],17:je[36],18:je[37],14:je[38],15:je[39],39:je[40],"31-32":je[41],"225-224":je[42]},nP=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],EEe=1,uv={components:{CarouselFullScreen:TEe,SearchFilters:Lke,VideoSearch:gwe,VideoPlayerControls:Lde,VideoPlayer:_ue,CurrentMatch:Coe,MatchesList:Eoe,GSCPlayerTeamGame:Ede,GscSwitchComponent:ME},props:{section:{type:Boolean,default:!0},componentWidth:{type:Number,default:767,validator(e){return e>0}},backgroundColor:{type:String,default:"#172531"},user:{type:Object,default:()=>({})},userForDiscoverVideos:{type:Object,default:()=>({})},token:{type:String,default:""},isGSUser:{type:Boolean,default:!0},tournamentSelectedId:{type:Number,default:0},seasonSelectedId:{type:Number,default:0},tournamentsForMediaPlayer:{type:[Map],default:()=>new Map},isFromMexico:{type:Boolean,default:!0},gsData:{type:[Object,null],default:null},isFirstRow:{type:Boolean,default:!1},custom:{type:[Object,null],default:null},autoFillVideos:{type:Boolean,default:!1},isPlayerUser:{type:Boolean,default:!1},isGoalkeeper:{type:[Boolean,Number],default:!1},playerId:{type:Number,default:0},isModalMode:{type:Boolean,default:!0},modalInitialData:{type:Object,default:null},isModal:{type:Boolean,default:!1},isGoalsOnly:{type:Boolean,default:!1},nextRivalTeam:{type:Object,default:()=>({team_id:0})}},data(){return{filterToSetUp:null,videojsLocal:null,player:null,lastSearchResult:null,mobileClass:!1,isMobileTabsActive:!1,currentMobileTab:"Estás viendo",currentTabMoreVideos:"Resumen",booleanIsFirstIteration:!0,numberCurrentSeasonId:0,numberLastActionId:0,numberPlayerSpeed:1,numberOptionsMenuTop:0,numberOptionsMenuLeft:0,booleanIsVideoPlayerPlaying:!1,booleanIsOptionsMenuVisible:!1,booleanIsSpeedModalVisible:!1,showModalConfirm:!1,showConfirmPlaylist:!0,showModal:!1,seasonId:0,plays:[],playerQueue:[],playsType:bu[0],playsTypeOptions:bu,playInfo:{},teamsMap:new Map,gamesMap:new Map,roundsMap:new Map,mediaPlayerMode:"games",playerPosition:0,playlistTournament:null,showImage:!1,seasonName:"",playlistSeasonIndex:0,playlistSeasonIndexAux:0,playerModeSelected:1,currentTournament:{seasons:[]},mediaPlayerResizeObserver:null,mediaPlayerWidth:0,mediaPlayerInfoHeight:598,lastMediaPlayerWidth:0,selectedType:1,roundsAndGamesWithPlaysMap:null,gameIdSelected:0,seasonSearchingCount:0,hasPlayerActivityInTournament:!1,isAutoPlay:!1,storeModule:this.isModalMode?"mediaModal":"mediaGeneral",isFirstTypeChange:!0,rivalCategories:[],counterAux:0,useIdsFromAdvancedFilter:!1,maxGameId:0,tournamentsForModalLauncher:new Map,lastGameIdWatched:0,isSomeListSelected:!1,booleanIsModesModalOpen:!1,arrayCategoriesIdsToFilter:null,arrayRivalCategoriesIdsToFilter:null,arrayCategoriesIdsRaw:null,booleanIsFilterApplied:!1,stringModeTitle:"Estas viendo: Goles de la jornada",objectMediaPlayerModeFilters:this.getEmptyMediaPlayerModeFilters(),playSeekerPlays:[],geoOptions:{enableHighAccuracy:!0,timeout:5e3,maximumAge:0},coords:null,concatPlays:!1,currentPlayIndex:0,firstInteractionToken:"",firstInteractionUrl:"https://playseeker-api-fi.golstats.com",userBehaviorUrl:"https://playseeker-api-ub.golstats.com",gamesUrl:"https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?",booleanIsPlaySeekerMode:!1,objectLastDataToFilter:null,objectPlaySeekerLastPlay:null,objectPlaySync:null,isCarouselFullScreenVisible:!1}},computed:{...mC("mediaModal",["currentPlaylistPlays","modalSectionSelected","isModalOpen","playlistGameId"]),...mC("mediaGeneral",["playersMapMyPlaylists","teamsMapMyPlaylists","gamesMapMyPlaylists","maxGameIdMyPlaylists","player","mapMinutesPlayedCategoryNames","playSeekerUserId","playSeekerCurrentSessionId"]),...gC("mediaModal",["currentPlayerQueueByGames"]),...gC("mediaGeneral",["userPlaylistsSeasonIds"]),currentMatch(){return this.currentPlayerQueueByGames&&this.currentPlayerQueueByGames.length&&this.playlistGameId?this.currentPlayerQueueByGames.find(e=>e.id===this.playlistGameId):null},dynamicClasses(){let e=[];return this.isModal&&e.push("modal-class"),this.mediaPlayerWidth>0&&(this.mediaPlayerWidth<=420?e.push("modal-video__420"):this.mediaPlayerWidth<=470&&e.push("modal-video__470"),this.mediaPlayerWidth<=750?e.push("modal-video__750"):this.mediaPlayerWidth<=850?e.push("modal-video__850"):this.mediaPlayerWidth<=1024?e.push("modal-video__1024"):this.mediaPlayerWidth<=1100?e.push("modal-video__1100"):this.mediaPlayerWidth<=1280?e.push("modal-video__1280"):this.mediaPlayerWidth<=1520&&e.push("modal-video__1520")),e},carouselPlayerQueue(){return this.playerQueue?this.playerQueue.filter(e=>e.gameId===this.currentMatch.id):[]},mediaPlayerType(){return"general"},extraCategories(){return[...sSe,...oSe,...mSe,...ySe,...SSe,...kSe,...NSe,...uSe].reduce((e,t)=>(t.categories.forEach(a=>{e.set(a,{id:a,name:this.$t&&t.translationKey&&this.$t(t.translationKey)||t.singleName})}),e),new Map)},isMyPlaylistsActive(){return this.isModalMode&&this.modalSectionSelected===2&&this.isSomeListSelected},modalInitialState(){return this.isModalMode?this.$store.state.mediaModal.modalInitialState:{}},modalSectionSelected(){return this.isModalMode?this.$store.state.mediaModal.modalSectionSelected:{}},playerType(){return this.isModalMode?this.$store.state.mediaModal.playerType:0},advancedFilter(){return this.isModalMode?this.$store.state.mediaModal.advancedFilter:{}},applyAdvancedFilterCounter(){return this.isModalMode?this.$store.state.mediaModal.applyAdvancedFilterCounter:0},selectedSubcategoryIds(){return this.isModalMode?this.$store.state.mediaModal.selectedSubcategoryIds:[]},getSeasonIdOnly(){return this.$store.getters[`${this.storeModule}/getSeasonIdOnly`]},getTeamId(){return this.$store.getters[`${this.storeModule}/getTeamId`]},getPlayerId(){return this.$store.getters[`${this.storeModule}/getPlayerId`]},seasonPlayers(){return this.$store.getters[`${this.storeModule}/seasonPlayers`]},selectedTournament(){return this.$store.getters[`${this.storeModule}/selectedTournament`]},isPlayerGoalkeeper(){return this.$store.getters[`${this.storeModule}/isPlayerGoalkeeper`]},hasPlayerPositionId(){return this.$store.getters[`${this.storeModule}/hasPlayerPositionId`]},playersByTeam(){return this.$store.getters[`${this.storeModule}/playersByTeam`]},tournaments(){return this.$store.state[`${this.storeModule}`].tournaments},seasonID(){return this.$store.state[`${this.storeModule}`].seasonID},playlistIndex(){return this.$store.state[`${this.storeModule}`].playlistIndex},retroSeason(){return this.$store.state[`${this.storeModule}`].retroSeason},objectMediaData(){return this.$store.state[`${this.storeModule}`].objectMediaData},playsSaved(){return this.$store.getters["mediaGeneral/playsSaved"]},summaryData(){return null},isSummaryData(){return!!this.summaryData},profilesSeasonId(){return this.isModalMode?0:this.$store.getters["filterGeneral/getSeasonId"]},currentCategories(){return this.isModalMode?this.modalSectionSelected===1?this.isGoalsOnly?Object.keys(Cf.gamesAndTeams).reduce((e,t)=>(t.split("-").forEach(a=>{e.push(a)}),e),[]):this.modalInitialState?this.modalInitialState.categoryIds&&this.modalInitialState.categoryIds.length?this.modalInitialState.categoryIds:this.getBestCategoriesIds():[]:this.useIdsFromAdvancedFilter?this.selectedSubcategoryIds:this.modalInitialState?this.modalInitialState.categoryIds:[]:this.summaryData?Object.keys(this.summaryData.isTeam?Cf.gamesAndTeams:this.summaryData.positionId===1?$i.player.goalkeeper:$i.player.regular).reduce((e,t)=>(t.split("-").forEach(a=>{e.push(a)}),e),[]):Object.keys(this.user&&this.user.is_player&&this.hasUserPlayerSelectedSeason?this.user.is_goalkeeper?$i.player.goalkeeper:$i.player.regular:Cf.gamesAndTeams).reduce((e,t)=>(t.split("-").forEach(a=>{e.push(a)}),e),[])},allCategories(){const e=new Map,t={...Cf.gamesAndTeams,...kEe};return Object.entries(t).forEach(([a,i])=>{a.split("-").forEach(n=>{e.set(n.includes("_r")?n:Number(n),i)})}),this.setBestCategoriesNames(e),e},queryCategories(){let e="";const t=[];return this.currentCategories.forEach((a,i)=>{let n=typeof a=="string"?a:a.toString(),r=!1;n.includes("_")&&(r=!0,n=Number(n.split("_")[0]),t.push(n)),e+=`${i>0?"&":""}${r?"r":""}categories=${n}`}),this.setRivalCategories(t),e},gamesByRound(){const e={};if(this.roundsAndGamesWithPlaysMap)for(const[t,a]of this.roundsAndGamesWithPlaysMap){const[i,n]=t.split(","),r=Array.from(a.values());r.sort((o,l)=>l.dateTimeMillis-o.dateTimeMillis),e[n]={name:i,games:r}}return e},teams(){return this.teamsMap?Array.from(this.teamsMap.values()):[]},isGoalsActive(){return this.playsType===bu[0]},headerResponsiveClass(){const e=[];return this.mediaPlayerWidth<354?e.push("header--width-354"):this.mediaPlayerWidth<440?e.push("header--width-400"):this.mediaPlayerWidth<541?e.push("header--width-540"):this.mediaPlayerWidth<626?e.push("header--width-626"):this.isFirstRow&&this.mediaPlayerWidth<610&&e.push("header--first-row"),e},playInfoStyle(){return!this.gsData&&this.mediaPlayerWidth<871?{padding:"0 0.5em"}:this.isFirstRow?{"margin-top":"0.3em"}:{}},headerIcon(){return this.custom!=null&&Object.keys(this.custom).length?this.custom.logo:"https://az755631.vo.msecnd.net/content/shieldLogoPc.png"},isUserTournament(){return this.gsData&&this.gsData.tournamentId===this.currentTournament._id},hasUserPlayerSelectedSeason(){return this.user.is_player?this.user.related_seasons.includes(this.numberCurrentSeasonId||this.seasonSelectedId):!1},hasUserTeamSelectedTournament(){return!this.user.is_player&&this.user.team?this.user.related_seasons.includes(this.numberCurrentSeasonId||this.seasonSelectedId):!1}},watch:{isModalOpen(e){e||this.applyObjectMediaData()},seasonSelected(){this.setInitialTitle()},tournamentSelectedId(){this.setInitialTitle()},seasonSelectedId:{handler(e){this.setUpData(e)},immediate:!0},selectedTournament:{deep:!0,handler(e){e&&(this.playlistTournament=e,this.playlistSeasonIndex=0)}},seasonID:{deep:!0,handler(e){e&&(this.playlistSeasonIndexAux=e.index)}},playsType(e){this.isModalMode||this.setPlaysType({mediaPlayerType:this.mediaPlayerType,playsType:e}),this.fetchInfo(!0,this.playlistTournament)},modalSectionSelected(e){e!==1&&(this.isSomeListSelected=!1),[0,1].includes(e)&&(this.playsType!==bu[e]?this.playsType=bu[e]:this.fetchInfo(!0,this.playlistTournament)),this.modalInitialState&&this.modalInitialState.mainSectionType-1===this.modalSectionSelected&&this.checkSeason()},selectedSubcategoryIds(e){e&&e.length&&this.applyAdvancedFilter()},seasonPlayers(e){if(this.getPlayerId&&!this.hasPlayerPositionId){const t=e.get(this.getPlayerId);t&&this.$store.commit(`${this.storeModule}/setPlayer`,t)}},profilesSeasonId:{handler(e){this.setUpData(e)}},tournamentsForMediaPlayer(e){this.seasonSelectedId&&e.size>0&&!this.isModalMode&&this.setUpData(this.seasonSelectedId)},currentPlaylistPlays(e){this.isModalMode&&this.modalSectionSelected===2&&this.setPlaylistPlays(e)},userPlaylistsSeasonIds(e){this.fillMyPlaylistsData(Array.from(e.values()))},seasonId:{immediate:!0,handler(e){this.isModalMode||this.setSeasonId({mediaPlayerType:this.mediaPlayerType,seasonId:e})}},currentCategories:{immediate:!0,handler(e){this.isModalMode||this.setCurrentCategories({mediaPlayerType:this.mediaPlayerType,currentCategories:e})}},selectedType:{immediate:!0,handler(e){this.isModalMode||this.setSelectedType({mediaPlayerType:this.mediaPlayerType,selectedType:e})}},getTeamId:{immediate:!0,handler(e){this.isModalMode||this.setTeamId({mediaPlayerType:this.mediaPlayerType,teamId:e})}},player:{immediate:!0,handler(e){this.isModalMode||this.setModalPlayer({mediaPlayerType:this.mediaPlayerType,player:e})}}},methods:{...fC("mediaModal",["setPlaylistGameId","setPlayerType","setModalInitialState","setIsModalOpen","setIsModalCreatePlayListOpen"]),...fC("mediaGeneral",["setPlayersMapMyPlaylists","setTeamsMapMyPlaylists","setGamesMapMyPlaylists","setMaxGameIdMyPlaylists","setSeasonId","setPlaysType","setCurrentCategories","setSelectedType","setTournamentsForModalLauncher","setTeamId","setModalPlayer","setPlaysToSaveAsFavorites","setPlaySeekerUserId","setPlaySeekerCurrentSessionId"]),applyObjectMediaData(){!this.objectMediaData||this.objectMediaData.booleanAvoidApply||(this.objectMediaData.numberMainSectionType&&this.$store.commit("mediaModal/setModalSectionSelected",this.objectMediaData.numberMainSectionType),this.objectPlaySync=this.objectMediaData.objectPlaySync?{...this.objectMediaData.objectPlaySync,booleanIsApplied:!1}:null,this.stringModeTitle=this.objectMediaData.stringModeTitle,this.playerQueue=[...this.objectMediaData.arrayPlayerQueue],this.$store.commit(`${this.storeModule}/setPlaylistIndex`,{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:this.objectMediaData.numberPlaylistIndex}),this.$store.commit(`${this.storeModule}/setCurrentPlayerQueue`,this.playerQueue),this.playlistSeasonIndex=this.objectMediaData.numberPlaylistSeasonIndex,this.booleanIsPlaySeekerMode=this.objectMediaData.booleanIsPlaySeekerMode,this.booleanIsFilterApplied=this.objectMediaData.booleanIsFilterApplied,this.objectMediaData.objectLastDataToFilter&&this.fillDataToFilterData(this.objectMediaData.objectLastDataToFilter))},setPlaylistPlays(e){const t=this.getFormattedPlays(e,!0);this.generatePlayerQueue(null,t,!0)},formatDate(e){if(e){const t=e.split("-");return`${Number(t[2])} ${nP[Number(t[1])-1]}, ${t[0]}`}},applyAdvancedFilter(){this.useIdsFromAdvancedFilter=!0,this.fetchInfo(!0,this.playlistTournament)},setRivalCategories(e){this.rivalCategories=e},setUpData(e,t=!1){if(!this.isFromMexico&&!this.isGSUser){this.$emit("finish");return}let a=!1;const i=this.tournamentsForMediaPlayer;e||(a=!0,e=this.seasonSelectedId);const n=Number(e);let r=i.get(n);if(this.tournamentsForModalLauncher=i,this.isModalMode||this.setTournamentsForModalLauncher({mediaPlayerType:this.mediaPlayerType,tournamentsForModalLauncher:i}),!r&&this.isModalMode&&this.modalInitialState&&this.modalInitialState.tournamentsLastClashes&&(r=this.modalInitialState.tournamentsLastClashes.get(e)),this.playlistTournament=r,r){if(this.summaryData&&(this.stringModeTitle=this.summaryData.isTeam?"Estas viendo: Resumen equipo":"Estas viendo: Resumen jugador"),this.playlistSeasonIndex=r.seasons.findIndex(o=>o.id===n),this.playlistSeasonIndexAux=this.playlistSeasonIndex,!t&&!this.summaryData)if(this.isPlayerUser){if(this.hasPlayerActivityInTournament=!!this.getPlayerTournamentBySelectedSeason(n,i),this.hasPlayerActivityInTournament){const o={id:Number(this.user.player)};this.isGoalkeeper&&(o.positionId=1),this.seasonSearchingCount=0,this.$store.commit(`${this.storeModule}/setPlayer`,o),this.$store.commit(`${this.storeModule}/setTeam`,this.gsData.teamId),this.onPlayerSelected();return}!this.hasPlayerActivityInTournament&&this.selectedType!==1&&(this.$store.commit(`${this.storeModule}/setPlayer`,null),this.$store.commit(`${this.storeModule}/setTeam`,null))}else if(this.gsData&&this.gsData.tournamentId===this.playlistTournament._id&&this.gsData.teamId){this.seasonSearchingCount=0,this.$store.commit(`${this.storeModule}/setPlayer`,null),this.$store.commit(`${this.storeModule}/setTeam`,this.gsData.teamId),this.onTeamSelected();return}else this.seasonSearchingCount=0,this.$store.commit(`${this.storeModule}/setPlayer`,null),this.$store.commit(`${this.storeModule}/setTeam`,null);this.fillSeasons([r],a)}},setInitialTitle(){!this.summaryData&&!this.booleanIsFilterApplied&&this.hasUserPlayerSelectedSeason?this.stringModeTitle="Estas viendo: Resumen de jugador":!this.summaryData&&!this.booleanIsFilterApplied&&this.hasUserTeamSelectedTournament?this.stringModeTitle="Estas viendo: Resumen de equipo":this.stringModeTitle="Estas viendo: Goles de la jornada"},closeModalConfirm(){this.showModalConfirm=!1},onModalSpeedClose(){this.booleanIsSpeedModalVisible=!1},onClickSpeed(e){this.numberPlayerSpeed=e,this.$refs.videoPlayer.setSpeedToAllPlayers(e),this.booleanIsSpeedModalVisible=!1},confirmModalConfirm(){this.showModalConfirm=!1,this.$refs.videoPlayer.playCurrentVideoPlayer()},openmodal(){this.$refs.videoPlayer.setAutoPlaysCount(0),this.showModal=!0},closeModal(){this.showModal=!1},getBestCategoriesIds(){let e=null;return this.mediaPlayerMode==="player"?this.isPlayerGoalkeeper?e=Object.keys($i.player.goalkeeper):e=Object.keys($i.player.regular):e=Object.keys($i[this.mediaPlayerMode]),e.reduce((t,a)=>(a.split("-").forEach(i=>{t.push(i)}),t),[])},setBestCategoriesNames(e){[...Object.entries($i.player.goalkeeper),...Object.entries($i.player.regular),...Object.entries($i[this.mediaPlayerMode])].forEach(([t,a])=>{t.split("-").forEach(i=>{e.set(Number(i),a)})})},onPlaysTypeClicked(e){this.playsType=e},getPlayTime(e,t){let a="",i=0;switch(e.matchLapse){case 1:a=e.syncStartFirstTime;break;case 2:a=e.syncStartSecondTime,i=45;break;case 3:a=e.syncStartFirstExtraTime,i=90;break;case 4:a=e.syncStartSecondExtraTime,i=105;break;case 5:a=e.syncStartPenals,i=120;break}return(!a||a==="0")&&(a="00:00"),this.getTimeToSeconds(a)+(this.getTimeToSeconds(e[t])-i*60)},getTimeToSeconds(e){const t=e.indexOf(".")>-1?e.substring(0,e.indexOf(".")):e,[a,i,n]=t.split(":").reverse();return(n?Number(n)*60*60:0)+Number(i)*60+Number(a)},getFormattedPlays(e,t=!1,a=null){this.roundsAndGamesWithPlaysMap=new Map,_u=new Map,e.forEach(n=>{const r=n.reduce((u,h,m)=>(u[CEe[m]]=h,u),{});r.playRaw=n;let o=null,l=null,c=null,d=0;if(t?(c=this.teamsMapMyPlaylists,d=this.maxGameIdMyPlaylists,o=this.gamesMapMyPlaylists.get(r.gameId),l=this.playersMapMyPlaylists.get(r.playerId),r.booleanIsFromMyPlaylists=!0):(c=a?a.mapTeams:this.teamsMap,d=a?a.maxGameId:this.maxGameId,o=a?a.mapGames.get(r.gameId):this.gamesMap.get(r.gameId),l=a?a.mapPlayers.get(r.playerId):this.seasonPlayers.get(r.playerId)),l&&o&&r.gameId<=d){const u=`${o.roundName},${o.roundAbbreviation},${o.seasonId}`,h=this.roundsAndGamesWithPlaysMap.get(u);h?h.set(o.id,o):this.roundsAndGamesWithPlaysMap.set(u,new Map().set(o.id,o)),r.game=o,r.game.awayTeam.id===r.teamId?(r.teamName=r.game.awayTeam.name,r.teamAcronym=r.game.awayTeam.acronym,r.rivalName=r.game.homeTeam.name):(r.teamName=r.game.homeTeam.name,r.teamAcronym=r.game.homeTeam.acronym,r.rivalName=r.game.awayTeam.name),r.playingAs=r.teamId===r.game.homeTeam.id?1:2,r.player=l,r.playerTeamLogo=c.get(r.player.teamId).logo,r.rivalTeamLogo=c.get(r.player.teamId===r.game.homeTeam.id?r.game.awayTeam.id:r.game.homeTeam.id).logo,r.startSeconds=this.getPlayTime(r,"startTime"),r.endSeconds=this.getPlayTime(r,"endTime");const m=new Date(r.gameDate),[p,f]=r.gameHour.split(":");m.setHours(p),m.setMinutes(f),r.dateTimeMillis=m.valueOf(),_u.has(r.gameId)?_u.get(r.gameId).plays.push(r):_u.set(r.gameId,{dateTimeMillis:m.valueOf(),plays:[r]})}});const i=Array.from(_u.values());return i.sort((n,r)=>r.dateTimeMillis-n.dateTimeMillis),i.reduce((n,r)=>(r.plays.sort((o,l)=>+`${o.matchLapse}${o.startTime.replace(/:*\.*/g,"")}`-+`${l.matchLapse}${l.startTime.replace(/:*\.*/g,"")}`),n.push(...r.plays),n),[])},generatePlayerQueue(e,t,a=!1,i=0,n){if(!t.length)return;const r=new Map,o=this.modalInitialState?this.modalInitialState.advancedFilter||{}:{};o&&o.fieldSections&&(o.fieldSectors=o.fieldSections.map(d=>Qi[`${d}`]));let l=0,c=0;if(this.lastSearchResult&&t.filter(d=>{const u=d.game.homeTeam.id===this.lastSearchResult.team.id||d.game.awayTeam.id===this.lastSearchResult.team.id;return u&&console.count("valid team"),u}).filter(d=>{const u=!this.lastSearchResult.game||d.gameId===this.lastSearchResult.game.id;return u&&console.count("valid game"),u}).filter(d=>!this.lastSearchResult.player||d.playerId===this.lastSearchResult.player.id),this.$store.commit("mediaGeneral/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:0}),this.playerQueue=t.reduce((d,u)=>{const h=`${u.gameId}-${u.playerId}-${u.startTime}`;let m=!1;if(this.modalInitialState&&this.modalInitialState.playsIds)m=!this.modalInitialState.playsIds.has(u.playId);else if(this.lastSearchResult)u.game.homeTeam.id===this.lastSearchResult.team.id||(u.game.awayTeam.id,this.lastSearchResult.team.id),this.lastSearchResult.team&&(m=u.game.homeTeam.id!==this.lastSearchResult.team.id&&u.game.awayTeam.id!==this.lastSearchResult.team.id),!m&&this.lastSearchResult.game&&(m=u.gameId!==this.lastSearchResult.game.id),!m&&this.lastSearchResult.player&&(m=u.playerId!==this.lastSearchResult.player.id);else if(this.isModalMode&&!a&&!n){this.modalInitialState.lastClashesGameId&&(m=u.gameId!==this.modalInitialState.lastClashesGameId);const y=this.getTeamId||this.modalInitialState.teamId;if(y&&(m=u.game.homeTeam.id!==y&&u.game.awayTeam.id!==y),!m&&this.selectedType===2&&(m=(this.modalInitialState&&this.modalInitialState.playerIds?this.modalInitialState.playerIds[0]:this.getPlayerId)!==u.playerId),!m&&o&&(o.playingAs&&o.playingAs.length&&(m=o.requiresRivalTransform&&o.playingAs.length===1&&u.teamId!==y?o.playingAs.includes(u.playingAs):!o.playingAs.includes(u.playingAs)),!m&&o.timeSections&&o.timeSections.length&&(m=!o.timeSections.includes(u.section)),!m&&o.coordinatePoint&&o.fieldSectors)){const b=vl(u[`x${o.coordinatePoint}`],u[`y${o.coordinatePoint}`])+1;m=!o.fieldSectors.includes(b)}if(!m&&y&&this.modalInitialState.matchResult&&this.modalInitialState.matchResult.length){const b=u.game.gameResult===3?3:u.game.gameResult===1&&y===u.game.homeTeam.id||u.game.gameResult===2&&y===u.game.awayTeam.id?1:2;m=!this.modalInitialState.matchResult.includes(b)}}const p=this.lastSearchResult?this.lastSearchResult.categoryIds:this.arrayCategoriesIdsToFilter||e,f=this.arrayRivalCategoriesIdsToFilter||this.rivalCategories;if(a||(n||!m)&&(p.includes(u.categoryId)||f.includes(u.categoryId)&&(this.booleanIsFilterApplied||!this.getTeamId||u.rivalTeamId===this.getTeamId))&&u.startSeconds!==u.endSeconds){const y=r.get(h);let b=this.modalInitialState&&this.modalInitialState.mainSectionType===this.modalSectionSelected+1&&this.modalInitialState.categorySingleName&&!this.modalInitialState.avoidCategorySingleName&&![35,54].includes(u.categoryId)?{name:this.modalInitialState.categorySingleName}:this.allCategories.get(u.categoryId)||this.allCategories.get(`${u.categoryId}_r`)||this.extraCategories.get(u.categoryId)||this.extraCategories.get(`${u.categoryId}_r`);this.modalInitialState&&this.modalInitialState.avoidCategorySingleName?b={name:this.modalInitialState.categorySingleName,weighing:1}:this.isModalMode&&u.categoryId===33&&(b={name:"Fuera de lugar",weighing:1});let E="";b||(E=this.mapMinutesPlayedCategoryNames.get(u.categoryId),E?b={name:E,weighing:1}:!b&&o&&(b={name:o.playListTitle,weighing:100})),b||(b=this.allCategories.get(u.categoryId)||this.allCategories.get(`${u.categoryId}_r`)||this.extraCategories.get(u.categoryId)||this.extraCategories.get(`${u.categoryId}_r`)),c||(this.lastGameIdWatched===u.gameId&&(c=l),l++),y?(b.weighing<y.mainCategory.weighing&&(y.mainCategory=b),y.categoriesNames.add(b.name)):(u.isSaved=this.playsSaved.has(u.playId),u.mainCategory=b,u.categoriesNames=new Set,u.categoriesNames.add(b.name),r.set(h,u),d.push(u))}return d},[]),this.lastSearchResult=null,this.showImage=!1,this.isModalMode){if(a)this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:0});else if(this.playerQueue.length)if(n&&this.objectMediaPlayerModeFilters.objectGameSelected){const d=this.playerQueue.findIndex(u=>this.objectMediaPlayerModeFilters.objectGameSelected.game_id===u.game.id);d!==-1&&this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:d})}else if(this.selectedType===1&&c)this.$store.commit("mediaGeneral/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:c});else if(this.modalInitialState&&!this.modalInitialState.lastClashesGameId&&this.modalInitialState.gameIds){const d=this.playerQueue.findIndex(u=>this.modalInitialState.gameIds.includes(u.game.id));d!==-1?this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:d}):this.playerQueue=[]}else if(this.modalInitialState&&this.modalInitialState.playData&&this.modalInitialState.playData.playId){const d=this.playerQueue.findIndex(u=>u.playId===this.modalInitialState.playData.playId);d!==-1&&this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:d})}else this.modalInitialState&&this.modalInitialState.currentPlayIndex?this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:this.modalInitialState.currentPlayIndex}):this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:i});this.$store.commit(`${this.storeModule}/setCurrentPlayerQueue`,this.playerQueue)}this.playerQueue.length||this.emptyListDecision(),this.booleanIsFirstIteration&&(this.booleanIsFirstIteration=!1,this.$emit("finish"))},emptyListDecision(){this.summaryData&&this.summaryData.isTeam&&this.playsType===this.playsTypeOptions[0]?this.playsType=this.playsTypeOptions[1]:!this.summaryData&&!this.isModalMode&&this.onTypeChanged(1)},getGeneralName(e){return e.split(" ").reduce((t,a,i)=>{if(i===0)if(a.includes("."))t.push(a);else{const n=a.toLowerCase().split("");n[0]=n[0].toUpperCase(),t.push(n.join(""))}else t.push(a.toLowerCase());return t},[]).join(" ")},getSingleName(e){return e.split(" ").reduce((t,a)=>{let i=a;return a.endsWith("ciones")?i=a.replace("ciones","ción"):a.endsWith("nales")?i=a.replace("nales","nal"):a.endsWith("vocan")?i=a.replace("vocan","voca"):a.endsWith("lones")?i=a.replace("lones","lón"):a.endsWith("oles")?i=a.replace("oles","ol"):(a.endsWith("os")||a.endsWith("as")||a.endsWith("es"))&&(i=a.slice(0,a.length-1)),t.push(i),t},[]).join(" ")},getCategoryFormat(e=""){const t=this.getGeneralName(e);return this.getSingleName(t)},getPlayerTournamentBySelectedSeason(e,t){const a=this.user.related_seasons.reduce((n,r)=>{const o=t.get(r);return o&&n.push(o._id),n},[]),i=t.get(e);return a.includes(i._id)?i:null},changeTournament(e){},changeSeason(e){},getFilteredPlays(e){return e.reduce((t,a)=>{if(this.objectMediaPlayerModeFilters.objectFilters.numberActionId>1){let i=!0;if(i&&this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs&&([3,4].includes(this.actionId)?i=!(this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.booleanRequiresRivalTransform&&this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs.length===1?a.teamId!==this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.numberTeamId?this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs.includes(a.playingAs):!this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs.includes(a.playingAs):!this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs.includes(a.playingAs)):i=this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs.includes(a.playingAs)),i&&this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayTimeSections&&(i=this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayTimeSections.includes(a.section)),i&&this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.coordinatePoint&&this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayFieldSections){const n=`${vl(a[`x${this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.coordinatePoint}`],a[`y${this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.coordinatePoint}`])+1}`,r=Qi[n],o=this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.requiresRivalTransform&&this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arraySelectedSubcategoryIds.includes(`${a.categoryId}_r`)?Qi[`${yu[n]}`]:r;i=!!this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayFieldSections.find(l=>l.num===o&&l.status)}i&&t.push(a)}else t.push(a);return t},[])},async fillSeasonPlayers(e){try{const t=await this.$store.dispatch("mediaGeneral/getPlayersBySeasons",{seasonId:e.id,returnData:!0});e.mapPlayers=new Map,e.mapPlayersByTeam=t.reduce((a,i)=>{e.mapPlayers.set(i.player_id,{id:i.player_id,name:i.player_name,shortName:i.shortName,photo:i.player_photo,teamId:i.team_id,positionId:i.position_id});const n=a.get(i.team_id);return n?n.push(i):a.set(i.team_id,[i]),a},new Map)}catch(t){throw new Error(t)}},async fillMatchDaysAndGamesV2(e){try{const{seasonsAndGames:t,seasonsAndTeams:a}=await this.fetchSeasonsGamesAndTeamsV2([e.id,...e.related_seasons.map(o=>o.id)],3),i=a.find(o=>o._id===e.id);e.arrayTeams=[],e.mapTeams=new Map;const n=i.teams.reduce((o,l)=>(e.arrayTeams.push(l),e.mapTeams.set(l.team_id,{name:l.colloquial_name,acronym:l.acronym,logo:l.logo,id:l.team_id}),o.set(l.team_id,l),o),new Map);e.mapGames=new Map,e.mapGamesByTeam=new Map;const r=Array.from(t.reduce((o,l)=>(l.games.forEach(c=>{if(c.game_status===1&&c.has_video){(!e.maxGameId||c.game_id>e.maxGameId)&&(e.maxGameId=c.game_id);let d=c.matchday_abbreviation.replace("M","J"),u=c.matchday_abbreviation.replace("M","Jornada ");const h=c.matchday_abbreviation.replace("M","");l.season_type===0?this.objectMediaPlayerModeFilters.objectTournamentSelected.id===33&&(c.seasonId===881?(d=w6[h]||d,u=S6[h]||u):(d=Cm[c.matchday_abbreviation]?c.matchday_abbreviation:d,u=Cm[c.matchday_abbreviation]||u,d==="FINAL"&&(d="F"))):l.season_type===1?(d=v6[c.matchday_abbreviation],u=d):c.matchday_id===182?(d="PI1",u="Play In 1"):c.matchday_id===183?(d="PI2",u="Play In 2"):(d=c.matchday_abbreviation.replace("PO","R"),u="Repechaje"),c.roundAbbreviation=d,c.roundName=u,e.mapGames.set(c.game_id,{id:c.game_id,date:c.date,dateTimeMillis:new Date(c.date_time_utc).valueOf(),homeTeam:e.mapTeams.get(c.home_team),awayTeam:e.mapTeams.get(c.visiting_team),roundAbbreviation:c.roundAbbreviation,roundName:c.roundName,score:c.score,gameResult:c.score[0]>c.score[1]?1:c.score[0]<c.score[1]?2:3,seasonId:l.season_id});const m=o.get(c.roundAbbreviation);c.numberDateTimeMillis=new Date(c.date_time_utc).getTime(),c.homeTeam=n.get(c.home_team),c.awayTeam=n.get(c.visiting_team);const p=e.mapGamesByTeam.get(c.home_team),f=e.mapGamesByTeam.get(c.visiting_team);p?p.push(c):e.mapGamesByTeam.set(c.home_team,[c]),f?f.push(c):e.mapGamesByTeam.set(c.visiting_team,[c]),m?m.arrayGames.push(c):o.set(c.roundAbbreviation,{stringMatchDayAbbreviation:c.roundAbbreviation,stringMatchDayName:c.roundName,arrayGames:[c]})}}),o),new Map).values());r.reverse(),r.forEach(o=>{o.arrayGames.sort((l,c)=>l.numberDateTimeMillis-c.numberDateTimeMillis)}),e.arrayMatchDays=r,this.objectMatchDaySelected=r[0]||{}}catch(t){throw new Error(t)}},async fetchSeasonsGamesAndTeamsV2(e,t,a=""){let i=a;try{i||(i=this.gamesUrl,e.forEach((o,l)=>{i+=`${l===0?"":"&"}seasons=${o}`}));const{data:{data:n,teams:r}}=await Ei.get(i);return{seasonsAndGames:n,seasonsAndTeams:r}}catch(n){if(t>0)return this.fetchSeasonsGamesAndTeamsV2(e,t-1,i);throw new Error(n)}},async fillNextSeasonPlays(){try{this.showImage=!0,this.playlistSeasonIndex++,this.seasonName=this.objectMediaPlayerModeFilters.objectTournamentSelected.arraySeasons[this.playlistSeasonIndex].name,this.playlistSeasonIndex>this.objectMediaPlayerModeFilters.objectTournamentSelected.arraySeasons.length-1&&(this.playlistSeasonIndex=0);const e=this.objectMediaPlayerModeFilters.objectTournamentSelected.arraySeasons[this.playlistSeasonIndex];e.arrayMatchDays||(await this.fillMatchDaysAndGamesV2(e),await this.fillSeasonPlayers(e));const t=await this.fetchPlays(e.id,this.objectMediaPlayerModeFilters.stringQueryCategoryIds,this.objectMediaPlayerModeFilters.stringQueryParams),a=this.getFormattedPlays(t,!1,e),i=this.getFilteredPlays(a);this.generatePlayerQueue(null,i,!1,0,!0)}catch(e){throw new Error(e)}},onPlaylistEnded(){this.booleanIsPlaySeekerMode||(this.isMyPlaylistsActive?this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:0}):this.booleanIsFilterApplied?this.fillNextSeasonPlays():(this.playlistSeasonIndex++,this.playlistSeasonIndex>this.playlistTournament.seasons.length-1&&(this.playlistSeasonIndex=0),this.seasonName=this.playlistTournament.seasons[this.playlistSeasonIndex].name,this.showImage=!0,setTimeout(()=>{this.fetchInfo(!1,this.playlistTournament)},4e3)))},onFullScreenChange(){this.isCarouselFullScreenVisible=!0},onTypeChanged(e=1){if((e!==this.selectedType||this.isModalMode)&&(this.isModalMode&&this.setPlayerType(e),this.selectedType!==e||this.isModalMode&&e===1)){if(this.selectedType=e,this.selectedType===2){this.mediaPlayerMode="player";const t=this.summaryData?{id:this.summaryData.id}:this.isModalMode?this.isFirstTypeChange?this.modalInitialState&&this.modalInitialState.goalkeeperIds?{id:this.modalInitialState.goalkeeperIds[0],positionId:1}:{id:this.modalInitialState.playerIds[0]}:this.playInfo.player:this.isUserTournament?null:this.playInfo.player;this.$store.commit(`${this.storeModule}/setPlayer`,t),this.$store.commit(`${this.storeModule}/setTeam`,this.isModalMode?this.playInfo.teamId:this.isUserTournament?this.gsData.teamId:this.playInfo.teamId),this.onPlayerSelected()}else if(this.selectedType===3){this.mediaPlayerMode="team";const t=this.summaryData?this.summaryData.id:this.isModalMode?this.isFirstTypeChange?this.modalInitialState&&this.modalInitialState.teamId:this.playInfo.teamId:this.hasPlayerActivityInTournament||this.isUserTournament?this.gsData.teamId:this.playInfo.teamId;this.$store.commit(`${this.storeModule}/setPlayer`,null),this.$store.commit(`${this.storeModule}/setTeam`,t),this.onTeamSelected()}else this.selectedType===1&&(this.mediaPlayerMode="games",this.$store.commit(`${this.storeModule}/setPlayer`,null),this.$store.commit(`${this.storeModule}/setTeam`,null),this.checkSeason());e!==0&&(this.isFirstTypeChange=!1)}},onMaxInactivityReached(){this.showModalConfirm=!0},checkSeason(){this.gsData||(this.playlistSeasonIndex=this.playlistSeasonIndexAux);const e=this.getSeasonIdOnly===this.seasonId;this.fetchInfo(e,this.playlistTournament)},onPlayerSelected(){this.mediaPlayerMode="player",this.checkSeason()},onTeamSelected(){this.mediaPlayerMode="team",this.checkSeason()},onGameIdSelected(e){this.gameIdSelected=e},onPlaying(){this.isAutoPlay=!0},onPlayChanged(e){if(this.lastGameIdWatched=e.gameId,e.isPlaySeeker)this.playInfo=e,this.objectPlaySeekerLastPlay={playListId:e.payloadData.playlist_id,groupPlayListId:e.payloadData.group_playlist_id,groupId:e.payloadData.group_id,playIndex:e.payloadData.play_number-1},window.localStorage.setItem("playSeekerLastPlay",JSON.stringify(this.objectPlaySeekerLastPlay));else if(e.booleanIsFullGame)this.playInfo={playId:e.playId,booleanIsFullGame:!0,homeTeamLogo:e.objectGame.homeTeam.logo,homeTeamName:e.objectGame.homeTeam.colloquial_name,awayTeamLogo:e.objectGame.awayTeam.logo,awayTeamName:e.objectGame.awayTeam.colloquial_name,arrayScore:e.objectGame.score,gameId:e.gameId,seasonId:e.objectGame.season_id,teamLogo:e.playerTeamLogo,playerLogo:e.player.photo,dateTimeMillis:new Date(e.objectGame.date_time_utc).getTime()};else if(this.summaryData)this.playInfo={playId:e.playId,homeTeamLogo:e.game.homeTeam.logo,homeTeamName:e.game.homeTeam.colloquial_name||e.game.homeTeam.name,awayTeamLogo:e.game.awayTeam.logo,awayTeamName:e.game.awayTeam.colloquial_name||e.game.awayTeam.name,arrayScore:e.game.score,gameId:e.gameId,seasonId:e.seasonId,mainCategoryName:C0(e.mainCategory.name),playerShortName:e.player.shortName,dateTimeMillis:e.dateTimeMillis,playRaw:e.playRaw,startSeconds:e.startSeconds,endSeconds:e.endSeconds};else{if(this.isModalMode){this.setPlaylistGameId(e.game.id);const t=this.playerType===2?e.player.shortName:this.playerType===3?this.modalInitialState&&this.modalInitialState.isRivalSubject&&this.modalInitialState.mainSectionType===this.modalSectionSelected+1?[35,54].includes(e.categoryId)?e.teamname:e.rivalName:[35,54].includes(e.categoryId)?e.rivalName:e.teamName:"";this.$emit("subject-change",t?` - ${t}`:"")}this.playInfo={playId:e.playId,date:e.gameDate,dateTimeMillis:e.dateTimeMillis,arrayScore:e.game.score,objectHomeTeam:e.game.homeTeam,objectAwayTeam:e.game.awayTeam,playerId:e.player.id,playerName:e.player.name,playerShortName:e.player.shortName,playCategory:e.categoryName,teams:`${e.game.homeTeam.name} vs ${e.game.awayTeam.name}`,playerPhoto:e.player.photo,teamLogo:e.playerTeamLogo,rivalLogo:e.rivalTeamLogo,teamId:e.teamId,categoryId:e.categoryId,jersey:e.jersey,mainCategoryName:C0(e.mainCategory.name||e.stringMainCategoryName||""),categoriesNames:Array.from(e.categoriesNames.values()).reduce((t,a,i)=>(t+=`${i===0?"":", "}${a}`,t),""),gameId:e.game.id,roundAbbreviation:e.game.roundAbbreviation,player:e.player,asLocal:e.game.homeTeam.id===e.teamId,momentOfPlay:e.momentOfPlay,seasonId:e.seasonId,playRaw:e.playRaw,startSeconds:e.startSeconds,endSeconds:e.endSeconds,booleanIsFromMyPlaylists:e.booleanIsFromMyPlaylists,tvStations:e.game.tvStations}}},async fetchPlays(e=null,t=null,a=null){try{this.lastGameIdWatched=0;let i="";if(a===null){const r=this.modalInitialState&&this.modalInitialState.playerIds&&this.modalInitialState.playerIds.length;this.modalInitialState.isFeaturedPlayers?(this.modalInitialState.playerIds.forEach(o=>{i+=`&player=${o}`}),this.modalInitialState.isFeaturedPlayers=!1):this.getPlayerId?(this.hasUserPlayerSelectedSeason&&this.getPlayerId===this.user.player||!this.user.is_player)&&(i+=`&player=${this.getPlayerId}`):r?this.modalInitialState.playerIds.forEach(o=>{i+=`&player=${o}`}):(this.getTeamId||this.modalInitialState.teamId)&&(i+=`&team=${this.getTeamId||this.modalInitialState.teamId}`),this.modalInitialState&&this.modalInitialState.isPost&&(i+="&isPost=1")}const n=await Ei.get(`https://cpj4073446.execute-api.us-east-2.amazonaws.com/prod/videos/plays/seasons/${e||this.seasonId}?${t||this.queryCategories}${a||i}`);if(n.data&&n.data.plays){const r=[...n.data.plays];return n.data.plays_rival?r.concat(n.data.plays_rival):r}return[]}catch(i){throw new Error(i)}},async fetchInfo(e,t){try{if(!t)return;let a=this.playlistSeasonIndex;this.playlistTournament=t,this.seasonId=t.seasons[a].id;let i=null,n=null;this.lastSearchResult&&(i="",this.lastSearchResult.player?i+=`&player=${this.lastSearchResult.player.id}`:this.lastSearchResult.team&&(i+=`&team=${this.lastSearchResult.team.id}`),n=this.lastSearchResult.categoryIds.reduce((d,u,h)=>(d+=`${h>0?"&":""}categories=${u}`,d),""));const r=[this.fetchPlays(null,n,i)];if(!e&&t.seasons[a]){const d=[this.seasonId];t.seasons[a].related_seasons&&t.seasons[a].related_seasons.length&&d.push(...t.seasons[a].related_seasons.map(u=>u.id)),r.push(this.$store.dispatch(`${this.storeModule}/fetchSeasonsGamesAndTeams`,{seasons:d})),r.push(this.$store.dispatch(`${this.storeModule}/getPlayersBySeasons`,{seasonId:this.seasonId}))}const[o,l]=await Promise.all(r);if(this.plays=o||[],this.hasPlayerActivityInTournament&&!this.plays.length)if(this.playlistSeasonIndex<this.playlistTournament.seasons.length-1&&this.seasonSearchingCount<1)this.playlistSeasonIndex++,this.seasonSearchingCount++,await this.fetchInfo(!1,t);else return;e||this.formatGamesAndTeams(l);const c=this.getFormattedPlays(this.plays);this.generatePlayerQueue(this.currentCategories.reduce((d,u)=>(typeof u=="string"&&u.includes("_")||d.push(Number(u)),d),[]),c),this.showImage=!1}catch(a){throw new Error(a)}},async fillSeasons(e,t=!1){try{if(e){let a=null;if(this.autoFillVideos?a=e.find(i=>i._id===1):a=e[0],a){if(this.currentTournament=a,this.isModalMode&&!t&&!this.lastSearchResult)return;await this.fetchInfo(!1,this.currentTournament)}}}catch(a){throw new Error(a)}},async fillMyPlaylistsData(e){if(e.length){const t=[this.$store.dispatch("mediaGeneral/fetchSeasonsGamesAndTeams",{seasons:e})];e.forEach(r=>{t.push(this.$store.dispatch("mediaGeneral/getPlayersBySeasons",{seasonId:r,returnData:!0}))});const a=await Promise.all(t),i=a.shift();this.formatGamesAndTeamsForMyPlaylists(i);const n=a.reduce((r,o)=>(o.forEach(l=>{r.set(l.player_id,{id:l.player_id,name:l.player_name,shortName:l.shortName,photo:l.player_photo,teamId:l.team_id,positionId:l.position_id})}),r),new Map);this.setPlayersMapMyPlaylists(n)}},getBestPlaysCategoriesIds(){return Object.keys($i[this.mediaPlayerMode]).reduce((e,t)=>(t.split("-").forEach(a=>{e.push(Number(a))}),e),[])},setUpMediaGeneralData(){const{objectCurrentPlay:e,numberCurrentTime:t}=this.$refs.videoPlayer.getCurrentPlayerPlayInfo(),a={numberPlayId:e.playId,numberCurrentTime:t},i={arrayPlayerQueue:[...this.playerQueue],stringModeTitle:this.stringModeTitle,numberPlaylistIndex:this.playlistIndex,numberPlaylistSeasonIndex:this.playlistSeasonIndex,booleanIsFilterApplied:this.booleanIsFilterApplied,booleanIsPlaySeekerMode:this.booleanIsPlaySeekerMode,booleanAvoidApply:this.isModalMode&&this.modalInitialState&&this.modalInitialState.avoidApply&&!this.booleanIsFilterApplied,objectPlaySync:a};this.booleanIsFilterApplied&&(i.objectLastDataToFilter=this.objectLastDataToFilter),this.$store.commit("mediaGeneral/setObjectMediaData",i)},formatGamesAndTeams(e){this.roundsMap=new Map,this.teamsMap=e.seasonsAndTeams.reduce((t,a)=>(a&&a.teams.forEach(i=>{t.has(i.team_id)||t.set(i.team_id,{name:i.colloquial_name,acronym:i.acronym,logo:i.logo,id:i.team_id,players:this.playersByTeam.get(i.team_id)})}),t),new Map),this.gamesMap=e.seasonsAndGames.reduce((t,a)=>{const i=!!(this.currentTournament&&this.currentTournament.tournament&&this.currentTournament.tournament.tournament_type);return a.games.forEach(n=>{n.seasonType=a.season_type,n.seasonId=a.season_id,n.game_id>this.maxGameId&&(this.maxGameId=n.game_id);let r=n.matchday_abbreviation.replace("M","J"),o=n.matchday_abbreviation.replace("M","Jornada ");const l=n.matchday_abbreviation.replace("M","");n.seasonType===0?i&&(n.seasonId===881?(r=w6[l]||r,o=S6[l]||o):(r=Cm[n.matchday_abbreviation]?n.matchday_abbreviation:r,o=Cm[n.matchday_abbreviation]||o,r==="FINAL"&&(r="F"))):n.seasonType===1?(r=v6[n.matchday_abbreviation],o=r):n.matchday_id===182?(r="PI1",o="Play In 1"):n.matchday_id===183?(r="PI2",o="Play In 2"):(r=n.matchday_abbreviation.replace("PO","R"),o="Repechaje"),n.roundAbbreviation=r,n.roundName=o;const c=n.date.split("-"),d={id:n.game_id,date:n.date,dateTimeMillis:new Date(n.date_time_utc).valueOf(),homeTeam:this.teamsMap.get(n.home_team),awayTeam:this.teamsMap.get(n.visiting_team),roundAbbreviation:n.roundAbbreviation,roundName:n.roundName,score:n.score,gameResult:n.score[0]>n.score[1]?1:n.score[0]<n.score[1]?2:3,seasonId:a.season_id,dateFormatted:`${Number(c[2])} ${nP[Number(c[1])-1]}, ${c[0]}`,tvStations:n.tv_stations?n.tv_stations.join(", "):null},u=this.roundsMap.get(n.roundAbbreviation);u?u.push(d):this.roundsMap.set(n.roundAbbreviation,[d]),t.has(n.game_id)||t.set(n.game_id,d)}),t},new Map)},formatGamesAndTeamsForMyPlaylists(e){const t=e.seasonsAndTeams.reduce((n,r)=>(r&&r.teams.forEach(o=>{n.has(o.team_id)||n.set(o.team_id,{name:o.colloquial_name,acronym:o.acronym,logo:o.logo,id:o.team_id,players:this.playersByTeam.get(o.team_id)})}),n),new Map);let a=0;const i=e.seasonsAndGames.reduce((n,r)=>(r.games.forEach(o=>{o.seasonType=r.season_type,o.seasonId=r.season_id,o.game_id>a&&(a=o.game_id);const l={id:o.game_id,date:o.date,dateTimeMillis:new Date(o.date_time_utc).valueOf(),homeTeam:t.get(o.home_team),awayTeam:t.get(o.visiting_team),roundAbbreviation:o.matchday_abbreviation,roundName:o.matchday_abbreviation.replace("M","MatchDay "),score:o.score,gameResult:o.score[0]>o.score[1]?1:o.score[0]<o.score[1]?2:3,seasonId:r.season_id};n.has(o.game_id)||n.set(o.game_id,l)}),n),new Map);this.setTeamsMapMyPlaylists(t),this.setGamesMapMyPlaylists(i),this.setMaxGameIdMyPlaylists(a)},onPlayerModeClicked(e){this.playerModeSelected=e},onClickModalLauncher(e=1){const{objectCurrentPlay:t,numberCurrentTime:a}=this.$refs.videoPlayer.getCurrentPlayerPlayInfo(),i={numberPlayId:t.playId,numberCurrentTime:a};this.$refs.videoPlayer.pausePlayers();let n=null;if(!e&&this.booleanIsFilterApplied||this.objectMediaPlayerModeFilters.objectSeasonSelected||this.booleanIsPlaySeekerMode||this.booleanIsFilterApplied){const r={arrayPlayerQueue:[...this.playerQueue],stringModeTitle:this.stringModeTitle,numberPlaylistIndex:this.playlistIndex,numberPlaylistSeasonIndex:this.playlistSeasonIndex,booleanIsPlaySeekerMode:this.booleanIsPlaySeekerMode,numberMainSectionType:e,objectPlaySync:i};r.booleanIsFilterApplied=this.booleanIsFilterApplied,this.booleanIsFilterApplied&&(r.objectLastDataToFilter=this.objectLastDataToFilter),this.$store.commit("mediaModal/setModalInitialState",null),this.$store.commit("mediaModal/setObjectMediaData",r)}else n={seasonId:this.seasonId,tournaments:this.tournamentsForModalLauncher,categoryIds:[...this.currentCategories],mainSectionType:e,matchResult:[1,2,3],currentPlayIndex:this.playlistIndex,objectPlaySync:i},this.getPlayerId?this.isPlayerGoalkeeper?n.goalkeeperIds=[this.getPlayerId]:n.playerIds=[this.getPlayerId]:this.getTeamId&&(n.teamId=this.getTeamId),this.$store.commit("mediaModal/setObjectMediaData",null),this.$store.commit("mediaModal/setModalInitialState",n);this.$store.commit("mediaModal/setIsModalOpen",!0)},setUpResizeObserver(){if(window.ResizeObserver)this.mediaPlayerResizeObserver=new window.ResizeObserver(()=>{this.mediaPlayerWidth=this.$refs.mediaPlayer.clientWidth,this.mediaPlayerInfoHeight=this.$refs.mediaContainerInfo.clientHeight,this.mediaPlayerWidth<=1024?this.mobileClass=!0:this.mobileClass=!1,this.mediaPlayerWidth<=750?this.isMobileTabsActive=!0:(this.isMobileTabsActive=!1,this.currentMobileTab="Estás viendo")}),this.mediaPlayerResizeObserver.observe(this.$refs.mediaPlayer),this.mediaPlayerResizeObserver.observe(this.$refs.mediaContainerInfo);else throw new Error("Resize observer not supported!")},onClickMyPlaylists(){this.isModalMode?this.$store.commit("mediaModal/setModalSectionSelected",2):this.onClickModalLauncher(2)},getEmptyMediaPlayerModeFilters(){return{objectTournamentSelected:null,objectSeasonSelected:null,stringQueryCategoryIds:"",stringQueryParams:"",objectFilters:{numberActionId:0,numberMediaPlayerType:null,objectCategorySelected:null,objectAdvancedFilters:{numberTeamId:null,numberPlayerId:null,arraySelectedSubcategoryIds:[],booleanRequiresRivalTransform:!1,numberCoordinatePoint:2,arrayPlayingAs:[],arrayTimeSections:[],arrayFieldSections:[]}}}},fillDataToFilterData(e){this.objectLastDataToFilter=e,this.arrayCategoriesIdsToFilter=e.arrayCategoriesIds,this.arrayRivalCategoriesIdsToFilter=e.arrayRivalCategoriesIds,this.arrayCategoriesIdsRaw=e.arrayCategoriesIdsRaw,this.objectMediaPlayerModeFilters.stringQueryCategoryIds=e.stringQueryCategoryIds,this.objectMediaPlayerModeFilters.stringQueryParams=e.stringQueryParams,this.objectMediaPlayerModeFilters.objectTournamentSelected=e.objectTournamentSelected,this.objectMediaPlayerModeFilters.objectSeasonSelected=e.objectSeasonSelected,this.objectMediaPlayerModeFilters.objectGameSelected=e.objectGameSelected,this.objectMediaPlayerModeFilters.objectFilters.numberMediaPlayerType=e.objectFilters.numberMediaPlayerType,this.objectMediaPlayerModeFilters.objectFilters.objectCategorySelected=e.objectFilters.objectCategorySelected,this.objectMediaPlayerModeFilters.objectFilters.numberActionId=e.objectFilters.numberActionId,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.numberTeamId=e.objectFilters.objectAdvancedFilters.numberTeamId,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.numberPlayerId=e.objectFilters.objectAdvancedFilters.numberPlayerId,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.booleanIsPlayerGoalKeeper=e.objectFilters.objectAdvancedFilters.booleanIsPlayerGoalKeeper,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arraySelectedSubcategoryIds=e.objectFilters.objectAdvancedFilters.arraySelectedSubcategoryIds,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.booleanRequiresRivalTransform=e.objectFilters.objectAdvancedFilters.booleanRequiresRivalTransform,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.numberCoordinatePoint=e.objectFilters.objectAdvancedFilters.numberCoordinatePoint,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayPlayingAs=e.objectFilters.objectAdvancedFilters.arrayPlayingAs,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayTimeSections=e.objectFilters.objectAdvancedFilters.arrayTimeSections,this.objectMediaPlayerModeFilters.objectFilters.objectAdvancedFilters.arrayFieldSections=e.objectFilters.objectAdvancedFilters.arrayFieldSections,this.selectedType=e.numberSelectedType},onApplyFilters(e){this.stringModeTitle=`Estas viendo: ${e.stringControlsTitle}`,this.booleanIsPlaySeekerMode=!1,this.booleanIsFilterApplied=!0,this.fillDataToFilterData(e),this.playlistSeasonIndex=e.objectTournamentSelected.numberSeasonSelectedIndex,this.generatePlayerQueue(null,e.arrayFormattedPlays,!1,e.numberPlaylistIndex,!0)},onClickOptions(e){this.booleanIsOptionsMenuVisible=!0,this.numberOptionsMenuTop=e.numberY,this.numberOptionsMenuLeft=e.numberX},onClickOpenModes(){this.$refs.videoPlayer.pausePlayers(),this.booleanIsModesModalOpen=!0},onClickFullGame(e){this.booleanIsPlaySeekerMode=!1,this.booleanIsFilterApplied=!0;const t=e.arrayMatchDayGames.findIndex(a=>a.game_id===e.objectGame.game_id);t!==-1&&(this.stringModeTitle=`Estas viendo: ${e.stringControlsTitle}`,this.booleanIsPlaySeekerMode=!1,this.playerQueue=e.arrayMatchDayGames.map(a=>(a.homeTeam.name=a.homeTeam.colloquial_name,a.awayTeam.name=a.awayTeam.colloquial_name,{booleanIsFullGame:!0,objectGame:a,gameId:a.game_id,startSeconds:0,endSeconds:null})),this.$store.commit(`${this.storeModule}/setPlaylistIndex`,{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:t}),this.$store.commit(`${this.storeModule}/setCurrentPlayerQueue`,this.playerQueue))},onModesModalClose(){this.booleanIsModesModalOpen=!1,this.onClickSpeed(1)},onClickMode(){this.$refs.videoPlayer.setSpeedToAllPlayers(1)},onClickSurpriseMe(){this.booleanIsFilterApplied=!1,this.booleanIsPlaySeekerMode=!0,this.fillPlaySeekerPlays()},getPlaySeekerCategoryName(e){if(e.categoryId===33)return"Fuera de lugar";if([35,54].includes(e.categoryId))return"Auto gol";{const t=this.allCategories.get(e.categoryId)||this.allCategories.get(`${e.categoryId}_r`)||this.extraCategories.get(e.categoryId)||this.extraCategories.get(`${e.categoryId}_r`);return t?t.name:"S/N"}},async setUpTokens(){try{const e=await(await fetch(`${this.firstInteractionUrl}/token`,{method:"POST",mode:"cors",headers:{Authorization:"Basic bXN1c2VyQWRtaW46bXN1c2VycGFzc3dvcmRBZG1pbg=="},referrerPolicy:"no-referrer"})).json();this.firstInteractionToken=e.token}catch(e){throw new Error(e)}},async fillPlaySeekerPlays(){try{if(this.stringModeTitle="Sorpréndeme",this.booleanIsPlaySeekerMode){const e=await(await fetch(`${this.firstInteractionUrl}/firstInteraction/${EEe}/${this.user.username}/playlist`,{method:"GET",headers:{Authorization:`Bearer ${this.firstInteractionToken}`},referrerPolicy:"no-referrer"})).json();e&&(this.setPlaySeekerUserId(e.user_id),this.setPlaySeekerCurrentSessionId(this.getPlaySeekerSessionId(this.playSeekerUserId)),this.$emit("change-user-id",this.playSeekerUserId),window.localStorage.setItem("playSeekerUserId",this.playSeekerUserId),this.formatPlaySeekerPlays(e))}}catch(e){throw new Error(e)}},formatPlaySeekerPlays(e){let t=[];e&&e.playlist&&e.playlist.length&&(t=e.playlist.reduce((i,n,r)=>{const o={...Object.entries(Zi).reduce((h,[m,p])=>(h[m]=n[p],h),{}),isPlaySeeker:!0,startSeconds:n[Zi.startTime],endSeconds:n[Zi.endTime],totalSeconds:Math.floor(n[Zi.endTime]-n[Zi.startTime]),payloadData:{play_id:n[Zi.playId],total_plays:e.total_plays,play_number:r+1,group_playlist_id:e.group_playlist_id,playlist_id:e.playlist_id,group_id:e.group_id,moment_of_play:n[Zi.momentOfPlay],play_type:n[Zi.categoryId],viewer_second_start:Math.floor(n[Zi.startTime]),intended_second_start:Math.floor(n[Zi.startTime]),intended_second_end:Math.floor(n[Zi.endTime]),latitude_of_user:null,longitude_of_user:null}},[l,c]=o.playerName.split(","),d=l.split(" ");let u="";for(const h of d)if(u+=` ${h}`,h.length>3)break;if(o.playerShortName=c&&l?`${c.trim().charAt(0)}.${u}`:"",!o.mainCategoryName){o.mainCategoryName=C0(this.getPlaySeekerCategoryName(o));const[h,m]=o.finalScore.split(" - ");o.arrayScore=[Number(h),Number(m)]}return i.push(o),i},[]));let a=[];this.concatPlays?a=[...this.playerQueue.splice(0,this.currentPlayIndex+1),...t]:a=t,this.playerQueue=a,this.objectPlaySeekerLastPlay&&this.objectPlaySeekerLastPlay.playListId===e.playlist_id&&this.objectPlaySeekerLastPlay.groupPlayListId===e.group_playlist_id&&this.objectPlaySeekerLastPlay.groupId===e.group_id&&this.$store.commit(`${this.storeModule}/setPlaylistIndex`,{mediaPlayerType:this.isModalMode?null:this.mediaPlayerType,playlistIndex:this.objectPlaySeekerLastPlay.playIndex}),this.$store.commit(`${this.storeModule}/setCurrentPlayerQueue`,this.playerQueue)},getPlaySeekerSessionId(e){return e?`S_${e}${Date.now()}`:null},getRandomPercentage(){return Math.floor(Math.random()*60+20)},async sendUserBehavior(e,t,a){try{if(this.playInfo.isPlaySeeker){const i={user_id:this.playSeekerUserId,current_session_id:this.playSeekerCurrentSessionId,last_play:{...this.playInfo.payloadData}};i&&(i.last_play.action=t,i.last_play.percentage_viewed=t===1?100:this.getRandomPercentage(),i.last_play.viewer_second_end=e||this.playInfo.endSeconds,i.last_play.date_time_of_user_action=a,this.coords&&(i.last_play.latitude_of_user=this.coords.latitude,i.last_play.longitude_of_user=this.coords.latitude));const n=await fetch(`${this.userBehaviorUrl}/user-behavior`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(n.status===200){const r=await n.json();r&&(this.concatPlays=!0,this.formatPlaySeekerPlays(r))}else this.concatPlays=!1}}catch(i){throw new Error(i)}},onGeoSuccess(e){this.coords=e.coords},onGeoError(e){throw new Error(e)},onClickTimeButton(e){e.numberType===1?this.$refs.videoPlayer.addSecondsToCurrentPlayer(e.numberValue*e.numberValueFactor):e.numberType===2?this.booleanIsSpeedModalVisible=!0:this.booleanIsVideoPlayerPlaying?this.$refs.videoPlayer.pausePlayers():this.$refs.videoPlayer.playCurrentPlayer()},onClickOption(e){this.$refs.videoPlayer.pausePlayers(),e===1?up.emit("click-game",{gameId:this.playInfo.gameId,gameStatus:1,dateTimeUTC:new Date(this.playInfo.dateTimeMillis).toISOString(),seasonId:this.playInfo.seasonId,stringSectionName:"lineups"}):e===2?this.onClickDownload():e===3?(this.setPlaysToSaveAsFavorites([this.playInfo.playRaw]),this.setIsModalCreatePlayListOpen(!0)):e===4&&(this.isModalMode?this.$emit("show-list"):this.onClickModalLauncher())},onClickNextBack(e){this.$refs.videoPlayer.onMoveToPlayClicked(e)},onPlayIteration({iterationTime:e,userAction:t,dateTimeIsoString:a}){this.booleanIsPlaySeekerMode&&this.sendUserBehavior(e,t,a)},onClickAnalyst(){this.onClickModalLauncher()},onClickFullscreen(){this.isCarouselFullScreenVisible=!0},onClickAdvnacedFilterType(e){},onChangeSeason(e){this.numberCurrentSeasonId=Number(e),this.isAutoPlay=!1,this.objectMediaPlayerModeFilters=this.getEmptyMediaPlayerModeFilters(),this.setUpData(e)},onUpdateSearchResult(e){this.lastSearchResult=e,this.setUpData(e.seasonId)},onClickClose(){this.$emit("close")},onClickCloseCarousel(e){e&&this.$store.commit("mediaModal/setPlaylistIndex",{mediaPlayerType:null,playlistIndex:e}),this.isCarouselFullScreenVisible=!1},getPlayerOptions(){return{playbackRates:[.5,1,1.5,2],autoplay:!1,controls:!0,controlBar:{children:["playToggle","volumePanel","playbackRateMenuButton","CurrentTimeDisplay","progressControl","remainingTimeDisplay","fullscreenToggle"],pictureInPictureToggle:!1,volumePanel:{inline:!1}},liveui:!0,preload:"auto",fluid:!0}},videoJsInit(){ge.registerPlugin("offset",ev),this.videojsLocal=ge},onClickAdvancedFilterType(e){this.filterToSetUp=e,setTimeout(()=>{this.filterToSetUp=null},100)}},async created(){try{this.videoJsInit(),Ei.defaults.headers.common.Authorization=this.token,this.modalInitialData&&this.$store.commit("mediaModal/setModalInitialState",this.modalInitialData),up.on("change-season",this.onChangeSeason),up.on("some-list-selected",()=>{this.isSomeListSelected=!0}),this.autoFillVideos&&await this.$store.dispatch(`${this.storeModule}/fetchTournaments`)}catch(e){throw new Error(e)}},mounted(){this.isModalMode?setTimeout(()=>{this.modalInitialState?(this.objectPlaySync=this.modalInitialState.objectPlaySync?{...this.modalInitialState.objectPlaySync,booleanIsApplied:!1}:null,this.setUpData(this.modalInitialState.seasonId),this.onTypeChanged(this.modalInitialState.playListType),this.$store.commit("mediaModal/setModalSectionSelected",this.modalInitialState.mainSectionType||1),this.stringModeTitle=`Estas viendo: ${this.modalInitialState.teamId?"Resumen de equipo":this.modalInitialState.playerIds&&this.modalInitialState.playerIds.length?"Resumen de jugador":this.modalInitialState.gameIds&&this.modalInitialState.gameIds.length?"Resumen de partido":""}`):this.objectMediaData&&(this.$store.commit("mediaModal/setModalSectionSelected",1),this.applyObjectMediaData())},100):this.seasonSelectedId&&this.tournamentsForMediaPlayer.size>0&&(this.setUpData(this.seasonSelectedId),this.setInitialTitle()),setTimeout(()=>{this.setUpResizeObserver()},1e3)},beforeUnmount(){this.isSomeListSelected=!1,this.mediaPlayerResizeObserver&&(this.mediaPlayerResizeObserver.disconnect(),this.mediaPlayerResizeObserver=null),this.$store.commit(`${this.storeModule}/setPlayer`,null),this.$store.commit(`${this.storeModule}/setTeam`,null),this.setPlaylistGameId(0)}},rP=()=>{s.useCssVars(e=>({c4dcc094:e.backgroundColor}))},sP=uv.setup;uv.setup=sP?(e,t)=>(rP(),sP(e,t)):rP;const vu=e=>(s.pushScopeId("data-v-ef1a8ac2"),e=e(),s.popScopeId(),e),IEe={class:"modal-video__videos"},xEe=vu(()=>s.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[s.createElementVNode("path",{d:"M5 15L15 5",stroke:"white","stroke-width":"1.7","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),s.createElementVNode("path",{d:"M15 15L5 5",stroke:"white","stroke-width":"1.7","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),NEe=[xEe],AEe={class:"modal-video__videos__search-and-filters"},PEe={class:"modal-video__search-and-filters__search"},OEe={class:"modal-video__search-and-filters__advanced"},BEe={class:"modal-video__videos__mobile"},DEe=vu(()=>s.createElementVNode("span",{class:"watching"},"Estás viendo: ",-1)),MEe={key:0,class:"category-name"},LEe={class:"modal-video__videos__video",ref:"mediaContainerInfo"},REe={key:1,class:"modal-video__detail"},FEe={class:"modal-video__img-container"},VEe=["src"],UEe={class:"modal-video__img-container overlap"},jEe=["src"],zEe={class:"modal-video__description"},HEe={key:2,class:"modal-video__date"},qEe={class:"discover-container"},WEe=vu(()=>s.createElementVNode("div",{class:"title-value"},"Descubre videos",-1)),GEe={class:"modal-video__matches"},KEe={class:"current-match-info"},XEe=vu(()=>s.createElementVNode("h4",null,"Estás viendo:",-1)),JEe={key:0},YEe={class:"modal-video__game-list"},QEe={class:"modal-video__game-list__title"},ZEe={key:0,class:"discover-videos"},$Ee=vu(()=>s.createElementVNode("div",{class:"title-value"},"Descubre videos",-1));function e5e(e,t,a,i,n,r){const o=s.resolveComponent("CarouselFullScreen"),l=s.resolveComponent("VideoSearch"),c=s.resolveComponent("SearchFilters"),d=s.resolveComponent("VideoPlayer"),u=s.resolveComponent("VideoPlayerControls"),h=s.resolveComponent("GscSwitchComponent"),m=s.resolveComponent("GSCPlayerTeamGame"),p=s.resolveComponent("CurrentMatch"),f=s.resolveComponent("MatchesList");return s.openBlock(),s.createElementBlock(s.Fragment,null,[n.isCarouselFullScreenVisible?(s.openBlock(),s.createBlock(o,{key:0,videojs:n.videojsLocal,"player-queue":r.carouselPlayerQueue,"playlist-index":r.playlistIndex,"initial-play":n.playInfo,onClose:r.onClickCloseCarousel},null,8,["videojs","player-queue","playlist-index","initial-play","onClose"])):s.createCommentVNode("",!0),s.createElementVNode("div",{ref:"mediaPlayer",class:s.normalizeClass(["modal-video",r.dynamicClasses])},[s.createElementVNode("div",IEe,[a.isModal?(s.openBlock(),s.createElementBlock("div",{key:0,class:"modal-video__close",onClick:t[0]||(t[0]=(...y)=>r.onClickClose&&r.onClickClose(...y))},NEe)):s.createCommentVNode("",!0),s.createElementVNode("div",AEe,[s.createElementVNode("div",PEe,[s.createVNode(l,{clientWidth:this.mediaPlayerWidth,onClickAdvancedFilterType:r.onClickAdvancedFilterType,"onUpdate:searchResult":r.onUpdateSearchResult},null,8,["clientWidth","onClickAdvancedFilterType","onUpdate:searchResult"])]),s.createElementVNode("div",OEe,[s.createVNode(c,{ref:"searchFilters",clientWidth:this.mediaPlayerWidth,"filter-type-to-set-up":n.filterToSetUp,onApplyFilters:r.onApplyFilters},null,8,["clientWidth","filter-type-to-set-up","onApplyFilters"])])]),s.createElementVNode("div",BEe,[n.mobileClass?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[DEe,n.playInfo?(s.openBlock(),s.createElementBlock("span",MEe,s.toDisplayString(n.playInfo.mainCategoryName),1)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)]),s.createElementVNode("div",LEe,[s.createVNode(d,{ref:"videoPlayer","player-queue":n.playerQueue,"is-v2":"","is-gs":"","is-from-mexico":a.isFromMexico,"is-gs-user":a.isGSUser,"container-width":n.mediaPlayerWidth,"game-id-selected":n.gameIdSelected,"is-first-row":!1,"plays-type-selected":n.selectedType,"is-auto-play":n.isAutoPlay,"is-modal-mode":a.isModalMode,"are-types-hidden":r.isSummaryData||r.isMyPlaylistsActive,"is-play-seeker-mode":n.booleanIsPlaySeekerMode,"play-sync":n.objectPlaySync,onPlayIteration:r.onPlayIteration,onPlaying:r.onPlaying,onPlayChanged:r.onPlayChanged,onMaxInactivityReached:r.onMaxInactivityReached,onPlaylistEnded:r.onPlaylistEnded,onChangeType:r.onTypeChanged,onPlay:t[1]||(t[1]=y=>n.booleanIsVideoPlayerPlaying=!0),onPause:t[2]||(t[2]=y=>n.booleanIsVideoPlayerPlaying=!1),onClickFullScreen:r.onClickFullscreen},null,8,["player-queue","is-from-mexico","is-gs-user","container-width","game-id-selected","plays-type-selected","is-auto-play","is-modal-mode","are-types-hidden","is-play-seeker-mode","play-sync","onPlayIteration","onPlaying","onPlayChanged","onMaxInactivityReached","onPlaylistEnded","onChangeType","onClickFullScreen"]),s.createVNode(u,{"play-info":n.playInfo,onClickNextBack:r.onClickNextBack,clientWidth:this.mediaPlayerWidth},null,8,["play-info","onClickNextBack","clientWidth"])],512),n.playInfo&&n.playInfo.objectHomeTeam?(s.openBlock(),s.createElementBlock("div",REe,[s.createElementVNode("div",FEe,[s.createElementVNode("img",{class:"modal-video__img",src:n.playInfo.teamLogo},null,8,VEe)]),s.createElementVNode("div",UEe,[s.createElementVNode("img",{class:"modal-video__img",src:n.playInfo.playerPhoto},null,8,jEe)]),s.createElementVNode("div",zEe,s.toDisplayString(n.playInfo.objectHomeTeam.acronym)+" "+s.toDisplayString(n.playInfo.arrayScore[0])+" : "+s.toDisplayString(n.playInfo.arrayScore[1])+" "+s.toDisplayString(n.playInfo.objectAwayTeam.acronym)+" I "+s.toDisplayString(n.playInfo.roundAbbreviation),1)])):s.createCommentVNode("",!0),!n.mobileClass&&n.playInfo?(s.openBlock(),s.createElementBlock("div",HEe,s.toDisplayString(r.formatDate(n.playInfo.date)),1)):s.createCommentVNode("",!0),s.createElementVNode("div",qEe,[a.userForDiscoverVideos&&a.nextRivalTeam?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[WEe,n.mobileClass?(s.openBlock(),s.createBlock(h,{key:0,buttons:["Estás viendo","Otros partidos","Descubre videos"],class:"current-match__tabs",selectedOption:n.currentMobileTab,arrow:!1,height:"26px",borderRadius:"32px",fontSize:"14px","font-family":"Poppins-Light",backgroundOptionActive:"transparent",borderWidth:"2px",onInput:t[3]||(t[3]=y=>n.currentMobileTab=y)},null,8,["selectedOption"])):s.createCommentVNode("",!0),a.section?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[!n.mobileClass||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(h,{key:0,style:{"margin-left":"0px"},buttons:["Resumen","Proximo rival"],onInput:t[4]||(t[4]=y=>n.currentTabMoreVideos=y),background:"trasparent",height:"28px",width:"160px",fontSize:"14px","font-family":"Poppins-Light",backgroundOptionActive:"transparent",borderWidth:"2px",type:2,arrow:!1,selectedOption:n.currentTabMoreVideos},null,8,["selectedOption"])):s.createCommentVNode("",!0),this.userForDiscoverVideos.is_player?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[n.currentTabMoreVideos=="Resumen"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:8,style:{"margin-top":"-30px"},title:"",backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,player:a.userForDiscoverVideos.player,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:8,style:{"margin-top":"-30px"},title:"",backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,player:a.userForDiscoverVideos.player,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[n.currentTabMoreVideos=="Resumen"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:7,title:"",style:{"margin-top":"-30px"},backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,team:a.userForDiscoverVideos.team,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:7,style:{"margin-top":"-30px"},title:"",backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,team:a.nextRivalTeam.team_id,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64))],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,style:{"margin-top":"-30px"},type:13,data:{season:a.userForDiscoverVideos.season,category:1255e3},width:"100%",backgroundColor:"#172531",title:""},null,8,["data"])):s.createCommentVNode("",!0)],64))],64)):s.createCommentVNode("",!0)])]),s.createElementVNode("div",GEe,[s.createElementVNode("div",KEe,[n.mobileClass?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[XEe,n.playInfo?(s.openBlock(),s.createElementBlock("h3",JEe,s.toDisplayString(n.playInfo.mainCategoryName),1)):s.createCommentVNode("",!0)],64)),r.currentMatch&&(!n.mobileClass||n.currentMobileTab==="Estás viendo")?(s.openBlock(),s.createBlock(p,{key:1,currentMatch:r.currentMatch,mobileClass:"",isMobile:this.mobileClass,isMobileTabsActive:this.isMobileTabsActive,clientWidth:this.mediaPlayerWidth,videoPlayerHeight:this.mediaPlayerInfoHeight},null,8,["currentMatch","isMobile","isMobileTabsActive","clientWidth","videoPlayerHeight"])):s.createCommentVNode("",!0)]),s.createElementVNode("div",YEe,[s.withDirectives(s.createElementVNode("div",QEe,"Otros partidos",512),[[s.vShow,(!n.mobileClass||!n.isMobileTabsActive)&&e.currentPlayerQueueByGames.length>1||!n.isMobileTabsActive]]),!n.mobileClass||n.currentMobileTab==="Otros partidos"||!n.isMobileTabsActive?(s.openBlock(),s.createBlock(f,{key:0,matches:e.currentPlayerQueueByGames,mobileClass:"",isMobileTabsActive:this.isMobileTabsActive,clientWidth:this.mediaPlayerWidth},null,8,["matches","isMobileTabsActive","clientWidth"])):s.createCommentVNode("",!0)])]),a.userForDiscoverVideos&&a.nextRivalTeam?(s.openBlock(),s.createElementBlock("div",ZEe,[$Ee,n.mobileClass?(s.openBlock(),s.createBlock(h,{key:0,buttons:["Estás viendo","Otros partidos","Descubre videos"],class:"current-match__tabs",selectedOption:n.currentMobileTab,arrow:!1,borderRadius:"32px",height:"28px",fontSize:"14px","font-family":"Poppins-Light",backgroundOptionActive:"transparent",borderWidth:"2px",onInput:t[5]||(t[5]=y=>n.currentMobileTab=y)},null,8,["selectedOption"])):s.createCommentVNode("",!0),a.section?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(h,{style:{"margin-left":"0px"},buttons:["Resumen","Proximo rival"],onInput:t[6]||(t[6]=y=>n.currentTabMoreVideos=y),background:"trasparent",height:"28px",width:"160px",fontSize:"14px","font-family":"Poppins-Light",backgroundOptionActive:"transparent",borderWidth:"2px",type:2,arrow:!1,selectedOption:n.currentTabMoreVideos},null,8,["selectedOption"]),this.userForDiscoverVideos.is_player?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[n.currentTabMoreVideos=="Resumen"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:8,style:{"margin-top":"-30px"},title:"",backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,player:a.userForDiscoverVideos.player,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:8,style:{"margin-top":"-30px"},title:"",backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,player:a.userForDiscoverVideos.player,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[n.currentTabMoreVideos=="Resumen"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:7,title:"",style:{"margin-top":"-30px"},backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,team:a.userForDiscoverVideos.team,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,type:7,style:{"margin-top":"-30px"},title:"",backgroundColor:"#172531",data:{season:a.userForDiscoverVideos.season,team:a.nextRivalTeam.team_id,category:1255e3},width:"100%"},null,8,["data"])):s.createCommentVNode("",!0)],64))],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[!n.mobileClass||n.currentMobileTab==="Resumen"||n.currentMobileTab==="Descubre videos"?(s.openBlock(),s.createBlock(m,{key:0,style:{"margin-top":"-30px"},type:13,data:{season:a.userForDiscoverVideos.season,category:1255e3},width:"100%",backgroundColor:"#172531",title:""},null,8,["data"])):s.createCommentVNode("",!0)],64))])):s.createCommentVNode("",!0)],2)],64)}const t5e=bt(uv,[["render",e5e],["__scopeId","data-v-ef1a8ac2"]]);f0e();const a5e={class:"container"},i5e=!1,n5e=si({__name:"GSCMediaPlayer",setup(e){const t=s.ref("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE");wc.defaults.headers.common.Authorization=t.value;const a=[{_id:44,seasons:[{name:"Clausura 2023",related_seasons:[{type:1,id:1752}],id:1713,type:0},{name:"Apertura 2022",related_seasons:[{type:1,id:1592}],id:1542,type:0},{name:"Grita Mexico C22",related_seasons:[{type:1,id:1521}],id:1486,type:0}],tournament:{show_logos:0,tournament_type:0,name:"Sub-20",logo:null,id:44,tournament_status:0,order:5}},{_id:1095,seasons:[{name:"Apertura 2023",related_seasons:[{type:1,id:1831}],id:1783,type:0},{name:"Clausura 2023",related_seasons:[{type:1,id:1750}],id:1715,type:0},{name:"Apertura 2022",related_seasons:[{type:1,id:1652}],id:1541,type:0},{name:"Grita Mexico C22",related_seasons:[{type:1,id:1527}],id:1488,type:0}],tournament:{show_logos:0,tournament_type:0,name:"Sub-16",logo:null,id:1095,tournament_status:0,order:7}},{_id:1001,seasons:[{name:"Clausura 2024",related_seasons:[],id:1838,type:0},{name:"Apertura 2023",related_seasons:[{type:1,id:1825}],id:1777,type:0},{name:"Clausura 2023",related_seasons:[{type:1,id:1747}],id:1696,type:0},{name:"Apertura 2022",related_seasons:[{type:1,id:1655}],id:1539,type:0},{name:"Grita Mexico C22",related_seasons:[{type:1,id:1523}],id:1485,type:0},{name:"Grita Mexico A21",related_seasons:[{type:1,id:1458}],id:1402,type:0},{name:"Guard1anes Clausura 2021",related_seasons:[{type:1,id:1384}],id:1323,type:0},{name:"Guard1anes 2020",related_seasons:[{type:1,id:1318}],id:1283,type:0},{name:"Clausura 2020",related_seasons:[],id:1241,type:0},{name:"Apertura 2019",related_seasons:[{type:1,id:1227}],id:1157,type:0},{name:"Clausura 2019",related_seasons:[{type:1,id:1132}],id:1095,type:0},{name:"Apertura 2018",related_seasons:[{type:1,id:1072}],id:1004,type:0},{name:"Clausura 2018",related_seasons:[{type:1,id:1237}],id:1236,type:0}],tournament:{show_logos:1,tournament_type:0,name:"Liga MX Femenil",logo:"https://az755631.vo.msecnd.net/tournaments/femenil_mx.png",id:1001,tournament_status:0,order:2}},{_id:1143,seasons:[{name:"Apertura 2023",related_seasons:[{type:1,id:1829}],id:1785,type:0}],tournament:{show_logos:0,tournament_type:0,name:"Sub-23",logo:null,id:1143,tournament_status:0,order:4}},{_id:1,seasons:[{name:"Clausura 2024",related_seasons:[],id:1836,type:0},{name:"Apertura 2023",related_seasons:[{type:2,id:1826},{type:1,id:1827}],id:1772,type:0},{name:"Clausura 2023",related_seasons:[{type:2,id:1745},{type:1,id:1746}],id:1694,type:0},{name:"Apertura 2022",related_seasons:[{type:2,id:1591},{type:1,id:1594}],id:1535,type:0},{name:"Grita Mexico C22",related_seasons:[{type:2,id:1520},{type:1,id:1525}],id:1476,type:0},{name:"Grita Mexico A21",related_seasons:[{type:2,id:1446},{type:1,id:1456}],id:1401,type:0},{name:"Guard1anes Clausura 2021",related_seasons:[{type:2,id:1382},{type:1,id:1383}],id:1325,type:0},{name:"Guard1anes 2020",related_seasons:[{type:2,id:1311},{type:1,id:1316}],id:1275,type:0},{name:"Clausura 2020",related_seasons:[],id:1239,type:0},{name:"Apertura 2019",related_seasons:[{type:1,id:1231}],id:1155,type:0},{name:"Clausura 2019",related_seasons:[{type:1,id:1135}],id:1093,type:0},{name:"Apertura 2018",related_seasons:[{type:1,id:1075}],id:1002,type:0}],tournament:{show_logos:1,tournament_type:0,name:"Liga MX",logo:"https://az755631.vo.msecnd.net/tournaments/liga_mx.png",id:1,tournament_status:0,order:1}},{_id:1071,seasons:[{name:"Clausura 2024",related_seasons:[],id:1837,type:0},{name:"Apertura 2023",related_seasons:[{type:2,id:1822},{type:1,id:1828}],id:1776,type:0},{name:"Clausura 2023",related_seasons:[{type:2,id:1742},{type:1,id:1748}],id:1695,type:0},{name:"Apertura 2022",related_seasons:[{type:2,id:1598},{type:1,id:1618}],id:1544,type:0},{name:"Grita Mexico C22",related_seasons:[{type:2,id:1515},{type:1,id:1519}],id:1484,type:0},{name:"Grita Mexico A21",related_seasons:[{type:2,id:1454},{type:1,id:1463}],id:1408,type:0},{name:"Guard1anes Clausura 2021",related_seasons:[{type:2,id:1378},{type:1,id:1380}],id:1327,type:0},{name:"Guard1anes 2020",related_seasons:[{type:2,id:1315},{type:1,id:1317}],id:1287,type:0}],tournament:{show_logos:1,tournament_type:0,name:"Liga Expansion MX",logo:"https://az755631.vo.msecnd.net/tournaments/expansion_mx.png",id:1071,tournament_status:0,order:3}},{_id:1096,seasons:[{name:"Apertura 2023",related_seasons:[{type:1,id:1830}],id:1782,type:0},{name:"Clausura 2023",related_seasons:[{type:1,id:1751}],id:1714,type:0},{name:"Apertura 2022",related_seasons:[{type:1,id:1593}],id:1543,type:0},{name:"Grita Mexico C22",related_seasons:[{type:1,id:1522}],id:1487,type:0}],tournament:{show_logos:0,tournament_type:0,name:"Sub-18",logo:null,id:1096,tournament_status:0,order:6}}],i={token:"",token_b2c:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MjQyNTQsIm5hbWUiOiJHb2xTdGF0cyIsInVzZXJuYW1lIjoiZ29sdGVzdGluZyIsImVtYWlsIjoiIiwicHJvdmlkZXJfaWQiOjEsImxvZ2luX2dvbHN0YXRzIjoxLCJpYXQiOjE3MDA3ODkyNTcsImV4cCI6MTczMjMyNTI1N30.4iVGU3Q8rcNFRkYiPEmEYj1pB_UoYr1L5virEIpmGhs",id:24254,username:"goltesting",name:"GolStats",team:1,player:0,tournament:1,type_system:"presidents",language:"es",active_time:1,season:1772,is_player:0,related_seasons:[],is_goalkeeper:0,show_dashboard:1,user_type:1,premiumAccount:!0,userType:1,accessVideos:!0,sessionExpiration:1701869305930},n=s.computed(()=>a.reduce((r,o)=>{const l={...o.tournament,seasons:o.seasons};return l.seasons.forEach(c=>{r.set(c.id,l)}),r},new Map));return(r,o)=>(s.openBlock(),s.createElementBlock("div",a5e,[s.createVNode(s.unref(t5e),{"season-selected-id":1772,user:i,section:i5e,token:t.value,"tournaments-for-media-player":n.value,"background-color":""},null,8,["token","tournaments-for-media-player"])]))}},[["__scopeId","data-v-6fdc2bb3"]]),r5e={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},s5e={DF:"Dieciseisavos",OF:"Octavos",CF:"Cuartos",SF:"Semifinales","3ER":"Tercer lugar",FINAL:"Final"},o5e={4:"Octavos",5:"Cuartos",6:"Semifinales",7:"Final"},l5e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},hv={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},oP=()=>{s.useCssVars(e=>({"1c960139":e.height,b2f635d8:e.borderWidthBtn,"06e99898":e.borderType,"55555c76":e.borderColor,"23b6d320":e.borderRadius,"22c97374":e.width,"22bb09fa":e.backgroundColor,c148da7c:e.cursorType,cce756fc:e.fontSize,cff98d60:e.fontStyle,"5123b3a5":e.fontFamily,"47bf58db":e.marginLeftStat,cadc8414:e.fontSizeStat}))},lP=hv.setup;hv.setup=lP?(e,t)=>(oP(),lP(e,t)):oP;const c5e=e=>(s.pushScopeId("data-v-fb269a1e"),e=e(),s.popScopeId(),e),d5e=["src"],u5e={key:1,class:"text"},h5e=["src"],p5e={class:"stats"},m5e=c5e(()=>s.createElementVNode("img",{class:"iconstats",src:"https://az755631.vo.msecnd.net/todoelfut/playdes.png"},null,-1)),f5e={class:"numstats"},g5e={class:"leyend"};function y5e(e,t,a,i,n,r){return s.openBlock(),s.createElementBlock("div",null,[a.type==0?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["button",n.status&&a.typeOnOff&&"button-active"]),style:s.normalizeStyle([r.customStyle,n.status&&a.typeOnOff&&r.customActive]),onClick:t[0]||(t[0]=(...o)=>r.btnClick&&r.btnClick(...o))},[a.icon&&a.iconPosition.toLowerCase()==="left"?(s.openBlock(),s.createElementBlock("img",{key:0,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,d5e)):s.createCommentVNode("",!0),a.textValue?(s.openBlock(),s.createElementBlock("div",u5e,s.toDisplayString(a.textValue),1)):s.createCommentVNode("",!0),a.icon&&a.iconPosition.toLowerCase()==="right"?(s.openBlock(),s.createElementBlock("img",{key:2,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,h5e)):s.createCommentVNode("",!0)],6)):s.createCommentVNode("",!0),a.type==1?(s.openBlock(),s.createElementBlock("div",{key:1,class:"button-target",onClick:t[1]||(t[1]=(...o)=>r.btnClick&&r.btnClick(...o))},[s.createElementVNode("div",p5e,[m5e,s.createElementVNode("div",f5e,s.toDisplayString(a.textStat),1)]),s.createElementVNode("div",g5e,s.toDisplayString(a.textCategory),1)])):s.createCommentVNode("",!0)])}const _5e=l5e(hv,[["render",y5e],["__scopeId","data-v-fb269a1e"]]),b5e={class:"gsc-dropdown__main-container__item-selected"},v5e=["height","width"],S5e=["stroke"],w5e={class:"gsc-dropdown__items-container"},T5e=["onClick"],C5e={key:0,class:"gsc-dropdown__items-footer"},k5e={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(t=>t in e)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listItemPadding:{type:String,default:"10px 12px"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1}},emits:["input","click-ready","update:modelValue"],setup(e,{emit:t}){const a=e,i=s.ref({}),n=s.ref(null),r=s.ref(a.isMultipleOption?-1:0),o=s.ref(!1);s.watch(()=>a.items,(p,f)=>{if(!a.modelValue&&(!a.onlyFirstTime||!f||!f.length)&&p&&p.length){if(a.defaultItemByProp){const y=a.items.findIndex(b=>b[a.defaultItemByProp.propName]===a.defaultItemByProp.value);y!==-1?(r.value=y,i.value=p[y]):(r.value=0,i.value=p[0])}else i.value=p[a.defaultItemByIndex];t("input",i.value)}},{immediate:!0}),s.watch(()=>a.modelValue,p=>{if(p){const f=a.items.findIndex(y=>typeof p=="object"?JSON.stringify(y)===JSON.stringify(p):y===p);f!==-1&&(r.value=f,i.value=a.items[f],t("update:modelValue",i.value))}},{immediate:!0});const l=s.computed(()=>({height:a.height,width:a.width,backgroundColor:a.backgroundColor,borderRadius:`${a.borderRadius}px`,border:`${a.borderType} ${a.borderWidth}px ${a.borderColor}`,color:a.color,"--hover-background-color":a.hoverBackgroundColor,"--list-item-padding":a.listItemPadding,"--list-background-color":a.listBackgroundColor,"--list-height":a.listHeight,"--list-item-selected-color":a.listItemSelectedColor,"--list-item-selected-background-color":a.listItemSelectedBackgroundColor,"--list-item-color":a.listItemColor,"--list-border-radius":`${a.listBorderRadius}`,"--list-border-color":a.listBorderColor,"--list-width":a.isListSameWidth?a.width:"fit-content","--list-border-width":`${a.listBorderWidth}px`,"--footer-border":`${a.footerBorderWidth}px solid ${a.footerBorderColor}`,"--dropdown-opacity":a.isDisabled?"0.5":"1","--dropdown-cursor":a.isDisabled?"not-allowed":"pointer","--dropdown-font-size":a.fontSize?a.fontSize:"14px"})),c=s.computed(()=>({height:`${a.arrowHeight}px`,width:`${a.arrowWidth}px`}));function d(){a.isDisabled||(o.value=!o.value)}function u(p){n.value.contains(p.target)||(o.value=!1)}function h(p,f){a.isMultipleOption?r.value=-1:(r.value=f,o.value=!1),i.value=p,t("input",i.value),t("update:modelValue",i.value)}function m(){o.value=!1,t("click-ready")}return s.onMounted(()=>{document.addEventListener("click",u)}),s.onBeforeMount(()=>{document.removeEventListener("click",u)}),(p,f)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"dropDown",ref:n,class:"gsc-dropdown",style:s.normalizeStyle(l.value)},[s.createElementVNode("div",{class:"gsc-dropdown__main-container",style:s.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:d},[s.createElementVNode("div",b5e,[s.renderSlot(p.$slots,"default",{selectedItem:i.value})]),s.createElementVNode("div",{class:s.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":o.value}]),style:s.normalizeStyle(c.value)},[(s.openBlock(),s.createElementBlock("svg",{height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:e.arrowColor},null,8,S5e)],8,v5e))],6)],4),s.createVNode(s.Transition,null,{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",w5e,[s.createElementVNode("div",null,[s.createElementVNode("div",{class:"gsc-dropdown__items",style:s.normalizeStyle({"margin-top":`${a.borderWidth}px`})},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.items,(y,b)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["gsc-dropdown__items__item",{selected:b===r.value}]),key:b,onClick:E=>h(y,b)},[s.renderSlot(p.$slots,"availableItem",{item:y})],10,T5e))),128))],4),e.isFooterVisible?(s.openBlock(),s.createElementBlock("div",C5e,[s.createVNode(s.unref(_5e),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:m})])):s.createCommentVNode("",!0)])],512),[[s.vShow,o.value]])]),_:3})],4))}},E5e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},I5e={class:"tournament-select__selected-tournament"},x5e={class:"tournament-select__selected-tournament__logo"},N5e=["src"],A5e={class:"tournament-select__selected-tournament__name"},P5e={__name:"GSCTournamentSelect",props:{apiUrl:{type:String,default:"https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/gs3/tournaments"},fontFamily:{type:String,default:"sans-serif"},logosUrl:{type:String,default:"https://az755631.vo.msecnd.net/todoelfut/"},logoFileType:{type:String,default:"png"},height:{type:String,default:"40px"},width:{type:String,default:"179px"},borderRadius:{type:Number,default:8},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"rgba(255, 255, 255, 0.2)"},backgroundColor:{type:String,default:"#0d1d29"},color:{type:String,default:"white"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(t=>t in e)},currentSeasonId:{type:Number,default:0}},emits:["input"],setup(e,{emit:t}){const a=e,i=s.ref([]),n=s.computed(()=>{const h={};return a.fontFamily&&(h["font-family"]=`${a.fontFamily}`),h}),r=s.computed(()=>i.value.find(h=>h.seasonsIds.has(a.currentSeasonId))||i.value[0]);async function o(){try{if(a.items&&a.items.length)i.value=[...a.items];else if(a.apiUrl){const h=await c();i.value=h.map(m=>({...m.tournament,seasons:m.seasons,seasonsIds:m.seasons.reduce((p,f)=>(p.add(f.id),p),new Set)})).sort((m,p)=>m.order-p.order)}}catch(h){throw new Error(h)}}function l(h){const m=new XMLHttpRequest,p=`${a.logosUrl}${h}.${a.logoFileType}`;return m.open("HEAD",p,!1),m.send(),m.status!==404}async function c(){try{return(await fetch(a.apiUrl)).json()}catch(h){return Promise.reject(h)}}function d(h){t("input",h)}function u(h){t("input",h)}return s.onMounted(()=>{o()}),(h,m)=>(s.openBlock(),s.createElementBlock("div",{class:"tournament-select",style:s.normalizeStyle(n.value)},[s.createVNode(s.unref(k5e),s.mergeProps(a,{"model-value":r.value,items:i.value,onInput:d,"onUpdate:modelValue":u}),{default:s.withCtx(({selectedItem:p})=>[s.createElementVNode("div",I5e,[s.createElementVNode("div",x5e,[l(p.id)?(s.openBlock(),s.createElementBlock("img",{key:0,src:`${a.logosUrl}${p.id}.${a.logoFileType}`,alt:""},null,8,N5e)):s.createCommentVNode("",!0)]),s.createElementVNode("div",A5e,s.toDisplayString(p.name),1)])]),availableItem:s.withCtx(({item:p})=>[s.createElementVNode("div",null,s.toDisplayString(p.name),1)]),_:1},16,["model-value","items"])],4))}},O5e=E5e(P5e,[["__scopeId","data-v-44050d64"]]),B5e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},pv={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},cP=()=>{s.useCssVars(e=>({"1c960139":e.height,b2f635d8:e.borderWidthBtn,"06e99898":e.borderType,"55555c76":e.borderColor,"23b6d320":e.borderRadius,"22c97374":e.width,"22bb09fa":e.backgroundColor,c148da7c:e.cursorType,cce756fc:e.fontSize,cff98d60:e.fontStyle,"5123b3a5":e.fontFamily,"47bf58db":e.marginLeftStat,cadc8414:e.fontSizeStat}))},dP=pv.setup;pv.setup=dP?(e,t)=>(cP(),dP(e,t)):cP;const D5e=e=>(s.pushScopeId("data-v-fb269a1e"),e=e(),s.popScopeId(),e),M5e=["src"],L5e={key:1,class:"text"},R5e=["src"],F5e={class:"stats"},V5e=D5e(()=>s.createElementVNode("img",{class:"iconstats",src:"https://az755631.vo.msecnd.net/todoelfut/playdes.png"},null,-1)),U5e={class:"numstats"},j5e={class:"leyend"};function z5e(e,t,a,i,n,r){return s.openBlock(),s.createElementBlock("div",null,[a.type==0?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["button",n.status&&a.typeOnOff&&"button-active"]),style:s.normalizeStyle([r.customStyle,n.status&&a.typeOnOff&&r.customActive]),onClick:t[0]||(t[0]=(...o)=>r.btnClick&&r.btnClick(...o))},[a.icon&&a.iconPosition.toLowerCase()==="left"?(s.openBlock(),s.createElementBlock("img",{key:0,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,M5e)):s.createCommentVNode("",!0),a.textValue?(s.openBlock(),s.createElementBlock("div",L5e,s.toDisplayString(a.textValue),1)):s.createCommentVNode("",!0),a.icon&&a.iconPosition.toLowerCase()==="right"?(s.openBlock(),s.createElementBlock("img",{key:2,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,R5e)):s.createCommentVNode("",!0)],6)):s.createCommentVNode("",!0),a.type==1?(s.openBlock(),s.createElementBlock("div",{key:1,class:"button-target",onClick:t[1]||(t[1]=(...o)=>r.btnClick&&r.btnClick(...o))},[s.createElementVNode("div",F5e,[V5e,s.createElementVNode("div",U5e,s.toDisplayString(a.textStat),1)]),s.createElementVNode("div",j5e,s.toDisplayString(a.textCategory),1)])):s.createCommentVNode("",!0)])}const H5e=B5e(pv,[["render",z5e],["__scopeId","data-v-fb269a1e"]]),q5e={class:"gsc-dropdown__main-container__item-selected"},W5e=["height","width"],G5e=["stroke"],K5e={class:"gsc-dropdown__items-container"},X5e=["onClick"],J5e={key:0,class:"gsc-dropdown__items-footer"},Y5e={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(t=>t in e)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listItemPadding:{type:String,default:"10px 12px"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1}},emits:["input","click-ready","update:modelValue"],setup(e,{emit:t}){const a=e,i=s.ref({}),n=s.ref(null),r=s.ref(a.isMultipleOption?-1:0),o=s.ref(!1);s.watch(()=>a.items,(p,f)=>{if(!a.modelValue&&(!a.onlyFirstTime||!f||!f.length)&&p&&p.length){if(a.defaultItemByProp){const y=a.items.findIndex(b=>b[a.defaultItemByProp.propName]===a.defaultItemByProp.value);y!==-1?(r.value=y,i.value=p[y]):(r.value=0,i.value=p[0])}else i.value=p[a.defaultItemByIndex];t("input",i.value)}},{immediate:!0}),s.watch(()=>a.modelValue,p=>{if(p){const f=a.items.findIndex(y=>typeof p=="object"?JSON.stringify(y)===JSON.stringify(p):y===p);f!==-1&&(r.value=f,i.value=a.items[f],t("update:modelValue",i.value))}},{immediate:!0});const l=s.computed(()=>({height:a.height,width:a.width,backgroundColor:a.backgroundColor,borderRadius:`${a.borderRadius}px`,border:`${a.borderType} ${a.borderWidth}px ${a.borderColor}`,color:a.color,"--hover-background-color":a.hoverBackgroundColor,"--list-item-padding":a.listItemPadding,"--list-background-color":a.listBackgroundColor,"--list-height":a.listHeight,"--list-item-selected-color":a.listItemSelectedColor,"--list-item-selected-background-color":a.listItemSelectedBackgroundColor,"--list-item-color":a.listItemColor,"--list-border-radius":`${a.listBorderRadius}`,"--list-border-color":a.listBorderColor,"--list-width":a.isListSameWidth?a.width:"fit-content","--list-border-width":`${a.listBorderWidth}px`,"--footer-border":`${a.footerBorderWidth}px solid ${a.footerBorderColor}`,"--dropdown-opacity":a.isDisabled?"0.5":"1","--dropdown-cursor":a.isDisabled?"not-allowed":"pointer","--dropdown-font-size":a.fontSize?a.fontSize:"14px"})),c=s.computed(()=>({height:`${a.arrowHeight}px`,width:`${a.arrowWidth}px`}));function d(){a.isDisabled||(o.value=!o.value)}function u(p){n.value.contains(p.target)||(o.value=!1)}function h(p,f){a.isMultipleOption?r.value=-1:(r.value=f,o.value=!1),i.value=p,t("input",i.value),t("update:modelValue",i.value)}function m(){o.value=!1,t("click-ready")}return s.onMounted(()=>{document.addEventListener("click",u)}),s.onBeforeMount(()=>{document.removeEventListener("click",u)}),(p,f)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"dropDown",ref:n,class:"gsc-dropdown",style:s.normalizeStyle(l.value)},[s.createElementVNode("div",{class:"gsc-dropdown__main-container",style:s.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:d},[s.createElementVNode("div",q5e,[s.renderSlot(p.$slots,"default",{selectedItem:i.value})]),s.createElementVNode("div",{class:s.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":o.value}]),style:s.normalizeStyle(c.value)},[(s.openBlock(),s.createElementBlock("svg",{height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:e.arrowColor},null,8,G5e)],8,W5e))],6)],4),s.createVNode(s.Transition,null,{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",K5e,[s.createElementVNode("div",null,[s.createElementVNode("div",{class:"gsc-dropdown__items",style:s.normalizeStyle({"margin-top":`${a.borderWidth}px`})},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.items,(y,b)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["gsc-dropdown__items__item",{selected:b===r.value}]),key:b,onClick:E=>h(y,b)},[s.renderSlot(p.$slots,"availableItem",{item:y})],10,X5e))),128))],4),e.isFooterVisible?(s.openBlock(),s.createElementBlock("div",J5e,[s.createVNode(s.unref(H5e),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:m})])):s.createCommentVNode("",!0)])],512),[[s.vShow,o.value]])]),_:3})],4))}},Q5e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},Z5e={class:"season-name"},$5e={components:{GSCSeasonSelect:Q5e({__name:"GSC-SeasonSelect",props:{seasons:{type:Array,default:()=>[]},currentSeasonId:{type:Number,default:0}},emits:["input"],setup(e,{emit:t}){const a=e,i=s.computed(()=>a.seasons.find(o=>o.id===a.currentSeasonId));function n(o){t("input",o)}function r(o){t("input",o)}return(o,l)=>(s.openBlock(),s.createBlock(s.unref(Y5e),{items:e.seasons,"model-value":i.value,height:"40px",width:"179px","background-color":"#0d1d29",color:"white","border-color":"rgba(255, 255, 255, 0.2)","font-family":"Poppins-Regular","border-radius":8,onInput:r,"onUpdate:modelValue":n},{default:s.withCtx(({selectedItem:c})=>[s.createElementVNode("div",Z5e,[s.createElementVNode("span",null,s.toDisplayString(c.name),1)])]),availableItem:s.withCtx(({item:c})=>[s.createElementVNode("span",null,s.toDisplayString(c.name),1)]),_:1},8,["items","model-value"]))}},[["__scopeId","data-v-a372361a"]]),GSCTournamentSelect:O5e,GSCGames:sj,GSCGridTeamsMatches:mB,GSCPlayersLanding:oB,GSCTops:oz,GSCTableCalendar:aU,GSCMediaPlayer:n5e},setup(){const e=s.ref("landingref"),{elementSize:t}=LO(e);return{landingref:e,elementSize:t}},watch:{team:{immediate:!0,deep:!0,async handler(e){if(Object.keys(this.seasonSelected).length!==0){const t=await this.generateSeasons(this.seasonSelected);this.seasonsSelected=t,this.fetchGames(e,t)}}},closestRound(e){this.selectedRoundKeyIndex=this.tournamentScheduleKeys.findIndex(t=>t===e),this.selectedRound=e}},props:{currentSeasonId:{type:Number,default:0},season:{type:Number,default:1772},isplayer:{type:Boolean,default:!1},user:{type:Object,default:()=>{}},team:{type:Number,default:0},player:{type:Number,default:0},gamesPerMatchDay:{type:Number,default:0,validator(e){return!Number.isNaN(e)&&e>=0}}},data(){return{defaultGameId:0,lastSeasonsIds:[],gamesPages:new Map,selectedRoundKeyIndex:0,selectedRound:0,fullTournamentScheduleFull:[],defaultMatchDayKey:null,isCupTournament:!1,retries:3,userTeamGames:[],isCupLegacyTournament:!1,tournamentScheduleKeys:[],currentTournamentGames:null,currentTournamentTeams:null,gamesUrl:"https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason/",gamesUrl2:"https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?",seasonSelected:{},seasonSelectedDropDowns:{},seasonsSelected:[],fullTournamentSchedule:{},tournamentSelected:{},tournamentSelectedDropDowns:{seasons:[]},playersLength:0,tokenFree:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},computed:{gamesFullLeague(){var e=[];for(let t=0;t<this.fullTournamentScheduleFull[this.selectedRound].length;t++)for(let a=0;a<this.fullTournamentScheduleFull[this.selectedRound][t].games.length;a++)e.push(this.fullTournamentScheduleFull[this.selectedRound][t].games[a]);return e},closestRound(){return this.userTeamGames&&this.userTeamGames.length?this.getUserTeamClosestRound(this.fullTournamentScheduleFull):this.getNormalClosestRound(this.fullTournamentScheduleFull)},containerGridCalendarTable(){return this.elementSize.width<=1e3?"container-grid-calendar-table-mobile":"container-grid-calendar-table"},containerbackground(){return this.elementSize.width<=680?"container-background-movil":"container-background"},containerdata(){return this.elementSize.width<=680?"container-data-movil":"container-data"}},methods:{onAction(e){this.$emit("action",e)},onOpenMedia(e){this.$emit("openmedia",e)},onOpenProfile(e){this.$emit("onOpenProfile",e)},onClickMatch(e){this.$emit("openGame",e)},onClickCalendar(){const e={type:this.tournamentSelected.id==this.user.tournament?1:0,team:this.team,season:this.seasonSelectedDropDowns};this.$emit("onClickMyCalendar",e)},moreTops(){const e={team:this.team,season:this.seasonSelectedDropDowns};this.$emit("openTops",e)},clickProfileBtn(e){this.$emit("openProfile",e)},viewAll(){const e={team:this.team,season:this.seasonSelectedDropDowns};this.$emit("openAllPlayers",e)},getTotalPlayers(e){this.playersLength=e},clickCard(e){const t={data:e,isPlayer:this.isplayer};this.$emit("clickOnMainCards",t)},async fetchGames(e,t){const a=t.map(n=>`seasons=${n.id}`).join("&"),i=wc.create({headers:{Authorization:`${this.tokenFree}`}});this.fullTournamentSchedule=await i.get(this.gamesUrl+e+"?"+a)},async generateSeasons(e){const t=[{id:e.id,type:e.type}];return e.related_seasons&&e.related_seasons.length&&t.push(...e.related_seasons.map(a=>({id:a.id,type:a.type}))),t},async onInputTournament(e){this.tournamentSelected=e,this.tournamentSelectedDropDowns.id!==e.id&&(this.tournamentSelectedDropDowns=e)},async onInputSeason(e){if(this.seasonSelected=e,this.tournamentSelected.id!=this.user.tournament){const t=await this.generateSeasons(this.seasonSelected);this.seasonsSelected=t,await this.createFullTournamentScheme(t,!1)}else{const t=await this.generateSeasons(this.seasonSelected);this.seasonsSelected=t,await this.fetchGames(this.user.team,t)}this.seasonSelectedDropDowns!==e.id&&(this.seasonSelectedDropDowns=e.id,this.$emit("change-season-id",e.id))},async fetchTournaments(e){try{const{data:t}=await wc.get("https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/tournaments");return t}catch(t){if(e>0)return this.fetchTournaments(e-1);throw new Error(t)}},async fetchSeasonsGamesAndTeams(e,t,a=""){let i=a;try{i||(i=this.gamesUrl2,e.forEach((l,c)=>{i+=`${c===0?"":"&"}seasons=${l}`}));const n=wc.create({headers:{Authorization:`${this.tokenFree}`}}),{data:{data:r,teams:o}}=await n.get(i);return{seasonsAndGames:r,seasonsAndTeams:o}}catch(n){if(t>0)return this.fetchSeasonsGamesAndTeams(e,t-1,i);throw new Error(n)}},areSeasonsDifferent(e){for(const t of e)if(!this.lastSeasonsIds.includes(t.season_id))return!0;return!1},async createFullTournamentScheme(e,t){try{this.fullTournamentSchedule={},this.userTeamGames=[];let a=0;const{seasonsAndGames:i,seasonsAndTeams:n}=await this.fetchSeasonsGamesAndTeams(e.map(c=>c.id),3);if(t&&this.areSeasonsDifferent(i))return;i.forEach(c=>{const{type:d}=e.find(u=>u.id===c.season_id);c.type=d,c.games.forEach(u=>{u.season_id=c.season_id}),d===0&&(a=c.season_id)});const r={seasonsGames:i},{teams:o}=n.find(c=>c.season_id===a),l=r&&r.seasonsGames?r.seasonsGames.map(c=>{const d=c.games.reduce((u,h)=>{const m={...h};return m.dateTimeMillis=new Date(m.date_time_utc).valueOf(),m.home_team=o.find(p=>p.team_id===h.home_team),m.visiting_team=o.find(p=>p.team_id===h.visiting_team),u[h.matchday_abbreviation]?u[h.matchday_abbreviation][h.game_status===3?"canceled":h.date]?u[h.matchday_abbreviation][h.game_status===3?"canceled":h.date].push(m):u[h.matchday_abbreviation][h.game_status===3?"canceled":h.date]=[m]:u[h.matchday_abbreviation]={[h.game_status===3?"canceled":h.date]:[m]},this.gsData&&this.gsData.teamId&&m.game_status===4&&(m.home_team.team_id===this.gsData.teamId||m.visiting_team.team_id===this.gsData.teamId)&&this.userTeamGames.push(m),u},{});this.userTeamGames.sort((u,h)=>u.dateTimeMillis-h.dateTimeMillis);for(let[u,h]of Object.entries(d))d[u]=Object.entries(h).map(([m,p])=>({date:m,games:p.sort((f,y)=>f.dateTimeMillis-y.dateTimeMillis)})),d[u].sort((m,p)=>m.date<p.date?-1:m.date>p.date?1:0);return{type:c.type,weight:c.type===0?0:c.type===2?1:2,schedule:d}}):[];l.sort((c,d)=>c.weight-d.weight),this.fullTournamentScheduleFull=l.reduce((c,d)=>{for(const[u,h]of Object.entries(d.schedule))if(d.type===0)if(this.isCup){const m=u.replace("M",""),p=`Jornada ${m}`;this.isCupLegacy?c[o5e[m]||p]=h:c[s5e[u]||p]=h}else c[Number(u.replace("M","")).toString()]=h;else d.type===2?["PI1","PI2"].includes(u)?c[u]=h:c[`R${Number(u.replace("PO",""))}`]=h:d.type===1&&(c[r5e[u]]=h);return c},{}),this.tournamentScheduleKeys=Object.keys(this.fullTournamentScheduleFull)}catch(a){throw new Error(a)}finally{this.loadingFlag=!1}},getNormalClosestRound(e){const a=Object.entries(Object.entries(e).reduce((r,[o,l])=>(r[o]=[],l.forEach(c=>{c.games.forEach(d=>{const u=new Date(d.date_time_utc).getTime()+66e5;r[o].push(u)})}),r),{}));if(!a.length)return"1";const i=new Date().getTime(),n=a.reduce((r,[o,l])=>{let c=null;return l.forEach(d=>{const u=d-i;u>=0&&(c===null||u<c)&&(c=u)}),c&&(r.shortestTime===null||c<r.shortestTime)&&(r.round=o,r.shortestTime=c),r},{round:"",shortestTime:null});return n.shortestTime!==null?n.round:a[a.length-1][0]},getUserTeamClosestRound(e){let t=1;if(this.userTeamGames.length){const a=this.userTeamGames[0];for(const[i,n]of Object.entries(e))for(const r of n)if(r.games.find(l=>l.game_id===a.game_id))return i}return t}},async created(){const a=(await this.fetchTournaments(3)).find(n=>n._id===1).seasons[1],i=[{id:a.id,type:a.type}];a.related_seasons&&a.related_seasons.length&&i.push(...a.related_seasons.map(n=>({id:n.id,type:n.type}))),await this.createFullTournamentScheme(i,!1)}},e4e=e=>(s.pushScopeId("data-v-e33e6072"),e=e(),s.popScopeId(),e),t4e={class:"gsclanding",ref:"landingref"},a4e={key:0,class:"container-selectors-mobile"},i4e={class:"container-selectors-mobile-tournament"},n4e={class:"container-selectors-mobile-season"},r4e={key:0,class:"home-item-movil"},s4e=e4e(()=>s.createElementVNode("div",{class:"home-movil"},"Inicio",-1)),o4e={class:"name-user-movil"},l4e={key:1,class:"home-item"},c4e={key:2,class:"bar-settings"},d4e={class:"name-user"},u4e={class:"container-selectors"},h4e={class:"selector-tournament"},p4e={class:"selector-seasons"},m4e={key:3,class:"container-games"},f4e={key:4,class:"container-players"},g4e={class:"container-tops"};function y4e(e,t,a,i,n,r){const o=s.resolveComponent("GSCTournamentSelect"),l=s.resolveComponent("GSCSeasonSelect"),c=s.resolveComponent("GSCGames"),d=s.resolveComponent("GSCGridTeamsMatches"),u=s.resolveComponent("GSCTableCalendar"),h=s.resolveComponent("GSCPlayersLanding"),m=s.resolveComponent("GSCTops");return s.resolveComponent("GSCMediaPlayer"),s.openBlock(),s.createElementBlock("div",t4e,[i.elementSize.width<=680?(s.openBlock(),s.createElementBlock("div",a4e,[s.createElementVNode("div",i4e,[s.createVNode(o,{"current-season-id":a.currentSeasonId,width:"100%",onInput:r.onInputTournament},null,8,["current-season-id","onInput"])]),s.createElementVNode("div",n4e,[s.createVNode(l,{"current-season-id":a.currentSeasonId,width:"100%",seasons:n.tournamentSelectedDropDowns.seasons,onInput:r.onInputSeason},null,8,["current-season-id","seasons","onInput"])])])):s.createCommentVNode("",!0),s.createElementVNode("div",{class:s.normalizeClass(r.containerbackground)},[s.createElementVNode("div",{class:s.normalizeClass(r.containerdata)},[i.elementSize.width<=680?(s.openBlock(),s.createElementBlock("div",r4e,[s4e,s.createElementVNode("div",o4e,[s.createTextVNode("Bienvenido "),a.user.name.split(",").length!=0?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[a.user.name.split(",").length==1?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[a.user.name.split(",")[0]!=""?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(", ")],64)):s.createCommentVNode("",!0),s.createTextVNode(s.toDisplayString(a.user.name.split(",")[0]),1)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[a.user.name.split(",")[0]!=""?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(", ")],64)):s.createCommentVNode("",!0),s.createTextVNode(s.toDisplayString(a.user.name.split(",")[1]),1)],64))],64)):s.createCommentVNode("",!0)])])):s.createCommentVNode("",!0),i.elementSize.width>680?(s.openBlock(),s.createElementBlock("div",l4e,"Inicio")):s.createCommentVNode("",!0),i.elementSize.width>680?(s.openBlock(),s.createElementBlock("div",c4e,[s.createElementVNode("div",d4e,[s.createTextVNode("Bienvenido "),a.user.name.split(",").length!=0?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[a.user.name.split(",").length==1?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[a.user.name.split(",")[0]!=""?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(", ")],64)):s.createCommentVNode("",!0),s.createTextVNode(s.toDisplayString(a.user.name.split(",")[0]),1)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[a.user.name.split(",")[0]!=""?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(", ")],64)):s.createCommentVNode("",!0),s.createTextVNode(s.toDisplayString(a.user.name.split(",")[1]),1)],64))],64)):s.createCommentVNode("",!0)]),s.createElementVNode("div",u4e,[s.createElementVNode("div",h4e,[s.createVNode(o,{"current-season-id":a.currentSeasonId,onInput:r.onInputTournament},null,8,["current-season-id","onInput"])]),s.createElementVNode("div",p4e,[s.createVNode(l,{"current-season-id":a.currentSeasonId,seasons:n.tournamentSelectedDropDowns.seasons,onInput:r.onInputSeason},null,8,["current-season-id","seasons","onInput"])])])])):s.createCommentVNode("",!0),Object.keys(n.tournamentSelected).length>0?(s.openBlock(),s.createElementBlock("div",m4e,[s.createVNode(c,{"component-width":i.elementSize.width,isplayer:a.isplayer,"is-full":n.tournamentSelected.id!=a.user.tournament,onClickMatch:r.onClickMatch,onClickCalendar:r.onClickCalendar,data:n.tournamentSelected.id==a.user.tournament?n.fullTournamentSchedule:r.gamesFullLeague},null,8,["component-width","isplayer","is-full","onClickMatch","onClickCalendar","data"])])):s.createCommentVNode("",!0),s.createElementVNode("div",{class:s.normalizeClass(r.containerGridCalendarTable)},[s.createElementVNode("div",{class:"container-grid",style:s.normalizeStyle(i.elementSize.width<1e3?"width: 100%":"")},[s.createVNode(d,{isPlayer:a.isplayer?n.tournamentSelected.id==a.user.tournament:!1,"player-id":a.user.player,"team-id":a.user.team,"season-selected":n.seasonSelected.id,"next-rival-id":Object.keys(n.fullTournamentSchedule).length>0?a.user.team==n.fullTournamentSchedule.data.prematch.home_team?n.fullTournamentSchedule.data.prematch.visiting_team:n.fullTournamentSchedule.data.prematch.home_team:0,"team-img":"https://az755631.vo.msecnd.net/teams-150/"+a.user.team+".png","player-img":"https://az755631.vo.msecnd.net/players-profile/"+a.user.player+".png","rival-img":Object.keys(n.fullTournamentSchedule).length>0?a.user.team==n.fullTournamentSchedule.data.prematch.home_team?"https://az755631.vo.msecnd.net/teams-150/"+n.fullTournamentSchedule.data.prematch.visiting_team+".png":"https://az755631.vo.msecnd.net/teams-150/"+n.fullTournamentSchedule.data.prematch.home_team+".png":"","has-team":a.isplayer?!1:n.tournamentSelected.id==a.user.tournament,"component-width":i.elementSize.width,onAction:r.clickCard},null,8,["isPlayer","player-id","team-id","season-selected","next-rival-id","team-img","player-img","rival-img","has-team","component-width","onAction"])],4),s.createElementVNode("div",{class:"container-calendar-table",style:s.normalizeStyle(i.elementSize.width<1e3?"width: 100%; margin-top: 30px;":"")},[s.createVNode(u,{onAction:r.onAction,season:n.seasonSelected,seasons:n.seasonsSelected,onOpenmedia:r.onOpenMedia,onOnOpenProfile:r.onOpenProfile,componentWidth:i.elementSize.width},null,8,["onAction","season","seasons","onOpenmedia","onOnOpenProfile","componentWidth"])],4)],2),n.tournamentSelected.id==a.user.tournament?s.withDirectives((s.openBlock(),s.createElementBlock("div",f4e,[s.createVNode(h,{onClickProfileBtn:r.clickProfileBtn,onViewAll:r.viewAll,onTotalPlayers:r.getTotalPlayers,"team-id":a.user.team,"season-id":n.seasonSelected.id,"is-player":a.user.player!=0},null,8,["onClickProfileBtn","onViewAll","onTotalPlayers","team-id","season-id","is-player"])],512)),[[s.vShow,n.playersLength>0]]):s.createCommentVNode("",!0),s.createElementVNode("div",g4e,[s.createVNode(m,{onMore:r.moreTops,"show-switch":n.tournamentSelected.id==a.user.tournament,season:n.seasonSelected.id,"team-id":a.user.team,onOpenmedia:r.onOpenMedia},null,8,["onMore","show-switch","season","team-id","onOpenmedia"])]),s.createCommentVNode("",!0)],2)],2)],512)}const _4e=si($5e,[["render",y4e],["__scopeId","data-v-e33e6072"]]),b4e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},v4e={key:1},S4e={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w4e=["fill"],T4e={key:0,class:"checkbox__teams"},C4e={class:"checkbox__teams__logo"},k4e=["src"],E4e={class:"checkbox__teams__logo"},I4e=["src"],x4e={__name:"GSC-Checkbox",props:{width:{type:String,default:"fit-content"},height:{type:String,default:"fit-content"},label:{type:String,default:""},labelWhiteSpace:{type:String,default:"normal"},labelColor:{type:String,default:"white"},fontFamily:{type:String,default:"sans-serif"},labelFontSize:{type:String,default:"12px"},modelValue:{type:Boolean,default:!1},justifyContent:{type:String,default:"flex-start"},alignItems:{type:String,default:"center"},boxBackgroundColor:{type:String,default:"#CBEE6B"},boxValueColor:{type:String,default:"#0d1d29"},boxValue:{type:[String,Number],default:""},boxPosition:{type:String,default:"left",validator(e){return["left","right","top","bottom"].includes(e)}},boxMarginTop:{type:String,default:"0.2em"},boxWidthAndHeight:{type:String,default:"16px"},boxBorderColor:{type:String,default:"#969da2"},boxBorderWidth:{type:String,default:"2px"},boxBorderRadius:{type:String,default:"4px"},boxValueFontSize:{type:String,default:"10px"},boxValueFontFamily:{type:String,default:"sans-serif"},avoidInteraction:{type:Boolean,default:!1},avoidToCheck:{type:Boolean,default:!1},isBoxOnly:{type:Boolean,default:!1},teamsIds:{type:Array,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e;s.useCssVars(d=>({"6582e90e":e.width,"310b3edf":e.height}));const i=s.ref(!1),n=s.computed(()=>{const d={color:a.boxValueColor,"font-family":a.fontFamily,height:a.boxWidthAndHeight,width:a.boxWidthAndHeight,minWidth:a.boxWidthAndHeight,"border-radius":a.boxBorderRadius,"margin-top":a.boxMarginTop};return i.value?(d["background-color"]=a.boxBackgroundColor,d.border=`solid ${a.boxBorderWidth} ${a.boxBackgroundColor}`):d.border=`solid ${a.boxBorderWidth} ${a.boxBorderColor}`,d}),r=s.computed(()=>({"font-family":a.boxValueFontFamily,"font-size":a.boxValueFontSize,color:a.boxValueColor,"line-height":1})),o=s.computed(()=>{const d={color:a.labelColor,"font-family":a.fontFamily,"font-size":a.labelFontSize,"white-space":a.labelWhiteSpace,"text-align":a.boxPosition==="top"||a.boxPosition==="bottom"?"center":a.boxPosition};return(a.boxPosition==="left"||a.boxPosition==="right")&&(d[`margin-${a.boxPosition}`]=a.isBoxOnly?"0":a.teamsIds?"8px":"10px"),d});s.watch(()=>a.modelValue,d=>{d!==i.value&&(i.value=d)},{immediate:!0});function l(){a.avoidInteraction||!i.value&&a.avoidToCheck||(i.value=!i.value,t("update:modelValue",i.value))}function c(d){return`${{}.TEAM_LOGOS_URL||"https://az755631.vo.msecnd.net/teams-80/"}${d}.png`}return(d,u)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:l},[s.createElementVNode("div",{class:"checkbox__box",style:s.normalizeStyle(n.value)},[i.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[a.boxValue?(s.openBlock(),s.createElementBlock("div",{key:0,class:"checkbox__box__value",style:s.normalizeStyle(r.value)},s.toDisplayString(e.boxValue),5)):(s.openBlock(),s.createElementBlock("div",v4e,[(s.openBlock(),s.createElementBlock("svg",S4e,[s.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:e.boxValueColor},null,8,w4e)]))]))],64)):s.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(s.openBlock(),s.createElementBlock("div",T4e,[s.createElementVNode("div",C4e,[s.createElementVNode("img",{src:c(e.teamsIds[0]),alt:""},null,8,k4e)]),s.createElementVNode("div",E4e,[s.createElementVNode("img",{src:c(e.teamsIds[1]),alt:""},null,8,I4e)])])):s.createCommentVNode("",!0),s.createElementVNode("div",{class:"checkbox__label",style:s.normalizeStyle(o.value)},s.toDisplayString(e.label),5)],2))}},mv=b4e(x4e,[["__scopeId","data-v-bcf3bcc6"]]),N4e={class:"subcategory-group"},A4e={__name:"SubcategoryGroup",props:{subcategoryGroup:{type:Array,default:()=>[]}},setup(e){return(t,a)=>(s.openBlock(),s.createElementBlock("div",N4e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.subcategoryGroup,i=>(s.openBlock(),s.createBlock(s.unref(mv),{key:i.id,modelValue:i.isSelected,"onUpdate:modelValue":n=>i.isSelected=n,label:i.name},null,8,["modelValue","onUpdate:modelValue","label"]))),128))]))}},P4e=bt(A4e,[["__scopeId","data-v-6c6e0261"]]),O4e={class:"filter-subcategories"},B4e=Object.freeze(Object.defineProperty({__proto__:null,default:bt({__name:"FilterSubcategories",props:{subcategoryGroups:{type:Array,default:()=>[]}},setup(e){return(t,a)=>(s.openBlock(),s.createElementBlock("div",O4e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.subcategoryGroups,i=>(s.openBlock(),s.createElementBlock("div",{key:i.id,class:"filter-subcategories__group"},[s.createVNode(P4e,{subcategoryGroup:i},null,8,["subcategoryGroup"])]))),128))]))}},[["__scopeId","data-v-feeb6f0d"]])},Symbol.toStringTag,{value:"Module"})),kf=e=>(s.pushScopeId("data-v-f22f11b6"),e=e(),s.popScopeId(),e),D4e={class:"details__header"},M4e=kf(()=>s.createElementVNode("div",{class:"details__header__title"},"Jugando como",-1)),L4e={class:"details__header__checkbox"},R4e={class:"details__body"},F4e={class:"details__body__playing-as"},V4e=["onClick"],U4e={class:"details__header"},j4e=kf(()=>s.createElementVNode("div",{class:"details__header__title"},"En: (Elige el lapso de tiempo)",-1)),z4e={class:"details__header__checkbox"},H4e={class:"details__body"},q4e=kf(()=>s.createElementVNode("div",{class:"details__body__title"},"1er tiempo",-1)),W4e={class:"details__body__game-section"},G4e=["onClick"],K4e={class:"details__body"},X4e=kf(()=>s.createElementVNode("div",{class:"details__body__title"},"2do tiempo",-1)),J4e={class:"details__body__game-section"},Y4e=["onClick"],Q4e=Object.freeze(Object.defineProperty({__proto__:null,default:bt({__name:"FilterConditions",props:{conditions:{type:Object,default:()=>({playingAs:[{name:"Local",value:1,isSelected:!0},{name:"Visitante",value:2,isSelected:!0}],gameSections:[{text:"0-15",value:1,isSelected:!0},{text:"16-30",value:2,isSelected:!0},{text:"31-45",value:3,isSelected:!0},{text:"46-60",value:4,isSelected:!0},{text:"61-75",value:5,isSelected:!0},{text:"76-90",value:6,isSelected:!0}]})},playingAs:{type:Array,default:()=>[{name:"Local",isSelected:!0},{name:"Visitante",isSelected:!0}]},gameSections:{type:Array,default:()=>[{text:"0-15",value:1,isSelected:!0},{text:"16-30",value:2,isSelected:!0},{text:"31-45",value:3,isSelected:!0},{text:"46-60",value:4,isSelected:!0},{text:"61-75",value:5,isSelected:!0},{text:"76-90",value:6,isSelected:!0}]},buttonsBackgroundColor:{type:String,default:"rgba(255, 255, 255, 0)"},buttonsBackgroundColorActive:{type:String,default:"rgba(203, 238, 107, 0.05)"},buttonsTextColor:{type:String,default:"rgba(255, 255, 255, 0.8)"},buttonsTextColorActive:{type:String,default:"rgba(255, 255, 255, 1)"},buttonsBorderColor:{type:String,default:"#8ea2ab"},buttonsBorderColorActive:{type:String,default:"#cbee6b"},buttonsBorderWidth:{type:String,default:"0.8px"},buttonsBorderWidthActive:{type:String,default:"1px"},buttonsBorderRadius:{type:String,default:"4px"}},setup(e){const t=e;s.useCssVars(u=>({"7fb261be":e.buttonsBackgroundColor,"2ed63bdf":e.buttonsTextColor,"104a673a":e.buttonsBorderWidth,12786400:e.buttonsBorderColor,"661a0664":e.buttonsBackgroundColorActive,"61bff876":e.buttonsTextColorActive,e5a1bd6e:e.buttonsBorderWidthActive,"50c5b926":e.buttonsBorderColorActive}));const a=s.computed(()=>t.conditions.playingAs.every(u=>u.isSelected)),i=s.computed(()=>t.conditions.gameSections.every(u=>u.isSelected)),n=s.computed(()=>t.conditions.gameSections.reduce((u,h)=>(h.value<=3?u.firstHalf.push(h):u.secondHalf.push(h),u),{firstHalf:[],secondHalf:[]})),r=s.computed(()=>({"--border-radius-first-button":`${t.buttonsBorderRadius} 0 0 ${t.buttonsBorderRadius}`,"--border-radius-last-button":`0 ${t.buttonsBorderRadius} ${t.buttonsBorderRadius} 0`}));function o(u){u?t.conditions.playingAs.forEach(h=>{h.isSelected=!0}):t.conditions.playingAs.forEach((h,m)=>{h.isSelected=m===0})}function l(u){t.conditions.playingAs.filter(h=>h.isSelected).length===1&&u.isSelected||(u.isSelected=!u.isSelected)}function c(u){t.conditions.gameSections.filter(h=>h.isSelected).length===1&&u.isSelected||(u.isSelected=!u.isSelected)}function d(u){u?t.conditions.gameSections.forEach(h=>{h.isSelected=!0}):t.conditions.gameSections.forEach((h,m)=>{h.isSelected=m===0})}return(u,h)=>(s.openBlock(),s.createElementBlock("div",{class:"details",style:s.normalizeStyle(r.value)},[s.createElementVNode("div",D4e,[M4e,s.createElementVNode("div",L4e,[s.createVNode(s.unref(mv),{label:"Todos","model-value":a.value,"onUpdate:modelValue":o},null,8,["model-value"])])]),s.createElementVNode("div",R4e,[s.createElementVNode("div",F4e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.conditions.playingAs,(m,p)=>(s.openBlock(),s.createElementBlock("div",{key:`pa${p}`,class:s.normalizeClass(["details__body__button",{active:m.isSelected}]),onClick:f=>l(m)},s.toDisplayString(m.name),11,V4e))),128))])]),s.createElementVNode("div",U4e,[j4e,s.createElementVNode("div",z4e,[s.createVNode(s.unref(mv),{label:"Todos","model-value":i.value,"onUpdate:modelValue":d},null,8,["model-value"])])]),s.createElementVNode("div",H4e,[q4e,s.createElementVNode("div",W4e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.firstHalf,(m,p)=>(s.openBlock(),s.createElementBlock("div",{key:`pa${p}`,class:s.normalizeClass(["details__body__button",{active:m.isSelected}]),onClick:f=>c(m)},s.toDisplayString(m.text),11,G4e))),128))])]),s.createElementVNode("div",K4e,[X4e,s.createElementVNode("div",J4e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value.secondHalf,(m,p)=>(s.openBlock(),s.createElementBlock("div",{key:`pa${p}`,class:s.normalizeClass(["details__body__button",{active:m.isSelected}]),onClick:f=>c(m)},s.toDisplayString(m.text),11,Y4e))),128))])])],4))}},[["__scopeId","data-v-f22f11b6"]])},Symbol.toStringTag,{value:"Module"})),Z4e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},fv={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},uP=()=>{s.useCssVars(e=>({"1c960139":e.height,b2f635d8:e.borderWidthBtn,"06e99898":e.borderType,"55555c76":e.borderColor,"23b6d320":e.borderRadius,"22c97374":e.width,"22bb09fa":e.backgroundColor,c148da7c:e.cursorType,cce756fc:e.fontSize,cff98d60:e.fontStyle,"5123b3a5":e.fontFamily,"47bf58db":e.marginLeftStat,cadc8414:e.fontSizeStat}))},hP=fv.setup;fv.setup=hP?(e,t)=>(uP(),hP(e,t)):uP;const $4e=e=>(s.pushScopeId("data-v-fb269a1e"),e=e(),s.popScopeId(),e),e3e=["src"],t3e={key:1,class:"text"},a3e=["src"],i3e={class:"stats"},n3e=$4e(()=>s.createElementVNode("img",{class:"iconstats",src:"https://az755631.vo.msecnd.net/todoelfut/playdes.png"},null,-1)),r3e={class:"numstats"},s3e={class:"leyend"};function o3e(e,t,a,i,n,r){return s.openBlock(),s.createElementBlock("div",null,[a.type==0?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["button",n.status&&a.typeOnOff&&"button-active"]),style:s.normalizeStyle([r.customStyle,n.status&&a.typeOnOff&&r.customActive]),onClick:t[0]||(t[0]=(...o)=>r.btnClick&&r.btnClick(...o))},[a.icon&&a.iconPosition.toLowerCase()==="left"?(s.openBlock(),s.createElementBlock("img",{key:0,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,e3e)):s.createCommentVNode("",!0),a.textValue?(s.openBlock(),s.createElementBlock("div",t3e,s.toDisplayString(a.textValue),1)):s.createCommentVNode("",!0),a.icon&&a.iconPosition.toLowerCase()==="right"?(s.openBlock(),s.createElementBlock("img",{key:2,class:"icon",style:s.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,a3e)):s.createCommentVNode("",!0)],6)):s.createCommentVNode("",!0),a.type==1?(s.openBlock(),s.createElementBlock("div",{key:1,class:"button-target",onClick:t[1]||(t[1]=(...o)=>r.btnClick&&r.btnClick(...o))},[s.createElementVNode("div",i3e,[n3e,s.createElementVNode("div",r3e,s.toDisplayString(a.textStat),1)]),s.createElementVNode("div",s3e,s.toDisplayString(a.textCategory),1)])):s.createCommentVNode("",!0)])}const l3e=Z4e(fv,[["render",o3e],["__scopeId","data-v-fb269a1e"]]),c3e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},d3e={key:1},u3e={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h3e=["fill"],p3e={key:0,class:"checkbox__teams"},m3e={class:"checkbox__teams__logo"},f3e=["src"],g3e={class:"checkbox__teams__logo"},y3e=["src"],_3e={__name:"GSC-Checkbox",props:{width:{type:String,default:"fit-content"},height:{type:String,default:"fit-content"},label:{type:String,default:""},labelWhiteSpace:{type:String,default:"normal"},labelColor:{type:String,default:"white"},fontFamily:{type:String,default:"sans-serif"},labelFontSize:{type:String,default:"12px"},modelValue:{type:Boolean,default:!1},justifyContent:{type:String,default:"flex-start"},alignItems:{type:String,default:"center"},boxBackgroundColor:{type:String,default:"#CBEE6B"},boxValueColor:{type:String,default:"#0d1d29"},boxValue:{type:[String,Number],default:""},boxPosition:{type:String,default:"left",validator(e){return["left","right","top","bottom"].includes(e)}},boxMarginTop:{type:String,default:"0.2em"},boxWidthAndHeight:{type:String,default:"16px"},boxBorderColor:{type:String,default:"#969da2"},boxBorderWidth:{type:String,default:"2px"},boxBorderRadius:{type:String,default:"4px"},boxValueFontSize:{type:String,default:"10px"},boxValueFontFamily:{type:String,default:"sans-serif"},avoidInteraction:{type:Boolean,default:!1},avoidToCheck:{type:Boolean,default:!1},isBoxOnly:{type:Boolean,default:!1},teamsIds:{type:Array,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e;s.useCssVars(d=>({"6582e90e":e.width,"310b3edf":e.height}));const i=s.ref(!1),n=s.computed(()=>{const d={color:a.boxValueColor,"font-family":a.fontFamily,height:a.boxWidthAndHeight,width:a.boxWidthAndHeight,minWidth:a.boxWidthAndHeight,"border-radius":a.boxBorderRadius,"margin-top":a.boxMarginTop};return i.value?(d["background-color"]=a.boxBackgroundColor,d.border=`solid ${a.boxBorderWidth} ${a.boxBackgroundColor}`):d.border=`solid ${a.boxBorderWidth} ${a.boxBorderColor}`,d}),r=s.computed(()=>({"font-family":a.boxValueFontFamily,"font-size":a.boxValueFontSize,color:a.boxValueColor,"line-height":1})),o=s.computed(()=>{const d={color:a.labelColor,"font-family":a.fontFamily,"font-size":a.labelFontSize,"white-space":a.labelWhiteSpace,"text-align":a.boxPosition==="top"||a.boxPosition==="bottom"?"center":a.boxPosition};return(a.boxPosition==="left"||a.boxPosition==="right")&&(d[`margin-${a.boxPosition}`]=a.isBoxOnly?"0":a.teamsIds?"8px":"10px"),d});s.watch(()=>a.modelValue,d=>{d!==i.value&&(i.value=d)},{immediate:!0});function l(){a.avoidInteraction||!i.value&&a.avoidToCheck||(i.value=!i.value,t("update:modelValue",i.value))}function c(d){return`${{}.TEAM_LOGOS_URL||"https://az755631.vo.msecnd.net/teams-80/"}${d}.png`}return(d,u)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:l},[s.createElementVNode("div",{class:"checkbox__box",style:s.normalizeStyle(n.value)},[i.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[a.boxValue?(s.openBlock(),s.createElementBlock("div",{key:0,class:"checkbox__box__value",style:s.normalizeStyle(r.value)},s.toDisplayString(e.boxValue),5)):(s.openBlock(),s.createElementBlock("div",d3e,[(s.openBlock(),s.createElementBlock("svg",u3e,[s.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:e.boxValueColor},null,8,h3e)]))]))],64)):s.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(s.openBlock(),s.createElementBlock("div",p3e,[s.createElementVNode("div",m3e,[s.createElementVNode("img",{src:c(e.teamsIds[0]),alt:""},null,8,f3e)]),s.createElementVNode("div",g3e,[s.createElementVNode("img",{src:c(e.teamsIds[1]),alt:""},null,8,y3e)])])):s.createCommentVNode("",!0),s.createElementVNode("div",{class:"checkbox__label",style:s.normalizeStyle(o.value)},s.toDisplayString(e.label),5)],2))}},b3e=c3e(_3e,[["__scopeId","data-v-bcf3bcc6"]]),v3e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,n]of t)a[i]=n;return a},gv={components:{GSCButton:l3e,GSCCheckbox:b3e},data(){return{update:0,all:!1,refreshBtn14:0,refreshBtn24:0,refreshBtn34:0,refreshBtn44:0,sectors:Array.from({length:16},(e,t)=>({sector:t+1,active:!1})),lastUpdatedValue:[]}},props:{backgroundColor:{type:String,default:"#2e3b46"},heightContainer:{type:String,default:"340px"},widthContainer:{type:String,default:"455px"},heightField:{type:Number,default:230},widthField:{type:Number,default:350},heightFieldGrid:{type:String,default:"230px"},widthFieldGrid:{type:String,default:"350px"},backgroundSectorActive:{type:String,default:"#cbee6b"},backgroundSectorDisabled:{type:String,default:"#2e3b46"},borderWidth:{type:Number,default:1},opacitySector:{type:Number,default:.5},borderColor:{type:String,default:"#FFFFFF"},colorLineField:{type:String,default:"#bfc2c5"},borderWidthLineField:{type:Number,default:2},value:{type:Array,default:()=>[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]},title:{type:String,default:"Pase(s) desde la(s) zona(s):"},titleFontSize:{type:String,default:"14px"}},watch:{value:{deep:!0,immediate:!0,handler(e){const t=e.sort();JSON.stringify(t)!==JSON.stringify(this.lastUpdatedValue)&&(this.lastUpdatedValue=t,this.sectors.forEach((a,i)=>{a.active=e.includes(i+1),this.validateField(i)}),this.$emit("update:modelValue",e))}},sectors:{handler(e){var t=[];for(let a=0;a<e.length;a++)e[a].active&&t.push(a+1);this.$emit("update:modelValue",t)},deep:!0}},computed:{translx(){var e=0;return this.widthField>305?e=this.widthField-305:this.widthField==268&&(e=-36),e},transly(){var e=0;return this.heightField>195?(e=this.heightField-195,e=e/2):this.heightField==180&&(e=-7),e},translxcircle(){var e=0;return this.widthField>305?(e=this.widthField-305,e=e/2):this.widthField==268&&(e=-18),e}},methods:{clickAll(e){if(e){for(let t=0;t<this.sectors.length;t++)this.sectors[t].active=!0,this.validateField(t);this.status14=!0,this.status24=!0,this.status34=!0,this.status44=!0,this.refreshBtn14+=1,this.refreshBtn24+=1,this.refreshBtn34+=1,this.refreshBtn44+=1}else for(let t=0;t<this.sectors.length;t++)this.sectors[t].active=!1,this.validateField(t),this.status14=!1,this.status24=!1,this.status34=!1,this.status44=!1,this.refreshBtn14=0,this.refreshBtn24=0,this.refreshBtn34=0,this.refreshBtn44=0},selectSector(e){var t=0;this.sectors[e].active=!this.sectors[e].active;for(let a=0;a<this.sectors.length;a++)this.sectors[a].active&&(t+=1);t==0&&(this.sectors[e].active=!0),this.validateField(e)},btn14(e){this.sectors[0].active=e?this.sectors[0].active=!0:this.sectors[0].active=!1,this.sectors[1].active=e?this.sectors[1].active=!0:this.sectors[1].active=!1,this.sectors[2].active=e?this.sectors[2].active=!0:this.sectors[2].active=!1,this.sectors[3].active=e?this.sectors[3].active=!0:this.sectors[3].active=!1;var t=0;for(let a=0;a<this.sectors.length;a++)this.sectors[a].active&&(t+=1);t==0?(this.sectors[0].active=!0,this.sectors[1].active=!0,this.sectors[2].active=!0,this.sectors[3].active=!0,this.status14=!0,this.refreshBtn14+=1):this.status14=!1,t==16&&(this.all=!0,this.update+=1)},btn24(e){this.sectors[4].active=e?this.sectors[4].active=!0:this.sectors[4].active=!1,this.sectors[5].active=e?this.sectors[5].active=!0:this.sectors[5].active=!1,this.sectors[6].active=e?this.sectors[6].active=!0:this.sectors[6].active=!1,this.sectors[7].active=e?this.sectors[7].active=!0:this.sectors[7].active=!1;var t=0;for(let a=0;a<this.sectors.length;a++)this.sectors[a].active&&(t+=1);t==0?(this.sectors[4].active=!0,this.sectors[5].active=!0,this.sectors[6].active=!0,this.sectors[7].active=!0,this.status24=!0,this.refreshBtn24+=1):this.status24=!1,t==16&&(this.all=!0,this.update+=1)},btn34(e){this.sectors[8].active=e?this.sectors[8].active=!0:this.sectors[8].active=!1,this.sectors[9].active=e?this.sectors[9].active=!0:this.sectors[9].active=!1,this.sectors[10].active=e?this.sectors[10].active=!0:this.sectors[10].active=!1,this.sectors[11].active=e?this.sectors[11].active=!0:this.sectors[11].active=!1;var t=0;for(let a=0;a<this.sectors.length;a++)this.sectors[a].active&&(t+=1);t==0?(this.sectors[8].active=!0,this.sectors[9].active=!0,this.sectors[10].active=!0,this.sectors[11].active=!0,this.status34=!0,this.refreshBtn34+=1):this.status34=!1,t==16&&(this.all=!0,this.update+=1)},btn44(e){this.sectors[12].active=e?this.sectors[12].active=!0:this.sectors[12].active=!1,this.sectors[13].active=e?this.sectors[13].active=!0:this.sectors[13].active=!1,this.sectors[14].active=e?this.sectors[14].active=!0:this.sectors[14].active=!1,this.sectors[15].active=e?this.sectors[15].active=!0:this.sectors[15].active=!1;var t=0;for(let a=0;a<this.sectors.length;a++)this.sectors[a].active&&(t+=1);t==0?(this.sectors[12].active=!0,this.sectors[13].active=!0,this.sectors[14].active=!0,this.sectors[15].active=!0,this.status44=!0,this.refreshBtn44+=1):this.status44=!1,t==16&&(this.all=!0,this.update+=1)},validateField(e){(e===0||e===1||e===2||e===3)&&(this.status14=!!(this.sectors[0].active&&this.sectors[1].active&&this.sectors[2].active&&this.sectors[3].active)),(e===4||e===5||e===6||e===7)&&(this.status24=!!(this.sectors[4].active&&this.sectors[5].active&&this.sectors[6].active&&this.sectors[7].active)),(e===8||e===9||e===10||e===11)&&(this.status34=!!(this.sectors[8].active&&this.sectors[9].active&&this.sectors[10].active&&this.sectors[11].active)),(e===12||e===13||e===14||e===15)&&(this.status44=!!(this.sectors[12].active&&this.sectors[13].active&&this.sectors[14].active&&this.sectors[15].active)),this.all=!!(this.status14&&this.status34&&this.status24&&this.status44),this.update+=1,this.status14&&(this.refreshBtn14+=1),this.status24&&(this.refreshBtn24+=1),this.status34&&(this.refreshBtn34+=1),this.status44&&(this.refreshBtn44+=1)}}},pP=()=>{s.useCssVars(e=>({ff70d60a:e.widthContainer,daba190c:e.heightContainer,"6f469996":e.backgroundColor,"4ee5a3c8":e.titleFontSize,"37ac484c":e.widthFieldGrid,"12f58b4e":e.heightFieldGrid}))},mP=gv.setup;gv.setup=mP?(e,t)=>(pP(),mP(e,t)):pP;const S3e={class:"gsc-field"},w3e={class:"gsc-field__title-checked"},T3e={class:"gsc-field__title-checked__title"},C3e={class:"gsc-field__title-checked__check-cont"},k3e={class:"gsc-field__container-field"},E3e={class:"gsc-field__container-field__field"},I3e={width:"100%",height:"100%",fill:"#2e3b46",xmlns:"http://www.w3.org/2000/svg"},x3e=["stroke"],N3e=["stroke","stroke-width"],A3e=["stroke","stroke-width"],P3e=["stroke-width","stroke"],O3e=["fill","fill-opacity","stroke","stroke-width"],B3e=["fill","fill-opacity","stroke","stroke-width"],D3e=["fill","fill-opacity","stroke","stroke-width"],M3e=["fill","fill-opacity","stroke","stroke-width"],L3e=["fill","fill-opacity","stroke","stroke-width"],R3e=["fill","fill-opacity","stroke","stroke-width"],F3e=["fill","fill-opacity","stroke","stroke-width"],V3e=["fill","fill-opacity","stroke","stroke-width"],U3e=["fill","fill-opacity","stroke","stroke-width"],j3e=["fill","fill-opacity","stroke","stroke-width"],z3e=["fill","fill-opacity","stroke","stroke-width"],H3e=["fill","fill-opacity","stroke","stroke-width"],q3e=["fill","fill-opacity","stroke","stroke-width"],W3e=["fill","fill-opacity","stroke","stroke-width"],G3e=["fill","fill-opacity","stroke","stroke-width"],K3e=["fill","fill-opacity","stroke","stroke-width"],X3e={class:"gsc-field__container-field__bar-buttons"};function J3e(e,t,a,i,n,r){const o=s.resolveComponent("GSCCheckbox"),l=s.resolveComponent("GSCButton");return s.openBlock(),s.createElementBlock("div",S3e,[s.createElementVNode("div",w3e,[s.createElementVNode("div",T3e,s.toDisplayString(a.title),1),s.createElementVNode("div",C3e,[(s.openBlock(),s.createBlock(o,{label:"Todas las zonas","font-family":"Poppins-Regular","box-value-font-family":"Poppins-Regular","box-position":"right","label-font-size":a.titleFontSize,"label-white-space":"nowrap","box-margin-top":"0.4em",value:n.all,key:n.update,"model-value":n.all,"onUpdate:modelValue":r.clickAll},null,8,["label-font-size","value","model-value","onUpdate:modelValue"]))])]),s.createElementVNode("div",k3e,[s.createElementVNode("div",E3e,[(s.openBlock(),s.createElementBlock("svg",I3e,[s.createElementVNode("rect",{x:"1.5",y:"0.5",width:"100%",height:"100%",rx:"1.5",stroke:a.colorLineField},null,8,x3e),s.createElementVNode("path",{style:s.normalizeStyle("transform: translate("+r.translx+"px, "+r.transly+"px);"),d:"M303.597 39.9799H263.371C262.817 39.9799 262.369 40.4301 262.371 40.984L262.842 155.176C262.845 155.726 263.292 156.172 263.842 156.172H302.884",stroke:a.colorLineField,"stroke-width":a.borderWidthLineField,"stroke-linecap":"square"},null,12,N3e),s.createElementVNode("path",{style:s.normalizeStyle("transform: translateY("+r.transly+"px);"),class:"porteria1",d:"M1.09097 156.172L41.3162 156.172C41.8701 156.172 42.3185 155.722 42.3162 155.168L41.845 40.9758C41.8427 40.4252 41.3957 39.98 40.845 39.98L1.80338 39.98",stroke:a.colorLineField,"stroke-width":a.borderWidthLineField,"stroke-linecap":"square"},null,12,A3e),s.createElementVNode("path",{style:s.normalizeStyle("transform: translate("+r.translxcircle+"px, "+r.transly+"px);"),class:"circle",d:"M182.911 97.4512C182.911 113.726 169.44 126.936 152.801 126.936C136.162 126.936 122.691 113.726 122.691 97.4512C122.691 81.1767 136.162 67.9662 152.801 67.9662C169.44 67.9662 182.911 81.1767 182.911 97.4512Z","stroke-width":a.borderWidthLineField,stroke:a.colorLineField},null,12,P3e),s.createElementVNode("rect",{x:"0%",y:"0%",width:"25%",height:"25%",fill:n.sectors[0].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[0]||(t[0]=c=>r.selectSector(0))},null,8,O3e),s.createElementVNode("rect",{x:"0%",y:"25%",width:"25%",height:"25%",fill:n.sectors[1].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[1]||(t[1]=c=>r.selectSector(1))},null,8,B3e),s.createElementVNode("rect",{x:"0%",y:"50%",width:"25%",height:"25%",fill:n.sectors[2].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[2]||(t[2]=c=>r.selectSector(2))},null,8,D3e),s.createElementVNode("rect",{x:"0%",y:"75%",width:"25%",height:"25%",fill:n.sectors[3].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[3]||(t[3]=c=>r.selectSector(3))},null,8,M3e),s.createElementVNode("rect",{x:"25%",y:"0%",width:"25%",height:"25%",fill:n.sectors[4].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[4]||(t[4]=c=>r.selectSector(4))},null,8,L3e),s.createElementVNode("rect",{x:"25%",y:"25%",width:"25%",height:"25%",fill:n.sectors[5].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[5]||(t[5]=c=>r.selectSector(5))},null,8,R3e),s.createElementVNode("rect",{x:"25%",y:"50%",width:"25%",height:"25%",fill:n.sectors[6].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[6]||(t[6]=c=>r.selectSector(6))},null,8,F3e),s.createElementVNode("rect",{x:"25%",y:"75%",width:"25%",height:"25%",fill:n.sectors[7].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[7]||(t[7]=c=>r.selectSector(7))},null,8,V3e),s.createElementVNode("rect",{x:"50%",y:"0%",width:"25%",height:"25%",fill:n.sectors[8].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[8]||(t[8]=c=>r.selectSector(8))},null,8,U3e),s.createElementVNode("rect",{x:"50%",y:"25%",width:"25%",height:"25%",fill:n.sectors[9].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[9]||(t[9]=c=>r.selectSector(9))},null,8,j3e),s.createElementVNode("rect",{x:"50%",y:"50%",width:"25%",height:"25%",fill:n.sectors[10].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[10]||(t[10]=c=>r.selectSector(10))},null,8,z3e),s.createElementVNode("rect",{x:"50%",y:"75%",width:"25%",height:"25%",fill:n.sectors[11].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[11]||(t[11]=c=>r.selectSector(11))},null,8,H3e),s.createElementVNode("rect",{x:"75%",y:"0%",width:"25%",height:"25%",fill:n.sectors[12].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[12]||(t[12]=c=>r.selectSector(12))},null,8,q3e),s.createElementVNode("rect",{x:"75%",y:"25%",width:"25%",height:"25%",fill:n.sectors[13].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[13]||(t[13]=c=>r.selectSector(13))},null,8,W3e),s.createElementVNode("rect",{x:"75%",y:"50%",width:"25%",height:"25%",fill:n.sectors[14].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[14]||(t[14]=c=>r.selectSector(14))},null,8,G3e),s.createElementVNode("rect",{x:"75%",y:"75%",width:"25%",height:"25%",fill:n.sectors[15].active?a.backgroundSectorActive:a.backgroundSectorDisabled,"fill-opacity":a.opacitySector,stroke:a.borderColor,"stroke-width":a.borderWidth,onClick:t[15]||(t[15]=c=>r.selectSector(15))},null,8,K3e)]))]),s.createElementVNode("div",X3e,[(s.openBlock(),s.createBlock(l,{"text-value":"1/4 tos","font-size":"12px",height:"26px",width:"65px","type-on-off":!0,"border-width":1,"font-color":"#bfc2c5","border-color":"#8c9399","border-radius":"4px","font-family":"Poppins-Medium","active-border-width":1,"background-color":"","active-background-color":"#cbee6b33",ref:"btn14",onStatus:r.btn14,key:n.refreshBtn14,value:e.status14},null,8,["onStatus","value"])),(s.openBlock(),s.createBlock(l,{"text-value":"2/4 tos","font-size":"12px",height:"26px",width:"65px","type-on-off":!0,"border-width":1,"font-color":"#bfc2c5","border-color":"#8c9399","border-radius":"4px","font-family":"Poppins-Medium","active-border-width":1,"background-color":"","active-background-color":"#cbee6b33",ref:"btn24",onStatus:r.btn24,key:n.refreshBtn24,value:e.status24},null,8,["onStatus","value"])),(s.openBlock(),s.createBlock(l,{"text-value":"3/4 tos","font-size":"12px",height:"26px",width:"65px","type-on-off":!0,"border-width":1,"font-color":"#bfc2c5","border-color":"#8c9399","border-radius":"4px","font-family":"Poppins-Medium","active-border-width":1,"background-color":"","active-background-color":"#cbee6b33",ref:"btn34",onStatus:r.btn34,key:n.refreshBtn34,value:e.status34},null,8,["onStatus","value"])),(s.openBlock(),s.createBlock(l,{"text-value":"4/4 tos","font-size":"12px",height:"26px",width:"65px","type-on-off":!0,"border-width":1,"font-color":"#bfc2c5","border-color":"#8c9399","border-radius":"4px","font-family":"Poppins-Medium","active-border-width":1,"background-color":"","active-background-color":"#cbee6b33",ref:"btn44",onStatus:r.btn44,key:n.refreshBtn44,value:e.status44},null,8,["onStatus","value"]))])])])}const Y3e=v3e(gv,[["render",J3e],["__scopeId","data-v-f9923331"]]),Q3e={class:"filter-field"},Z3e=Object.freeze(Object.defineProperty({__proto__:null,default:bt({__name:"FilterField",setup(e){const t=s.ref(Array.from({length:16},(i,n)=>n+1));function a(i){}return(i,n)=>(s.openBlock(),s.createElementBlock("div",Q3e,[s.createVNode(s.unref(Y3e),{width:"100%","background-color":"#2E3B46",value:t.value,"onUpdate:modelValue":a},null,8,["value"])]))}},[["__scopeId","data-v-dc8a3bf4"]])},Symbol.toStringTag,{value:"Module"}));fs.GSCLanding=_4e,Object.defineProperty(fs,Symbol.toStringTag,{value:"Module"})});