@clickview/curator 1.100.0-rc.0 → 1.100.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/.vite/manifest.json +207 -207
  2. package/dist/Assets/js/dist/scripts/{Cm7VDspf2.chunk.js → BNHULwJy2.chunk.js} +2 -2
  3. package/dist/Assets/js/dist/scripts/{Cm7VDspf2.chunk.js.map → BNHULwJy2.chunk.js.map} +1 -1
  4. package/dist/Assets/js/dist/scripts/{BuHB0395.chunk.js → BO-eqfrD.chunk.js} +2 -2
  5. package/dist/Assets/js/dist/scripts/{BuHB0395.chunk.js.map → BO-eqfrD.chunk.js.map} +1 -1
  6. package/dist/Assets/js/dist/scripts/{CdZIanX12.chunk.js → BiTzUyxj2.chunk.js} +2 -2
  7. package/dist/Assets/js/dist/scripts/{CdZIanX12.chunk.js.map → BiTzUyxj2.chunk.js.map} +1 -1
  8. package/dist/Assets/js/dist/scripts/{C5ckf65S.chunk.js → Bznq7eHJ.chunk.js} +2 -2
  9. package/dist/Assets/js/dist/scripts/{C5ckf65S.chunk.js.map → Bznq7eHJ.chunk.js.map} +1 -1
  10. package/dist/Assets/js/dist/scripts/{DWvLbZEm.chunk.js → C2mEE4FT.chunk.js} +2 -2
  11. package/dist/Assets/js/dist/scripts/{DWvLbZEm.chunk.js.map → C2mEE4FT.chunk.js.map} +1 -1
  12. package/dist/Assets/js/dist/scripts/{DadPgJ4J.chunk.js → CMGpVYHd.chunk.js} +2 -2
  13. package/dist/Assets/js/dist/scripts/{DadPgJ4J.chunk.js.map → CMGpVYHd.chunk.js.map} +1 -1
  14. package/dist/Assets/js/dist/scripts/{D55DRVBy2.chunk.js → DFwtjofq2.chunk.js} +2 -2
  15. package/dist/Assets/js/dist/scripts/{D55DRVBy2.chunk.js.map → DFwtjofq2.chunk.js.map} +1 -1
  16. package/dist/Assets/js/dist/scripts/{DSxo4Hbf2.chunk.js → DRmwJ1it2.chunk.js} +2 -2
  17. package/dist/Assets/js/dist/scripts/{DSxo4Hbf2.chunk.js.map → DRmwJ1it2.chunk.js.map} +1 -1
  18. package/dist/Assets/js/dist/scripts/{BWv_VfB9.chunk.js → DWS9yr24.chunk.js} +2 -2
  19. package/dist/Assets/js/dist/scripts/{BWv_VfB9.chunk.js.map → DWS9yr24.chunk.js.map} +1 -1
  20. package/dist/Assets/js/dist/scripts/{x-X8lnk_2.chunk.js → Da_9BBKD2.chunk.js} +2 -2
  21. package/dist/Assets/js/dist/scripts/{x-X8lnk_2.chunk.js.map → Da_9BBKD2.chunk.js.map} +1 -1
  22. package/dist/Assets/js/dist/scripts/{DqiPZITr.chunk.js → DpRxeR-t.chunk.js} +2 -2
  23. package/dist/Assets/js/dist/scripts/{DqiPZITr.chunk.js.map → DpRxeR-t.chunk.js.map} +1 -1
  24. package/dist/Assets/js/dist/scripts/{CmKCnpM-.chunk.js → MtOi7z-o.chunk.js} +2 -2
  25. package/dist/Assets/js/dist/scripts/{CmKCnpM-.chunk.js.map → MtOi7z-o.chunk.js.map} +1 -1
  26. package/dist/Assets/js/dist/scripts/{app-BgAg7846.js → app-Dl-tzfIp.js} +3 -3
  27. package/dist/Assets/js/dist/scripts/{app-BgAg7846.js.map → app-Dl-tzfIp.js.map} +1 -1
  28. package/dist/Assets/js/dist/scripts/{BdSMYtTT2.chunk.js → uS1TyZwO2.chunk.js} +2 -2
  29. package/dist/Assets/js/dist/scripts/{BdSMYtTT2.chunk.js.map → uS1TyZwO2.chunk.js.map} +1 -1
  30. package/dist/bundles.json +1 -1
  31. package/dist/en.json +1 -1
  32. package/package.json +1 -1
@@ -229,7 +229,7 @@ ${fp(e)}`),t.map&&!t.map.bytes&&(this.logger_(`going to request init segment.`),
229
229
  fill='currentColor'
230
230
  />
231
231
  </svg>
232
- `,Gh=class extends Hh{constructor(e,t){super(e,t)}createEl(){let e=Uh.prototype.createEl.call(this,`button`,{className:this.buildCSSClass()},{type:`button`,title:this.controlText_});return e.innerHTML=Wh,this.createControlTextEl(e),e}handleClick(e){e.stopPropagation(),e.preventDefault(),this.options_?.onClick&&this.options_.onClick()}buildCSSClass(){return`cv-remove-video-button`}};W.registerComponent(`removeVideoButton`,Gh),Gh.prototype.controlText_=`Remove from watch history`;var Kh=`cvplayer-playback-quality:v2`,qh=`cvplayer-localcache-playback-quality:v2`,Jh=class{static isQualityUserPreference(){let e=localStorage.getItem(Kh),t=localStorage.getItem(qh);return!!(e||t)}static getPlayerMode(e){let t=e.isFullscreen?.()??!1,n=e.usingPlugin?.(`playerModePlugin`)?e.playerModePlugin()?.isHovering?.()??!1:!1,r=e.usingPlugin?.(`theatreModePlugin`)?e.theatreModePlugin()?.getTheatreMode?.()??!1:!1;return t?`fullscreen`:n?`hover`:r?`theatre`:`default`}static findQualityLevel(e,t){for(let n=0;n<e.length;n++)if(e[n].quality<=t)return e[n];let n=e[e.length-1];if(!n)throw Error(`No quality levels available`);return n}static enableQualityLevel(e,t){for(let n=0;n<e.length;n++){let r=e[n];r.enabled=r.id===t}}},Yh=function(e){return e.Default=`play`,e.Hover=`hover`,e}({}),Xh=W.getPlugin(`plugin`),Zh=`cv-preview-mode`,Qh=`cv-force-16-9`,$h=class extends Xh{constructor(e,t){super(e),this.hasSeeked=!1,this.buttonAdded=!1,this.mode=null,this.defaultDisplayMode=`normal`,this.onQualityReady=null,t?.defaultDisplayMode&&(this.defaultDisplayMode=t.defaultDisplayMode),t?.startTime&&(this.startTime=t.startTime),this.onSeek=this.onSeek.bind(this),this.player.one(`seeking`,this.onSeek)}onSeek(){this.hasSeeked=!0}dispose(){this.cleanupQualityListener(),this.player.off(`seeking`,this.onSeek),super.dispose()}getMode(){return this.mode}isHovering(){return this.mode===`hover`}setPlayerMode(e,t,n){this.player.trigger(`flushprogress`);let r=this.mode;if(this.mode=e,e===`hover`){this.buttonAdded||this.addButtons(t,n),this.player.addClass(Zh),this.applyAspectRatioFix(),this.enableSubtitles(),this.mute(),this.setLowQuality(),this.removeActivityTimeout(),this.player.trigger(`resize`);return}r===`hover`&&(this.applyDefaultModeLayout(),this.player.removeClass(Zh),this.player.removeClass(Qh),this.disableSubtitles(),this.unmute(),this.cleanupQualityListener(),this.restorePreviousQuality(),this.restoreActivityTimeout(),this.player.trigger(`resize`),this.hasSeeked||=(this.player.currentTime(this.startTime??0),!1))}applyDefaultModeLayout(){let e=this.player.usingPlugin?.(`theatreModePlugin`);this.defaultDisplayMode===`theatre`?(e&&this.player.theatreModePlugin()?.toggleTheatreMode(!0),this.player.fill(!0)):(e&&this.player.theatreModePlugin()?.toggleTheatreMode(!1),this.player.fluid(!0))}applyAspectRatioFix(){let e=()=>{let e=this.player.videoWidth(),t=this.player.videoHeight();if(e>0&&t>0){let n=e/t;Math.abs(n-16/9)<.01||this.player.addClass(Qh)}};this.player.readyState()>=1?e():this.player.one(`loadedmetadata`,e)}addButtons(e,t){let n=new zh(this.player),r=new Vh(this.player,{onClickHandler:e}),i=new Gh(this.player,{onClick:t});t&&c.isFunction(t)&&this.player.addChild(i),this.player.addChild(n),this.player.addChild(r),this.buttonAdded=!0}enableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().previewModeSubtitles())}disableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().applyUserPreferences())}mute(){this.player.ready(()=>{this.player.persistVolumePlugin().disable(),this.player.muted(!0)})}unmute(){this.player.ready(()=>{this.player.persistVolumePlugin().applyUserPreferences(),this.player.persistVolumePlugin().enable()})}setLowQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().disable();let e=this.player.qualityLevels();if(e.length>0){this.switchToLowestQuality(e);return}this.cleanupQualityListener(),this.onQualityReady=()=>{this.onQualityReady=null,this.switchToLowestQuality(e)},e.one(`change`,this.onQualityReady)})}cleanupQualityListener(){this.onQualityReady&&=(this.player.qualityLevels().off(`change`,this.onQualityReady),null)}switchToLowestQuality(e){let t=e[e.length-1];t&&Jh.enableQualityLevel(e,t.id)}restorePreviousQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().applyUserPreferences(),this.player.persistQualitySettingsPlugin().enable()})}removeActivityTimeout(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}restoreActivityTimeout(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}};W.registerPlugin(`playerModePlugin`,$h);var eg=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;function tg(e,t,n,r){let i,a,o,s=t||[0],c=(n||=0)>>>3,l=r===-1?3:0;for(i=0;i<e.length;i+=1)o=i+c,a=o>>>2,s.length<=a&&s.push(0),s[a]|=e[i]<<8*(l+o%4*r);return{value:s,binLen:8*e.length+n}}function ng(e,t,n){switch(t){case`UTF8`:case`UTF16BE`:case`UTF16LE`:break;default:throw Error(`encoding must be UTF8, UTF16BE, or UTF16LE`)}switch(e){case`HEX`:return function(e,t,r){return function(e,t,n,r){let i,a,o,s;if(e.length%2!=0)throw Error(`String of HEX type must be in byte increments`);let c=t||[0],l=(n||=0)>>>3,u=r===-1?3:0;for(i=0;i<e.length;i+=2){if(a=parseInt(e.substr(i,2),16),isNaN(a))throw Error(`String of HEX type contains invalid characters`);for(s=(i>>>1)+l,o=s>>>2;c.length<=o;)c.push(0);c[o]|=a<<8*(u+s%4*r)}return{value:c,binLen:4*e.length+n}}(e,t,r,n)};case`TEXT`:return function(e,r,i){return function(e,t,n,r,i){let a,o,s,c,l,u,d,f,p=0,m=n||[0],h=(r||=0)>>>3;if(t===`UTF8`)for(d=i===-1?3:0,s=0;s<e.length;s+=1)for(a=e.charCodeAt(s),o=[],128>a?o.push(a):2048>a?(o.push(192|a>>>6),o.push(128|63&a)):55296>a||57344<=a?o.push(224|a>>>12,128|a>>>6&63,128|63&a):(s+=1,a=65536+((1023&a)<<10|1023&e.charCodeAt(s)),o.push(240|a>>>18,128|a>>>12&63,128|a>>>6&63,128|63&a)),c=0;c<o.length;c+=1){for(u=p+h,l=u>>>2;m.length<=l;)m.push(0);m[l]|=o[c]<<8*(d+u%4*i),p+=1}else for(d=i===-1?2:0,f=t===`UTF16LE`&&i!==1||t!==`UTF16LE`&&i===1,s=0;s<e.length;s+=1){for(a=e.charCodeAt(s),!0===f&&(c=255&a,a=c<<8|a>>>8),u=p+h,l=u>>>2;m.length<=l;)m.push(0);m[l]|=a<<8*(d+u%4*i),p+=2}return{value:m,binLen:8*p+r}}(e,t,r,i,n)};case`B64`:return function(e,t,r){return function(e,t,n,r){let i,a,o,s,c,l,u,d=0,f=t||[0],p=(n||=0)>>>3,m=r===-1?3:0,h=e.indexOf(`=`);if(e.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw Error(`Invalid character in base-64 string`);if(e=e.replace(/=/g,``),h!==-1&&h<e.length)throw Error(`Invalid '=' found in base-64 string`);for(a=0;a<e.length;a+=4){for(c=e.substr(a,4),s=0,o=0;o<c.length;o+=1)i=eg.indexOf(c.charAt(o)),s|=i<<18-6*o;for(o=0;o<c.length-1;o+=1){for(u=d+p,l=u>>>2;f.length<=l;)f.push(0);f[l]|=(s>>>16-8*o&255)<<8*(m+u%4*r),d+=1}}return{value:f,binLen:8*d+n}}(e,t,r,n)};case`BYTES`:return function(e,t,r){return function(e,t,n,r){let i,a,o,s,c=t||[0],l=(n||=0)>>>3,u=r===-1?3:0;for(a=0;a<e.length;a+=1)i=e.charCodeAt(a),s=a+l,o=s>>>2,c.length<=o&&c.push(0),c[o]|=i<<8*(u+s%4*r);return{value:c,binLen:8*e.length+n}}(e,t,r,n)};case`ARRAYBUFFER`:return function(e,t,r){return function(e,t,n,r){return tg(new Uint8Array(e),t,n,r)}(e,t,r,n)};case`UINT8ARRAY`:return function(e,t,r){return tg(e,t,r,n)};default:throw Error(`format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY`)}}function rg(e,t,n,r){switch(e){case`HEX`:return function(e){return function(e,t,n,r){let i=`0123456789abcdef`,a,o,s=``,c=t/8,l=n===-1?3:0;for(a=0;a<c;a+=1)o=e[a>>>2]>>>8*(l+a%4*n),s+=i.charAt(o>>>4&15)+i.charAt(15&o);return r.outputUpper?s.toUpperCase():s}(e,t,n,r)};case`B64`:return function(e){return function(e,t,n,r){let i,a,o,s,c,l=``,u=t/8,d=n===-1?3:0;for(i=0;i<u;i+=3)for(s=i+1<u?e[i+1>>>2]:0,c=i+2<u?e[i+2>>>2]:0,o=(e[i>>>2]>>>8*(d+i%4*n)&255)<<16|(s>>>8*(d+n*((i+1)%4))&255)<<8|c>>>8*(d+n*((i+2)%4))&255,a=0;a<4;a+=1)l+=8*i+6*a<=t?eg.charAt(o>>>6*(3-a)&63):r.b64Pad;return l}(e,t,n,r)};case`BYTES`:return function(e){return function(e,t,n){let r,i,a=``,o=t/8,s=n===-1?3:0;for(r=0;r<o;r+=1)i=e[r>>>2]>>>8*(s+r%4*n)&255,a+=String.fromCharCode(i);return a}(e,t,n)};case`ARRAYBUFFER`:return function(e){return function(e,t,n){let r,i=t/8,a=new ArrayBuffer(i),o=new Uint8Array(a),s=n===-1?3:0;for(r=0;r<i;r+=1)o[r]=e[r>>>2]>>>8*(s+r%4*n)&255;return a}(e,t,n)};case`UINT8ARRAY`:return function(e){return function(e,t,n){let r,i=t/8,a=n===-1?3:0,o=new Uint8Array(i);for(r=0;r<i;r+=1)o[r]=e[r>>>2]>>>8*(a+r%4*n)&255;return o}(e,t,n)};default:throw Error(`format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY`)}}function ig(e){let t={outputUpper:!1,b64Pad:`=`,outputLen:-1},n=e||{},r=`Output length must be a multiple of 8`;if(t.outputUpper=n.outputUpper||!1,n.b64Pad&&(t.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw Error(r);t.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw Error(r);t.outputLen=n.shakeLen}if(typeof t.outputUpper!=`boolean`)throw Error(`Invalid outputUpper formatting option`);if(typeof t.b64Pad!=`string`)throw Error(`Invalid b64Pad formatting option`);return t}var ag=class{constructor(e,t,n){let r=n||{};if(this.t=t,this.i=r.encoding||`UTF8`,this.numRounds=r.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw Error(`numRounds must a integer >= 1`);this.o=e,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.U=[],this.R=[]}update(e){let t,n=0,r=this.T>>>5,i=this.F(e,this.h,this.u),a=i.binLen,o=i.value,s=a>>>5;for(t=0;t<s;t+=r)n+this.T<=a&&(this.m=this.g(o.slice(t,t+r),this.m),n+=this.T);return this.A+=n,this.h=o.slice(n>>>5),this.u=a%this.T,this.l=!0,this}getHash(e,t){let n,r,i=this.B,a=ig(t);if(this.v){if(a.outputLen===-1)throw Error(`Output length must be specified in options`);i=a.outputLen}let o=rg(e,i,this.H,a);if(this.p&&this.C)return o(this.C(a));for(r=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),i),n=1;n<this.numRounds;n+=1)this.v&&i%32!=0&&(r[r.length-1]&=16777215>>>24-i%32),r=this.Y(r,i,0,this.L(this.o),i);return o(r)}setHMACKey(e,t,n){if(!this.M)throw Error(`Variant does not support HMAC`);if(this.l)throw Error(`Cannot set MAC key after calling update`);let r=ng(t,(n||{}).encoding||`UTF8`,this.H);this.N(r(e))}N(e){let t=this.T>>>3,n=t/4-1,r;if(this.numRounds!==1)throw Error(`Cannot set numRounds with MAC`);if(this.p)throw Error(`MAC key already set`);for(t<e.binLen/8&&(e.value=this.Y(e.value,e.binLen,0,this.L(this.o),this.B));e.value.length<=n;)e.value.push(0);for(r=0;r<=n;r+=1)this.U[r]=909522486^e.value[r],this.R[r]=1549556828^e.value[r];this.m=this.g(this.U,this.m),this.A=this.T,this.p=!0}getHMAC(e,t){let n=ig(t);return rg(e,this.B,this.H,n)(this.S())}S(){let e;if(!this.p)throw Error(`Cannot call getHMAC without first setting MAC key`);let t=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),this.B);return e=this.g(this.R,this.L(this.o)),e=this.Y(t,this.B,this.T,e,this.B),e}};function og(e,t){return e<<t|e>>>32-t}function sg(e,t,n){return e^t^n}function cg(e,t,n){return e&t^e&n^t&n}function lg(e,t){let n=(65535&e)+(65535&t);return(65535&(e>>>16)+(t>>>16)+(n>>>16))<<16|65535&n}function ug(e,t,n,r,i){let a=(65535&e)+(65535&t)+(65535&n)+(65535&r)+(65535&i);return(65535&(e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(i>>>16)+(a>>>16))<<16|65535&a}function dg(e){return[1732584193,4023233417,2562383102,271733878,3285377520]}function fg(e,t){let n,r,i,a,o,s,c,l=[];for(n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],c=0;c<80;c+=1)l[c]=c<16?e[c]:og(l[c-3]^l[c-8]^l[c-14]^l[c-16],1),s=c<20?ug(og(n,5),(u=r)&i^~u&a,o,1518500249,l[c]):c<40?ug(og(n,5),sg(r,i,a),o,1859775393,l[c]):c<60?ug(og(n,5),cg(r,i,a),o,2400959708,l[c]):ug(og(n,5),sg(r,i,a),o,3395469782,l[c]),o=a,a=i,i=og(r,30),r=n,n=s;var u;return t[0]=lg(n,t[0]),t[1]=lg(r,t[1]),t[2]=lg(i,t[2]),t[3]=lg(a,t[3]),t[4]=lg(o,t[4]),t}function pg(e,t,n,r){let i,a=15+(t+65>>>9<<4),o=t+n;for(;e.length<=a;)e.push(0);for(e[t>>>5]|=128<<24-t%32,e[a]=4294967295&o,e[a-1]=o/4294967296|0,i=0;i<e.length;i+=16)r=fg(e.slice(i,i+16),r);return r}var mg=class extends ag{constructor(e,t,n){if(e!==`SHA-1`)throw Error(`Chosen SHA variant is not supported`);super(e,t,n);let r=n||{};this.M=!0,this.C=this.S,this.H=-1,this.F=ng(this.t,this.i,this.H),this.g=fg,this.I=function(e){return e.slice()},this.L=dg,this.Y=pg,this.m=[1732584193,4023233417,2562383102,271733878,3285377520],this.T=512,this.B=160,this.v=!1,r.hmacKey&&this.N(function(e,t,n,r){let i=e+` must include a value and format`;if(!t){if(!r)throw Error(i);return r}if(t.value===void 0||!t.format)throw Error(i);return ng(t.format,t.encoding||`UTF8`,n)(t.value)}(`hmacKey`,r.hmacKey,this.H))}},hg=function(e){return e.CvApSoutheast1=`cv-ap-southeast-1`,e.CvApSoutheast2=`cv-ap-southeast-2`,e.CvEuWest1=`cv-eu-west-1`,e.CvNaWest1=`cv-na-west-1`,e}({}),gg={CvApSoutheast1:{systemName:hg.CvApSoutheast1},CvApSoutheast2:{systemName:hg.CvApSoutheast2},CvEuWest1:{systemName:hg.CvEuWest1},CvNaWest1:{systemName:hg.CvNaWest1}},_g=`r`,vg=`cv:r`,yg=`cv:r:e`,bg=`referrer`,xg=`cv:originalReferrer`,Sg=28800,Cg=[`internalReferrer`],wg={getDecodedAttributionData(){let e=g.cacheGet(vg);return e&&Object.keys(e).length>0?e:Tg()?.decoded},getEncodedAttributionData(){let e=g.cacheGet(yg);return e?.length?e:Tg().encoded},getProfileId(){return wg.getDecodedAttributionData()?.profileId??null},setAttributionData(e){e&&jg(Ag(e),e)},decodeRValue(e){if(e)try{let t=atob(e),n=JSON.parse(t);if(!Dg(n))throw Error(`Decoded R value is invalid: ${JSON.stringify(n)}`);return n}catch(e){let t=e instanceof Error?e.message:e?.toString();console.error(t)}}};function Tg(){let e=g.cacheGet(vg),t=g.cacheGet(yg);return Dg(e)?{encoded:t,decoded:e}:Eg()}function Eg(){g.cacheRemove(vg),g.cacheRemove(yg);let e=kg(),t=wg.decodeRValue(e);if(t)return jg(e,t),{decoded:t,encoded:e};let n={internalReferrer:window.location.origin+window.location.pathname,originalReferrer:Og()},r=Ag(n);return jg(r,n),{decoded:n,encoded:r}}function Dg(e){return!e||typeof e!=`object`||Object.keys(e).length<Cg.length?!1:Cg.every(t=>typeof e[t]==`string`)}function Og(){let e=g.cacheGet(xg);if(e&&typeof e==`string`)return e;let t=document.referrer??``;if(window.URLSearchParams){let e=new URLSearchParams(window.location.search),n=e.has(bg)&&e.get(bg);e.has(bg)&&e.get(bg)&&(t=n)}return t&&g.cacheSet(xg,t,Sg),t}function kg(){if(!window.URLSearchParams)return;let e=new URLSearchParams(window.location.search);if(e.has(_g))return e.get(_g)}function Ag(e){if(Dg(e))try{return btoa(JSON.stringify(e))}catch{console.error(`R value could not be encoded: ${JSON.stringify(e)}`)}}function jg(e,t){try{g.cacheSet(vg,t,Sg),g.cacheSet(yg,e,Sg)}catch{console.error(`Could not store attribution data in session storage`)}}var Mg=3,Ng=5e3,Pg=6,Fg={},Ig=class{constructor(e){this.key=e.toString()}getCount(){return Fg[this.key]||0}increment(){Fg[this.key]=this.getCount()+1}reset(){delete Fg[this.key]}shouldBreak(){return this.getCount()>=Pg}},Lg=class{constructor(){this.attempt=0}async wait(){await new Promise(e=>setTimeout(e,Ng*2**this.attempt)),this.attempt++}};async function Rg(e,t){let n=new Lg,r=new Ig(e);async function i(){let n=await fetch(e,t);if(n.status>=500&&!r.shouldBreak())throw Error(`Server error: ${n.status}`);return n.ok&&r.reset(),n}for(let e=1;e<=Mg;e++)try{return await i()}catch(t){if(e>=Mg||r.shouldBreak())throw t;r.increment(),await n.wait()}}var zg=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Bg(e){return typeof e==`string`&&zg.test(e)}function Vg(e){if(!Bg(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}var Hg=`cv:session:`,Ug=`cv:window:v2:`,Wg=1e3*60*30,Gg=4;function Kg(e){if(e===p.LocalStorage)return g.isAvailable()?g:m;if(e===p.SessionStorage)return h.isAvailable()?h:m}function qg(e){return new Date().getTime()+e}function Jg(){return be()}function Yg(e,t){return e+(t||`0`)}function Xg(e){return new Date().getTime()>e}function Zg(e){return!(typeof e!=`object`||typeof e?.id!=`string`||!Bg(e.id)||Vg(e.id)!==Gg||typeof e?.ttl!=`number`||e?.ttl<=0||isNaN(e?.ttl))}function Qg(e,t,n){let r=Kg(n),i=Yg(e,t),a=r.get(i);return!Zg(a)||Xg(a?.ttl)?null:a}function $g(e,t,n,r){let i=Kg(n),a=Yg(e,t),o={id:Jg(),ttl:qg(r)};return i.set(a,o),o}function e_(e,t,n,r,i){let a=Kg(n),o=Yg(e,t);a.set(o,{id:r.id,ttl:qg(i)})}function t_(e,t,n){let r=Kg(n);if(!r?.isAvailable())return;let i=Yg(e,t);r.remove(i)}var n_=null,r_={getClientSessionData(e){let t=Qg(Hg,e,p.LocalStorage);t?e_(Hg,e,p.LocalStorage,t,Wg):t=$g(Hg,e,p.LocalStorage,Wg);let n=Qg(Ug,e,p.SessionStorage);return n?n_===null&&e_(Ug,e,p.SessionStorage,n,Wg):n=$g(Ug,e,p.SessionStorage,n_??Wg),{id:t.id,windowId:n.id}},resetClientSession(e){t_(Hg,e,p.LocalStorage),t_(Ug,e,p.SessionStorage)},lockWindowSession(e,t){n_=t;let n=Qg(Ug,e,p.SessionStorage);n&&e_(Ug,e,p.SessionStorage,n,t)},unlockWindowSession(e){n_=null;let t=Qg(Ug,e,p.SessionStorage);t&&e_(Ug,e,p.SessionStorage,t,Wg)}},i_={isObject(e){let t=typeof e;return t===`function`||t===`object`&&!!e},isFunction(e){return typeof e==`function`}},G={mobileDevice:/Mobi/i,iphone:/iphone/i,ipad:/ipad/i,android:/android/i,blackberry:/blackberry/i,windowsPhone:/windows phone/i,iosVersion:/OS\s+([\d_.-:]+)\s/i,androidVersion:/android\s+([\d_.-\/]+)[\s;:,\)]/i,blackberryVersion:/(blackberry|version)\s?\d*\/([\d.]+)/i,windowsPhoneVersion:/windows\sphone.*?([\d_.-\/]+)[\s;:,\)]/i,mac:/Mac/i,unix:/X11/i,linux:/Linux/i,windows:/Win/i,win2000:/nt 5.0/i,winXP:/nt 5.1/i,winVista:/nt 6.0/i,win7:/nt 6.1/i,win8:/nt 6.2/i,win81:/nt 6.3/i,win10:/nt 10.0/i,osxVersion:/OS\sX\s([\d_.]+)/i,chrome:/^(?!.*Edge).*Chrome/i,safari:/^(?!.*(?:Chrome|Edge)).*Safari/i,edge:/edge/i,ie:/(msie|trident)/i,opera:/(opr|opera)/i,firefox:/firefox/i,generalVersion:/(chrome|firefox|version)\/(\d+.*?)(\s|$)/i,operaVersion:/(opr|opera)\/(\d+).*?(\s|$)/i,ieVersion:/MSIE\s+(\d+).*?/i,edgeVersion:/(edge)\/(\d+).*?(\s|$)/i},a_=`Unknown`;function o_(e,t,n){let[r]=t.exec(n)||[];return r||=a_,{name:e,version:r}}function s_(e,t,n){if(!t)return{name:e,version:a_};let r=t.exec(n);return{name:e,version:r&&r.length?r[0].trim():a_}}function c_(e,t){let n={name:e,version:null};return G.win2000.test(t)&&(n.version=`2000`),G.winXP.test(t)&&(n.version=`XP`),G.winVista.test(t)&&(n.version=`Vista`),G.win7.test(t)&&(n.version=`7`),G.win8.test(t)&&(n.version=`8`),G.win81.test(t)&&(n.version=`8.1`),G.win10.test(t)&&(n.version=`10`),n.version||=a_,n}var l_={getDeviceType(){let e=window.navigator.userAgent;return G.mobileDevice.test(e)?G.iphone.test(e)?`iPhone`:G.ipad.test(e)?`iPad`:G.android.test(e)?`Android`:G.blackberry.test(e)?`Blackberry`:G.windowsPhone.test(e)?`Windows Phone`:a_:`Desktop`},getOperatingSystem(){let e=window.navigator.userAgent;return G.android.test(e)?s_(`Android`,G.androidVersion,e):G.iphone.test(e)||G.ipad.test(e)?s_(`iOS`,G.iosVersion,e):G.linux.test(e)?s_(`Linux`,null,e):G.unix.test(e)?s_(`Unix`,null,e):G.mac.test(e)?s_(`Macintosh`,G.osxVersion,e):G.windows.test(e)?c_(`Windows`,e):G.blackberry.test(e)?s_(`BlackBerry`,G.blackberryVersion,e):G.windowsPhone.test(e)?s_(`Windows Phone`,G.windowsPhoneVersion,e):{name:a_,version:a_}},getBrowser(){let e=window.navigator.userAgent;return G.chrome.test(e)?o_(`Chrome`,G.generalVersion,e):G.firefox.test(e)?o_(`Firefox`,G.generalVersion,e):G.safari.test(e)?o_(`Safari`,G.generalVersion,e):G.ie.test(e)?o_(`Internet Explorer`,G.ieVersion,e):G.edge.test(e)?o_(`Edge`,G.edgeVersion,e):G.opera.test(e)?o_(`Opera`,G.operaVersion,e):{name:a_,version:a_}},isTouchScreen(){return!!(`ontouchstart`in window||navigator.maxTouchPoints)}},u_=28800,d_=`cv:utmparams`,f_=[[`source`,`utm_source`],[`medium`,`utm_medium`],[`campaign`,`utm_campaign`],[`term`,`utm_term`],[`content`,`utm_content`]],p_=f_.reduce((e,[t])=>({...e,[t]:t}),{}),m_={getUtmParameters(){if(!window.URLSearchParams)return null;let e=new URLSearchParams(window.location.search),t={};return f_.forEach(([n,r])=>{e.has(r)&&(t[n]=e.get(r))}),h_(t)},setUtmParameters(e){if(!e)return;let t={};return Object.keys(e).forEach(n=>{p_[n]&&(t[n]=e[n])}),h_(t)},getURLSearchParams(){if(!window.URLSearchParams)return null;let e=new URLSearchParams,t=m_.getUtmParameters();return t?(f_.forEach(([n,r])=>{t[n]&&e.set(r,t[n])}),e):null}};function h_(e){if(Object.keys(e).length)return g.cacheSet(d_,e,u_),e;let t=g.cacheGet(d_);return t&&typeof t==`object`&&Object.keys(t).length?t:null}var g_={name:`@clickview/analytics`,version:`2.3.0`,description:`Analytics`,main:`dist/app.js`,types:`dist/analytics/src/app.d.ts`,type:`module`,private:!0,repository:{type:`git`,url:`https://gitlab.cvinternal.net/front-end/clickview`},scripts:{start:`npm run build`,"type-check":`tsc --noEmit`,build:`npm run type-check && node ../../../node_modules/vite/bin/vite.js build`,prebuild:`npm run clean`,clean:`npx rimraf dist`},author:``,license:`ISC`,devDependencies:{"tsc-alias":`1.8.16`},dependencies:{jssha:`3.3.1`,uuid:`11.1.1`}},__=`zXJL9nOHxzDlMUDjiP41`,v_=`unknown`,y_=class{constructor(e){this.options=e,this.initialize()}initialize(){this.validateOptions(),this.options.logUtmParameters&&(this.utmParameters=m_.getUtmParameters()),this.options.logAttributionData&&(this.attributionData=wg.getDecodedAttributionData())}get name(){return`CollectionApiClient`}async log(e){if(Array.isArray(e))return this.logBulk(e);this.shouldLog(e)&&(this.validateEvent(e),await this.postData(await this.formatData(e)))}async logBulk(e){let t=e.filter(e=>this.shouldLog(e));if(!t.length)return;t.forEach(e=>this.validateEvent(e));let n=await Promise.all(t.map(e=>this.formatData(e)));await this.postData(n)}validateOptions(){if(!i_.isFunction(this.options.getUser))throw Error(`getUser option is required.`)}shouldLog(e){return!i_.isFunction(this.options.shouldLog)||this.options.shouldLog(e)}async postData(e){let t=await this.getRegionalUrl(this.options.collectionApiUrls),n=JSON.stringify(e),r={"Content-Type":`application/json`,...this.getSignatureHeader(n)},i=xe.safeUrlConcat(t,`/v1/ingest`);Array.isArray(e)&&(i=xe.safeUrlConcat(i,`/bulk`));try{let e=await Rg(i,{method:`POST`,mode:`cors`,headers:r,body:n});e.ok||this.logError(Error(`CollectionApiClient failed to log event. Status: ${e.status} ${e.statusText}`),!1,this.getResponseAsObject(e))}catch(e){this.logError(e)}}getResponseAsObject(e){return{headers:e.headers,ok:e.ok,redirected:e.redirected,status:e.status,statusText:e.statusText,type:e.type,url:e.url,body:e.text()}}getSignatureHeader(e){let t=new mg(`SHA-1`,`TEXT`,{hmacKey:{value:__,format:`TEXT`,encoding:`UTF8`}});return t.update(e),{"cv-analytics-signature":`${this.options.collectionApiClientId}.${t.getHash(`B64`)}`}}async getRegionalUrl(e){switch((await this.getRegion()).systemName){case hg.CvEuWest1:return e.cvEuWest1;case hg.CvApSoutheast2:return e.cvApSoutheast2;case hg.CvNaWest1:return e.cvNaWest1;case hg.CvApSoutheast1:default:return e.cvApSoutheast1}}validateEvent(e){typeof e.type!=`string`&&this.logError(Error(`Event type is required.`),!0),i_.isObject(e.actionContext)||this.logError(Error(`Event actionContext is required.`),!0),e.actionContext.entity||this.logError(Error(`Event actionContext entity is required.`),!0)}async formatData(e){return{type:e.type,data:await this.getEventData(e),metadata:this.getEventMetadata(e)}}async getEventData(e){let t=e.actionContext,n=this.getPlatformMetadata(),r=await this.getUserData(),i=await this.getSessionData(),a={name:this.options.productName,version:this.options.productVersion};this.options.productVariant&&(a.variant=this.options.productVariant);let o={user:r,action:t,platform:n,product:a,session:i};this.utmParameters&&(o.utm=this.utmParameters);let s=this.extractData(e),c=Object.keys(o).map(e=>e.toLowerCase()),l=Object.keys(s).map(e=>e.toLowerCase());return c.forEach(e=>{l.includes(e)&&this.logError(Error(`${e} is a reserved key.`),!0)}),{...o,...s}}extractData(e){return i_.isFunction(this.options.formatData)?this.options.formatData(e):{[e.actionContext.entity]:e.data}}async getUserData(){let e;try{e=await this.options.getProfileId?.()}catch(e){this.logError(e)}try{let t=await this.options.getUser();return t?.id?{id:t.id,role:t.role?.toLowerCase()||v_,userGroup:(t.userGroup??we.Unknown).toLowerCase(),yearGroup:this.normalizeYearGroup(t.yearGroup),profileId:e,customer:{id:t.customerId,name:t.customerName,customerGuid:t.customerGuid,crmId:t.crmId,country:t.countryCode,region:await this.getRegion(),openCustomer:!1,accessPolicy:t.accessPolicy}}:e?{profileId:e}:void 0}catch(e){this.logError(e)}}async getRegion(){let e=this.options.regionName;try{let t=await this.options.getUser();t?.instanceRegion&&(e=t.instanceRegion)}catch(e){this.logError(e)}return e||this.logError(Error(`RegionName is not set.`),!0),this.getRegionByName(e.toLowerCase())}async getSessionData(){try{let e=await this.options.getUser();return{...r_.getClientSessionData(e?.id),authSessionId:e?.sessionId}}catch(e){return console.error(e),r_.getClientSessionData(null)}}getPlatformMetadata(){let e={url:window.location.href,referrer:document.referrer};return this.attributionData?.internalReferrer&&(e.internalReferrer=this.attributionData.internalReferrer),this.attributionData?.originalReferrer&&(e.originalReferrer=this.attributionData.originalReferrer),{browser:l_.getBrowser(),os:l_.getOperatingSystem(),request:e,screenResolution:`${window.screen.width}x${window.screen.height}`,viewportResolution:`${window.innerWidth}x${window.innerHeight}`}}getEventMetadata(e){return{client:{name:`${this.name}.ts`,version:g_.version,region:this.getRegionByName(this.options.regionName)},timestamp:new Date().toISOString(),eventVersion:e.eventVersion}}getRegionByName(e){let t;return Object.values(gg).forEach(n=>{n.systemName===e&&(t=n)}),t}normalizeYearGroup(e){return e?e.toLowerCase().split(` `).join(`_`):v_}logError(e,t,...n){if(this.options.logError&&this.options.logError(e,...n),t)throw e}};function b_(e){return!i_.isObject(e)||!i_.isObject(e.actionContext)?{}:{entity:e.actionContext.entity,location:e.actionContext.location,descriptor:e.actionContext.descriptor}}function x_(e){let t={},n=(e,t)=>{switch(t){case`description`:return T.ValueUpdated;case`channel`:case`rating`:case`series`:case`distributor`:case`producer`:return e&&e.id||T.EntityRemoved;default:return e}};return Object.keys(e).forEach(r=>{t[r]=n(e[r],r)}),t}var S_={passthrough(e){return e},getEditData(e,t){let{entity:n,location:r}=b_(t);return n===v.Video&&r===A.EditVideoDetails?x_(e):e}},K={allow:()=>!0,restrict:()=>!1},C_={getShareData(e){let{id:t,search:n,pagePositionIndex:r,shareId:i,shareType:a}=e,o={id:t,search:n,pagePositionIndex:r,shareId:i,shareType:a};return e.video?.id&&(o.video={id:e.video.id}),e.clip?.id&&(o.clip={id:e.clip.id},e.clip.video?.id&&(o.video={id:e.clip.video?.id})),e.shareCount!==void 0&&(o.shareCount=e.shareCount),e.embedDetails&&(o.embedDetails=e.embedDetails),o}},w_={getUploadData(e,t){let{entity:n}=t.actionContext;if(n===v.Video)return w_.formatVideoUpload(e,t);if(n===v.Resource||n===v.Subtitle)return w_.formatResourceUpload(e);if(n===v.Banner||n===v.Thumbnail||n===v.MixedMedia)return e;throw Error(`Upload data event not correctly formatted.`)},formatVideoUpload(e,t){let{workflowPhase:n}=t.actionContext;if(n===y.Start)return w_.getStartVideoUploadData(e);if(n===y.Discard)return w_.getDiscardVideoUploadData(e);if(n===y.Complete)return w_.getCompleteUploadData(e)},getStartVideoUploadData(e){return!e||!e.length?[]:(e instanceof FileList&&(e=Array.from(e)),e.map(t=>({fileName:t.name,size:t.size,type:t.type,count:e.length})))},getDiscardVideoUploadData(e){let t=t=>{let{type:n,name:r,status:i,cvUpload:a}=t.file,o={fileName:r,count:Array.isArray(e)?e.length:1,type:n,status:i};return t.progress&&(o.progress=t.progress.toFixed(2)),a&&(o.uploadId=a.uploadId),o};return Array.isArray(e)?e.map(e=>t(e)):[t(e)]},getCompleteUploadData(e){return!e||!e.length?[]:e.map(t=>{let{fileName:n,libraryId:r,folderId:i,autoCaption:a}=t;return{fileName:n,libraryId:r,folderId:i,autoCaption:a,count:e.length}})},formatResourceUpload(e){let{id:t,name:n}=e,r={id:t,name:n};return i_.isObject(e.metadata)&&(r.type=e.metadata.type),r}},T_={[_.Navigate]:K.restrict,[_.Click]:K.allow,[_.Search]:K.allow,[_.InstantSearch]:K.allow,[_.Play]:K.allow,[_.Stream]:K.allow,[_.WebPlayerStream]:K.allow,[_.StreamProgress]:K.allow,[_.PreviewStreamProgress]:K.allow,[_.StreamBuffering]:K.allow,[_.Rename]:K.allow,[_.Move]:K.allow,[_.Create]:K.allow,[_.Delete]:K.allow,[_.Associate]:K.allow,[_.Dissociate]:K.allow,[_.Filter]:K.allow,[_.Sort]:K.allow,[_.Approve]:K.allow,[_.Reject]:K.allow,[_.Disable]:K.allow,[_.Upload]:K.allow,[_.Download]:K.allow,[_.SetAccess]:K.allow,[_.AddToLocalCache]:K.restrict,[_.Share]:K.allow,[_.Unshare]:K.allow,[_.Edit]:K.allow,[_.Suggest]:K.allow,[_.Favourite]:K.allow,[_.WorkspaceAdd]:K.allow,[_.ResolveWarning]:K.allow,[_.DismissWarning]:K.allow,[_.EditAssoc]:K.allow,[_.Follow]:K.allow,[_.Print]:K.allow,[_.Copy]:K.allow,[_.Activate]:K.allow,[_.VerifyEmail]:K.allow,[_.ChangePassword]:K.allow,[_.Export]:K.allow,[_.SendEmail]:K.allow,[_.Publish]:K.allow,[_.Submit]:K.allow,[_.Complete]:K.allow,[_.Archive]:K.allow,[_.Promote]:K.allow,[_.Demote]:K.allow,[_.BulkAction]:K.allow,[_.Remove]:K.allow,[_.Dismiss]:K.allow,[_.Open]:K.allow,[_.Hide]:K.allow,[_.PageView]:K.allow,[_.Select]:K.allow,[_.SwitchCustomer]:K.allow,[_.Focus]:K.allow,[_.Blur]:K.allow,[_.Hover]:K.allow,[_.Unhover]:K.allow},E_={[_.Search]:S_.passthrough,[_.InstantSearch]:S_.passthrough,[_.Play]:S_.passthrough,[_.Stream]:S_.passthrough,[_.StreamProgress]:S_.passthrough,[_.PreviewStreamProgress]:S_.passthrough,[_.StreamBuffering]:S_.passthrough,[_.Click]:S_.passthrough,[_.Filter]:S_.passthrough,[_.Sort]:S_.passthrough,[_.SetAccess]:S_.passthrough,[_.Approve]:S_.passthrough,[_.Reject]:S_.passthrough,[_.Create]:S_.passthrough,[_.Delete]:S_.passthrough,[_.Rename]:S_.passthrough,[_.Move]:S_.passthrough,[_.Edit]:S_.passthrough,[_.Share]:C_.getShareData,[_.Disable]:S_.passthrough,[_.Suggest]:S_.passthrough,[_.Upload]:w_.getUploadData,[_.ResolveWarning]:S_.passthrough,[_.DismissWarning]:S_.passthrough,[_.Follow]:S_.passthrough,[_.Print]:S_.passthrough,[_.Copy]:S_.passthrough},D_={[_.Search]:()=>`search`,[_.InstantSearch]:()=>`search`,[_.Filter]:()=>`filter`,[_.Stream]:()=>v.Video},O_={user:`target_user`,product:`target_product`},k_={[_.StreamProgress]:!0,[_.WebPlayerStream]:!0,[_.PreviewStreamProgress]:!0,[_.StreamBuffering]:!0},A_={shouldLog(e){return!!T_[e.type](e)},formatData(e){let t=E_[e.type],n=i_.isFunction(t)?t(e.data,e):e.data;if(k_[e.type])return n;let r=e.actionContext.entity;return i_.isFunction(D_[e.type])&&(r=D_[e.type](e)),O_[r]&&(r=O_[r]),{[r]:n}}},j_=1e3*60*60*8,M_=class{constructor(e){this.options=e,this.initialize()}logStream(){let e=`v:${this.options.videoId}`,t=this.getPlayerMetrics();g.cacheExists(e)||(this.collectionApiClient.log({type:_.WebPlayerStream,actionContext:this.getActionContext(),data:{...this.getAnalyticsData(),player:t},eventVersion:O.V3}),g&&g.cacheSet(e,null,300))}logVideoProgress(e,t,n){let r=this.getAnalyticsData(),i=this.getPlayerMetrics(),a=n?_.PreviewStreamProgress:_.StreamProgress,o=e.map(e=>({type:a,actionContext:this.getActionContext(),data:{...r,player:i,progress:e},eventVersion:O.V2}));for(let e of t)o.push({type:_.StreamBuffering,actionContext:this.getActionContext(),data:{...r,player:i,buffering:e},eventVersion:O.V2});this.collectionApiClient.log(o)}logUserAction(e,t){let n={...this.getAnalyticsData(),...e},r={...this.getActionContext(),...t};this.collectionApiClient.log({type:t.actionType,data:n,actionContext:r,eventVersion:t.eventVersion||O.V2})}getAnalyticsData(){let e={video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache,isQualityUserPreference:Jh.isQualityUserPreference()},...this.options.additionalAnalyticsData||{}};this.options.shareId&&(e.video.shareId=this.options.shareId);let t=this.getEntityType();return t===v.Interactive?e.interactive={id:+this.options.mediaId}:t===v.Clip&&(e.clip={id:+this.options.mediaId}),e}initialize(){this.setupCollectionApiClient(),r_.lockWindowSession(this.options.userId,j_),this.options.player.one(`dispose`,()=>r_.unlockWindowSession(this.options.userId))}setupCollectionApiClient(){this.collectionApiClient=new y_({productName:`player.web`,productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:()=>this.getCurrentUser(),shouldLog:A_.shouldLog,formatData:A_.formatData})}async getCurrentUser(){return{id:this.options.userId,customerId:this.options.customerId,sessionId:this.options.authSessionId}}getActionContext(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?E.Embedded:void 0,workflowPhase:void 0}}getEntityType(){switch(this.options.mediaType){case`MasterVideo`:return v.Video;case`MasterInteractive`:return v.Interactive;case`MasterClip`:return v.Clip}}getLocationContext(){switch(this.options.playerType){case`player`:return A.Player;case`interactive-player`:return A.InteractivePlayer;case`create-clip-player`:return A.CreateClipPlayer}}getPlayerMetrics(){let e=this.options.player,t=e.qualityLevels?.();return{mode:Jh.getPlayerMode(e),width:e.currentWidth(),height:e.currentHeight(),quality:t?.[t?.selectedIndex]?.id}}},N_=class extends Error{constructor(e,t){super(t?.title||`Ajax error`),this.url=e,this.response=t}},P_=new class{constructor(){this.tokens={gateway:null}}async get(e,t){return await this.parseResponse(await fetch(e,{method:`GET`,mode:`cors`,headers:this.getHeaders(t)}))}async delete(e,t){await fetch(e,{method:`DELETE`,headers:this.getHeaders(t)})}async post(e,t,n,r=!0){let i=await fetch(e,{method:`POST`,headers:this.getHeaders(n),body:t,mode:`cors`});if(r)return await this.parseResponse(i)}async put(e,t,n,r=!0){let i=await fetch(e,{method:`PUT`,headers:this.getHeaders(n),body:t,mode:`cors`});if(r)return await this.parseResponse(i)}setToken(e,t){this.tokens[e]=t}hasToken(e){return!!this.tokens[e]}getHeaders(e={}){let t={"Content-Type":`application/json`};return this.tokens[e.tokenName]&&(t.authorization=`Bearer ${this.tokens[e.tokenName]}`),t}async parseResponse(e){if(e.status===404)return null;if(!e.ok){let t;try{t=await e.json()}catch{throw new N_(e.url)}finally{throw new N_(e.url,t)}}return await e.json()}},q=r(t(((e,t)=>{function n(e){if(e&&typeof e==`object`){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if(typeof e==`number`)return o[e];var n=String(e),a=r[n.toLowerCase()];if(a)return a;var a=i[n.toLowerCase()];if(a)return a;if(n.length===1)return n.charCodeAt(0)}n.isEventKey=function(e,t){if(e&&typeof e==`object`){var n=e.which||e.keyCode||e.charCode;if(n==null)return!1;if(typeof t==`string`){var a=r[t.toLowerCase()];if(a)return a===n;var a=i[t.toLowerCase()];if(a)return a===n}else if(typeof t==`number`)return t===n;return!1}},e=t.exports=n;var r=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(a=97;a<123;a++)r[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)r[a-48]=a;for(a=1;a<13;a++)r[`f`+a]=a+111;for(a=0;a<10;a++)r[`numpad `+a]=a+96;var o=e.names=e.title={};for(a in r)o[r[a]]=a;for(var s in i)r[s]=i[s]}))());function F_(e){document[e.fsApi_.fullscreenEnabled]&&(e.isFullscreen()?e.exitFullscreen():e.requestFullscreen())}function I_(e){let t=e.theatreModePlugin().getTheatreMode();e.theatreModePlugin().toggleTheatreMode(!t,{shouldLog:!0})}function L_(e){let t=e.volume(),n=e.lastVolume_();if(t===0){let t=n<.1?.1:n;e.volume(t),e.muted(!1)}else e.muted(!e.muted())}function R_(e){e.paused()?e.play():e.pause()}function z_(e,t){e.currentTime(e.currentTime()+t)}function B_(e,t){t>0&&e.muted()&&e.muted(!1),e.volume(e.volume()+t)}function V_(e){let t=e.target;return t.tagName.toLowerCase()===`video`||!![`video-js`,`vjs-tech`].find(e=>t.classList.contains(e))}var H_={f:F_,m:L_,k:R_,space:R_,t:I_,left:e=>z_(e,-5),right:e=>z_(e,5),j:e=>z_(e,-10),l:e=>z_(e,10),up:e=>B_(e,.05),down:e=>B_(e,-.05)};function U_(e,t,n){if(e.ctrlKey||e.metaKey||e.altKey)return;let r=(0,q.default)(e),i=[`up`,`down`].includes(r);if(i&&!e.shiftKey||!i&&e.shiftKey||r===`t`&&!n.allowTheatreMode||r===`f`&&!n.allowFullscreen||!H_[r])return;H_[r](t,e);let a=V_(e),o=[`space`].includes(r);(a||o)&&(e.preventDefault(),e.stopPropagation())}var W_=function(e){return e.PhysicallyChapteredVideo=`physically-chaptered-video`,e}({}),G_={name:`@clickview/player`,version:`1.53.0`,description:`ClickView Player`,main:`dist/player-app.js`,type:`module`,scripts:{"type-check":`tsc --noEmit`,"build-app":`node ../../../node_modules/vite/bin/vite.js build --config vite.config.app.ts`,"build-styles":`node ../../../node_modules/vite/bin/vite.js build --config vite.config.styles.ts`,build:`npm run type-check && npm run build-player && npm run build-interactive-player`,"build-player":`node ../../../node_modules/vite/bin/vite.js build --config vite.player.config.ts`,"build-interactive-player":`node ../../../node_modules/vite/bin/vite.js build --config vite.interactive-player.config.ts`,"build-font":`cross-env NODE_ENV=development npm run start`,test:`jest`,"test-watch":`jest --watch`,"test-harness":`npm run build && node ../../../node_modules/vite/bin/vite.js --config vite.test-harness.config.ts`},repository:{type:`git`,url:`https://gitlab.cvinternal.net/front-end/clickview`},author:`Matt Trengrove, Cameron Hill, Shale Kuzmanovski`,license:`ISC`,devDependencies:{"@clickview/player-font":`0.0.17`,"@types/chromecast-caf-sender":`1.0.3`,"@types/cropperjs":`1.3.0`,"@types/draft-js":`0.10.44`,"@types/node-polyglot":`0.4.34`,"@types/react-draft-wysiwyg":`1.13.1`,"@types/signalr-no-jquery":`0.1.3`,"@types/simplebar":`5.1.1`,"@types/video.js":`7.3.58`,jest:`29.6.4`,"ts-jest":`29.1.1`,"vite-plugin-mkcert":`1.17.12`},dependencies:{"@microsoft/signalr":`5.0.2`,"@types/react-canvas-draw":`1.2.1`,cropperjs:`1.5.6`,"draft-convert":`2.1.10`,"draft-js":`0.11.7`,keycode:`2.2.0`,"node-polyglot":`2.3.0`,"react-canvas-draw":`1.2.1`,"react-draft-wysiwyg":`1.15.0`,"react-textarea-autosize":`8.3.2`,"signalr-no-jquery":`0.2.0`,simplebar:`5.3.0`,"simplebar-react":`2.3.0`,"video.js":`8.20.0`,"videojs-contrib-quality-levels":`2.0.9`}},K_=t(((e,t)=>{t.exports=n;function n(e,t){var n,r=null;try{n=JSON.parse(e,t)}catch(e){r=e}return[r,n]}})),q_=t(((e,t)=>{var n=De(),r=function(e,t){return t===void 0&&(t=!1),function(r,a,o){if(r){e(r);return}if(a.statusCode>=400&&a.statusCode<=599){var s=o;if(t)if(n.TextDecoder){var c=i(a.headers&&a.headers[`content-type`]);try{s=new TextDecoder(c).decode(o)}catch{}}else s=String.fromCharCode.apply(null,new Uint8Array(o));e({cause:s});return}e(null,o)}};function i(e){return e===void 0&&(e=``),e.toLowerCase().split(`;`).reduce(function(e,t){var n=t.split(`=`),r=n[0],i=n[1];return r.trim()===`charset`?i.trim():e},`utf-8`)}t.exports=r})),J_=t(((e,t)=>{var n=De(),r=f(),i=Ae();l.httpHandler=q_();var a=function(e){var t={};return e&&e.trim().split(`
232
+ `,Gh=class extends Hh{constructor(e,t){super(e,t)}createEl(){let e=Uh.prototype.createEl.call(this,`button`,{className:this.buildCSSClass()},{type:`button`,title:this.controlText_});return e.innerHTML=Wh,this.createControlTextEl(e),e}handleClick(e){e.stopPropagation(),e.preventDefault(),this.options_?.onClick&&this.options_.onClick()}buildCSSClass(){return`cv-remove-video-button`}};W.registerComponent(`removeVideoButton`,Gh),Gh.prototype.controlText_=`Remove from watch history`;var Kh=`cvplayer-playback-quality:v2`,qh=`cvplayer-localcache-playback-quality:v2`,Jh=class{static isQualityUserPreference(){let e=localStorage.getItem(Kh),t=localStorage.getItem(qh);return!!(e||t)}static getPlayerMode(e){let t=e.isFullscreen?.()??!1,n=e.usingPlugin?.(`playerModePlugin`)?e.playerModePlugin()?.isHovering?.()??!1:!1,r=e.usingPlugin?.(`theatreModePlugin`)?e.theatreModePlugin()?.getTheatreMode?.()??!1:!1;return t?`fullscreen`:n?`hover`:r?`theatre`:`default`}static findQualityLevel(e,t){for(let n=0;n<e.length;n++)if(e[n].quality<=t)return e[n];let n=e[e.length-1];if(!n)throw Error(`No quality levels available`);return n}static enableQualityLevel(e,t){for(let n=0;n<e.length;n++){let r=e[n];r.enabled=r.id===t}}},Yh=function(e){return e.Default=`play`,e.Hover=`hover`,e}({}),Xh=W.getPlugin(`plugin`),Zh=`cv-preview-mode`,Qh=`cv-force-16-9`,$h=class extends Xh{constructor(e,t){super(e),this.hasSeeked=!1,this.buttonAdded=!1,this.mode=null,this.defaultDisplayMode=`normal`,this.onQualityReady=null,t?.defaultDisplayMode&&(this.defaultDisplayMode=t.defaultDisplayMode),t?.startTime&&(this.startTime=t.startTime),this.onSeek=this.onSeek.bind(this),this.player.one(`seeking`,this.onSeek)}onSeek(){this.hasSeeked=!0}dispose(){this.cleanupQualityListener(),this.player.off(`seeking`,this.onSeek),super.dispose()}getMode(){return this.mode}isHovering(){return this.mode===`hover`}setPlayerMode(e,t,n){this.player.trigger(`flushprogress`);let r=this.mode;if(this.mode=e,e===`hover`){this.buttonAdded||this.addButtons(t,n),this.player.addClass(Zh),this.applyAspectRatioFix(),this.enableSubtitles(),this.mute(),this.setLowQuality(),this.removeActivityTimeout(),this.player.trigger(`resize`);return}r===`hover`&&(this.applyDefaultModeLayout(),this.player.removeClass(Zh),this.player.removeClass(Qh),this.disableSubtitles(),this.unmute(),this.cleanupQualityListener(),this.restorePreviousQuality(),this.restoreActivityTimeout(),this.player.trigger(`resize`),this.hasSeeked||=(this.player.currentTime(this.startTime??0),!1))}applyDefaultModeLayout(){let e=this.player.usingPlugin?.(`theatreModePlugin`);this.defaultDisplayMode===`theatre`?(e&&this.player.theatreModePlugin()?.toggleTheatreMode(!0),this.player.fill(!0)):(e&&this.player.theatreModePlugin()?.toggleTheatreMode(!1),this.player.fluid(!0))}applyAspectRatioFix(){let e=()=>{let e=this.player.videoWidth(),t=this.player.videoHeight();if(e>0&&t>0){let n=e/t;Math.abs(n-16/9)<.01||this.player.addClass(Qh)}};this.player.readyState()>=1?e():this.player.one(`loadedmetadata`,e)}addButtons(e,t){let n=new zh(this.player),r=new Vh(this.player,{onClickHandler:e}),i=new Gh(this.player,{onClick:t});t&&c.isFunction(t)&&this.player.addChild(i),this.player.addChild(n),this.player.addChild(r),this.buttonAdded=!0}enableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().previewModeSubtitles())}disableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().applyUserPreferences())}mute(){this.player.ready(()=>{this.player.persistVolumePlugin().disable(),this.player.muted(!0)})}unmute(){this.player.ready(()=>{this.player.persistVolumePlugin().applyUserPreferences(),this.player.persistVolumePlugin().enable()})}setLowQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().disable();let e=this.player.qualityLevels();if(e.length>0){this.switchToLowestQuality(e);return}this.cleanupQualityListener(),this.onQualityReady=()=>{this.onQualityReady=null,this.switchToLowestQuality(e)},e.one(`change`,this.onQualityReady)})}cleanupQualityListener(){this.onQualityReady&&=(this.player.qualityLevels().off(`change`,this.onQualityReady),null)}switchToLowestQuality(e){let t=e[e.length-1];t&&Jh.enableQualityLevel(e,t.id)}restorePreviousQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().applyUserPreferences(),this.player.persistQualitySettingsPlugin().enable()})}removeActivityTimeout(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}restoreActivityTimeout(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}};W.registerPlugin(`playerModePlugin`,$h);var eg=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;function tg(e,t,n,r){let i,a,o,s=t||[0],c=(n||=0)>>>3,l=r===-1?3:0;for(i=0;i<e.length;i+=1)o=i+c,a=o>>>2,s.length<=a&&s.push(0),s[a]|=e[i]<<8*(l+o%4*r);return{value:s,binLen:8*e.length+n}}function ng(e,t,n){switch(t){case`UTF8`:case`UTF16BE`:case`UTF16LE`:break;default:throw Error(`encoding must be UTF8, UTF16BE, or UTF16LE`)}switch(e){case`HEX`:return function(e,t,r){return function(e,t,n,r){let i,a,o,s;if(e.length%2!=0)throw Error(`String of HEX type must be in byte increments`);let c=t||[0],l=(n||=0)>>>3,u=r===-1?3:0;for(i=0;i<e.length;i+=2){if(a=parseInt(e.substr(i,2),16),isNaN(a))throw Error(`String of HEX type contains invalid characters`);for(s=(i>>>1)+l,o=s>>>2;c.length<=o;)c.push(0);c[o]|=a<<8*(u+s%4*r)}return{value:c,binLen:4*e.length+n}}(e,t,r,n)};case`TEXT`:return function(e,r,i){return function(e,t,n,r,i){let a,o,s,c,l,u,d,f,p=0,m=n||[0],h=(r||=0)>>>3;if(t===`UTF8`)for(d=i===-1?3:0,s=0;s<e.length;s+=1)for(a=e.charCodeAt(s),o=[],128>a?o.push(a):2048>a?(o.push(192|a>>>6),o.push(128|63&a)):55296>a||57344<=a?o.push(224|a>>>12,128|a>>>6&63,128|63&a):(s+=1,a=65536+((1023&a)<<10|1023&e.charCodeAt(s)),o.push(240|a>>>18,128|a>>>12&63,128|a>>>6&63,128|63&a)),c=0;c<o.length;c+=1){for(u=p+h,l=u>>>2;m.length<=l;)m.push(0);m[l]|=o[c]<<8*(d+u%4*i),p+=1}else for(d=i===-1?2:0,f=t===`UTF16LE`&&i!==1||t!==`UTF16LE`&&i===1,s=0;s<e.length;s+=1){for(a=e.charCodeAt(s),!0===f&&(c=255&a,a=c<<8|a>>>8),u=p+h,l=u>>>2;m.length<=l;)m.push(0);m[l]|=a<<8*(d+u%4*i),p+=2}return{value:m,binLen:8*p+r}}(e,t,r,i,n)};case`B64`:return function(e,t,r){return function(e,t,n,r){let i,a,o,s,c,l,u,d=0,f=t||[0],p=(n||=0)>>>3,m=r===-1?3:0,h=e.indexOf(`=`);if(e.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw Error(`Invalid character in base-64 string`);if(e=e.replace(/=/g,``),h!==-1&&h<e.length)throw Error(`Invalid '=' found in base-64 string`);for(a=0;a<e.length;a+=4){for(c=e.substr(a,4),s=0,o=0;o<c.length;o+=1)i=eg.indexOf(c.charAt(o)),s|=i<<18-6*o;for(o=0;o<c.length-1;o+=1){for(u=d+p,l=u>>>2;f.length<=l;)f.push(0);f[l]|=(s>>>16-8*o&255)<<8*(m+u%4*r),d+=1}}return{value:f,binLen:8*d+n}}(e,t,r,n)};case`BYTES`:return function(e,t,r){return function(e,t,n,r){let i,a,o,s,c=t||[0],l=(n||=0)>>>3,u=r===-1?3:0;for(a=0;a<e.length;a+=1)i=e.charCodeAt(a),s=a+l,o=s>>>2,c.length<=o&&c.push(0),c[o]|=i<<8*(u+s%4*r);return{value:c,binLen:8*e.length+n}}(e,t,r,n)};case`ARRAYBUFFER`:return function(e,t,r){return function(e,t,n,r){return tg(new Uint8Array(e),t,n,r)}(e,t,r,n)};case`UINT8ARRAY`:return function(e,t,r){return tg(e,t,r,n)};default:throw Error(`format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY`)}}function rg(e,t,n,r){switch(e){case`HEX`:return function(e){return function(e,t,n,r){let i=`0123456789abcdef`,a,o,s=``,c=t/8,l=n===-1?3:0;for(a=0;a<c;a+=1)o=e[a>>>2]>>>8*(l+a%4*n),s+=i.charAt(o>>>4&15)+i.charAt(15&o);return r.outputUpper?s.toUpperCase():s}(e,t,n,r)};case`B64`:return function(e){return function(e,t,n,r){let i,a,o,s,c,l=``,u=t/8,d=n===-1?3:0;for(i=0;i<u;i+=3)for(s=i+1<u?e[i+1>>>2]:0,c=i+2<u?e[i+2>>>2]:0,o=(e[i>>>2]>>>8*(d+i%4*n)&255)<<16|(s>>>8*(d+n*((i+1)%4))&255)<<8|c>>>8*(d+n*((i+2)%4))&255,a=0;a<4;a+=1)l+=8*i+6*a<=t?eg.charAt(o>>>6*(3-a)&63):r.b64Pad;return l}(e,t,n,r)};case`BYTES`:return function(e){return function(e,t,n){let r,i,a=``,o=t/8,s=n===-1?3:0;for(r=0;r<o;r+=1)i=e[r>>>2]>>>8*(s+r%4*n)&255,a+=String.fromCharCode(i);return a}(e,t,n)};case`ARRAYBUFFER`:return function(e){return function(e,t,n){let r,i=t/8,a=new ArrayBuffer(i),o=new Uint8Array(a),s=n===-1?3:0;for(r=0;r<i;r+=1)o[r]=e[r>>>2]>>>8*(s+r%4*n)&255;return a}(e,t,n)};case`UINT8ARRAY`:return function(e){return function(e,t,n){let r,i=t/8,a=n===-1?3:0,o=new Uint8Array(i);for(r=0;r<i;r+=1)o[r]=e[r>>>2]>>>8*(a+r%4*n)&255;return o}(e,t,n)};default:throw Error(`format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY`)}}function ig(e){let t={outputUpper:!1,b64Pad:`=`,outputLen:-1},n=e||{},r=`Output length must be a multiple of 8`;if(t.outputUpper=n.outputUpper||!1,n.b64Pad&&(t.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw Error(r);t.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw Error(r);t.outputLen=n.shakeLen}if(typeof t.outputUpper!=`boolean`)throw Error(`Invalid outputUpper formatting option`);if(typeof t.b64Pad!=`string`)throw Error(`Invalid b64Pad formatting option`);return t}var ag=class{constructor(e,t,n){let r=n||{};if(this.t=t,this.i=r.encoding||`UTF8`,this.numRounds=r.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw Error(`numRounds must a integer >= 1`);this.o=e,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.U=[],this.R=[]}update(e){let t,n=0,r=this.T>>>5,i=this.F(e,this.h,this.u),a=i.binLen,o=i.value,s=a>>>5;for(t=0;t<s;t+=r)n+this.T<=a&&(this.m=this.g(o.slice(t,t+r),this.m),n+=this.T);return this.A+=n,this.h=o.slice(n>>>5),this.u=a%this.T,this.l=!0,this}getHash(e,t){let n,r,i=this.B,a=ig(t);if(this.v){if(a.outputLen===-1)throw Error(`Output length must be specified in options`);i=a.outputLen}let o=rg(e,i,this.H,a);if(this.p&&this.C)return o(this.C(a));for(r=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),i),n=1;n<this.numRounds;n+=1)this.v&&i%32!=0&&(r[r.length-1]&=16777215>>>24-i%32),r=this.Y(r,i,0,this.L(this.o),i);return o(r)}setHMACKey(e,t,n){if(!this.M)throw Error(`Variant does not support HMAC`);if(this.l)throw Error(`Cannot set MAC key after calling update`);let r=ng(t,(n||{}).encoding||`UTF8`,this.H);this.N(r(e))}N(e){let t=this.T>>>3,n=t/4-1,r;if(this.numRounds!==1)throw Error(`Cannot set numRounds with MAC`);if(this.p)throw Error(`MAC key already set`);for(t<e.binLen/8&&(e.value=this.Y(e.value,e.binLen,0,this.L(this.o),this.B));e.value.length<=n;)e.value.push(0);for(r=0;r<=n;r+=1)this.U[r]=909522486^e.value[r],this.R[r]=1549556828^e.value[r];this.m=this.g(this.U,this.m),this.A=this.T,this.p=!0}getHMAC(e,t){let n=ig(t);return rg(e,this.B,this.H,n)(this.S())}S(){let e;if(!this.p)throw Error(`Cannot call getHMAC without first setting MAC key`);let t=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),this.B);return e=this.g(this.R,this.L(this.o)),e=this.Y(t,this.B,this.T,e,this.B),e}};function og(e,t){return e<<t|e>>>32-t}function sg(e,t,n){return e^t^n}function cg(e,t,n){return e&t^e&n^t&n}function lg(e,t){let n=(65535&e)+(65535&t);return(65535&(e>>>16)+(t>>>16)+(n>>>16))<<16|65535&n}function ug(e,t,n,r,i){let a=(65535&e)+(65535&t)+(65535&n)+(65535&r)+(65535&i);return(65535&(e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(i>>>16)+(a>>>16))<<16|65535&a}function dg(e){return[1732584193,4023233417,2562383102,271733878,3285377520]}function fg(e,t){let n,r,i,a,o,s,c,l=[];for(n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],c=0;c<80;c+=1)l[c]=c<16?e[c]:og(l[c-3]^l[c-8]^l[c-14]^l[c-16],1),s=c<20?ug(og(n,5),(u=r)&i^~u&a,o,1518500249,l[c]):c<40?ug(og(n,5),sg(r,i,a),o,1859775393,l[c]):c<60?ug(og(n,5),cg(r,i,a),o,2400959708,l[c]):ug(og(n,5),sg(r,i,a),o,3395469782,l[c]),o=a,a=i,i=og(r,30),r=n,n=s;var u;return t[0]=lg(n,t[0]),t[1]=lg(r,t[1]),t[2]=lg(i,t[2]),t[3]=lg(a,t[3]),t[4]=lg(o,t[4]),t}function pg(e,t,n,r){let i,a=15+(t+65>>>9<<4),o=t+n;for(;e.length<=a;)e.push(0);for(e[t>>>5]|=128<<24-t%32,e[a]=4294967295&o,e[a-1]=o/4294967296|0,i=0;i<e.length;i+=16)r=fg(e.slice(i,i+16),r);return r}var mg=class extends ag{constructor(e,t,n){if(e!==`SHA-1`)throw Error(`Chosen SHA variant is not supported`);super(e,t,n);let r=n||{};this.M=!0,this.C=this.S,this.H=-1,this.F=ng(this.t,this.i,this.H),this.g=fg,this.I=function(e){return e.slice()},this.L=dg,this.Y=pg,this.m=[1732584193,4023233417,2562383102,271733878,3285377520],this.T=512,this.B=160,this.v=!1,r.hmacKey&&this.N(function(e,t,n,r){let i=e+` must include a value and format`;if(!t){if(!r)throw Error(i);return r}if(t.value===void 0||!t.format)throw Error(i);return ng(t.format,t.encoding||`UTF8`,n)(t.value)}(`hmacKey`,r.hmacKey,this.H))}},hg=function(e){return e.CvApSoutheast1=`cv-ap-southeast-1`,e.CvApSoutheast2=`cv-ap-southeast-2`,e.CvEuWest1=`cv-eu-west-1`,e.CvNaWest1=`cv-na-west-1`,e}({}),gg={CvApSoutheast1:{systemName:hg.CvApSoutheast1},CvApSoutheast2:{systemName:hg.CvApSoutheast2},CvEuWest1:{systemName:hg.CvEuWest1},CvNaWest1:{systemName:hg.CvNaWest1}},_g=`r`,vg=`cv:r`,yg=`cv:r:e`,bg=`referrer`,xg=`cv:originalReferrer`,Sg=28800,Cg=[`internalReferrer`],wg={getDecodedAttributionData(){let e=g.cacheGet(vg);return e&&Object.keys(e).length>0?e:Tg()?.decoded},getEncodedAttributionData(){let e=g.cacheGet(yg);return e?.length?e:Tg().encoded},getProfileId(){return wg.getDecodedAttributionData()?.profileId??null},setAttributionData(e){e&&jg(Ag(e),e)},decodeRValue(e){if(e)try{let t=atob(e),n=JSON.parse(t);if(!Dg(n))throw Error(`Decoded R value is invalid: ${JSON.stringify(n)}`);return n}catch(e){let t=e instanceof Error?e.message:e?.toString();console.error(t)}}};function Tg(){let e=g.cacheGet(vg),t=g.cacheGet(yg);return Dg(e)?{encoded:t,decoded:e}:Eg()}function Eg(){g.cacheRemove(vg),g.cacheRemove(yg);let e=kg(),t=wg.decodeRValue(e);if(t)return jg(e,t),{decoded:t,encoded:e};let n={internalReferrer:window.location.origin+window.location.pathname,originalReferrer:Og()},r=Ag(n);return jg(r,n),{decoded:n,encoded:r}}function Dg(e){return!e||typeof e!=`object`||Object.keys(e).length<Cg.length?!1:Cg.every(t=>typeof e[t]==`string`)}function Og(){let e=g.cacheGet(xg);if(e&&typeof e==`string`)return e;let t=document.referrer??``;if(window.URLSearchParams){let e=new URLSearchParams(window.location.search),n=e.has(bg)&&e.get(bg);e.has(bg)&&e.get(bg)&&(t=n)}return t&&g.cacheSet(xg,t,Sg),t}function kg(){if(!window.URLSearchParams)return;let e=new URLSearchParams(window.location.search);if(e.has(_g))return e.get(_g)}function Ag(e){if(Dg(e))try{return btoa(JSON.stringify(e))}catch{console.error(`R value could not be encoded: ${JSON.stringify(e)}`)}}function jg(e,t){try{g.cacheSet(vg,t,Sg),g.cacheSet(yg,e,Sg)}catch{console.error(`Could not store attribution data in session storage`)}}var Mg=3,Ng=5e3,Pg=6,Fg={},Ig=class{constructor(e){this.key=e.toString()}getCount(){return Fg[this.key]||0}increment(){Fg[this.key]=this.getCount()+1}reset(){delete Fg[this.key]}shouldBreak(){return this.getCount()>=Pg}},Lg=class{constructor(){this.attempt=0}async wait(){await new Promise(e=>setTimeout(e,Ng*2**this.attempt)),this.attempt++}};async function Rg(e,t){let n=new Lg,r=new Ig(e);async function i(){let n=await fetch(e,t);if(n.status>=500&&!r.shouldBreak())throw Error(`Server error: ${n.status}`);return n.ok&&r.reset(),n}for(let e=1;e<=Mg;e++)try{return await i()}catch(t){if(e>=Mg||r.shouldBreak())throw t;r.increment(),await n.wait()}}var zg=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Bg(e){return typeof e==`string`&&zg.test(e)}function Vg(e){if(!Bg(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}var Hg=`cv:session:`,Ug=`cv:window:v2:`,Wg=1e3*60*30,Gg=4;function Kg(e){if(e===p.LocalStorage)return g.isAvailable()?g:m;if(e===p.SessionStorage)return h.isAvailable()?h:m}function qg(e){return new Date().getTime()+e}function Jg(){return be()}function Yg(e,t){return e+(t||`0`)}function Xg(e){return new Date().getTime()>e}function Zg(e){return!(typeof e!=`object`||typeof e?.id!=`string`||!Bg(e.id)||Vg(e.id)!==Gg||typeof e?.ttl!=`number`||e?.ttl<=0||isNaN(e?.ttl))}function Qg(e,t,n){let r=Kg(n),i=Yg(e,t),a=r.get(i);return!Zg(a)||Xg(a?.ttl)?null:a}function $g(e,t,n,r){let i=Kg(n),a=Yg(e,t),o={id:Jg(),ttl:qg(r)};return i.set(a,o),o}function e_(e,t,n,r,i){let a=Kg(n),o=Yg(e,t);a.set(o,{id:r.id,ttl:qg(i)})}function t_(e,t,n){let r=Kg(n);if(!r?.isAvailable())return;let i=Yg(e,t);r.remove(i)}var n_=null,r_={getClientSessionData(e){let t=Qg(Hg,e,p.LocalStorage);t?e_(Hg,e,p.LocalStorage,t,Wg):t=$g(Hg,e,p.LocalStorage,Wg);let n=Qg(Ug,e,p.SessionStorage);return n?n_===null&&e_(Ug,e,p.SessionStorage,n,Wg):n=$g(Ug,e,p.SessionStorage,n_??Wg),{id:t.id,windowId:n.id}},resetClientSession(e){t_(Hg,e,p.LocalStorage),t_(Ug,e,p.SessionStorage)},lockWindowSession(e,t){n_=t;let n=Qg(Ug,e,p.SessionStorage);n&&e_(Ug,e,p.SessionStorage,n,t)},unlockWindowSession(e){n_=null;let t=Qg(Ug,e,p.SessionStorage);t&&e_(Ug,e,p.SessionStorage,t,Wg)}},i_={isObject(e){let t=typeof e;return t===`function`||t===`object`&&!!e},isFunction(e){return typeof e==`function`}},G={mobileDevice:/Mobi/i,iphone:/iphone/i,ipad:/ipad/i,android:/android/i,blackberry:/blackberry/i,windowsPhone:/windows phone/i,iosVersion:/OS\s+([\d_.-:]+)\s/i,androidVersion:/android\s+([\d_.-\/]+)[\s;:,\)]/i,blackberryVersion:/(blackberry|version)\s?\d*\/([\d.]+)/i,windowsPhoneVersion:/windows\sphone.*?([\d_.-\/]+)[\s;:,\)]/i,mac:/Mac/i,unix:/X11/i,linux:/Linux/i,windows:/Win/i,win2000:/nt 5.0/i,winXP:/nt 5.1/i,winVista:/nt 6.0/i,win7:/nt 6.1/i,win8:/nt 6.2/i,win81:/nt 6.3/i,win10:/nt 10.0/i,osxVersion:/OS\sX\s([\d_.]+)/i,chrome:/^(?!.*Edge).*Chrome/i,safari:/^(?!.*(?:Chrome|Edge)).*Safari/i,edge:/edge/i,ie:/(msie|trident)/i,opera:/(opr|opera)/i,firefox:/firefox/i,generalVersion:/(chrome|firefox|version)\/(\d+.*?)(\s|$)/i,operaVersion:/(opr|opera)\/(\d+).*?(\s|$)/i,ieVersion:/MSIE\s+(\d+).*?/i,edgeVersion:/(edge)\/(\d+).*?(\s|$)/i},a_=`Unknown`;function o_(e,t,n){let[r]=t.exec(n)||[];return r||=a_,{name:e,version:r}}function s_(e,t,n){if(!t)return{name:e,version:a_};let r=t.exec(n);return{name:e,version:r&&r.length?r[0].trim():a_}}function c_(e,t){let n={name:e,version:null};return G.win2000.test(t)&&(n.version=`2000`),G.winXP.test(t)&&(n.version=`XP`),G.winVista.test(t)&&(n.version=`Vista`),G.win7.test(t)&&(n.version=`7`),G.win8.test(t)&&(n.version=`8`),G.win81.test(t)&&(n.version=`8.1`),G.win10.test(t)&&(n.version=`10`),n.version||=a_,n}var l_={getDeviceType(){let e=window.navigator.userAgent;return G.mobileDevice.test(e)?G.iphone.test(e)?`iPhone`:G.ipad.test(e)?`iPad`:G.android.test(e)?`Android`:G.blackberry.test(e)?`Blackberry`:G.windowsPhone.test(e)?`Windows Phone`:a_:`Desktop`},getOperatingSystem(){let e=window.navigator.userAgent;return G.android.test(e)?s_(`Android`,G.androidVersion,e):G.iphone.test(e)||G.ipad.test(e)?s_(`iOS`,G.iosVersion,e):G.linux.test(e)?s_(`Linux`,null,e):G.unix.test(e)?s_(`Unix`,null,e):G.mac.test(e)?s_(`Macintosh`,G.osxVersion,e):G.windows.test(e)?c_(`Windows`,e):G.blackberry.test(e)?s_(`BlackBerry`,G.blackberryVersion,e):G.windowsPhone.test(e)?s_(`Windows Phone`,G.windowsPhoneVersion,e):{name:a_,version:a_}},getBrowser(){let e=window.navigator.userAgent;return G.chrome.test(e)?o_(`Chrome`,G.generalVersion,e):G.firefox.test(e)?o_(`Firefox`,G.generalVersion,e):G.safari.test(e)?o_(`Safari`,G.generalVersion,e):G.ie.test(e)?o_(`Internet Explorer`,G.ieVersion,e):G.edge.test(e)?o_(`Edge`,G.edgeVersion,e):G.opera.test(e)?o_(`Opera`,G.operaVersion,e):{name:a_,version:a_}},isTouchScreen(){return!!(`ontouchstart`in window||navigator.maxTouchPoints)}},u_=28800,d_=`cv:utmparams`,f_=[[`source`,`utm_source`],[`medium`,`utm_medium`],[`campaign`,`utm_campaign`],[`term`,`utm_term`],[`content`,`utm_content`]],p_=f_.reduce((e,[t])=>({...e,[t]:t}),{}),m_={getUtmParameters(){if(!window.URLSearchParams)return null;let e=new URLSearchParams(window.location.search),t={};return f_.forEach(([n,r])=>{e.has(r)&&(t[n]=e.get(r))}),h_(t)},setUtmParameters(e){if(!e)return;let t={};return Object.keys(e).forEach(n=>{p_[n]&&(t[n]=e[n])}),h_(t)},getURLSearchParams(){if(!window.URLSearchParams)return null;let e=new URLSearchParams,t=m_.getUtmParameters();return t?(f_.forEach(([n,r])=>{t[n]&&e.set(r,t[n])}),e):null}};function h_(e){if(Object.keys(e).length)return g.cacheSet(d_,e,u_),e;let t=g.cacheGet(d_);return t&&typeof t==`object`&&Object.keys(t).length?t:null}var g_={name:`@clickview/analytics`,version:`2.3.0`,description:`Analytics`,main:`dist/app.js`,types:`dist/analytics/src/app.d.ts`,type:`module`,private:!0,repository:{type:`git`,url:`https://gitlab.cvinternal.net/front-end/clickview`},scripts:{start:`npm run build`,"type-check":`tsc --noEmit`,build:`npm run type-check && node ../../../node_modules/vite/bin/vite.js build`,prebuild:`npm run clean`,clean:`npx rimraf dist`},author:``,license:`ISC`,devDependencies:{"tsc-alias":`1.8.16`},dependencies:{jssha:`3.3.1`,uuid:`11.1.1`}},__=`zXJL9nOHxzDlMUDjiP41`,v_=`unknown`,y_=class{constructor(e){this.options=e,this.initialize()}initialize(){this.validateOptions(),this.options.logUtmParameters&&(this.utmParameters=m_.getUtmParameters()),this.options.logAttributionData&&(this.attributionData=wg.getDecodedAttributionData())}get name(){return`CollectionApiClient`}async log(e){if(Array.isArray(e))return this.logBulk(e);this.shouldLog(e)&&(this.validateEvent(e),await this.postData(await this.formatData(e)))}async logBulk(e){let t=e.filter(e=>this.shouldLog(e));if(!t.length)return;t.forEach(e=>this.validateEvent(e));let n=await Promise.all(t.map(e=>this.formatData(e)));await this.postData(n)}validateOptions(){if(!i_.isFunction(this.options.getUser))throw Error(`getUser option is required.`)}shouldLog(e){return!i_.isFunction(this.options.shouldLog)||this.options.shouldLog(e)}async postData(e){let t=await this.getRegionalUrl(this.options.collectionApiUrls),n=JSON.stringify(e),r={"Content-Type":`application/json`,...this.getSignatureHeader(n)},i=xe.safeUrlConcat(t,`/v1/ingest`);Array.isArray(e)&&(i=xe.safeUrlConcat(i,`/bulk`));try{let e=await Rg(i,{method:`POST`,mode:`cors`,headers:r,body:n});e.ok||this.logError(Error(`CollectionApiClient failed to log event. Status: ${e.status} ${e.statusText}`),!1,this.getResponseAsObject(e))}catch(e){this.logError(e)}}getResponseAsObject(e){return{headers:e.headers,ok:e.ok,redirected:e.redirected,status:e.status,statusText:e.statusText,type:e.type,url:e.url,body:e.text()}}getSignatureHeader(e){let t=new mg(`SHA-1`,`TEXT`,{hmacKey:{value:__,format:`TEXT`,encoding:`UTF8`}});return t.update(e),{"cv-analytics-signature":`${this.options.collectionApiClientId}.${t.getHash(`B64`)}`}}async getRegionalUrl(e){switch((await this.getRegion()).systemName){case hg.CvEuWest1:return e.cvEuWest1;case hg.CvApSoutheast2:return e.cvApSoutheast2;case hg.CvNaWest1:return e.cvNaWest1;case hg.CvApSoutheast1:default:return e.cvApSoutheast1}}validateEvent(e){typeof e.type!=`string`&&this.logError(Error(`Event type is required.`),!0),i_.isObject(e.actionContext)||this.logError(Error(`Event actionContext is required.`),!0),e.actionContext.entity||this.logError(Error(`Event actionContext entity is required.`),!0)}async formatData(e){return{type:e.type,data:await this.getEventData(e),metadata:this.getEventMetadata(e)}}async getEventData(e){let t=e.actionContext,n=this.getPlatformMetadata(),r=await this.getUserData(),i=await this.getSessionData(),a={name:this.options.productName,version:this.options.productVersion};this.options.productVariant&&(a.variant=this.options.productVariant);let o={user:r,action:t,platform:n,product:a,session:i};this.utmParameters&&(o.utm=this.utmParameters);let s=this.extractData(e),c=Object.keys(o).map(e=>e.toLowerCase()),l=Object.keys(s).map(e=>e.toLowerCase());return c.forEach(e=>{l.includes(e)&&this.logError(Error(`${e} is a reserved key.`),!0)}),{...o,...s}}extractData(e){return i_.isFunction(this.options.formatData)?this.options.formatData(e):{[e.actionContext.entity]:e.data}}async getUserData(){let e;try{e=await this.options.getProfileId?.()}catch(e){this.logError(e)}try{let t=await this.options.getUser();return t?.id?{id:t.id,role:t.role?.toLowerCase()||v_,userGroup:(t.userGroup??we.Unknown).toLowerCase(),yearGroup:this.normalizeYearGroup(t.yearGroup),profileId:e,customer:{id:t.customerId,name:t.customerName,customerGuid:t.customerGuid,crmId:t.crmId,country:t.countryCode,region:await this.getRegion(),openCustomer:!1,accessPolicy:t.accessPolicy}}:e?{profileId:e}:void 0}catch(e){this.logError(e)}}async getRegion(){let e=this.options.regionName;try{let t=await this.options.getUser();t?.instanceRegion&&(e=t.instanceRegion)}catch(e){this.logError(e)}return e||this.logError(Error(`RegionName is not set.`),!0),this.getRegionByName(e.toLowerCase())}async getSessionData(){try{let e=await this.options.getUser();return{...r_.getClientSessionData(e?.id),authSessionId:e?.sessionId}}catch(e){return console.error(e),r_.getClientSessionData(null)}}getPlatformMetadata(){let e={url:window.location.href,referrer:document.referrer};return this.attributionData?.internalReferrer&&(e.internalReferrer=this.attributionData.internalReferrer),this.attributionData?.originalReferrer&&(e.originalReferrer=this.attributionData.originalReferrer),{browser:l_.getBrowser(),os:l_.getOperatingSystem(),request:e,screenResolution:`${window.screen.width}x${window.screen.height}`,viewportResolution:`${window.innerWidth}x${window.innerHeight}`}}getEventMetadata(e){return{client:{name:`${this.name}.ts`,version:g_.version,region:this.getRegionByName(this.options.regionName)},timestamp:new Date().toISOString(),eventVersion:e.eventVersion}}getRegionByName(e){let t;return Object.values(gg).forEach(n=>{n.systemName===e&&(t=n)}),t}normalizeYearGroup(e){return e?e.toLowerCase().split(` `).join(`_`):v_}logError(e,t,...n){if(this.options.logError&&this.options.logError(e,...n),t)throw e}};function b_(e){return!i_.isObject(e)||!i_.isObject(e.actionContext)?{}:{entity:e.actionContext.entity,location:e.actionContext.location,descriptor:e.actionContext.descriptor}}function x_(e){let t={},n=(e,t)=>{switch(t){case`description`:return T.ValueUpdated;case`channel`:case`rating`:case`series`:case`distributor`:case`producer`:return e&&e.id||T.EntityRemoved;default:return e}};return Object.keys(e).forEach(r=>{t[r]=n(e[r],r)}),t}var S_={passthrough(e){return e},getEditData(e,t){let{entity:n,location:r}=b_(t);return n===v.Video&&r===A.EditVideoDetails?x_(e):e}},K={allow:()=>!0,restrict:()=>!1},C_={getShareData(e){let{id:t,search:n,pagePositionIndex:r,shareId:i,shareType:a}=e,o={id:t,search:n,pagePositionIndex:r,shareId:i,shareType:a};return e.video?.id&&(o.video={id:e.video.id}),e.clip?.id&&(o.clip={id:e.clip.id},e.clip.video?.id&&(o.video={id:e.clip.video?.id})),e.shareCount!==void 0&&(o.shareCount=e.shareCount),e.embedDetails&&(o.embedDetails=e.embedDetails),o}},w_={getUploadData(e,t){let{entity:n}=t.actionContext;if(n===v.Video)return w_.formatVideoUpload(e,t);if(n===v.Resource||n===v.Subtitle)return w_.formatResourceUpload(e);if(n===v.Banner||n===v.Thumbnail||n===v.MixedMedia)return e;throw Error(`Upload data event not correctly formatted.`)},formatVideoUpload(e,t){let{workflowPhase:n}=t.actionContext;if(n===y.Start)return w_.getStartVideoUploadData(e);if(n===y.Discard)return w_.getDiscardVideoUploadData(e);if(n===y.Complete)return w_.getCompleteUploadData(e)},getStartVideoUploadData(e){return!e||!e.length?[]:(e instanceof FileList&&(e=Array.from(e)),e.map(t=>({fileName:t.name,size:t.size,type:t.type,count:e.length})))},getDiscardVideoUploadData(e){let t=t=>{let{type:n,name:r,status:i,cvUpload:a}=t.file,o={fileName:r,count:Array.isArray(e)?e.length:1,type:n,status:i};return t.progress&&(o.progress=t.progress.toFixed(2)),a&&(o.uploadId=a.uploadId),o};return Array.isArray(e)?e.map(e=>t(e)):[t(e)]},getCompleteUploadData(e){return!e||!e.length?[]:e.map(t=>{let{fileName:n,libraryId:r,folderId:i,autoCaption:a}=t;return{fileName:n,libraryId:r,folderId:i,autoCaption:a,count:e.length}})},formatResourceUpload(e){let{id:t,name:n}=e,r={id:t,name:n};return i_.isObject(e.metadata)&&(r.type=e.metadata.type),r}},T_={[_.Navigate]:K.restrict,[_.Click]:K.allow,[_.Search]:K.allow,[_.InstantSearch]:K.allow,[_.Play]:K.allow,[_.Stream]:K.allow,[_.WebPlayerStream]:K.allow,[_.StreamProgress]:K.allow,[_.PreviewStreamProgress]:K.allow,[_.StreamBuffering]:K.allow,[_.Rename]:K.allow,[_.Move]:K.allow,[_.Create]:K.allow,[_.Delete]:K.allow,[_.Associate]:K.allow,[_.Dissociate]:K.allow,[_.Filter]:K.allow,[_.Sort]:K.allow,[_.Approve]:K.allow,[_.Reject]:K.allow,[_.Disable]:K.allow,[_.Upload]:K.allow,[_.Download]:K.allow,[_.SetAccess]:K.allow,[_.AddToLocalCache]:K.restrict,[_.Share]:K.allow,[_.Unshare]:K.allow,[_.Edit]:K.allow,[_.Suggest]:K.allow,[_.Favourite]:K.allow,[_.WorkspaceAdd]:K.allow,[_.ResolveWarning]:K.allow,[_.DismissWarning]:K.allow,[_.EditAssoc]:K.allow,[_.Follow]:K.allow,[_.Print]:K.allow,[_.Copy]:K.allow,[_.Activate]:K.allow,[_.VerifyEmail]:K.allow,[_.ChangePassword]:K.allow,[_.Export]:K.allow,[_.SendEmail]:K.allow,[_.Publish]:K.allow,[_.Submit]:K.allow,[_.Complete]:K.allow,[_.Archive]:K.allow,[_.Promote]:K.allow,[_.Demote]:K.allow,[_.BulkAction]:K.allow,[_.Remove]:K.allow,[_.Dismiss]:K.allow,[_.Open]:K.allow,[_.Hide]:K.allow,[_.PageView]:K.allow,[_.Select]:K.allow,[_.SwitchCustomer]:K.allow,[_.Focus]:K.allow,[_.Blur]:K.allow,[_.Hover]:K.allow,[_.Unhover]:K.allow},E_={[_.Search]:S_.passthrough,[_.InstantSearch]:S_.passthrough,[_.Play]:S_.passthrough,[_.Stream]:S_.passthrough,[_.StreamProgress]:S_.passthrough,[_.PreviewStreamProgress]:S_.passthrough,[_.StreamBuffering]:S_.passthrough,[_.Click]:S_.passthrough,[_.Filter]:S_.passthrough,[_.Sort]:S_.passthrough,[_.SetAccess]:S_.passthrough,[_.Approve]:S_.passthrough,[_.Reject]:S_.passthrough,[_.Create]:S_.passthrough,[_.Delete]:S_.passthrough,[_.Rename]:S_.passthrough,[_.Move]:S_.passthrough,[_.Edit]:S_.passthrough,[_.Share]:C_.getShareData,[_.Disable]:S_.passthrough,[_.Suggest]:S_.passthrough,[_.Upload]:w_.getUploadData,[_.ResolveWarning]:S_.passthrough,[_.DismissWarning]:S_.passthrough,[_.Follow]:S_.passthrough,[_.Print]:S_.passthrough,[_.Copy]:S_.passthrough},D_={[_.Search]:()=>`search`,[_.InstantSearch]:()=>`search`,[_.Filter]:()=>`filter`,[_.Stream]:()=>v.Video},O_={user:`target_user`,product:`target_product`},k_={[_.StreamProgress]:!0,[_.WebPlayerStream]:!0,[_.PreviewStreamProgress]:!0,[_.StreamBuffering]:!0},A_={shouldLog(e){return!!T_[e.type](e)},formatData(e){let t=E_[e.type],n=i_.isFunction(t)?t(e.data,e):e.data;if(k_[e.type])return n;let r=e.actionContext.entity;return i_.isFunction(D_[e.type])&&(r=D_[e.type](e)),O_[r]&&(r=O_[r]),{[r]:n}}},j_=1e3*60*60*8,M_=class{constructor(e){this.options=e,this.initialize()}logStream(){let e=`v:${this.options.videoId}`,t=this.getPlayerMetrics();g.cacheExists(e)||(this.collectionApiClient.log({type:_.WebPlayerStream,actionContext:this.getActionContext(),data:{...this.getAnalyticsData(),player:t},eventVersion:O.V3}),g&&g.cacheSet(e,null,300))}logVideoProgress(e,t,n){let r=this.getAnalyticsData(),i=this.getPlayerMetrics(),a=n?_.PreviewStreamProgress:_.StreamProgress,o=e.map(e=>({type:a,actionContext:this.getActionContext(),data:{...r,player:i,progress:e},eventVersion:O.V2}));for(let e of t)o.push({type:_.StreamBuffering,actionContext:this.getActionContext(),data:{...r,player:i,buffering:e},eventVersion:O.V2});this.collectionApiClient.log(o)}logUserAction(e,t){let n={...this.getAnalyticsData(),...e},r={...this.getActionContext(),...t};this.collectionApiClient.log({type:t.actionType,data:n,actionContext:r,eventVersion:t.eventVersion||O.V2})}getAnalyticsData(){let e={video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache,isQualityUserPreference:Jh.isQualityUserPreference()},...this.options.additionalAnalyticsData||{}};this.options.shareId&&(e.video.shareId=this.options.shareId);let t=this.getEntityType();return t===v.Interactive?e.interactive={id:+this.options.mediaId}:t===v.Clip&&(e.clip={id:+this.options.mediaId}),e}initialize(){this.setupCollectionApiClient(),r_.lockWindowSession(this.options.userId,j_),this.options.player.one(`dispose`,()=>r_.unlockWindowSession(this.options.userId))}setupCollectionApiClient(){this.collectionApiClient=new y_({productName:`player.web`,productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:()=>this.getCurrentUser(),shouldLog:A_.shouldLog,formatData:A_.formatData})}async getCurrentUser(){return{id:this.options.userId,customerId:this.options.customerId,sessionId:this.options.authSessionId}}getActionContext(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?E.Embedded:void 0,workflowPhase:void 0}}getEntityType(){switch(this.options.mediaType){case`MasterVideo`:return v.Video;case`MasterInteractive`:return v.Interactive;case`MasterClip`:return v.Clip}}getLocationContext(){switch(this.options.playerType){case`player`:return A.Player;case`interactive-player`:return A.InteractivePlayer;case`create-clip-player`:return A.CreateClipPlayer}}getPlayerMetrics(){let e=this.options.player,t=e.qualityLevels?.();return{mode:Jh.getPlayerMode(e),width:e.currentWidth(),height:e.currentHeight(),quality:t?.[t?.selectedIndex]?.id}}},N_=class extends Error{constructor(e,t){super(t?.title||`Ajax error`),this.url=e,this.response=t}},P_=new class{constructor(){this.tokens={gateway:null}}async get(e,t){return await this.parseResponse(await fetch(e,{method:`GET`,mode:`cors`,headers:this.getHeaders(t)}))}async delete(e,t){await fetch(e,{method:`DELETE`,headers:this.getHeaders(t)})}async post(e,t,n,r=!0){let i=await fetch(e,{method:`POST`,headers:this.getHeaders(n),body:t,mode:`cors`});if(r)return await this.parseResponse(i)}async put(e,t,n,r=!0){let i=await fetch(e,{method:`PUT`,headers:this.getHeaders(n),body:t,mode:`cors`});if(r)return await this.parseResponse(i)}setToken(e,t){this.tokens[e]=t}hasToken(e){return!!this.tokens[e]}getHeaders(e={}){let t={"Content-Type":`application/json`};return this.tokens[e.tokenName]&&(t.authorization=`Bearer ${this.tokens[e.tokenName]}`),t}async parseResponse(e){if(e.status===404)return null;if(!e.ok){let t;try{t=await e.json()}catch{throw new N_(e.url)}finally{throw new N_(e.url,t)}}return await e.json()}},q=r(t(((e,t)=>{function n(e){if(e&&typeof e==`object`){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if(typeof e==`number`)return o[e];var n=String(e),a=r[n.toLowerCase()];if(a)return a;var a=i[n.toLowerCase()];if(a)return a;if(n.length===1)return n.charCodeAt(0)}n.isEventKey=function(e,t){if(e&&typeof e==`object`){var n=e.which||e.keyCode||e.charCode;if(n==null)return!1;if(typeof t==`string`){var a=r[t.toLowerCase()];if(a)return a===n;var a=i[t.toLowerCase()];if(a)return a===n}else if(typeof t==`number`)return t===n;return!1}},e=t.exports=n;var r=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(a=97;a<123;a++)r[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)r[a-48]=a;for(a=1;a<13;a++)r[`f`+a]=a+111;for(a=0;a<10;a++)r[`numpad `+a]=a+96;var o=e.names=e.title={};for(a in r)o[r[a]]=a;for(var s in i)r[s]=i[s]}))());function F_(e){document[e.fsApi_.fullscreenEnabled]&&(e.isFullscreen()?e.exitFullscreen():e.requestFullscreen())}function I_(e){let t=e.theatreModePlugin().getTheatreMode();e.theatreModePlugin().toggleTheatreMode(!t,{shouldLog:!0})}function L_(e){let t=e.volume(),n=e.lastVolume_();if(t===0){let t=n<.1?.1:n;e.volume(t),e.muted(!1)}else e.muted(!e.muted())}function R_(e){e.paused()?e.play():e.pause()}function z_(e,t){e.currentTime(e.currentTime()+t)}function B_(e,t){t>0&&e.muted()&&e.muted(!1),e.volume(e.volume()+t)}function V_(e){let t=e.target;return t.tagName.toLowerCase()===`video`||!![`video-js`,`vjs-tech`].find(e=>t.classList.contains(e))}var H_={f:F_,m:L_,k:R_,space:R_,t:I_,left:e=>z_(e,-5),right:e=>z_(e,5),j:e=>z_(e,-10),l:e=>z_(e,10),up:e=>B_(e,.05),down:e=>B_(e,-.05)};function U_(e,t,n){if(e.ctrlKey||e.metaKey||e.altKey)return;let r=(0,q.default)(e),i=[`up`,`down`].includes(r);if(i&&!e.shiftKey||!i&&e.shiftKey||r===`t`&&!n.allowTheatreMode||r===`f`&&!n.allowFullscreen||!H_[r])return;H_[r](t,e);let a=V_(e),o=[`space`].includes(r);(a||o)&&(e.preventDefault(),e.stopPropagation())}var W_=function(e){return e.PhysicallyChapteredVideo=`physically-chaptered-video`,e}({}),G_={name:`@clickview/player`,version:`1.54.0-rc.0`,description:`ClickView Player`,main:`dist/player-app.js`,type:`module`,scripts:{"type-check":`tsc --noEmit`,"build-app":`node ../../../node_modules/vite/bin/vite.js build --config vite.config.app.ts`,"build-styles":`node ../../../node_modules/vite/bin/vite.js build --config vite.config.styles.ts`,build:`npm run type-check && npm run build-player && npm run build-interactive-player`,"build-player":`node ../../../node_modules/vite/bin/vite.js build --config vite.player.config.ts`,"build-interactive-player":`node ../../../node_modules/vite/bin/vite.js build --config vite.interactive-player.config.ts`,"build-font":`cross-env NODE_ENV=development npm run start`,test:`jest`,"test-watch":`jest --watch`,"test-harness":`npm run build && node ../../../node_modules/vite/bin/vite.js --config vite.test-harness.config.ts`},repository:{type:`git`,url:`https://gitlab.cvinternal.net/front-end/clickview`},author:`Matt Trengrove, Cameron Hill, Shale Kuzmanovski`,license:`ISC`,devDependencies:{"@clickview/player-font":`0.0.17`,"@types/chromecast-caf-sender":`1.0.3`,"@types/cropperjs":`1.3.0`,"@types/draft-js":`0.10.44`,"@types/node-polyglot":`0.4.34`,"@types/react-draft-wysiwyg":`1.13.1`,"@types/signalr-no-jquery":`0.1.3`,"@types/simplebar":`5.1.1`,"@types/video.js":`7.3.58`,jest:`29.6.4`,"ts-jest":`29.1.1`,"vite-plugin-mkcert":`1.17.12`},dependencies:{"@microsoft/signalr":`5.0.2`,"@types/react-canvas-draw":`1.2.1`,cropperjs:`1.5.6`,"draft-convert":`2.1.10`,"draft-js":`0.11.7`,keycode:`2.2.0`,"node-polyglot":`2.3.0`,"react-canvas-draw":`1.2.1`,"react-draft-wysiwyg":`1.15.0`,"react-textarea-autosize":`8.3.2`,"signalr-no-jquery":`0.2.0`,simplebar:`5.3.0`,"simplebar-react":`2.3.0`,"video.js":`8.20.0`,"videojs-contrib-quality-levels":`2.0.9`}},K_=t(((e,t)=>{t.exports=n;function n(e,t){var n,r=null;try{n=JSON.parse(e,t)}catch(e){r=e}return[r,n]}})),q_=t(((e,t)=>{var n=De(),r=function(e,t){return t===void 0&&(t=!1),function(r,a,o){if(r){e(r);return}if(a.statusCode>=400&&a.statusCode<=599){var s=o;if(t)if(n.TextDecoder){var c=i(a.headers&&a.headers[`content-type`]);try{s=new TextDecoder(c).decode(o)}catch{}}else s=String.fromCharCode.apply(null,new Uint8Array(o));e({cause:s});return}e(null,o)}};function i(e){return e===void 0&&(e=``),e.toLowerCase().split(`;`).reduce(function(e,t){var n=t.split(`=`),r=n[0],i=n[1];return r.trim()===`charset`?i.trim():e},`utf-8`)}t.exports=r})),J_=t(((e,t)=>{var n=De(),r=f(),i=Ae();l.httpHandler=q_();var a=function(e){var t={};return e&&e.trim().split(`
233
233
  `).forEach(function(e){var n=e.indexOf(`:`),r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}),t};t.exports=l,t.exports.default=l,l.XMLHttpRequest=n.XMLHttpRequest||p,l.XDomainRequest=`withCredentials`in new l.XMLHttpRequest?l.XMLHttpRequest:n.XDomainRequest,o([`get`,`put`,`post`,`patch`,`head`,`delete`],function(e){l[e===`delete`?`del`:e]=function(t,n,r){return n=c(t,n,r),n.method=e.toUpperCase(),u(n)}});function o(e,t){for(var n=0;n<e.length;n++)t(e[n])}function s(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function c(e,t,n){var a=e;return i(t)?(n=t,typeof e==`string`&&(a={uri:e})):a=r({},t,{uri:e}),a.callback=n,a}function l(e,t,n){return t=c(e,t,n),u(t)}function u(e){if(e.callback===void 0)throw Error(`callback argument missing`);var t=!1,n=function(n,r,i){t||(t=!0,e.callback(n,r,i))};function r(){u.readyState===4&&setTimeout(c,0)}function i(){var e=void 0;if(e=u.response?u.response:u.responseText||d(u),y)try{e=JSON.parse(e)}catch{}return e}function o(e){return clearTimeout(b),e instanceof Error||(e=Error(``+(e||`Unknown XMLHttpRequest Error`))),e.statusCode=0,n(e,x)}function c(){if(!p){var t;clearTimeout(b),t=e.useXDR&&u.status===void 0?200:u.status===1223?204:u.status;var r=x,o=null;return t===0?o=Error(`Internal XMLHttpRequest Error`):(r={body:i(),statusCode:t,method:h,headers:{},url:m,rawRequest:u},u.getAllResponseHeaders&&(r.headers=a(u.getAllResponseHeaders()))),n(o,r,r.body)}}var u=e.xhr||null;u||=e.cors||e.useXDR?new l.XDomainRequest:new l.XMLHttpRequest;var f,p,m=u.url=e.uri||e.url,h=u.method=e.method||`GET`,g=e.body||e.data,_=u.headers=e.headers||{},v=!!e.sync,y=!1,b,x={body:void 0,headers:{},statusCode:0,method:h,url:m,rawRequest:u};if(`json`in e&&e.json!==!1&&(y=!0,_.accept||_.Accept||(_.Accept=`application/json`),h!==`GET`&&h!==`HEAD`&&(_[`content-type`]||_[`Content-Type`]||(_[`Content-Type`]=`application/json`),g=JSON.stringify(e.json===!0?g:e.json))),u.onreadystatechange=r,u.onload=c,u.onerror=o,u.onprogress=function(){},u.onabort=function(){p=!0},u.ontimeout=o,u.open(h,m,!v,e.username,e.password),v||(u.withCredentials=!!e.withCredentials),!v&&e.timeout>0&&(b=setTimeout(function(){if(!p){p=!0,u.abort(`timeout`);var e=Error(`XMLHttpRequest timeout`);e.code=`ETIMEDOUT`,o(e)}},e.timeout)),u.setRequestHeader)for(f in _)_.hasOwnProperty(f)&&u.setRequestHeader(f,_[f]);else if(e.headers&&!s(e.headers))throw Error(`Headers cannot be set on an XDomainRequest object`);return`responseType`in e&&(u.responseType=e.responseType),`beforeSend`in e&&typeof e.beforeSend==`function`&&e.beforeSend(u),u.send(g||null),u}function d(e){try{if(e.responseType===`document`)return e.responseXML;var t=e.responseXML&&e.responseXML.documentElement.nodeName===`parsererror`;if(e.responseType===``&&!t)return e.responseXML}catch{}return null}function p(){}})),Y_=r(K_()),X_=r(J_());function Z_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Z_=function(){return!!e})()}function Q_(e,t,n){if(Z_())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&D(i,n.prototype),i}function $_(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&D(e,t)}var ev=r(t(((e,t)=>{(function(n){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,n){if(n||={},e=e.trim(),t=t.trim(),!t){if(!n.alwaysNormalize)return e;var r=s.parseURL(e);if(!r)throw Error(`Error trying to parse base URL.`);return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var a=s.parseURL(t);if(!a)throw Error(`Error trying to parse relative URL.`);if(a.scheme)return n.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw Error(`Error trying to parse base URL.`);if(!o.netLoc&&o.path&&o.path[0]!==`/`){var c=i.exec(o.path);o.netLoc=c[1],o.path=c[2]}o.netLoc&&!o.path&&(o.path=`/`);var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,a.path[0]!==`/`))if(!a.path)l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));else{var u=o.path,d=u.substring(0,u.lastIndexOf(`/`)+1)+a.path;l.path=s.normalizePath(d)}return l.path===null&&(l.path=n.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||``,netLoc:t[2]||``,path:t[3]||``,params:t[4]||``,query:t[5]||``,fragment:t[6]||``}:null},normalizePath:function(e){for(e=e.split(``).reverse().join(``).replace(a,``);e.length!==(e=e.replace(o,``)).length;);return e.split(``).reverse().join(``)},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};typeof e==`object`&&typeof t==`object`?t.exports=s:typeof define==`function`&&define.amd?define([],function(){return s}):typeof e==`object`?e.URLToolkit=s:n.URLToolkit=s})(e)}))()),tv=`http://example.com`,nv=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=P.default.location&&P.default.location.href||``);var n=typeof P.default.URL==`function`,r=/^\/\//.test(e),i=!P.default.location&&!/\/\//i.test(e);if(n?e=new P.default.URL(e,P.default.location||tv):/\/\//i.test(e)||(e=ev.default.buildAbsoluteURL(P.default.location&&P.default.location.href||``,e)),n){var a=new URL(t,e);return i?a.href.slice(tv.length):r?a.href.slice(a.protocol.length):a.href}return ev.default.buildAbsoluteURL(e,t)},rv=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(arguments.length===2)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,o=0;o<a;++o)t[o].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on(`data`,function(t){e.push(t)})},e}(),iv=function(e){return P.default.atob?P.default.atob(e):Buffer.from(e,`base64`).toString(`binary`)};function av(e){for(var t=iv(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var ov=function(e){w(t,e);function t(){var t=e.call(this)||this;return t.buffer=``,t}var n=t.prototype;return n.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf(`
234
234
  `);t>-1;t=this.buffer.indexOf(`
235
235
  `))this.trigger(`data`,this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(rv),sv=` `,cv=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||``),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},lv=function(){return RegExp(`(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))`)},uv=function(e){for(var t=e.split(lv()),n={},r=t.length,i;r--;)t[r]!==``&&(i=/([^=]*)=(.*)/.exec(t[r]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,``),i[1]=i[1].replace(/^\s+|\s+$/g,``),i[1]=i[1].replace(/^['"](.*)['"]$/g,`$1`),n[i[0]]=i[1]);return n},dv=function(e){w(t,e);function t(){var t=e.call(this)||this;return t.customParsers=[],t.tagMappers=[],t}var n=t.prototype;return n.push=function(e){var t=this,n,r;if(e=e.trim(),e.length!==0){if(e[0]!==`#`){this.trigger(`data`,{type:`uri`,uri:e});return}this.tagMappers.reduce(function(t,n){var r=n(e);return r===e?t:t.concat([r])},[e]).forEach(function(e){for(var i=0;i<t.customParsers.length;i++)if(t.customParsers[i].call(t,e))return;if(e.indexOf(`#EXT`)!==0){t.trigger(`data`,{type:`comment`,text:e.slice(1)});return}if(e=e.replace(`\r`,``),n=/^#EXTM3U/.exec(e),n){t.trigger(`data`,{type:`tag`,tagType:`m3u`});return}if(n=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`inf`},n[1]&&(r.duration=parseFloat(n[1])),n[2]&&(r.title=n[2]),t.trigger(`data`,r);return}if(n=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e),n){r={type:`tag`,tagType:`targetduration`},n[1]&&(r.duration=parseInt(n[1],10)),t.trigger(`data`,r);return}if(n=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e),n){r={type:`tag`,tagType:`version`},n[1]&&(r.version=parseInt(n[1],10)),t.trigger(`data`,r);return}if(n=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e),n){r={type:`tag`,tagType:`media-sequence`},n[1]&&(r.number=parseInt(n[1],10)),t.trigger(`data`,r);return}if(n=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e),n){r={type:`tag`,tagType:`discontinuity-sequence`},n[1]&&(r.number=parseInt(n[1],10)),t.trigger(`data`,r);return}if(n=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`playlist-type`},n[1]&&(r.playlistType=n[1]),t.trigger(`data`,r);return}if(n=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e),n){r=b(cv(n[1]),{type:`tag`,tagType:`byterange`}),t.trigger(`data`,r);return}if(n=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e),n){r={type:`tag`,tagType:`allow-cache`},n[1]&&(r.allowed=!/NO/.test(n[1])),t.trigger(`data`,r);return}if(n=/^#EXT-X-MAP:?(.*)$/.exec(e),n){if(r={type:`tag`,tagType:`map`},n[1]){var a=uv(n[1]);a.URI&&(r.uri=a.URI),a.BYTERANGE&&(r.byterange=cv(a.BYTERANGE))}t.trigger(`data`,r);return}if(n=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e),n){if(r={type:`tag`,tagType:`stream-inf`},n[1]){if(r.attributes=uv(n[1]),r.attributes.RESOLUTION){var o=r.attributes.RESOLUTION.split(`x`),s={};o[0]&&(s.width=parseInt(o[0],10)),o[1]&&(s.height=parseInt(o[1],10)),r.attributes.RESOLUTION=s}r.attributes.BANDWIDTH&&(r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)),r.attributes[`FRAME-RATE`]&&(r.attributes[`FRAME-RATE`]=parseFloat(r.attributes[`FRAME-RATE`])),r.attributes[`PROGRAM-ID`]&&(r.attributes[`PROGRAM-ID`]=parseInt(r.attributes[`PROGRAM-ID`],10))}t.trigger(`data`,r);return}if(n=/^#EXT-X-MEDIA:?(.*)$/.exec(e),n){r={type:`tag`,tagType:`media`},n[1]&&(r.attributes=uv(n[1])),t.trigger(`data`,r);return}if(n=/^#EXT-X-ENDLIST/.exec(e),n){t.trigger(`data`,{type:`tag`,tagType:`endlist`});return}if(n=/^#EXT-X-DISCONTINUITY/.exec(e),n){t.trigger(`data`,{type:`tag`,tagType:`discontinuity`});return}if(n=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e),n){r={type:`tag`,tagType:`program-date-time`},n[1]&&(r.dateTimeString=n[1],r.dateTimeObject=new Date(n[1])),t.trigger(`data`,r);return}if(n=/^#EXT-X-KEY:?(.*)$/.exec(e),n){r={type:`tag`,tagType:`key`},n[1]&&(r.attributes=uv(n[1]),r.attributes.IV&&(r.attributes.IV.substring(0,2).toLowerCase()===`0x`&&(r.attributes.IV=r.attributes.IV.substring(2)),r.attributes.IV=r.attributes.IV.match(/.{8}/g),r.attributes.IV[0]=parseInt(r.attributes.IV[0],16),r.attributes.IV[1]=parseInt(r.attributes.IV[1],16),r.attributes.IV[2]=parseInt(r.attributes.IV[2],16),r.attributes.IV[3]=parseInt(r.attributes.IV[3],16),r.attributes.IV=new Uint32Array(r.attributes.IV))),t.trigger(`data`,r);return}if(n=/^#EXT-X-START:?(.*)$/.exec(e),n){r={type:`tag`,tagType:`start`},n[1]&&(r.attributes=uv(n[1]),r.attributes[`TIME-OFFSET`]=parseFloat(r.attributes[`TIME-OFFSET`]),r.attributes.PRECISE=/YES/.test(r.attributes.PRECISE)),t.trigger(`data`,r);return}if(n=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`cue-out-cont`},n[1]?r.data=n[1]:r.data=``,t.trigger(`data`,r);return}if(n=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`cue-out`},n[1]?r.data=n[1]:r.data=``,t.trigger(`data`,r);return}if(n=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`cue-in`},n[1]?r.data=n[1]:r.data=``,t.trigger(`data`,r);return}if(n=/^#EXT-X-SKIP:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`skip`},r.attributes=uv(n[1]),r.attributes.hasOwnProperty(`SKIPPED-SEGMENTS`)&&(r.attributes[`SKIPPED-SEGMENTS`]=parseInt(r.attributes[`SKIPPED-SEGMENTS`],10)),r.attributes.hasOwnProperty(`RECENTLY-REMOVED-DATERANGES`)&&(r.attributes[`RECENTLY-REMOVED-DATERANGES`]=r.attributes[`RECENTLY-REMOVED-DATERANGES`].split(sv)),t.trigger(`data`,r);return}if(n=/^#EXT-X-PART:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`part`},r.attributes=uv(n[1]),[`DURATION`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseFloat(r.attributes[e]))}),[`INDEPENDENT`,`GAP`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=/YES/.test(r.attributes[e]))}),r.attributes.hasOwnProperty(`BYTERANGE`)&&(r.attributes.byterange=cv(r.attributes.BYTERANGE)),t.trigger(`data`,r);return}if(n=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`server-control`},r.attributes=uv(n[1]),[`CAN-SKIP-UNTIL`,`PART-HOLD-BACK`,`HOLD-BACK`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseFloat(r.attributes[e]))}),[`CAN-SKIP-DATERANGES`,`CAN-BLOCK-RELOAD`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=/YES/.test(r.attributes[e]))}),t.trigger(`data`,r);return}if(n=/^#EXT-X-PART-INF:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`part-inf`},r.attributes=uv(n[1]),[`PART-TARGET`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseFloat(r.attributes[e]))}),t.trigger(`data`,r);return}if(n=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`preload-hint`},r.attributes=uv(n[1]),[`BYTERANGE-START`,`BYTERANGE-LENGTH`].forEach(function(e){if(r.attributes.hasOwnProperty(e)){r.attributes[e]=parseInt(r.attributes[e],10);var t=e===`BYTERANGE-LENGTH`?`length`:`offset`;r.attributes.byterange=r.attributes.byterange||{},r.attributes.byterange[t]=r.attributes[e],delete r.attributes[e]}}),t.trigger(`data`,r);return}if(n=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`rendition-report`},r.attributes=uv(n[1]),[`LAST-MSN`,`LAST-PART`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseInt(r.attributes[e],10))}),t.trigger(`data`,r);return}t.trigger(`data`,{type:`tag`,data:e.slice(4)})})}},n.addParser=function(e){var t=this,n=e.expression,r=e.customType,i=e.dataParser,a=e.segment;typeof i!=`function`&&(i=function(e){return e}),this.customParsers.push(function(e){if(n.exec(e))return t.trigger(`data`,{type:`custom`,data:i(e),customType:r,segment:a}),!0})},n.addTagMapper=function(e){var t=e.expression,n=e.map;this.tagMappers.push(function(e){return t.test(e)?n(e):e})},t}(rv),fv=function(e){return e.toLowerCase().replace(/-(\w)/g,function(e){return e[1].toUpperCase()})},pv=function(e){var t={};return Object.keys(e).forEach(function(n){t[fv(n)]=e[n]}),t},mv=function(e){var t=e.serverControl,n=e.targetDuration,r=e.partTargetDuration;if(t){var i=`#EXT-X-SERVER-CONTROL`,a=`holdBack`,o=`partHoldBack`,s=n&&n*3,c=r&&r*2;n&&!t.hasOwnProperty(a)&&(t[a]=s,this.trigger(`info`,{message:i+` defaulting HOLD-BACK to targetDuration * 3 (`+s+`).`})),s&&t[a]<s&&(this.trigger(`warn`,{message:i+` clamping HOLD-BACK (`+t[a]+`) to targetDuration * 3 (`+s+`)`}),t[a]=s),r&&!t.hasOwnProperty(o)&&(t[o]=r*3,this.trigger(`info`,{message:i+` defaulting PART-HOLD-BACK to partTargetDuration * 3 (`+t[o]+`).`})),r&&t[o]<c&&(this.trigger(`warn`,{message:i+` clamping PART-HOLD-BACK (`+t[o]+`) to partTargetDuration * 2 (`+c+`).`}),t[o]=c)}},hv=function(e){w(t,e);function t(){var t=e.call(this)||this;t.lineStream=new ov,t.parseStream=new dv,t.lineStream.pipe(t.parseStream);var n=M(t),r=[],i={},a,o,s=!1,c=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},u=`urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed`,d=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var f=0,p=0;return t.on(`end`,function(){i.uri||!i.parts&&!i.preloadHints||(!i.map&&a&&(i.map=a),!i.key&&o&&(i.key=o),!i.timeline&&typeof d==`number`&&(i.timeline=d),t.manifest.preloadSegment=i)}),t.parseStream.on(`data`,function(e){var t,m;({tag:function(){({version:function(){e.version&&(this.manifest.version=e.version)},"allow-cache":function(){this.manifest.allowCache=e.allowed,`allowed`in e||(this.trigger(`info`,{message:`defaulting allowCache to YES`}),this.manifest.allowCache=!0)},byterange:function(){var t={};`length`in e&&(i.byterange=t,t.length=e.length,`offset`in e||(e.offset=f)),`offset`in e&&(i.byterange=t,t.offset=e.offset),f=t.offset+t.length},endlist:function(){this.manifest.endList=!0},inf:function(){`mediaSequence`in this.manifest||(this.manifest.mediaSequence=0,this.trigger(`info`,{message:`defaulting media sequence to zero`})),`discontinuitySequence`in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger(`info`,{message:`defaulting discontinuity sequence to zero`})),e.duration>0&&(i.duration=e.duration),e.duration===0&&(i.duration=.01,this.trigger(`info`,{message:`updating zero segment duration to a small value`})),this.manifest.segments=r},key:function(){if(!e.attributes){this.trigger(`warn`,{message:`ignoring key declaration without attribute list`});return}if(e.attributes.METHOD===`NONE`){o=null;return}if(!e.attributes.URI){this.trigger(`warn`,{message:`ignoring key declaration without URI`});return}if(e.attributes.KEYFORMAT===`com.apple.streamingkeydelivery`){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.apple.fps.1_0`]={attributes:e.attributes};return}if(e.attributes.KEYFORMAT===`com.microsoft.playready`){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.microsoft.playready`]={uri:e.attributes.URI};return}if(e.attributes.KEYFORMAT===u){if([`SAMPLE-AES`,`SAMPLE-AES-CTR`,`SAMPLE-AES-CENC`].indexOf(e.attributes.METHOD)===-1){this.trigger(`warn`,{message:`invalid key method provided for Widevine`});return}if(e.attributes.METHOD===`SAMPLE-AES-CENC`&&this.trigger(`warn`,{message:`SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead`}),e.attributes.URI.substring(0,23)!==`data:text/plain;base64,`){this.trigger(`warn`,{message:`invalid key URI provided for Widevine`});return}if(!(e.attributes.KEYID&&e.attributes.KEYID.substring(0,2)===`0x`)){this.trigger(`warn`,{message:`invalid key ID provided for Widevine`});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.widevine.alpha`]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:av(e.attributes.URI.split(`,`)[1])};return}e.attributes.METHOD||this.trigger(`warn`,{message:`defaulting key method to AES-128`}),o={method:e.attributes.METHOD||`AES-128`,uri:e.attributes.URI},e.attributes.IV!==void 0&&(o.iv=e.attributes.IV)},"media-sequence":function(){if(!isFinite(e.number)){this.trigger(`warn`,{message:`ignoring invalid media sequence: `+e.number});return}this.manifest.mediaSequence=e.number},"discontinuity-sequence":function(){if(!isFinite(e.number)){this.trigger(`warn`,{message:`ignoring invalid discontinuity sequence: `+e.number});return}this.manifest.discontinuitySequence=e.number,d=e.number},"playlist-type":function(){if(!/VOD|EVENT/.test(e.playlistType)){this.trigger(`warn`,{message:`ignoring unknown playlist type: `+e.playlist});return}this.manifest.playlistType=e.playlistType},map:function(){a={},e.uri&&(a.uri=e.uri),e.byterange&&(a.byterange=e.byterange),o&&(a.key=o)},"stream-inf":function(){if(this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||l,!e.attributes){this.trigger(`warn`,{message:`ignoring empty stream-inf attributes`});return}i.attributes||={},b(i.attributes,e.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(e.attributes&&e.attributes.TYPE&&e.attributes[`GROUP-ID`]&&e.attributes.NAME)){this.trigger(`warn`,{message:`ignoring incomplete or missing media group`});return}var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes[`GROUP-ID`]]=n[e.attributes[`GROUP-ID`]]||{},t=n[e.attributes[`GROUP-ID`]],m={default:/yes/i.test(e.attributes.DEFAULT)},m.default?m.autoselect=!0:m.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(m.language=e.attributes.LANGUAGE),e.attributes.URI&&(m.uri=e.attributes.URI),e.attributes[`INSTREAM-ID`]&&(m.instreamId=e.attributes[`INSTREAM-ID`]),e.attributes.CHARACTERISTICS&&(m.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(m.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=m},discontinuity:function(){d+=1,i.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),i.dateTimeString=e.dateTimeString,i.dateTimeObject=e.dateTimeObject},targetduration:function(){if(!isFinite(e.duration)||e.duration<0){this.trigger(`warn`,{message:`ignoring invalid target duration: `+e.duration});return}this.manifest.targetDuration=e.duration,mv.call(this,this.manifest)},start:function(){if(!e.attributes||isNaN(e.attributes[`TIME-OFFSET`])){this.trigger(`warn`,{message:`ignoring start declaration without appropriate attribute list`});return}this.manifest.start={timeOffset:e.attributes[`TIME-OFFSET`],precise:e.attributes.PRECISE}},"cue-out":function(){i.cueOut=e.data},"cue-out-cont":function(){i.cueOutCont=e.data},"cue-in":function(){i.cueIn=e.data},skip:function(){this.manifest.skip=pv(e.attributes),this.warnOnMissingAttributes_(`#EXT-X-SKIP`,e.attributes,[`SKIPPED-SEGMENTS`])},part:function(){var t=this;s=!0;var n=this.manifest.segments.length,r=pv(e.attributes);i.parts=i.parts||[],i.parts.push(r),r.byterange&&(r.byterange.hasOwnProperty(`offset`)||(r.byterange.offset=p),p=r.byterange.offset+r.byterange.length);var a=i.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #`+a+` for segment #`+n,e.attributes,[`URI`,`DURATION`]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(e,n){e.hasOwnProperty(`lastPart`)||t.trigger(`warn`,{message:`#EXT-X-RENDITION-REPORT #`+n+` lacks required attribute(s): LAST-PART`})})},"server-control":function(){var t=this.manifest.serverControl=pv(e.attributes);t.hasOwnProperty(`canBlockReload`)||(t.canBlockReload=!1,this.trigger(`info`,{message:`#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false`})),mv.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty(`canSkipUntil`)&&this.trigger(`warn`,{message:`#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set`})},"preload-hint":function(){var t=this.manifest.segments.length,n=pv(e.attributes),r=n.type&&n.type===`PART`;i.preloadHints=i.preloadHints||[],i.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty(`offset`)||(n.byterange.offset=r?p:0,r&&(p=n.byterange.offset+n.byterange.length)));var a=i.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #`+a+` for segment #`+t,e.attributes,[`TYPE`,`URI`]),n.type)for(var o=0;o<i.preloadHints.length-1;o++){var s=i.preloadHints[o];s.type&&s.type===n.type&&this.trigger(`warn`,{message:`#EXT-X-PRELOAD-HINT #`+a+` for segment #`+t+` has the same TYPE `+n.type+` as preload hint #`+o})}},"rendition-report":function(){var t=pv(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var n=this.manifest.renditionReports.length-1,r=[`LAST-MSN`,`URI`];s&&r.push(`LAST-PART`),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #`+n,e.attributes,r)},"part-inf":function(){this.manifest.partInf=pv(e.attributes),this.warnOnMissingAttributes_(`#EXT-X-PART-INF`,e.attributes,[`PART-TARGET`]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),mv.call(this,this.manifest)}}[e.tagType]||c).call(n)},uri:function(){i.uri=e.uri,r.push(i),this.manifest.targetDuration&&!(`duration`in i)&&(this.trigger(`warn`,{message:`defaulting segment duration to the target duration`}),i.duration=this.manifest.targetDuration),o&&(i.key=o),i.timeline=d,a&&(i.map=a),p=0,i={}},comment:function(){},custom:function(){e.segment?(i.custom=i.custom||{},i.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(n)}),t}var n=t.prototype;return n.warnOnMissingAttributes_=function(e,t,n){var r=[];n.forEach(function(e){t.hasOwnProperty(e)||r.push(e)}),r.length&&this.trigger(`warn`,{message:e+` lacks required attribute(s): `+r.join(`, `)})},n.push=function(e){this.lineStream.push(e)},n.end=function(){this.lineStream.push(`
@@ -302,4 +302,4 @@ browserWorkerPolyFill(self);
302
302
  <path d="M268.06 2.91764L254.192 14.8403L262.401 17.4661L258.324 27.0679L272.192 15.1453L263.983 12.5194L268.06 2.91764Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
303
303
  </svg>
304
304
  `})}};W.registerComponent(`ErrorDisplay`,kz);var Az=W.getComponent(`FullscreenToggle`),jz=`Fullscreen (f)`,Mz=class extends Az{handleFullscreenChange(){Az.prototype.handleFullscreenChange.call(this),this.controlText(jz)}};W.registerComponent(`FullscreenToggle`,Mz),Mz.prototype.controlText_=jz;var Nz=W.getComponent(`MuteToggle`),Pz=`Mute (m)`,Fz=`Unmute (m)`,Iz=class extends Nz{updateControlText_(){let e=this.player_.muted()||this.player_.volume()===0?Fz:Pz;this.controlText_!==e&&this.controlText(e)}};W.registerComponent(`MuteToggle`,Iz),Iz.prototype.controlText_=Pz;var Lz=W.getComponent(`Player`),Rz=e=>e.indexOf(`#`)===0?e.slice(1):e,zz=3,Bz,Vz=class e{static{this.options_={viewKey:null,controls:!0,playbackRates:[.25,.5,.75,1,1.25,1.5,1.75,2],playerApi:new URL(`http://localhost:52000`),enableLocalCache:!0,eventLogging:!0,allowFullscreen:!0}}constructor(t,n){if(this.streamLogged=!1,this.options=W.obj.merge({},e.options_,n),this.options.playerApi===null)throw Error(`PlayerApi required`);this.initialize(),this.createEl(t),this.buildVideoJs(),this.options.splash&&this.setupSplash(this.options.splash),this.bindEventListeners(),this.setupSeekBar(),this.fetchConfig(),this.logStream=this.logStream.bind(this),this.player.ready(()=>{this._configurePlugins(),this.options.setup&&this.options.setup(this.options,this.player),this.fetch().catch(e=>this.handleFetchError(e))})}initialize(){}_configurePlugins(){this.player.configureMenuDimensionsPlugin({mobile:this.options.mobile,overflowControls:this.options.overflowControls,seekBarName:this.getSeekBarName()}),this.player.progressReporterPlugin({onFlush:this.onFlushProgress=this.onFlushProgress.bind(this)}),this.player.persistVolumePlugin(),!this.options.mobile&&this.options.allowFullscreen&&this.player.fullscreenOnRotatePlugin(),this.player.touchControls(),this.player.playerModePlugin({defaultDisplayMode:this.options.nextDefaultDisplayMode,startTime:this.options.startTime}),this.options.getExternalLink&&this.player.openExternallyPlugin({getExternalLink:this.options.getExternalLink}),this.player.oldVersionRefreshPlugin?.(),this.configurePlugins()}configurePlugins(){}onFlushProgress(e,t){let n=this.player.playerModePlugin().isHovering();this.analyticsService?.logVideoProgress(e,t,n)}buildVideoJs(){return this.player=W(this.el,this.getPlayerOptions())}getInactivityTimeout(){if(typeof this.options.inactivityTimeout==`number`)return this.options.inactivityTimeout;let e=500;return(this.options.mobile||W.browser.IS_IOS||W.browser.IS_ANDROID)&&(e=3e3),e}getFluid(){return!(this.options.theatreMode||this.options.embed||this.options.mobile)}getFill(){return!!(this.options.theatreMode||this.options.embed||this.options.mobile)}getPlayerOptions(){let e=Lz.prototype.options_.children;return e=e.filter(e=>!(e===`bigPlayButton`||e===`posterImage`)),{controls:this.options.controls,fluid:this.getFluid(),fill:this.getFill(),inactivityTimeout:this.getInactivityTimeout(),controlBar:{children:[`timeWrapper`,`progressControl`]},children:[...e,{name:`collapserator`,children:Ih.filter(e=>!(e===`fullscreenToggle`&&!this.options.allowFullscreen||e===`playbackRateMenuButton`&&!this.options.playbackRates?.length))},`playPauseFeedback`,`controlBarGradient`],userActions:{hotkeys:e=>U_(e,this.player,this.options)},playbackRates:this.options.playbackRates,techOrder:[`html5`],html5:{nativeTextTracks:!1},playsinline:!0,aspectRatio:this.options.aspectRatio,mobile:this.options.mobile,allowTheatreMode:this.options.allowTheatreMode,deferMenus:this.options.deferMenus,muted:this.options.muted,devicesConfig:this.options.devicesConfig}}async getPlaybackObject(){if(this.options.offlinePlaybackObject)return this.options.offlinePlaybackObject;let e=this.options.fetch;if(this.options.fetch===void 0&&(e=e=>{let t=`${this.options.playerApi.origin}/api/playback?viewKey=${e}`;return P_.get(t)}),!this.options.viewKey)throw Error(`Please specify a viewKey or a fetch function`);let t=await e(this.options.viewKey);if(!t)throw Error(`Error fetching playback object`);return t}setChaptersInternal(e,t){let n=hh.getTrack(this.player,`chapters`,null);n||=this.player.addTextTrack(`chapters`),[...n.cues.cues_].forEach(e=>n.removeCue(e)),e.forEach(e=>{n.addCue({startTime:e.timestamp,endTime:e.endTimestamp,text:e.name})}),t&&n.trigger({type:`cv:cuechange`,target:n}),n.trigger({type:`loadeddata`,target:n})}setChapters(e){this.setChaptersInternal(e,!0)}setPlayerMode(e,t,n){this.player.playerModePlugin().setPlayerMode(e,t,n)}getPlayerMode(){return this.player.playerModePlugin().getMode()}setFavourite(e,t){this.player.favouritePlugin().setFavourite(e,t)}async fetch(){let e=await this.getPlaybackObject();if(this.isDisposed())return;let t=e.mediaType===`MasterClip`,n=e.additionalData?.clipData;e.chapters?.list?.length>0&&!t&&!n&&this.setChaptersInternal(e.chapters.list,!1),this.player.localCache({localCacheAddresses:e.localCacheAddresses??[],enabled:this.options.enableLocalCache??!0}),this.player.progressiveFiles({sources:e.files.progressive.map(e=>({id:e.profile,mimeType:e.mimeType,url:e.url,quality:e.quality,label:e.label}))}),this.player.handleNetworkErrors({playerApi:this.options.playerApi,fileToken:e.files.fileToken}),e.subtitles.list.length>0&&e.subtitles.list.forEach(e=>{if(e.mimeType!==`text/vtt`)return;let t=this.player.addRemoteTextTrack({kind:`subtitles`,src:e.url,language:e.language,label:e.label},!0);if(hh.sanitizeTrack(t.track,this.player),this.options.allowTranscript){let t=this.player.addRemoteTextTrack({kind:`metadata`,src:e.url+(e.url.includes(`?`)?`&`:`?`)+`fullSentences=true`,language:e.language,label:`transcript`},!0);t.track.isClickViewProduced=e.isClickViewProduced,hh.sanitizeTrack(t.track,this.player)}}),e.posterUrl&&this.player.poster(de.createUrl(e.posterUrl,{size:ce.Large})),this.setupSplash({title:e.title,posterUrl:e.posterUrl,episodeNumber:e.episodeNumber,ratingCode:e.ratingCode,seasonNumber:e.seasonNumber,seriesName:e.seriesName}),this.additionalSetup(e),this.handleAutoplay(e),this.options.startTime&&(this.player.currentTime(this.options.startTime),this.player.one(`canplay`,()=>{this.player.currentTime(this.options.startTime)})),this.player.trigger(`cv-playback-data-loaded`,e)}handleFetchError(e){let t=e.message;e instanceof N_&&e.response?.type===W_.PhysicallyChapteredVideo&&(t=`Video cannot be played because it is either corrupt or damaged.`),this.player.error(t),this.options.onError&&this.options.onError(e)}async fetchConfig(){if(Bz||this.options.fetch||this.options.offlinePlaybackObject)return;let e=`${this.options.playerApi.origin}/api/config`;Bz=await P_.get(e),!this.isDisposed()&&this.trigger(`config:loaded`)}additionalSetup(e){this.player.whiteboardModePlugin(),this.player.deferMenusPlugin();let t=this.options.enableLocalCache&&!!e.localCacheAddresses?.length;Bz?this.setupAnalyticsService(e,t):this.one(`config:loaded`,()=>this.setupAnalyticsService(e,t)),this.analyticsService||!this.isAnalyticsEnabled()?this.setupAnalyticsDependentPlugins(e):this.one(`analytics:loaded`,()=>this.setupAnalyticsDependentPlugins(e))}setupAnalyticsService(e,t){this.options.eventLogging&&(this.analyticsService=new M_({player:this.player,collectionApiUrls:Bz.collectionApi.urls,collectionApiClientId:Bz.collectionApi.clientId,productVersion:G_.version,authSessionId:e.viewerAuthSessionId,videoId:e.videoId,mediaId:e.mediaId,userId:e.viewerId,shareId:e.shareId,customerId:e.viewerCustomerId,mediaType:e.mediaType,playerType:this.getAnalyticsPlayerType(),isEmbedded:this.options.embed,isUsingLocalCache:t,additionalAnalyticsData:this.getAdditionalAnalyticsData(e),regionName:e.instanceRegion||this.options.sharerInstanceRegion||hg.CvApSoutheast1}),this.on(`timeupdate`,this.logStream),this.trigger(`analytics:loaded`))}setupAnalyticsDependentPlugins(e){this.player.persistSubtitleSettingsPlugin({showSubtitles:e.settings?.showSubtitles,subtitleSize:e.settings?.playbackSubtitleSizeDefault,analyticsService:this.analyticsService}),this.player.persistQualitySettingsPlugin({playbackQuality:e.settings?.playbackQuality,playbackQualityLocalCache:e.settings?.playbackQualityLocalCache,playbackQualityFallback:e.settings?.playbackQualityFallback,analyticsService:this.analyticsService}),this.player.persistPlaybackRatePlugin({analyticsService:this.analyticsService})}getAdditionalAnalyticsData(e){return{}}isAnalyticsEnabled(){return this.options.fetch||this.options.offlinePlaybackObject?!1:this.options.eventLogging}handleAutoplay(e){this.options.autoplay&&this.player.ready(()=>{this.player.play().catch(()=>{this.isDisposed()||this.showSplash()})})}logStream(){this.analyticsService&&(this.player.currentTime()<zz||this.streamLogged||this.player.playerModePlugin().getMode()!==Yh.Hover&&(this.analyticsService.logStream(),this.streamLogged=!0,this.off(`timeupdate`,this.logStream)))}getAnalyticsPlayerType(){return`player`}createEl(e){let t;typeof e==`string`?(e=Rz(e),t=W.dom.$(`#`+e)):t=e;let n=`video-js`;return this.getPlayerClassName()&&(n+=` ${this.getPlayerClassName()}`),this.el=W.dom.createEl(`video`,{},{class:n}),t.appendChild(this.el),this.el}getPlayerClassName(){return``}on(e,t){this.player.on(e,t)}one(e,t){this.player.one(e,t)}off(e,t){this.player.off(e,t)}trigger(e,t){return this.player.trigger(e,t)}dispose(){this.player.dispose()}ready(e){this.player.ready(e)}isDisposed(){return this.player.isDisposed()}play(){this.player.play()}pause(){this.player.pause()}isPaused(){return this.player.paused()}currentTime(e){return this.player.currentTime(e)}muted(e){return this.player.muted(e)}duration(){return this.player.duration()}isFullscreen(){return this.player.isFullscreen()}requestFullscreen(){this.player.requestFullscreen()}exitFullscreen(){this.player.exitFullscreen()}playbackRate(e){return this.player.playbackRate(e)}quality(e){let t=this.player.qualityLevels();for(let n=0;n<t.length;n++){let r=t[n];if(e){r.enabled=r.id===e.toString();continue}if(r.enabled)return r.id}}subtitles(e){let t=this.player.textTracks();for(let n=0;n<t.length;n++){let r=t[n];if(r.kind===`subtitles`){if(e!==void 0){r.label===e?r.mode=`showing`:r.mode=`disabled`;continue}if(r.mode===`showing`)return r.label}}}bindEventListeners(){let e=e=>e.preventDefault();if(this.showSplash=this.showSplash.bind(this),this.hideSplash=this.hideSplash.bind(this),this.player.on(`ended`,this.showSplash),this.player.on(`play`,this.hideSplash),this.player.tech(!0).on(`contextmenu`,e),this.player.one(`dispose`,()=>{this.off(`ended`,this.showSplash),this.off(`play`,this.hideSplash),this.player.qualityLevels().off(`change`,this.hideSplash),this.player.tech(!0).off(`contextmenu`,e)}),!this.options.hotkeyElQuerySelector)return;let t=W.dom.$(this.options.hotkeyElQuerySelector);t&&(this.player.on(t,`keydown`,this.player.handleKeyDown),this.player.one(`dispose`,()=>{this.player.off(t,`keydown`,this.player.handleKeyDown)}))}setupSeekBar(){let e=this.getSeekBarName(),t=this.player.controlBar.getChild(`progressControl`);t.addChild(e,{...this.getSeekBarOptions(),playerOptions:this.player.options_.playerOptions}),t.setSeekBarName(e)}setupSplash(e){this._splashAdded||(this._splashAdded=!0,this.player.addChild(`posterImage`,{embed:this.options.embed,...e}),this.player.addChild(`bigPlayButton`),this.options.autoplay?this.hideSplash():this.showSplash())}showSplash(){this.player.hasStarted(!1),this.player.getChild(`posterImage`).show(),this.player.getChild(`bigPlayButton`).show()}hideSplash(){this.player.getChild(`posterImage`).hide(),this.player.getChild(`bigPlayButton`).hide()}getSeekBarOptions(){return{}}getSeekBarName(){return`ChapterSeekBar`}};function Hz(e){return new Proxy(e,{get(e,t,n){if(!(t!==`off`&&e.isDisposed()))return Reflect.get(e,t,n)}})}export{P_ as A,vF as C,KP as D,XP as E,hh as F,ih as I,W as L,bh as M,yh as N,aM as O,_h as P,Ee as R,bF as S,QP as T,JF as _,LL as a,DF as b,rL as c,VI as d,FI as f,YF as g,XF as h,RL as i,r_ as j,Ij as k,XI as l,kI as m,Vz as n,kL as o,NI as p,FR as r,aL as s,Hz as t,qI as u,qF as v,gF as w,TF as x,KF as y,Te as z};
305
- //# sourceMappingURL=C5ckf65S.chunk.js.map
305
+ //# sourceMappingURL=Bznq7eHJ.chunk.js.map