bitmovin-player 8.281.0 → 8.282.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bitmovinplayer-serviceworker.js +2 -2
- package/bitmovinplayer-serviceworker.prod.js +2 -2
- package/bitmovinplayer-ui.js +1 -1
- package/bitmovinplayer.js +2 -2
- package/bitmovinplayer.prod.js +2 -2
- package/modules/bitmovinplayer-abr.js +2 -2
- package/modules/bitmovinplayer-abr.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-bitmovin.js +2 -2
- package/modules/bitmovinplayer-advertising-bitmovin.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-core.js +2 -2
- package/modules/bitmovinplayer-advertising-core.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-ima.js +2 -2
- package/modules/bitmovinplayer-advertising-ima.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-omsdk.js +2 -2
- package/modules/bitmovinplayer-advertising-omsdk.prod.js +2 -2
- package/modules/bitmovinplayer-analytics.js +1 -1
- package/modules/bitmovinplayer-analytics.prod.js +1 -1
- package/modules/bitmovinplayer-container-mp4.js +2 -2
- package/modules/bitmovinplayer-container-mp4.prod.js +2 -2
- package/modules/bitmovinplayer-container-ts.js +2 -2
- package/modules/bitmovinplayer-container-ts.prod.js +2 -2
- package/modules/bitmovinplayer-container-webm.js +2 -2
- package/modules/bitmovinplayer-container-webm.prod.js +2 -2
- package/modules/bitmovinplayer-core.js +2 -2
- package/modules/bitmovinplayer-core.prod.js +2 -2
- package/modules/bitmovinplayer-crypto.js +2 -2
- package/modules/bitmovinplayer-crypto.prod.js +2 -2
- package/modules/bitmovinplayer-dash.js +2 -2
- package/modules/bitmovinplayer-dash.prod.js +2 -2
- package/modules/bitmovinplayer-drm.js +2 -2
- package/modules/bitmovinplayer-drm.prod.js +2 -2
- package/modules/bitmovinplayer-engine-bitmovin.js +2 -2
- package/modules/bitmovinplayer-engine-bitmovin.prod.js +2 -2
- package/modules/bitmovinplayer-engine-native.js +2 -2
- package/modules/bitmovinplayer-engine-native.prod.js +2 -2
- package/modules/bitmovinplayer-engine-webrtc.js +2 -2
- package/modules/bitmovinplayer-engine-webrtc.prod.js +2 -2
- package/modules/bitmovinplayer-envivio.js +1 -1
- package/modules/bitmovinplayer-envivio.prod.js +1 -1
- package/modules/bitmovinplayer-hls.js +2 -2
- package/modules/bitmovinplayer-hls.prod.js +2 -2
- package/modules/bitmovinplayer-lowlatency.js +2 -2
- package/modules/bitmovinplayer-lowlatency.prod.js +2 -2
- package/modules/bitmovinplayer-mserenderer.js +2 -2
- package/modules/bitmovinplayer-mserenderer.prod.js +2 -2
- package/modules/bitmovinplayer-patch.js +1 -1
- package/modules/bitmovinplayer-patch.prod.js +1 -1
- package/modules/bitmovinplayer-playstation4.js +2 -2
- package/modules/bitmovinplayer-playstation4.prod.js +2 -2
- package/modules/bitmovinplayer-playstation5.js +2 -2
- package/modules/bitmovinplayer-playstation5.prod.js +2 -2
- package/modules/bitmovinplayer-polyfill.js +1 -1
- package/modules/bitmovinplayer-polyfill.prod.js +1 -1
- package/modules/bitmovinplayer-reactnative.js +1 -1
- package/modules/bitmovinplayer-reactnative.prod.js +1 -1
- package/modules/bitmovinplayer-remotecontrol.js +2 -2
- package/modules/bitmovinplayer-remotecontrol.prod.js +2 -2
- package/modules/bitmovinplayer-serviceworker-client.js +2 -2
- package/modules/bitmovinplayer-serviceworker-client.prod.js +2 -2
- package/modules/bitmovinplayer-serviceworker.js +2 -2
- package/modules/bitmovinplayer-serviceworker.prod.js +2 -2
- package/modules/bitmovinplayer-sgai.js +2 -2
- package/modules/bitmovinplayer-sgai.prod.js +2 -2
- package/modules/bitmovinplayer-smooth.js +2 -2
- package/modules/bitmovinplayer-smooth.prod.js +2 -2
- package/modules/bitmovinplayer-style.js +2 -2
- package/modules/bitmovinplayer-style.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-cea608.js +2 -2
- package/modules/bitmovinplayer-subtitles-cea608.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-native.js +2 -2
- package/modules/bitmovinplayer-subtitles-native.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-ttml.js +2 -2
- package/modules/bitmovinplayer-subtitles-ttml.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-vtt.js +2 -2
- package/modules/bitmovinplayer-subtitles-vtt.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles.js +2 -2
- package/modules/bitmovinplayer-subtitles.prod.js +2 -2
- package/modules/bitmovinplayer-thumbnail-imp.js +2 -2
- package/modules/bitmovinplayer-thumbnail-imp.prod.js +2 -2
- package/modules/bitmovinplayer-thumbnail.js +2 -2
- package/modules/bitmovinplayer-thumbnail.prod.js +2 -2
- package/modules/bitmovinplayer-tizen.js +2 -2
- package/modules/bitmovinplayer-tizen.prod.js +2 -2
- package/modules/bitmovinplayer-ui.js +2 -2
- package/modules/bitmovinplayer-ui.prod.js +2 -2
- package/modules/bitmovinplayer-vidaa.js +2 -2
- package/modules/bitmovinplayer-vidaa.prod.js +2 -2
- package/modules/bitmovinplayer-vr.js +2 -2
- package/modules/bitmovinplayer-vr.prod.js +2 -2
- package/modules/bitmovinplayer-webos.js +2 -2
- package/modules/bitmovinplayer-webos.prod.js +2 -2
- package/modules/bitmovinplayer-wpe.js +2 -2
- package/modules/bitmovinplayer-wpe.prod.js +2 -2
- package/modules/bitmovinplayer-xml.js +1 -1
- package/modules/bitmovinplayer-xml.prod.js +1 -1
- package/package.json +1 -1
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.282.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.drm=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.drm=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[766],{67579:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MediaKeySystemConfig=void 0,function(e){!function(e){e.Required="required",e.Optional="optional"}(e.PersistentState||(e.PersistentState={})),function(e){e.Optional="optional",e.NotAllowed="not-allowed"}(e.DistinctiveIdentifier||(e.DistinctiveIdentifier={})),function(e){e.Temporary="temporary",e.PersistentLicense="persistent-license"}(e.SessionType||(e.SessionType={}))}(n||(t.MediaKeySystemConfig=n={}))},88559:function(e,t,n){var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentProtectionHelper=void 0;var i=n(25811),s=n(51682),o=n(33468),a=n(74853),u=n(70233),c=n(92656),d="_cenc:default_KID",l=function(){function e(){}return e.extractUint32FromString=function(e,t){return(e.charCodeAt(t)<<24)+(e.charCodeAt(t+1)<<16)+(e.charCodeAt(t+2)<<8)+e.charCodeAt(t+3)},e.parseKeyIds=function(e){var t=c.PlayReady.parseWrmHeader(e,4);if(!t||!t.length)return[];var n=c.PlayReady.extractKeyIdsFromPlayReadyHeaders(t);return n&&n.length?n.map(function(e){return function(e){var t=a.ArrayHelper.stringToArrayWithoutEncoding(atob(e));return c.PlayReady.kidToCENC(t),a.ArrayHelper.arrayBufferToAsciiString(t.buffer)}(e)}):[]},e.getFirstKeyId=function(e){if(!e||!e.length)return null;for(var t=0,n=e;t<n.length;t++){var r=f(n[t]);if(r&&r.length)return r[0]}return null},e.writeKeySystemId=function(e,t,n){return e.setUint32(t,parseInt(n.substring(0,8),16)),t+=4,e.setUint32(t,parseInt(n.substring(8,16),16)),t+=4,e.setUint32(t,parseInt(n.substring(16,24),16)),t+=4,e.setUint32(t,parseInt(n.substring(24,32),16)),t+4},e.writeKeyIds=function(t,n,r){return t.setUint32(n,r.length),n+=4,r.forEach(function(r){t.setUint32(n,e.extractUint32FromString(r,0)),n+=4,t.setUint32(n,e.extractUint32FromString(r,4)),n+=4,t.setUint32(n,e.extractUint32FromString(r,8)),n+=4,t.setUint32(n,e.extractUint32FromString(r,12)),n+=4}),n},e.extractKeySystemIdFromUri=function(e){return e.replace(/-/g,"").split(":")[2]},e.wrapInPsshBox=function(e,t){var n=a.ArrayHelper.stringToArrayWithoutEncoding(atob(e)),r=this.parseKeyIds(n),i=r.length>0,o=s.ISOBMFFConstants.BOX_SIZE_LENGTH+s.ISOBMFFConstants.BOX_TYPE_LENGTH+s.ISOBMFFConstants.FULL_BOX_VERSION_LENGTH+s.ISOBMFFConstants.FULL_BOX_FLAGS_LENGTH+s.ISOBMFFConstants.PSSH_SYSTEM_ID_LENGTH+s.ISOBMFFConstants.PSSH_DATA_SIZE;i&&(o+=s.ISOBMFFConstants.PSSH_KID_COUNT_LENGTH+r.length*s.ISOBMFFConstants.PSSH_KID_LEN);var u=this.extractKeySystemIdFromUri(t),c=o+n.byteLength,d=new Uint8Array(c),l=new DataView(d.buffer),p=0;if(l.setUint32(p,c),p+=4,l.setUint32(p,1886614376),p+=4,l.setUint8(p,i?1:0),p+=1,p+=3,!u||32!==u.length)return a.ArrayHelper.arrayBufferToAsciiString(n.buffer);p=this.writeKeySystemId(l,p,u),i&&(p=this.writeKeyIds(l,p,r)),l.setUint32(p,n.length),p+=4;for(var y=0;y<n.byteLength;y++)l.setUint8(p+y,n[y]);return btoa(a.ArrayHelper.arrayBufferToAsciiString(d.buffer))},e.parseBoxSize=function(e){return new DataView(e.buffer,0).getUint32(0)},e.parseBoxType=function(e){var t=new DataView(e.buffer,4);return String.fromCharCode(t.getUint8(0))+String.fromCharCode(t.getUint8(1))+String.fromCharCode(t.getUint8(2))+String.fromCharCode(t.getUint8(3))},e.isValidPsshBox=function(e){var t=a.ArrayHelper.stringToArrayWithoutEncoding(atob(e)),n=this.parseBoxSize(t),r=this.parseBoxType(t);return n===t.byteLength&&"pssh"===r},e.extractKidsFromPSSHBox=function(e){if(!e||e.byteLength<3)return[];var t=8,n=[],r=new DataView(e);if(r.getUint8(t)<=0)return[];t+=20;var i=r.getUint32(t);t+=4;for(var s=0;s<i;s++){for(var o="",a=t;a<t+16;a++)o+=("00"+r.getUint8(a).toString(16)).slice(-2);t+=16,n.push(u.FormatHelper.beautifyUUID(o))}return n},e.parseContentProtection=function(t,n){var r=function(e){if(i.DRMSchemeIDURIs[e])return e;var t=(0,o.keySystemUidToKind)(e);return(0,i.keySystemNameToSchemeUri)(t)}(t.keyformat);if(!r)return null;e.isValidPsshBox(n)||(n=e.wrapInPsshBox(n,r));var s={schemeIdUri:r,pssh:n};return t.keyid&&(s.defaultKid=t.keyid),s},e.parseContentProtectionDescriptors=function(e){return e.filter(p).map(y)},e}();function p(e){var t;return i.DRMSchemeIDURIs.hasOwnProperty(null===(t=null==e?void 0:e._schemeIdUri)||void 0===t?void 0:t.toLowerCase())}function y(e){var t,n={schemeIdUri:e._schemeIdUri.toLowerCase(),name:i.DRMSchemeIDURIs[e._schemeIdUri.toLowerCase()]};"cenc"===n.name&&"string"==typeof e[d]&&(n.defaultKid=e[d].toLowerCase());var s=(null===(t=e.pssh)||void 0===t?void 0:t.length)>0?e.pssh:function(e,t){return(null==e?void 0:e.length)>0?e.map(function(e){return{__text:l.wrapInPsshBox(e.__text,t)}}):[]}(e.pro,e._schemeIdUri);return s.length>0&&(n.pssh=[],n.kids=[],n.psshData=[]),s.forEach(function(e){var t=atob(e.__text),i=a.ArrayHelper.stringToArrayWithoutEncoding(t).buffer,s=l.extractKidsFromPSSHBox(i);n.pssh.push(t),n.psshData.push(i),n.kids=r(r([],n.kids,!0),s,!0)}),n}function f(e){var t=e._schemeIdUri.toLowerCase(),n=i.DRMSchemeIDURIs[t];return"cenc"===n&&"string"==typeof e[d]?[e[d].toLowerCase()]:"playready"===n&&e.pro&&e.pro.length?function(e){var t=h(e,"pro");return l.parseKeyIds(t).map(function(e){return u.FormatHelper.bytesToUUID(a.ArrayHelper.stringToArrayWithoutEncoding(e))})}(e):function(e){var t=h(e,"pssh");return l.extractKidsFromPSSHBox(t.buffer)}(e)}function h(e,t){var n=function(e,t){var n,r,i=null!==(n=e[t])&&void 0!==n?n:null;if(!i)return"";var s=null!==(r=i[0])&&void 0!==r?r:null;return s?s.__text:""}(e,t);return a.ArrayHelper.stringToArrayWithoutEncoding(atob(n))}t.ContentProtectionHelper=l},29173:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.DRMManager=void 0;var i=n(66790),s=n(40306),o=n(3336),a=n(20213),u=n(33468),c=n(48488),d=n(15971),l=n(74853),p=n(34841),y=n(49867),f=n(70581),h=n(92656),v=n(58857),m=n(84344),S=function(){function e(e){var t=this;this.gp=function(){return Promise.all([t.cp.promise,t.dp.promise]).then(t.np).then(function(){var e,n,r,i=t.usedKeySystem.kind===u.KeySystemKind.PLAYREADY,s=null!==(r=null===(n=null===(e=(0,d.getSourceState)(t.context))||void 0===e?void 0:e.drm)||void 0===n?void 0:n.keyIdsWithErrors)&&void 0!==r?r:[];i&&s.length>0&&t.fp.maybeScheduleRecovery(s)}).catch(function(){})},this.hp=function(e){return t.addInitData(e)},this.isLicenseRequestOngoing=function(){return!(!t.emeHandler||"function"!=typeof t.emeHandler.isLicenseRequestOngoing)&&t.emeHandler.isLicenseRequestOngoing()},this.lp=function(e,n){var r;if(e.response!==h.EMPTY_KEY_MESSAGE)if(e.hasOwnProperty("statusCode")&&"postponed"===e.statusCode)t.licenseStorage.resetLicense(t.usedKeySystem.kind,e.initDataStr);else if(t.usedKeySystem.kind){var i="object"==typeof e.response?e.response:null;((null===(r=null==i?void 0:i.failedKeyIds)||void 0===r?void 0:r.length)?i.failedKeyIds:n).forEach(function(e){t.context.store.dispatch((0,c.trackDrmKidError)(e))}),t.licenseStorage.addLicense(t.usedKeySystem.kind,{initDataStr:e.initDataStr})}},this.mp=function(e){t.usedKeySystem.kind&&t.licenseStorage.addLicense(t.usedKeySystem.kind,e)},this.np=function(){Boolean(t.usedKeySystem.kind)&&!t.bp&&t.context.eventHandler.fireError(new o.PlayerError(s.ErrorCode.DRM_INIT_DATA_MISSING,{drmKeySystem:t.usedKeySystem.kind},"No init data was found in the manifest or the segments for the used key system.",t.context.sourceContext.sourceIdentifier))},this.context=e,this.emeHandler=null,this.ap=!1,this.licenseStorage=new v.LicenseStorage(this.context),this.context.videoElement.drmHandler=this,this.bp=!1,this.cp=new p.Deferred,this.cp.promise.catch(function(){}),this.dp=new p.Deferred,this.usedKeySystem={kind:null,uid:null},this.fp=new y.DrmStallRecovery(this.context)}return e.prototype.shutdown=function(){var e;return this.ep=!0,this.fp.dispose(),this.licenseStorage.dispose(),this.context.videoElement.drmHandler=null,this.ap=!1,this.usedKeySystem={kind:null,uid:null},this.bp=!1,this.cp.reject(),null===(e=(0,d.getSourceStore)(this.context))||void 0===e||e.dispatch((0,c.resetUsedKeySystem)()),null===this.emeHandler?Promise.resolve():(this.emeHandler.setWaitingForKeyListener(null),this.emeHandler.unload())},e.prototype.ip=function(){var e=this;this.licenseStorage.getEntriesWithoutLicense().filter(function(t){return t.systemName!==e.usedKeySystem.kind}).forEach(function(t){return e.licenseStorage.remove(t.initDataStr)})},e.prototype.jp=function(){this.licenseStorage.getEntriesWithoutLicense().some(function(e){return e.initData})&&(this.bp=!0)},e.prototype.kp=function(){var e=this;this.licenseStorage.getEntriesWithoutLicense().filter(function(e){return e.initData&&!e.initDataStr}).forEach(function(t){var n=e.emeHandler.getIdentifierFromInitData(l.ArrayHelper.arrayBufferToAsciiString(t.initData));e.licenseStorage.updateInitData(r(r({},t),{initDataStr:n}))})},e.prototype.setConfig=function(e,t){var n=this,r=(0,u.getRelevantKeySystemMap)(e);return(0,m.resolveDRMSystem)(r,e,this.context).then(function(e){var r;if(n.ep)return Promise.reject(new Error(i.DrmSetupError.CANCELLED));n.usedKeySystem=e.keySystem,n.ap=!0,null===(r=(0,d.getSourceStore)(n.context))||void 0===r||r.dispatch((0,c.setUsedKeySystem)(n.usedKeySystem)),n.emeHandler=e.emeHandler.instance,n.emeHandler.setEncryptedListener(n.hp),n.emeHandler.setWaitingForKeyListener(n.gp);var s=n.emeHandler.load(e.keySystem.instance,e.keySystem.uid,e.config,t);return n.ip(),n.jp(),n.kp(),n.requestMissingLicenses(),n.cp.resolve(),s.then(function(){return e.emeHandler.kind})}).catch(function(e){return null!==n.emeHandler&&n.emeHandler.unload(),n.cp.reject(),Promise.reject(e)})},e.prototype.requestMissingLicenses=function(){var e,t,n,r=this;if(this.ap&&this.usedKeySystem.kind){var i=this.licenseStorage.getEntriesWithoutLicense(),s=null!==(n=null===(t=null===(e=(0,d.getSourceState)(this.context))||void 0===e?void 0:e.drm)||void 0===t?void 0:t.keyIdsWithErrors)&&void 0!==n?n:[];i.forEach(function(e){var t=e.initData,n=e.initDataStr,i=e.sessionId,o=e.systemName,a=e.wasRequested,u=e.isPending;o===r.usedKeySystem.kind?t?a||e.keyIds.length>0&&e.keyIds.every(function(e){return s.includes(e)})||(r.licenseStorage.setRequested(n,o),r.emeHandler.requestLicense(t,n,i).then(r.mp).catch(function(t){return r.lp(t,e.keyIds)})):u||r.licenseStorage.setPending(n,o):r.licenseStorage.remove(n)})}},e.prototype.preprocessInitDataStr=function(e){var t;return e.initDataStr?null===(t=this.emeHandler)||void 0===t?void 0:t.getIdentifierFromInitData(e.initDataStr):void 0},e.prototype.hasOngoingLicenseRequests=function(e){return this.licenseStorage.hasOngoingLicenseRequests(e)},e.prototype.hasUsableMediaKey=function(e){return this.emeHandler instanceof f.UnprefixedEMEHandler?this.licenseStorage.hasUsableOrPendingMediaKey(e,this.usedKeySystem.kind):this.licenseStorage.hasLicense(e,this.usedKeySystem.kind)},e.prototype.addInitData=function(e){var t,n;if(e&&(!this.usedKeySystem.kind||e.systemName===this.usedKeySystem.kind)){var i=this.preprocessInitDataStr(e),s=this.usedKeySystem.kind||e.systemName,o=i?this.licenseStorage.getLicense(i,s):void 0;(null==o?void 0:o.initData)||(e.initDataStr=i,e.kid=null!==(n=null===(t=this.emeHandler)||void 0===t?void 0:t.getKeyUuidsFromInitData(e.initData))&&void 0!==n?n:[],o?this.licenseStorage.updateInitData(r(r({},o),{systemName:s,initData:e.initData,initDataStr:e.initDataStr,keyIds:e.kid})):this.licenseStorage.add(e),this.bp=this.bp||Boolean(this.usedKeySystem.kind&&e.initData)),this.requestMissingLicenses()}},e.prototype.getUsedKeySystemKind=function(){return this.usedKeySystem.kind},e.prototype.getUsedKeySystemUid=function(){return this.usedKeySystem.uid},e.prototype.reInitializeEmeHandler=function(){var e;null===(e=this.emeHandler)||void 0===e||e.reInitialize()},e.prototype.signalInitDataShouldBeAvailable=function(){this.dp.resolve()},e.prototype.prepareForMseShutdown=function(){var e,t,n;return null!==(n=null===(t=null===(e=this.emeHandler)||void 0===e?void 0:e.prepareForMseShutdown)||void 0===t?void 0:t.call(e))&&void 0!==n?n:Promise.resolve()},e.prototype.suspend=function(){var e,t;return null!==(t=null===(e=this.emeHandler)||void 0===e?void 0:e.suspend())&&void 0!==t?t:Promise.resolve()},e.prototype.renewLicense=function(e){var t,n;if((null===(t=this.usedKeySystem)||void 0===t?void 0:t.kind)!==u.KeySystemKind.PLAYREADY)return Promise.reject(a.WarningCode.DRM_LICENSE_RENEWAL_FAILED);if(!(null===(n=this.emeHandler)||void 0===n?void 0:n.disposeSessionForInitData))return Promise.reject(a.WarningCode.DRM_LICENSE_RENEWAL_FAILED);var r=this.licenseStorage.findLicenseForPublicId(e,this.usedKeySystem.kind);return r?this.op(r.initDataStr):Promise.reject(a.WarningCode.DRM_LICENSE_RENEWAL_FAILED)},e.prototype.isUsingUnprefixedEmeHandler=function(){return!!this.emeHandler&&this.emeHandler instanceof f.UnprefixedEMEHandler},e.prototype.op=function(e){var t=this;return this.licenseStorage.resetLicense(this.usedKeySystem.kind,e),this.emeHandler.disposeSessionForInitData(e).then(function(){return t.requestMissingLicenses()}).catch(function(n){return t.context.eventHandler.dispatchEvent(a.PlayerEvent.Warning,new a.PlayerWarning(a.WarningCode.DRM_LICENSE_RENEWAL_FAILED,null,{keyIds:e.split(";"),error:n})),Promise.reject(n)})},e}();t.DRMManager=S},34079:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createDrmApi=function(e,t){return new(function(){function t(){}return t.prototype.renewLicense=function(t){var n=e();if(!n)return Promise.reject("NoSourceLoaded");var i=n.get(r.ServiceName.DrmService);return i?i.renewLicense(t):Promise.reject("NoDrmSource")},t}())};var r=n(80813)},97115:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createDrmManager=function(e){return(0,i.getCapabilities)()[r.CapabilityKey.isTizen]&&s.ModuleManager.has(o.ModuleName.Tizen)?s.ModuleManager.get(o.ModuleName.Tizen).createTizenDRMManager(e):(0,i.getCapabilities)()[r.CapabilityKey.isWebOS]&&s.ModuleManager.has(o.ModuleName.Webos)?new(s.ModuleManager.get(o.ModuleName.Webos).getWebosDrmManagerConstructor())(e):new a.DRMManager(e)};var r=n(7387),i=n(21513),s=n(88052),o=n(62756),a=n(29173)},93101:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.DrmService=void 0;var i=n(66790),s=n(33468),o=n(7387),a=n(15971),u=n(21513),c=n(93204),d=n(34841),l=n(46057),p=n(97115),y=n(55327),f=n(84344),h=n(99921),v=function(){function e(e){this.context=e,this.rp=new d.Deferred,this.sp=!1,this.vp=Promise.resolve()}return e.prototype.wp=function(){var e=this;this.zp().then(function(){return e.qp=(0,p.createDrmManager)(e.context)})},e.prototype.canReuseEmeHandler=function(){var e=this.tp;return e===h.EMEHandlerKind.UNPREFIXED||e===h.EMEHandlerKind.MS_PREFIXED},e.prototype.reInitializeEmeHandler=function(){return this.qp.reInitializeEmeHandler()},e.prototype.resolveDrmSystemFromSourceConfig=function(e){var t=this;if(!this.up){var n=(0,s.getRelevantKeySystemMap)(e);this.up=(0,l.yieldToMain)().then(function(){return(0,f.resolveUsedDRMSystem)(n,e,t.context)}).then(function(t){return r(r({},t),{config:e})}).catch(function(e){return null})}},e.prototype.setDrmConfig=function(e){this.pp=e,this.rp=new d.Deferred,this.sp=!1,this.wp()},e.prototype.updateDrmConfig=function(e,t){var n=this;return this.sp?this.rp.promise:(this.pp=r(r({},this.pp),e),this.sp=!0,this.qp.setConfig(this.pp,t).then(function(e){n.tp=e,n.rp.resolve()}).catch(function(e){n.sp=!1,n.rp.reject(e)}).finally(function(){return n.rp.promise}))},e.prototype.addInitData=function(e){var t=this;this.qp&&this.rp.promise.then(function(){var n;return null===(n=t.qp)||void 0===n?void 0:n.addInitData(e)}).catch(function(e){null==e||e.message,i.DrmSetupError.CANCELLED})},e.prototype.renewLicense=function(e){var t,n;return null!==(n=null===(t=this.qp)||void 0===t?void 0:t.renewLicense(e))&&void 0!==n?n:Promise.reject("No active drm manager")},e.prototype.getUsedKeySystemKind=function(){var e;return(null===(e=this.qp)||void 0===e?void 0:e.getUsedKeySystemKind())||null},e.prototype.getUsedKeySystemUid=function(){var e;return(null===(e=this.qp)||void 0===e?void 0:e.getUsedKeySystemUid())||null},e.prototype.getUsedOrEarlyResolvedKeySystemUid=function(){var e=this.getUsedKeySystemUid();return e?Promise.resolve(e):this.up?this.up.then(function(e){var t;return null!==(t=null==e?void 0:e.keySystem.uid)&&void 0!==t?t:null}):Promise.resolve(null)},e.prototype.getResolvedKeySystemFromSourceConfig=function(){return this.up||Promise.resolve(null)},e.prototype.waitForPendingLicenseRequests=function(e){var t=this,n=function(){var n,r;return null!==(r=null===(n=t.qp)||void 0===n?void 0:n.hasOngoingLicenseRequests(e))&&void 0!==r&&r};if(!n())return Promise.resolve();var r=new d.Deferred,i=(0,c.subscribe)(this.context.store)(function(e){return y.getLicenseState(e)},function(){n()||(i(),r.resolve())});return r.promise},e.prototype.xp=function(e){var t,n=this;if(null===(t=this.qp)||void 0===t?void 0:t.hasUsableMediaKey(e))return Promise.resolve();var r=new d.Deferred,i=(0,c.subscribe)(this.context.store)(function(e){return y.getLicenseState(e)},function(){var t,s,o,u;if(null===(t=n.qp)||void 0===t?void 0:t.hasUsableMediaKey(e))return i(),void r.resolve();(null!==(u=null===(o=null===(s=(0,a.getSourceState)(n.context))||void 0===s?void 0:s.drm)||void 0===o?void 0:o.keyIdsWithErrors)&&void 0!==u?u:[]).includes(e)&&(i(),r.reject(new Error("DRM key ID ".concat(e," failed"))))});return this.qp&&this.qp.requestMissingLicenses(),r.promise},e.prototype.yp=function(e){var t,n,r,i=this.getUsedKeySystemKind()===s.KeySystemKind.PLAYREADY,a=(0,u.getCapabilities)()[o.CapabilityKey.isEdge],c=null!==(n=null===(t=this.qp)||void 0===t?void 0:t.isUsingUnprefixedEmeHandler())&&void 0!==n&&n,d=i&&a&&c,l=e.hasDrmKid()?e.getDrmKid():void 0;return!(!this.sp||void 0===l||!d||(null===(r=this.qp)||void 0===r?void 0:r.hasUsableMediaKey(l)))},e.prototype.maybeWaitForDrmLicense=function(e,t){var n=this,r=!e.isInit()||e.isSelfInit(),i=this.yp(e),s=void 0!==t&&Object.keys(t).length>0,o=e.hasDrmKid()?e.getDrmKid():void 0;return s&&i&&r&&void 0!==o?(null==t?void 0:t.keyIdsWithErrors.includes(o))?Promise.reject(new Error("DRM key ID ".concat(o," failed"))):(e.getDrmInitData().forEach(function(e){return n.addInitData(e)}),this.xp(o)):Promise.resolve()},e.prototype.preprocessInitDataStr=function(e){return this.qp.preprocessInitDataStr(e)},e.prototype.signalInitDataShouldBeAvailable=function(){this.qp.signalInitDataShouldBeAvailable()},Object.defineProperty(e.prototype,"shutdownPromise",{get:function(){return this.vp},enumerable:!1,configurable:!0}),e.prototype.zp=function(){var e=this;return this.qp&&(this.vp=this.vp.then(function(){var t;return null===(t=e.qp)||void 0===t?void 0:t.shutdown().catch(function(e){})})),this.vp},e.prototype.shutdownIfNeeded=function(e){return e&&this.canReuseEmeHandler()?Promise.resolve():this.release()},e.prototype.release=function(){var e=this;return this.pp=null,this.zp().then(function(){e.qp=void 0})},e.prototype.prepareForMseShutdown=function(){var e,t;return null!==(t=null===(e=this.qp)||void 0===e?void 0:e.prepareForMseShutdown())&&void 0!==t?t:Promise.resolve()},e.prototype.suspend=function(){var e,t;return null!==(t=null===(e=this.qp)||void 0===e?void 0:e.suspend())&&void 0!==t?t:Promise.resolve()},e.prototype.dispose=function(){this.release()},e.prototype.isDrmConfigSet=function(){return Boolean(this.pp)},e}();t.DrmService=v},49867:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.DrmStallRecovery=void 0;var r=n(80813),i=n(93204),s=n(55327),o=function(){function e(t){var n=this;this.context=t,this.GS=null,this.HS=null,this.IS=0,this.JS=0,this.KS=[],this.LS=null,this.MS=null,this.QS=function(){var t=n.context.videoElement;if(t){var r=n.HS,i=t.currentTime>n.IS+e.PROGRESS_EPSILON_S,s=n.JS-n.OS,o=null!==n.LS&&n.LS>=s;n.GS=null,n.HS=null,i||("initial"===r&&o?n.PS("extended"):n.RS())}},this.NS=this.context.settings.DRM_STALL_RECOVERY_SETTLE_TIMEOUT_MS,this.OS=this.context.settings.DRM_STALL_RECOVERY_LICENSE_ACTIVITY_LOOKBACK_MS,this.MS=(0,i.subscribe)(this.context.store)(s.getLicenseState,function(){n.LS=Date.now()})}return e.prototype.maybeScheduleRecovery=function(e){this.HS||(this.KS=e,this.PS("initial"))},e.prototype.dispose=function(){null!==this.GS&&(clearTimeout(this.GS),this.GS=null),null!==this.MS&&(this.MS(),this.MS=null),this.HS=null},e.prototype.PS=function(e){var t=this.context.videoElement;t&&(this.HS=e,this.IS=t.currentTime,this.JS=Date.now(),this.GS=setTimeout(this.QS,this.NS))},e.prototype.RS=function(){var e=this.context.serviceManager.get(r.ServiceName.RecoveryService);e&&e.recover("DRM stall: waitingforkey persisted with permanently-failed KIDs").catch(function(e){})},e.PROGRESS_EPSILON_S=.05,e}();t.DrmStallRecovery=o},24109:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.FairplayHandler=t.SupportedFairplayKeySystems=void 0;var i,s,o=n(40306),a=n(3336),u=n(4129),c=n(91523),d=n(57456),l=n(29669),p=n(74853),y=n(88844),f=n(19274);!function(e){e[e.MEDIA_KEYERR_DOMAIN=6]="MEDIA_KEYERR_DOMAIN"}(i||(i={})),function(e){e.FPS_1="com.apple.fps.1_0"}(s||(t.SupportedFairplayKeySystems=s={}));var h=function(){function e(t,n,r){var s=this;this.Tp=function(e){if(s.Ep){s.Fp=!0;var t=e.initData,n=s.iq(t);if(s.Pp(t),s.Kp)s.gq(n,t);else{var r=s.Ep.serverCertificate;if(r)return r instanceof ArrayBuffer==0?void s.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_CERTIFICATE_ERROR,void 0,"The provided `AppleFairplayDRMConfig.serverCertificate` is not of type `ArrayBuffer`.",s.Ap.sourceContext.sourceIdentifier)):(s.Kp=s.fq(r),void s.gq(n,t));s.Sp().then(function(e){s.Kp=s.fq(e.body),s.gq(n,t)}).catch(function(e){}),s.Np()}}else s.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_MISSING_CONFIGURATION,void 0,"A FairPlay DRM config is required to play this source, but none was provided.",s.Ap.sourceContext.sourceIdentifier))},this.hq=function(e,t){s.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.NETWORK_FAILED_CERTIFICATE_REQUEST,{responseCode:e.status,responseText:e.statusText,serverResponse:e.body,reason:t.message},"Failed to load the FairPlay certificate: ".concat(e.status," ").concat(e.statusText,"."),s.Ap.sourceContext.sourceIdentifier))},this.lq=function(){(0,y.clearTimeoutIfDefined)(s.Lp)},this.mq=function(t,n){s.Fp=!0;var r=t.message,i=t.target,c=s.Ep,p=c.withCredentials,y=void 0!==p&&p,f=c.licenseResponseType,h=void 0===f?l.HttpResponseType.TEXT:f,v=c.maxLicenseRequestRetries,m=c.headers,S=c.prepareMessage,E=d.XhrHelper.mergeHeaders({"Content-Type":"application/x-www-form-urlencoded"},m),b=s.Qp(v),g=new u.DefaultContentLoader(s.Ap,{maxRetries:b,requestType:l.HttpRequestType.DRM_LICENSE_FAIRPLAY});t.messageBase64Encoded=e.base64EncodeUint8Array(r);var L="function"==typeof S?S(t,i):"spc=".concat(encodeURIComponent(t.messageBase64Encoded),"&assetId=").concat(i.contentId),I=s.eq(n);I&&"string"==typeof I?g.load(I,l.HttpRequestMethod.POST,h,L,E,y).then(function(e){s.nq(e,i)}).catch(s.oq):(s.Fp=!1,s.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_NO_LICENSE_SERVER_URL_PROVIDED,{licenseServer:I},"No valid license server URL was provided through the FairPlay DRM config.",s.Ap.sourceContext.sourceIdentifier)))},this.nq=function(t,n){if(s.Fp=!1,"function"!=typeof s.Ep.prepareLicenseAsync){var r=t.body;"function"==typeof s.Ep.prepareLicense?r=s.Ep.prepareLicense(r):(r=r.trim()).startsWith("<ckc>")&&r.endsWith("</ckc>")&&(r=r.slice(5,-6));var i=r;"string"==typeof r&&(i=e.base64DecodeUint8Array(r)),n.update(i)}else s.Ep.prepareLicenseAsync(t.body).then(function(e){n.update(e)}).catch(function(e){s.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_CERTIFICATE_ERROR,{reason:e},"Unable to parse the certificate: `AppleFairplayDRMConfig.prepareLicenseAsync` failed.",s.Ap.sourceContext.sourceIdentifier))})},this.oq=function(e){s.Fp=!1,s.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_FAILED_LICENSE_REQUEST,{responseCode:e.status,responseText:e.statusText,serverResponse:e.body},void 0,s.Bp))},this.pq=function(e){s.Fp=!1;var t=e.target,n=t?t.error:{},r=n.code,u=n.systemCode,c=s.Hp&&s.Ap.settings.FAIRPLAY_IGNORE_DUPLICATE_INIT_DATA_KEY_ERRORS;r===i.MEDIA_KEYERR_DOMAIN&&1212433232===u?s.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_RESTRICTED_OUTPUT,void 0,void 0,s.Bp)):c||s.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_KEY_ERROR,{code:r,systemCode:u},void 0,s.Bp))},this.qq=function(){},this.isLicenseRequestOngoing=function(){return s.Fp},this.Ap=t,this.Bp=t.sourceContext.sourceIdentifier,this.Cp=t.settings,this.Dp=n,this.Ep=r,this.Fp=!1,this.Gp=[],this.Hp=!1,this.Jp=null,this.Ip=null,r&&r.hasOwnProperty("certificateURL")&&(this.Mp=r.certificateURL),this.Dp.drmHandler=this,this.Dp.addEventListener(f.MediaElementEvent.webkitneedkey,this.Tp),this.Dp.addEventListener(f.MediaElementEvent.error,this.lq)}return e.prototype.Np=function(){var e=this;(0,y.clearTimeoutIfDefined)(this.Lp);var t=(0,c.getRequestTimeout)(this.Ap,l.HttpRequestType.DRM_CERTIFICATE_FAIRPLAY);this.Lp=window.setTimeout(function(){e.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_CERTIFICATE_ERROR,void 0,"The FairPlay certificate request was not completed within the timeout of ".concat(t," ms."),e.Ap.sourceContext.sourceIdentifier))},t)},e.stringToArray=function(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint16Array(t),r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return n},e.base64DecodeUint8Array=function(e){for(var t=window.atob(e),n=t.length,r=new Uint8Array(new ArrayBuffer(n)),i=0;i<n;i++)r[i]=t.charCodeAt(i);return r},e.base64EncodeUint8Array=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="",r=0;r<e.length;){var i=e[r++],s=r<e.length?e[r++]:Number.NaN,o=r<e.length?e[r++]:Number.NaN,a=i>>2,u=(3&i)<<4|s>>4,c=(15&s)<<2|o>>6,d=63&o;isNaN(s)?c=d=64:isNaN(o)&&(d=64),n+=t.charAt(a)+t.charAt(u)+t.charAt(c)+t.charAt(d)}return n},e.prototype.Op=function(e,t,n,r){void 0===r&&(r=null),n.addEventListener(e,function(e){return t(e,r)},!1)},e.prototype.Pp=function(e){var t=p.ArrayHelper.arrayBufferToAsciiString(e.buffer,!1);this.Gp.includes(t)?this.Hp=!0:this.Gp.push(t)},e.prototype.Qp=function(e){var t=parseInt("".concat(e));return isFinite(t)?t:3},e.prototype.Rp=function(){var e=this.Ep.maxCertificateRequestRetries;return new u.DefaultContentLoader(this.Ap,{onFailure:this.hq,maxRetries:this.Qp(e),requestType:l.HttpRequestType.DRM_CERTIFICATE_FAIRPLAY})},e.prototype.Sp=function(){var e=this,t=this.Ep,n=t.withCredentials,i=void 0!==n&&n,s=t.certificateHeaders,o=r({},s);return this.Ip=this.Rp(),new Promise(function(t,n){e.Ip.load(e.Mp,l.HttpRequestMethod.GET,l.HttpResponseType.ARRAYBUFFER,null,o,i).then(function(e){return t(e)}).catch(function(e){return n(e)}).finally(function(){e.Ip=null})})},e.prototype.eq=function(e){var t=p.ArrayHelper.arrayBufferToAsciiString(e.buffer,!1);return this.Ep&&this.Ep.hasOwnProperty("LA_URL")?this.Ep.LA_URL:/skd:\/\//.test(t)?"function"==typeof this.Ep.getLicenseServerUrl?this.Ep.getLicenseServerUrl(t.substring(t.indexOf("skd:"))):t.substring(t.indexOf("skd:")+4):null},e.prototype.fq=function(e){var t="function"==typeof this.Ep.prepareCertificate;try{return t?new Uint8Array(this.Ep.prepareCertificate(e)):new Uint8Array(e)}catch(e){return void this.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_CERTIFICATE_ERROR,{reason:e},"There was an error during the processing of the certificate: ".concat(t?"`AppleFairplayDRMConfig.prepareCertificate` failed":"the obtained certificate is invalid","."),this.Ap.sourceContext.sourceIdentifier))}},e.prototype.gq=function(e,t){(0,y.clearTimeoutIfDefined)(this.Lp);var n=this.jq(t,e,this.Kp);if(this.Jp||this.kq(),this.Dp.webkitKeys||this.Dp.webkitSetMediaKeys(new WebKitMediaKeys(this.Jp)),this.Dp.webkitKeys){var r=this.Dp.webkitKeys.createSession("video/mp4",n);r?(r.contentId=e,this.Op("webkitkeymessage",this.mq,r,t),this.Op("webkitkeyadded",this.qq,r),this.Op("webkitkeyerror",this.pq,r)):this.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_KEY_SESSION_INITIALIZATION_FAILED,void 0,"Unable to initialize DRM key session: `webkitKeys.createSession` failed.",this.Ap.sourceContext.sourceIdentifier))}else this.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_MEDIA_KEY_INITIALIZATION_FAILED,void 0,"Unable to initialize the DRM media keys: the video element does not support WebKit keys.",this.Ap.sourceContext.sourceIdentifier))},e.prototype.iq=function(e){var t=p.ArrayHelper.arrayBufferToAsciiString(e.buffer,!1);if("function"==typeof this.Ep.prepareContentId)t=this.Ep.prepareContentId(t);else{var n=t.indexOf("?");t=n<0?"":t.substring(n+1)}return t},e.prototype.jq=function(t,n,r){var i="string"==typeof n?e.stringToArray(n):n,s=0,o=new ArrayBuffer(t.byteLength+4+i.byteLength+4+r.byteLength),a=new DataView(o);new Uint8Array(o,s,t.byteLength).set(t),s+=t.byteLength,a.setUint32(s,i.byteLength,!0),s+=4;var u=this.Ep.useUint16InitData?new Uint16Array(o,s,i.length):new Uint8Array(o,s,i.byteLength);return u.set(i),s+=u.byteLength,a.setUint32(s,r.byteLength,!0),s+=4,new Uint8Array(o,s,r.byteLength).set(r),new Uint8Array(o,0,o.byteLength)},e.prototype.kq=function(){var e=Object.keys(s).map(function(e){return s[e]});this.Jp=e.find(function(e){return WebKitMediaKeys.isTypeSupported(e,"video/mp4")})||null,this.Jp||this.Ap.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_KEY_SYSTEM_NOT_SUPPORTED,{supportedKeySystem:e},"FairPlay DRM is not supported on this platform.",this.Ap.sourceContext.sourceIdentifier))},e.prototype.destroy=function(){this.Dp.drmHandler=null,this.Dp.removeEventListener(f.MediaElementEvent.webkitneedkey,this.Tp),this.Dp.removeEventListener(f.MediaElementEvent.error,this.lq),this.Jp=null,this.Kp=null,this.Gp=[],this.Mp=null,this.Hp=!1},e.prototype.dispose=function(){var e;this.destroy(),(0,y.clearTimeoutIfDefined)(this.Lp),null===(e=this.Ip)||void 0===e||e.cancel(),this.Cp=null,this.Jp=null,this.Kp=null,this.Mp=null},e}();t.FairplayHandler=h},58857:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasMatchingLicenseInfoForKeySystem=t.LicenseStorage=void 0,t.isMediaKeyStatusUnknownOrPendingOrUsable=function(e){return e.mediaKeyStatus===c.MediaKeyStatus.Usable||e.mediaKeyStatus===c.MediaKeyStatus.Pending||e.mediaKeyStatus===c.MediaKeyStatus.Unknown},t.getKeySystemMap=y,t.getAllLicensesForKeySystem=f;var i=n(3714),s=n(93204),o=n(4358),a=n(91921),u=n(55327),c=n(56068),d=function(){function e(e){var t=this;this.US=1,this.VS=function(e){t.SS.store.dispatch((0,o.resetLicenses)())},this.YS=function(){return u.getLicenseState(t.SS.store.getState())},this.ZS=function(e){t.SS.store.dispatch(e)},this.SS=e,this.SS.store.hasReducer("drmLicenses")||(this.SS.store.addReducer("drmLicenses",a.LicenseReducer),this.SS.store.dispatch((0,o.initializeLicenseStorage)(e.storedConfig))),this.WS(),this.VS=this.VS.bind(this),window.addEventListener("beforeunload",this.VS)}return e.prototype.WS=function(){var e=this;this.TS=(0,s.subscribe)(this.SS.store)(function(e){return u.getLicenseState(e)},function(t){return e.XS(t)})},e.prototype.XS=function(e){(0,o.maybeStoreLicences)(e,this.SS.storedConfig)},e.prototype.add=function(e){var t=e.systemName,n=e.initData,r=e.initDataStr;if(!t||!r||this.getLicense(r,t))return!1;var i={hasLicense:!1,initData:n,initDataStr:r,license:null,isPending:!1,systemName:t,wasRequested:!1,keyIds:e.kid,mediaKeyStatus:c.MediaKeyStatus.Unknown,usedByPlayerId:this.SS.internalPlayerID};return this.ZS((0,o.addLicense)({systemName:t,licenseInfo:i,initDataStr:r})),!0},e.prototype.addLicense=function(e,t){var n=t.initDataStr,s=t.license,a=t.response,u=t.sessionInfo,c=void 0===u?{}:u;if(s||a||t.restoredFromPersistentLicense){var d=this.getLicense(n,e),l=r(r(r({},d||{}),c),{isPending:!1,hasLicense:!0,license:s||null,usedByPlayerId:this.SS.internalPlayerID});l.publicId||(l.publicId=String(this.US++)),this.SS.eventHandler.dispatchEvent(i.PlayerEvent.DrmLicenseAdded,{license:{id:l.publicId,keyIds:l.initDataStr.split(";"),keySystemString:e}});var p={licenseInfo:l,initDataStr:n,systemName:e};return this.ZS(d?(0,o.updateLicense)(p):(0,o.addLicense)(p))}this.ZS((0,o.removeLicense)({initDataStr:n,systemName:e}))},e.prototype.findLicenseForPublicId=function(e,t){var n,r=this.YS().drmData[t];return Object.keys(r).forEach(function(t){r[t].publicId===e&&(n=r[t])}),n},e.prototype.getEntriesWithoutLicense=function(){var e=this.YS().drmData;return Object.values(e).flatMap(function(e){return Object.values(e)}).filter(function(e){return!e.hasLicense&&!e.wasRequested})},e.prototype.getLicense=function(e,t){var n=this.YS(),r=(0,o.getLicenseInfoKey)(e);return n.drmData[t]&&n.drmData[t][r]},e.prototype.getAllLicensesForKeySystem=function(e){return f(e,this.YS())},e.prototype.aS=function(e,t,n){var i=this.getLicense(e,t);i&&this.ZS((0,o.updateLicense)({initDataStr:e,licenseInfo:n(r({},i)),systemName:t}))},e.prototype.setRequested=function(e,t){this.aS(e,t,function(e){return r(r({},e),{wasRequested:!0})})},e.prototype.hasLicense=function(e,n){return(0,t.hasMatchingLicenseInfoForKeySystem)(e,y(this.YS(),n),l)},e.prototype.hasUsableOrPendingMediaKey=function(e,n){return(0,t.hasMatchingLicenseInfoForKeySystem)(e,y(this.YS(),n),p)},e.prototype.hasOngoingLicenseRequests=function(e){return this.getAllLicensesForKeySystem(e).some(function(e){return!e.hasLicense&&e.wasRequested})},e.prototype.setKeyIds=function(e,t,n){this.aS(e,t,function(e){return r(r({},e),{keyIds:n})})},e.prototype.setPending=function(e,t){this.aS(e,t,function(e){return r(r({},e),{isPending:!0})})},e.prototype.resetLicense=function(e,t){var n=this.getLicense(t,e)||{},i=r(r({},n),{keyIds:[],isPending:!1,hasLicense:!1,license:null,expiration:null,sessionId:null,wasRequested:!1});this.ZS((0,o.resetLicense)({systemName:e,initDataStr:t,licenseInfo:i}))},e.prototype.remove=function(e){this.ZS((0,o.removeLicense)({initDataStr:e}))},e.prototype.updateInitData=function(e){var t=e.initDataStr,n=e.systemName;this.ZS((0,o.updateLicense)({initDataStr:t,licenseInfo:e,systemName:n}))},e.prototype.dispose=function(){this.SS.store.getState().drmLicenses&&!this.SS.store.getState().drmLicenses.inPersistentState?this.SS.store.dispatch((0,o.clearLicenseStorage)()):this.SS.store.dispatch((0,o.resetLicenses)()),this.TS&&this.TS(),window.removeEventListener("beforeunload",this.VS)},e}();function l(e){return e.hasLicense}function p(e){return e.mediaKeyStatus===c.MediaKeyStatus.Usable||e.mediaKeyStatus===c.MediaKeyStatus.Pending}function y(e,t){var n;return null!==(n=null==e?void 0:e.drmData[t])&&void 0!==n?n:{}}function f(e,t){var n=t.drmData[e];return n?Object.values(n):[]}t.LicenseStorage=d,t.hasMatchingLicenseInfoForKeySystem=function(e,t,n){return Object.values(t).some(function(t){return t.keyIds.includes(e)&&n(t)})}},47272:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.DRMModuleDefinition=void 0;var r=n(62756),i=n(67579),s=n(88559),o=n(34079),a=n(29173),u=n(93101),c=n(70581),d=n(80680),l=n(24109),p=n(92656),y=n(4358),f=n(55327),h=n(78763),v=n(6234);t.DRMModuleDefinition={name:r.ModuleName.DRM,module:{DrmService:u.DrmService,DRMManager:a.DRMManager,FairplayHandler:l.FairplayHandler,PlayReady:p.PlayReady,DRMDetectorService:h.DRMDetectorService,WebKitPrefixedEMEHandler:d.WebKitPrefixedEMEHandler,UnprefixedEMEHandler:c.UnprefixedEMEHandler,parseInitData:v.parseInitData,getLicenseState:f.getLicenseState,getLicenseInfoKey:y.getLicenseInfoKey,createDrmApi:o.createDrmApi,ContentProtectionHelper:s.ContentProtectionHelper},exports:{MediaKeySystemConfig:i.MediaKeySystemConfig}},t.default=t.DRMModuleDefinition},46658:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ParallelContentLoader=void 0;var r=n(4129),i=function(){function e(e,t){this.dS=[],this.bS=e,this.cS=t}return e.prototype.load=function(e,t,n,i,s,o,a,u){var c=this,d=new r.DefaultContentLoader(this.bS,this.cS);return this.dS.push(d),d.load(e,t,n,i,s,o,a,u).finally(function(){c.dS=c.dS.filter(function(e){return e!==d}),d.dispose()})},e.prototype.cancel=function(){this.dS.forEach(function(e){return e.cancel()})},e.prototype.isLoading=function(){return this.dS.some(function(e){return e.isLoading()})},e.prototype.isRetrying=function(){return this.dS.some(function(e){return e.isRetrying()})},e.prototype.dispose=function(){this.dS.forEach(function(e){return e.dispose()}),this.dS=[]},e}();t.ParallelContentLoader=i},86558:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.MSPrefixedEMEHandler=void 0,t.isMsPrefixedEmeHandlerSupported=function(e){return window.MSMediaKeys&&"function"==typeof MSMediaKeys.isTypeSupported&&MSMediaKeys.isTypeSupported(e)?Promise.resolve({keySystem:e}):Promise.reject("DOMException: Unsupported keySystem")};var r,i=n(40306),s=n(3336),o=n(34841),a=n(70850),u=n(19274),c=n(6234);!function(e){e.KeyMessage="mskeymessage",e.KeyAdded="mskeyadded",e.KeyError="mskeyerror"}(r||(r={}));var d=function(){function e(e){var t=this;this.Ibb=function(){if(t.ubb)return Promise.reject("EME handler destroyed");if(t.Gbb.readyState===HTMLMediaElement.HAVE_NOTHING)return a.Util.delay(250,t.Ibb);if(t.Gbb.msKeys)return Promise.resolve();try{t.Fbb=new MSMediaKeys(t.wbb),t.Gbb.msSetMediaKeys(t.Fbb)}catch(e){return t.xbb.fireError(new s.PlayerError(i.ErrorCode.DRM_MEDIA_KEY_INITIALIZATION_FAILED,{keySystem:t.wbb,eme:"msPrefixed",error:e},"Unable to initialize the DRM media keys: `msSetMediaKeys` failed.",t.vbb.sourceContext.sourceIdentifier)),Promise.reject(e)}return Promise.resolve()},this.Jbb=function(e){if(t.zbb&&t.zbb(),e){var n=(0,c.parseInitData)(e.initData);n&&n.length&&t.Cbb&&n.forEach(function(e){return t.Cbb(e)})}},this.vbb=e,this.ubb=!1,this.Bbb=[],this.ybb=!1,this.xbb=this.vbb.eventHandler}return Object.defineProperty(e.prototype,"Gbb",{get:function(){return this.vbb.videoElement},enumerable:!1,configurable:!0}),e.getVideoErrorNameFromError=function(e,t){for(var n in e)if((n.indexOf("MEDIA_ERR_")>-1||n.indexOf("MEDIA_KEYERR_")>-1)&&e[n]===t)return n;return"UNKNOWN"},e.getHexFromCode=function(e){return isFinite(e)?(e<0&&(e=4294967295+e+1),"0x"+e.toString(16).toUpperCase()):null},e.prototype.Hbb=function(t,n){if(this.ybb=!1,null!==t&&t.deferred.reject(),n&&n.target&&n.target.error){this.Gbb.removeEventListener(u.MediaElementEvent.error,this.Dbb);var r=n.target.error,o=Number(r.code),a=Number(r.systemCode),c=Number(r.msExtendedCode),d=e.getVideoErrorNameFromError(r,o),l=e.getHexFromCode(a),p=e.getHexFromCode(c)||l,y=i.ErrorCode[i.ErrorCode.DRM_KEY_ERROR]+" - "+d+" (code: "+o+"), "+p;this.xbb.fireError(new s.PlayerError(i.ErrorCode.DRM_KEY_ERROR,{code:o,systemCode:a},y,this.vbb.sourceContext.sourceIdentifier))}},e.prototype.Kbb=function(e,t){var n=this,r=t.target.sessionId;this.Ebb[r]=t.target,this.ybb=!0,this.tbb.handleLicenseRequest(t).then(function(t){n.Obb(t.body,r,e.id),e.license=t,n.ybb=!1}).catch(function(t){e.deferred.reject(t),n.ybb=!1})},e.prototype.Lbb=function(e,t){Boolean(e)&&Boolean(e.license)?e.deferred.resolve(e.license):e.deferred.resolve({response:"automatically added by EME",licenseRequestId:e.id}),this.ybb=!1},e.prototype.Mbb=function(e){var t=this.tbb.getCDMData();return t?this.Gbb.msKeys.createSession("video/mp4",e,new Uint8Array(t)):this.Gbb.msKeys.createSession("video/mp4",e)},e.prototype.Nbb=function(e){var t=this,n={deferred:new o.Deferred,id:a.Util.generateUniqueId()};return e?(this.Abb.then(function(){t.Gbb.msKeys&&(t.ybb?n.deferred.reject({status:"postponed",licenseRequestId:n.id}):(e.byteLength,t.ybb=!0,n.onKeyError=t.Hbb.bind(t,n),n.onKeyAdded=t.Lbb.bind(t,n),n.onKeyMessage=t.Kbb.bind(t,n),n.session=t.Mbb(new Uint8Array(e)),n.session.addEventListener(r.KeyError,n.onKeyError,!1),n.session.addEventListener(r.KeyAdded,n.onKeyAdded,!1),n.session.addEventListener(r.KeyMessage,n.onKeyMessage,!1),t.Bbb.push(n)))}),n.deferred.promise):Promise.reject("no init data ("+n.id+")")},e.prototype.Obb=function(e,t,n){this.ybb=!1,e&&this.Ebb[t].update(this.tbb.prepareLicense(e))},e.prototype.setWaitingForKeyListener=function(e){this.zbb=e},e.prototype.setEncryptedListener=function(e){this.Cbb=e},e.prototype.load=function(e,t){var n=this;return this.tbb=e,this.wbb=t,this.ubb=!1,this.Ebb={},this.Abb=this.Ibb(),this.Abb.then(function(){n.Dbb&&n.Gbb.removeEventListener(u.MediaElementEvent.error,n.Dbb),n.Dbb=n.Hbb.bind(n,null),n.Gbb.addEventListener(u.MediaElementEvent.error,n.Dbb)}).catch(function(){}),this.Gbb.addEventListener(u.MediaElementEvent.msneedkey,this.Jbb),this.Abb},e.prototype.reInitialize=function(){this.Gbb.eventHandler.hasEventHandler(u.MediaElementEvent.msneedkey,this.Jbb)||this.Gbb.addEventListener(u.MediaElementEvent.msneedkey,this.Jbb),null==this.Gbb.msKeys&&this.Gbb.msSetMediaKeys(this.Fbb)},e.prototype.Pbb=function(e){var t=e.getElementsByTagName("KID");if(!t)return null;for(var n="",r=0;r<t.length;r++){var i=t[r];i&&i.childNodes&&i.childNodes.length>0?n+=i.childNodes[0].nodeValue+";":i&&i.hasAttribute("value")?n+=i.getAttribute("value")+";":i&&i.hasAttribute("VALUE")&&(n+=i.getAttribute("VALUE")+";")}return n.split(";")[0]||null},e.prototype.Qbb=function(e){var t=new RegExp("p[\0]+l[\0]+a[\0]+y[\0]+r[\0]+e[\0]+a[\0]+d[\0]+y","gi"),n=new RegExp("w[\0]+r[\0]+m[\0]+h[\0]+e[\0]+a[\0]+d[\0]+e[\0]+r","gi"),r=t.test(e)||n.test(e);if(!e.includes("<")||!r)return e;for(var i=e.slice(e.indexOf("<")),s="",o=0;o<i.length;o+=2)s+=i[o];try{var a=new DOMParser;return this.Pbb(a.parseFromString(s,"application/xml"))||e}catch(t){return e}},e.prototype.getKeyUuidsFromInitData=function(e){var t,n;return null!==(n=null===(t=this.tbb)||void 0===t?void 0:t.getKeyUuidsFromInitData(e))&&void 0!==n?n:[]},e.prototype.getIdentifierFromInitData=function(e){return this.tbb?this.tbb.getIdentifierFromInitData(e):this.Qbb(e)},e.prototype.requestLicense=function(e,t){var n=this;return this.Abb.then(function(){return n.Nbb(e).then(function(e){return{initDataStr:t,license:e.body,response:e.response,licenseRequestId:e.licenseRequestId}}).catch(function(e){return Promise.reject({initDataStr:t,statusCode:e.status,licenseRequestId:e.licenseRequestId,response:e})})}).catch(function(e){return Promise.reject(e)})},e.prototype.isLicenseRequestOngoing=function(){return this.ybb},e.prototype.unload=function(){var e=this;this.ubb=!0,this.Gbb.removeEventListener(u.MediaElementEvent.msneedkey,this.Jbb),this.Gbb.removeEventListener(u.MediaElementEvent.error,this.Dbb),this.Bbb.forEach(function(e){try{var t=e.session;t.removeEventListener(r.KeyError,e.onKeyError),t.removeEventListener(r.KeyAdded,e.onKeyAdded),t.removeEventListener(r.KeyMessage,e.onKeyMessage)}catch(e){}});var t=Object.keys(this.Ebb||{}).map(function(t){return Promise.resolve(e.Ebb[t].close())});return this.Ebb={},this.tbb=null,this.wbb=null,this.Bbb=[],this.Abb=null,this.zbb=null,this.Fbb=null,Promise.all(t).catch(function(e){return Promise.resolve(null)})},e.prototype.suspend=function(){return Promise.resolve()},e}();t.MSPrefixedEMEHandler=d},70581:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.UnprefixedEMEHandler=void 0,t.isUnprefixedEmeHandlerSupported=function(e){return window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess(e,[{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.4d401e"'}]},{initDataTypes:["cenc"],videoCapabilities:void 0,audioCapabilities:void 0}]):Promise.reject("no requestMediaKeySystemAccess call available")};var s,o=n(66790),a=n(40306),u=n(3336),c=n(25926),d=n(4224),l=n(3714),p=n(33468),y=n(48488),f=n(21513),h=n(74853),v=n(34841),m=n(70233),S=n(15487),E=n(19274),b=n(67579),g=n(92656),L=n(4358),I=n(55327),D=n(56068),M=n(6234);!function(e){e.KeyMessage="message",e.KeyStatusChange="keystatuseschange"}(s||(s={}));var R=function(){function e(e){var t=this;this.Gq=function(e,n){if(!t.zq)return t.closeSession(e),Promise.resolve(n);var r=t.vq.get(e);return r&&(r.loaded=!0),t.Oq(n.body,e).then(function(){return n}).catch(function(e){return Promise.reject(e)})},this.encryptedEventHandler=function(e){e&&t.processMediaEncryptedEvent(e)},this.Pq=function(e){t.yq&&t.yq()},this.Tq=function(e,t){switch(e){case D.MediaKeyStatus.Usable:case D.MediaKeyStatus.Expired:case D.MediaKeyStatus.Pending:case D.MediaKeyStatus.OutputRestricted:}},this.Uq=function(e){var n,r=e.target,i=t.vq.get(r),s=t.Sq(r.keyStatuses),o=Object.values(s),a=Object.keys(s);if(i){var u=i.initDataStr;t.Wq(s,btoa(u)),t.hasExpiredKeys(o)&&(t.closeSession(r),t.vq.delete(r),null===(n=t.context.store)||void 0===n||n.dispatch((0,L.removeLicense)({initDataStr:u})));var c=!(!t.context.settings.CHECK_ALL_DRM_LICENSES_FOR_KID||!t.Cq)&&(0,I.verifyKeysAreUsableOrPendingOnAnyLicense)(a,(0,p.keySystemUidToKind)(t.uq),(0,I.getLicenseState)(t.Cq));if(!(a.length>0&&c)&&o.includes(D.MediaKeyStatus.OutputRestricted)){var d=Object.keys(s).filter(function(e){return s[e]===D.MediaKeyStatus.OutputRestricted});t.Vq(d,r,u)}}},this.context=e,this.sq=e.sourceContext.sourceIdentifier,this.vq=new Map,this.wq=[],this.xq=!1,this.tq=null}return Object.defineProperty(e.prototype,"video",{get:function(){return this.context.videoElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Cq",{get:function(){return this.context.store.getState()},enumerable:!1,configurable:!0}),e.prototype.Dq=function(e,t){var n=this,r=[],i=[];return t&&2===t.length&&(r=t[0]||[],i=t[1]||[]),e.hasOwnProperty("initDataTypes")||(e.initDataTypes=["cenc"]),e.hasOwnProperty("distinctiveIdentifier")||(e.distinctiveIdentifier="optional"),e.videoCapabilities&&e.videoCapabilities.length<1&&delete e.videoCapabilities,e.audioCapabilities&&e.audioCapabilities.length<1&&delete e.audioCapabilities,r&&r.length>0&&(e.audioCapabilities=e.audioCapabilities||[],e.audioCapabilities=e.audioCapabilities.concat(r),(this.Aq.audioRobustness||""===this.Aq.audioRobustness)&&e.audioCapabilities.forEach(function(e){e.robustness=n.Aq.audioRobustness})),i&&i.length>0&&(e.videoCapabilities=e.videoCapabilities||[],e.videoCapabilities=e.videoCapabilities.concat(i),(this.Aq.videoRobustness||""===this.Aq.videoRobustness)&&e.videoCapabilities.forEach(function(e){e.robustness=n.Aq.videoRobustness})),e},e.prototype.Eq=function(e,t){void 0===t&&(t=!1);var n=r({},this.Dq(this.rq.getMediaKeySystemConfiguration(),e));return(t||(0,f.default)().getState().capabilities.isTizen)&&(n.sessionTypes=[b.MediaKeySystemConfig.SessionType.Temporary]),[n,{initDataTypes:["cenc"],videoCapabilities:void 0,audioCapabilities:void 0,distinctiveIdentifier:n.distinctiveIdentifier,persistentState:n.persistentState,sessionTypes:n.sessionTypes}]},e.prototype.Fq=function(e){var t=this,n=this.Eq(e);return window.navigator.requestMediaKeySystemAccess(this.uq,n).catch(function(){var n=t.Eq(e,!0);return window.navigator.requestMediaKeySystemAccess(t.uq,n)}).then(function(e){var n=e.getConfiguration();return t.context.store.dispatch((0,L.setPersistentState)(t.Iq(n))),t.tq=n,e.createMediaKeys()})},e.prototype.Hq=function(e,t){var n=this;if(this.rq){this.xq=!0;var i=t.message,s=t.target,o=this.vq.get(s);o&&(o.expiration=s.expiration);var a=2===i.byteLength;btoa(h.ArrayHelper.arrayBufferToAsciiString(i,!0)),this.rq.handleLicenseRequest(t).then(this.Gq.bind(this,s)).then(function(t){!a&&e.resolve(r(r({},t),{session:s,wasLicenseRestored:!1}))}).catch(function(t){n.closeSession(s),n.vq.delete(s),e.reject(t)})}else e.reject("session destroyed")},e.prototype.Iq=function(e){var t=e||this.tq||{},n=t.persistentState,r=t.sessionTypes,i=void 0===r?[]:r;return n===b.MediaKeySystemConfig.PersistentState.Required&&i.includes(b.MediaKeySystemConfig.SessionType.PersistentLicense)},e.prototype.Jq=function(e,t,n){var r=this.video.mediaKeysObject,i=this.Iq()?r.createSession(b.MediaKeySystemConfig.SessionType.PersistentLicense):r.createSession(),s={expiration:null,initData:e,initDataStr:t,loaded:!1,onKeyMessage:n};return this.vq.set(i,s),i},e.prototype.Kq=function(e,t,n,r){var i=this,o=this.Hq.bind(this,r),a=this.Jq(e,t,o);return a.addEventListener(s.KeyStatusChange,this.Uq),a.addEventListener(s.KeyMessage,o),a.load(n).then(function(e){e?r.resolve({session:a,wasLicenseRestored:!0}):i.vq.delete(a)}).catch(function(e){r.reject(e),i.vq.delete(a)}),r.promise},e.prototype.Lq=function(e,t,n){var r=this,i=this.Hq.bind(this,n),o=this.Jq(e,t,i);return o.addEventListener(s.KeyStatusChange,this.Uq),o.addEventListener(s.KeyMessage,i),o.generateRequest("cenc",e).catch(function(e){r.vq.delete(o),n.reject(e),r.context.eventHandler.fireError(new u.PlayerError(a.ErrorCode.DRM_KEY_SESSION_INITIALIZATION_FAILED,{reason:e,licenseInitDataString:t},"Unable to initialize DRM key session: `MediaKeySession.generateRequest` failed.",r.sq))}),n.promise},e.prototype.setMediaKeys=function(e){var t=this,n=new v.Deferred;return this.video.mediaKeysPromise=(this.video.mediaKeysPromise||Promise.resolve()).then(function(){var r=t.video.setMediaKeys(e)||Promise.resolve();return n.resolve(r),r.then(function(){}).catch(function(e){return Promise.reject(e)})}),n.promise},e.prototype.Mq=function(e){e||this.context.eventHandler.dispatchEvent(l.PlayerEvent.Warning,new c.PlayerWarning(d.WarningCode.DRM_SERVER_CERTIFICATE_NOT_SUPPORTED))},e.prototype.onServerCertificateSetFailed=function(e,t,n){n.reason=t instanceof Error?t.message:"unknown error",this.context.eventHandler.fireError(new u.PlayerError(a.ErrorCode.DRM_CERTIFICATE_ERROR,n,"Unable to setup the key system: `MediaKeys.setServerCertificate` failed.",this.sq))},e.prototype.Nq=function(e,t){var n=this;this.Aq.serverCertificate&&e&&e.setServerCertificate(this.Aq.serverCertificate).then(function(e){return n.Mq(e)}).catch(function(r){return n.onServerCertificateSetFailed(e,r,t)})},e.prototype.setupKeySystem=function(e){var t=this,n={drmCapabilities:e,keySystem:this.uq,eme:"unprefixed"};return this.Fq(e).then(function(e){return n.createdMediaKeys=e,null===t.uq?Promise.reject(new Error(o.DrmSetupError.CANCELLED)):(t.video.mediaKeysObject=e,t.Nq(e,n),t.setMediaKeys(e))}).catch(function(e){var r;return(null==e?void 0:e.message)!==o.DrmSetupError.CANCELLED&&(n.reason=null!==(r=null==e?void 0:e.message)&&void 0!==r?r:e,t.context.eventHandler.fireError(new u.PlayerError(a.ErrorCode.DRM_MEDIA_KEY_INITIALIZATION_FAILED,n,"Unable to initialize the DRM key system with the specified combinations.",t.sq))),Promise.reject(e)})},e.prototype.Oq=function(e,t){return this.xq=!1,e&&this.rq?(this.wq.includes(t)||this.wq.push(t),t.update(this.rq.prepareLicense(e))):Promise.reject()},e.prototype.processMediaEncryptedEvent=function(e){var t=this,n=(0,M.parseInitData)(e.initData);n&&n.length&&this.Bq&&n.forEach(function(e){return t.Bq(e)})},e.prototype.hasExpiredKeys=function(e){return e.some(function(e){return e===D.MediaKeyStatus.Expired})},e.prototype.Qq=function(e){var t=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer);return(0,p.keySystemUidToKind)(this.uq)===p.KeySystemKind.PLAYREADY&&(0,S.isEdge)()&&g.PlayReady.kidToCENC(t),m.FormatHelper.bytesToUUID(t)},e.prototype.Rq=function(e,t){var n="",r="";return"string"==typeof e?(n=this.Qq(t),r=String(e)):"string"==typeof t&&(n=this.Qq(e),r=String(t)),[n,r]},e.prototype.Sq=function(e){var t=this,n={};return e.forEach(function(e,r){var i=t.Rq(e,r),s=i[0],o=i[1];n[s]=o}),n},e.prototype.Vq=function(e,t,n){var r,i=this;this.context.eventHandler.dispatchEvent(l.PlayerEvent.Warning,new c.PlayerWarning(d.WarningCode.DRM_RESTRICTED_OUTPUT,"Output restricted for "+e.join(", "))),e.forEach(function(e){var t;return null===(t=i.context.store)||void 0===t?void 0:t.dispatch((0,y.trackDrmKidError)(e))}),this.closeSession(t),this.vq.delete(t),null===(r=this.context.store)||void 0===r||r.dispatch((0,L.removeLicense)({initDataStr:n}))},e.prototype.Wq=function(e,t){var n=this;Object.keys(e).forEach(function(r){var i,s,o=e[r];null===(i=n.context.store)||void 0===i||i.dispatch((0,L.setMediaKeyStatus)((0,p.keySystemUidToKind)(n.uq),r,o,t)),o===D.MediaKeyStatus.InternalError&&(null===(s=n.context.store)||void 0===s||s.dispatch((0,y.trackDrmKidError)(r))),n.Tq(o,r)})},e.prototype.unload=function(){var e,t=this,n=[];this.vq.forEach(function(e,t){return n.push(t)}),this.video.removeEventListener(E.MediaElementEvent.waitingforkey,this.Pq),this.video.removeEventListener(E.MediaElementEvent.encrypted,this.encryptedEventHandler);var r=n.map(function(e){var n=t.closeSession(e);return t.wq.includes(e)?n:Promise.resolve()});this.rq=null,this.vq=new Map,this.wq=[],this.uq=null,this.yq=null,this.video.mediaKeysObject=null;var s=null===(e=this.zq)||void 0===e?void 0:e.catch(function(e){}).finally(function(){return t.zq=void 0});return Promise.all(i(i([],r,!0),[s],!1)).then(function(){return t.setMediaKeys(null).catch(function(e){})}).catch(function(e){})},e.prototype.closeSession=function(e){var t=this.vq.get(e);return t&&(e.removeEventListener(s.KeyStatusChange,this.Uq),e.removeEventListener(s.KeyMessage,t.onKeyMessage)),Promise.race([e.closed,e.close()]).catch(function(e){})},e.prototype.load=function(e,t,n,r){return this.rq=e,this.uq=t,this.Aq=n[(0,p.keySystemUidToKind)(t)],this.video.addEventListener(E.MediaElementEvent.encrypted,this.encryptedEventHandler),this.video.addEventListener(E.MediaElementEvent.waitingforkey,this.Pq),this.zq=this.setupKeySystem(r),this.zq},e.prototype.Xq=function(e){var t=!1;return this.vq.forEach(function(n){return t=t||n.initData===e}),t},e.prototype.reInitialize=function(){this.video.eventHandler.hasEventHandler(E.MediaElementEvent.encrypted,this.encryptedEventHandler)||this.video.addEventListener(E.MediaElementEvent.encrypted,this.encryptedEventHandler),this.video.eventHandler.hasEventHandler(E.MediaElementEvent.waitingforkey,this.Pq)||this.video.addEventListener(E.MediaElementEvent.waitingforkey,this.Pq)},e.prototype.Yq=function(e){if(!this.Cq)return!1;for(var t=(0,p.keySystemUidToKind)(this.uq),n=(0,I.getLicenseState)(this.Cq).drmData[t],r=0,i=Object.keys(n);r<i.length;r++){var s=n[i[r]];if(s.sessionId===e)return void 0===s.usedByPlayerId||s.usedByPlayerId===this.context.internalPlayerID}return!1},e.prototype.Zq=function(e,t,n,r){return e?this.Xq(e)?(r.reject({message:"session for requested initData already present"}),r.promise):n&&this.Iq()&&this.Yq(n)?this.Kq(e,t,n,r):this.Lq(e,t,r):(r.reject({message:"no initData provided for license request"}),r.promise)},e.prototype.aq=function(){return new v.Deferred},e.prototype.requestLicense=function(e,t,n){var r=this;this.xq=!0;var i=this.aq();return this.zq.then(function(){return null===r.video.mediaKeysObject?Promise.reject(new Error(o.DrmSetupError.CANCELLED)):r.Zq(e,t,n,i)}).then(function(e){r.xq=!1;var n=e.session,i=void 0===n?{}:n;return{initDataStr:t,license:e.wasLicenseRestored?null:e.body,sessionInfo:{sessionId:i.sessionId,expiration:i.expiration},restoredFromPersistentLicense:e.wasLicenseRestored}}).catch(function(e){return r.xq=!1,Promise.reject({response:e,initDataStr:t})})},e.prototype.getKeyUuidsFromInitData=function(e){var t,n;return null!==(n=null===(t=this.rq)||void 0===t?void 0:t.getKeyUuidsFromInitData(e))&&void 0!==n?n:[]},e.prototype.getIdentifierFromInitData=function(e){return this.rq?this.rq.getIdentifierFromInitData(e):e},e.prototype.isLicenseRequestOngoing=function(){return this.xq},e.prototype.setWaitingForKeyListener=function(e){this.yq=e},e.prototype.setEncryptedListener=function(e){this.Bq=e},e.prototype.suspend=function(){return Promise.resolve()},e.prototype.disposeSessionForInitData=function(e){var t=this,n=[];return this.vq.forEach(function(r,i){r.initDataStr===e&&(n.push(t.closeSession(i).then(function(){})),t.wq=t.wq.filter(function(e){return e.sessionId!==i.sessionId}),t.vq.delete(i))}),n.length<1?Promise.reject("Unable to find an existing drm session for "+e):Promise.all(n)},e}();t.UnprefixedEMEHandler=R},80680:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebKitPrefixedEMEHandler=void 0,t.isWebkitPrefixedEmeHandlerSupported=function(e,t){return"function"==typeof e.getWrappedElement().webkitGenerateKeyRequest&&"function"==typeof e.canPlayType&&e.canPlayType("video/mp4",t)?Promise.resolve({keySystem:t}):Promise.reject("DOMException: Unsupported keySystem")};var r,i,s=n(40306),o=n(3336),a=n(34841),u=n(19274),c=n(6234);!function(e){e[e.Domain=6]="Domain"}(r||(r={})),function(e){e[e.HDCP=1212433232]="HDCP"}(i||(i={}));var d=function(){function e(e){var t=this;this.sr=function(e){if(t.cq&&t.cq(),e){var n=(0,c.parseInitData)(e.initData);n&&n.length&&t.pr&&t.invokeEncryptedListener(e.initData,n)}},this.context=e,this.dq=e.sourceContext.sourceIdentifier,this.video=e.videoElement,this.or=[],this.rr=[]}return e.prototype.invokeEncryptedListener=function(e,t){var n=this;t.forEach(function(e){return n.pr(e)})},e.prototype.tr=function(e,t,n){this.or.includes(n)&&this.or.splice(this.or.indexOf(n)),this.video.webkitAddKey(this.selectedKeySystem,e,t,n)},e.prototype.ur=function(e,t,n){this.bq=!1,null!==e&&this.tr(this.keySystem.prepareLicense(e),t,n)},e.prototype.vr=function(e,t){null!==e&&e.deferred.reject();var n=t.target||{},a=n.error||n.errorCode||{},u=a.code,c=a.systemCode;u===r.Domain&&c===i.HDCP?this.context.eventHandler.fireError(new o.PlayerError(s.ErrorCode.DRM_RESTRICTED_OUTPUT,void 0,void 0,this.dq)):this.context.eventHandler.fireError(new o.PlayerError(s.ErrorCode.DRM_KEY_ERROR,{code:u,systemCode:c},void 0,this.dq))},e.prototype.wr=function(e,t){Boolean(e)&&Boolean(e.license)&&e.deferred.resolve(e.license),Boolean(e)&&Boolean(e.onKeyError)&&this.video.removeEventListener(u.MediaElementEvent.webkitkeyerror,e.onKeyError)},e.prototype.xr=function(e,t){var n=this,r=t.sessionId;t.kid=e.kid,this.or.includes(r)||(this.or.push(r),this.bq=!0,this.keySystem.handleLicenseRequest(t).then(function(t){n.ur(t.body,t.kid||e.initData,r),e.license=t}).catch(function(t){return e.deferred.reject(t)}))},e.prototype.yr=function(e,t){var n=this,r={kid:t,initData:e,deferred:new a.Deferred};return this.rr.push(r.deferred),r.onKeyError=this.vr.bind(this,r),r.onKeyAdded=this.wr.bind(this,r),r.onKeyMessage=this.xr.bind(this,r),this.video.addEventListener(u.MediaElementEvent.webkitkeyerror,r.onKeyError),this.video.addEventListener(u.MediaElementEvent.webkitkeyadded,r.onKeyAdded),this.video.addEventListener(u.MediaElementEvent.webkitkeymessage,r.onKeyMessage),this.video.webkitGenerateKeyRequest(this.selectedKeySystem,new Uint8Array(e)),r.deferred.promise.finally(function(){n.video.removeEventListener(u.MediaElementEvent.webkitkeyerror,r.onKeyError),n.video.removeEventListener(u.MediaElementEvent.webkitkeyadded,r.onKeyAdded),n.video.removeEventListener(u.MediaElementEvent.webkitkeymessage,r.onKeyMessage),n.zr(r.deferred)}),r.deferred.promise},e.prototype.zr=function(e){var t=this.rr.findIndex(function(t){return t===e});this.rr.splice(t,1)},e.prototype.unload=function(){var e;return this.qr&&this.video.removeEventListener(u.MediaElementEvent.webkitkeyerror,this.qr),this.rr.forEach(function(e){e.reject("unloading the WebKITPrefixedEMEHandler")}),this.rr=[],this.video.removeEventListener(u.MediaElementEvent.webkitneedkey,this.sr),this.selectedKeySystem=null,null===(e=this.keySystem)||void 0===e||e.dispose(),this.keySystem=null,this.cq=null,Promise.resolve()},e.prototype.load=function(e,t){return this.keySystem=e,this.selectedKeySystem=t,this.qr&&this.video.removeEventListener(u.MediaElementEvent.webkitkeyerror,this.qr),this.qr=this.vr.bind(this,null),this.video.addEventListener(u.MediaElementEvent.webkitneedkey,this.sr),this.video.addEventListener(u.MediaElementEvent.webkitkeyerror,this.qr),Promise.resolve()},e.prototype.reInitialize=function(){},e.prototype.requestLicense=function(e,t){var n=this;return this.bq=!0,this.yr(e).then(function(e){return n.bq=!1,{initDataStr:t,license:e.body}}).catch(function(e){return n.bq=!1,Promise.reject({initDataStr:t,statusCode:e.status,response:e})})},e.prototype.getKeyUuidsFromInitData=function(e){var t,n;return null!==(n=null===(t=this.keySystem)||void 0===t?void 0:t.getKeyUuidsFromInitData(e))&&void 0!==n?n:[]},e.prototype.getIdentifierFromInitData=function(e){return this.keySystem?this.keySystem.getIdentifierFromInitData(e):e},e.prototype.isLicenseRequestOngoing=function(){return this.bq},e.prototype.setWaitingForKeyListener=function(e){this.cq=e},e.prototype.setEncryptedListener=function(e){this.pr=e},e.prototype.suspend=function(){return Promise.resolve()},e}();t.WebKitPrefixedEMEHandler=d},92656:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.PlayReady=t.EMPTY_KEY_MESSAGE=void 0;var i=n(40306),s=n(3336),o=n(25926),a=n(4224),u=n(3714),c=n(57456),d=n(29669),l=n(51682),p=n(74853),y=n(70233),f=n(67579),h=n(46658),v="<WRMHEADER";function m(e){var t="string"==typeof e?(new DOMParser).parseFromString(e,"application/xml"):e;if(!t)return null;var n=t.getElementsByTagName("LA_URL");return n.length>0?n.item(0).textContent:null}t.EMPTY_KEY_MESSAGE="KeyMessageWasEmpty";var S=function(){function e(e,t){var n=this;this.context=e,this.Fr=function(e,t){null!==e&&(n.Dr(null==e?void 0:e.status)?n.context.eventHandler.dispatchEvent(u.PlayerEvent.Warning,new o.PlayerWarning(a.WarningCode.DRM_FAILED_LICENSE_REQUEST,"License request failed, retrying with other keys.",{responseCode:null==e?void 0:e.status,responseText:null==e?void 0:e.statusText,serverResponse:null==e?void 0:e.body})):n.context.eventHandler.fireError(new s.PlayerError(i.ErrorCode.DRM_FAILED_LICENSE_REQUEST,{statusCode:null==e?void 0:e.status,statusText:null==e?void 0:e.statusText,serverResponse:null==e?void 0:e.body},"Failed to load the PlayReady DRM license: ".concat(null==e?void 0:e.status," ").concat(null==e?void 0:e.statusText,"."),n.Ar)))},this.Ar=e.sourceContext.sourceIdentifier,this.Br=t,this.Cr=new h.ParallelContentLoader(e,{onFailure:this.Fr,maxRetries:t.maxLicenseRequestRetries,retryDelay:t.licenseRequestRetryDelay,requestType:d.HttpRequestType.DRM_LICENSE_PLAYREADY})}return e.getPlaintextChallengeText=function(e,t){var n=e.getElementsByTagName("Challenge")[0];if(n.hasOwnProperty("innerHTML"))return'<Challenge xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols/messages">'+n.innerHTML+"</Challenge>";var r=t.indexOf("<Challenge"),i=t.indexOf("</Challenge>")+12;return t.substring(r,i)},e.prototype.Dr=function(e){return!!this.Br.retryOtherKeysOnHttpStatusCode&&this.Br.retryOtherKeysOnHttpStatusCode.includes(e)},e.prototype.Er=function(t){var n=(new DOMParser).parseFromString(t,"application/xml");return n.getElementsByTagName("parsererror").length>0?[]:e.extractKeyIdsFromPlayReadyHeaders([n],this.context).map(e.base64KidToUuid)},e.prototype.Gr=function(n){var r,o=n.message.buffer||n.message,a=this.Br.hasOwnProperty("utf8message")&&this.Br.utf8message,u=p.ArrayHelper.arrayBufferToAsciiString(o,a);if(0===u.length)return t.EMPTY_KEY_MESSAGE;var c=(new DOMParser).parseFromString(u,"application/xml");if(c.getElementsByTagName("Challenge")[0])if(this.Br.hasOwnProperty("plaintextChallenge")&&this.Br.plaintextChallenge)r='<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><AcquireLicense xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols"><challenge>'+e.getPlaintextChallengeText(c,u)+"</challenge></AcquireLicense></soap:Body></soap:Envelope>";else{var d=c.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;d&&(r=window.atob(d))}var l={},y=u.match(/<HttpHeaders>.*<\/HttpHeaders>/);if(y&&1===y.length){var f=y[0].match(/<name>([^<]+?)<\/name>/g),h=y[0].match(/<value>([^<]+?)<\/value>/g);if(null===f||null===h||f.length!==h.length)return this.context.eventHandler.fireError(new s.PlayerError(i.ErrorCode.DRM_PLAYREADY_INVALID_HEADER_KEY_VALUE_PAIR,{headerNameListEmpty:null===f,headerValueListEmpty:null===h,headerPairLengthMismatch:(null==f?void 0:f.length)!==(null==h?void 0:h.length)},"An invalid key/value pair was encountered while parsing the PlayReady license request headers.",this.Ar)),null;for(var v=0;v<f.length;v++)l[f[v].replace(/<\/?name>/g,"")]=h[v].replace(/<\/?value>/g,"")}return{challenge:r,laURL:this.Br.LA_URL||n.destinationURL||n.defaultURL||m(c)||m(r),headers:l}},e.prototype.handleLicenseRequest=function(e){var n=this,r=this.Gr(e);if(r===t.EMPTY_KEY_MESSAGE)return Promise.reject(t.EMPTY_KEY_MESSAGE);if(!r||!r.laURL)return Promise.reject("no LA URL given");if(!("forceSSL"in this.Br)||this.Br.forceSSL){var i=document.createElement("a");i.href=r.laURL,i.protocol="https:",r.laURL=i.href}return r.headers=c.XhrHelper.mergeHeaders(r.headers,this.Br.headers||{}),this.Cr.load(r.laURL,d.HttpRequestMethod.POST,d.HttpResponseType.ARRAYBUFFER,r.challenge,r.headers,this.Br.withCredentials).catch(function(e){if(n.Dr(null==e?void 0:e.status)){var t=n.Er(r.challenge);e.failedKeyIds=t}throw e})},e.prototype.prepareLicense=function(e){try{return new Uint8Array(e)}catch(e){return this.context.eventHandler.fireError(new s.PlayerError(i.ErrorCode.DRM_KEY_ERROR,{reason:"Unable to construct a Uint8Array from the license response"},void 0,this.Ar)),null}},e.prototype.getCDMData=function(){if(this.Br&&this.Br.customData){for(var t=[],n=0;n<this.Br.customData.length;++n)t.push(this.Br.customData.charCodeAt(n)),t.push(0);var r=String.fromCharCode.apply(null,t);r=btoa(r);var i=e.PRCDMData.replace("%PROACTIVE%",Boolean(this.Br.proactiveLicense)+"").replace("%CUSTOMDATA%",r),s=[];for(n=0;n<i.length;++n)s.push(i.charCodeAt(n)),s.push(0);return new Uint8Array(s).buffer}return null},e.getPlayreadyRecordsFromWrmHeader=function(e,t){for(var n=0,r=[],i=p.ArrayHelper.sparseArrayBufferToAsciiString(e.buffer,2,t);n<i.length;){var s=i.indexOf(v,n),o=i.indexOf("WRMHEADER>",s);if(s>=0&&o>s&&n<o){var a=t+2*s,u=t+2*o+20;r.push({type:1,value:e.buffer.slice(a,u)}),n=o}else n=i.length}return r},e.getPlayReadyRecordsFromPlayreadyObject=function(e,t){var n=t+4,r=[],i=new DataView(e.buffer),s=i.getUint16(n,!0);n+=2;for(var o=0;o<s;o++){var a=i.getUint16(n,!0);n+=2;var u=i.getUint16(n,!0);n+=2;var c={type:a,value:e.buffer.slice(n,n+u)};r.push(c),n+=u}return r},e.isValidPlayReadyObject=function(e,t){var n=new DataView(e.buffer,t);return!(n.getUint32(0,!0)>n.byteLength)&&v.split("").map(function(e){return e.charCodeAt(0)}).some(function(e,t){return n.getUint16(t,!0)!==e})},e.getPlayReadyRecords=function(e,t){return this.isValidPlayReadyObject(e,t)?this.getPlayReadyRecordsFromPlayreadyObject(e,t):this.getPlayreadyRecordsFromWrmHeader(e,t)},e.parsePlayReadyRecord=function(e,t){if(1!==e.type)return null;try{return(new DOMParser).parseFromString(p.ArrayHelper.sparseArrayBufferToAsciiString(e.value),"application/xml")}catch(e){return null}},e.parseWrmHeader=function(e,t,n){var r=this;return void 0===n&&(n=null),this.getPlayReadyRecords(e,t).map(function(e){return r.parsePlayReadyRecord(e,n)}).filter(function(e){return null!==e})},e.prototype.Hr=function(e){var t=p.ArrayHelper.stringToArrayWithoutEncoding(e);return this.parsePlayReadyInitDataBuffer(t.buffer)},e.prototype.parsePlayReadyInitDataBuffer=function(t){for(var n=new DataView(t),r="",i=l.ISOBMFFConstants.BOX_SIZE_LENGTH,s=0;s<l.ISOBMFFConstants.BOX_TYPE_LENGTH;s++){var o=n.getInt8(i+s);r+=String.fromCharCode(o)}if("pssh"===r){i+=l.ISOBMFFConstants.BOX_TYPE_LENGTH;var a=n.getUint8(i);i+=l.ISOBMFFConstants.FULL_BOX_VERSION_LENGTH+l.ISOBMFFConstants.FULL_BOX_FLAGS_LENGTH+l.ISOBMFFConstants.PSSH_SYSTEM_ID_LENGTH,a>0&&(i+=4+n.getUint32(i)*l.ISOBMFFConstants.PSSH_KID_LEN),i+=4}return e.parseWrmHeader(new Uint8Array(t),i,this.context)},e.extractKeyIdsFromPlayReadyHeaders=function(e,t){for(var n,r,i,s=[],o=0;o<e.length;o++){var a=e[o].getElementsByTagName("KID");if(a&&a.length>0)for(var u=0;u<a.length;u++){var c=a[u],d=null===(n=c.textContent)||void 0===n?void 0:n.trim(),l=(null===(r=c.getAttribute("VALUE"))||void 0===r?void 0:r.trim())||(null===(i=c.getAttribute("value"))||void 0===i?void 0:i.trim()),p=d||l;p&&s.push(p)}}return s},e.prototype.getKeyUuidsFromInitData=function(t){return e.extractKeyIdsFromPlayReadyHeaders(this.parsePlayReadyInitDataBuffer(t),this.context).map(e.base64KidToUuid)},e.base64KidToUuid=function(t){var n=new Uint8Array(p.ArrayHelper.stringToArrayWithoutEncoding(atob(t)));return e.kidToCENC(n),y.FormatHelper.bytesToUUID(n)},e.prototype.getIdentifierFromInitData=function(t){if(!t.includes("<"))return t;var n=this.Hr(t),r=e.extractKeyIdsFromPlayReadyHeaders(n,this.context);return r&&r.length>0?r.join(";"):t},e.prototype.getMediaKeySystemConfiguration=function(){var e=this.Br.mediaKeySystemConfig,t={persistentState:f.MediaKeySystemConfig.PersistentState.Optional,sessionTypes:[f.MediaKeySystemConfig.SessionType.Temporary]};return"object"==typeof e?r(r({},t),e):t},e.swapBytes=function(e,t,n){var r=e[n];e[n]=e[t],e[t]=r},e.kidToCENC=function(t){e.swapBytes(t,0,3),e.swapBytes(t,1,2),e.swapBytes(t,4,5),e.swapBytes(t,6,7)},e.prototype.dispose=function(){this.Br=null,this.Cr.dispose()},e.PRCDMData='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="%PROACTIVE%"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>',e}();t.PlayReady=S},25271:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.PrimeTime=void 0;var r=n(40306),i=n(3336),s=n(4129),o=n(29669),a=function(){function e(e,t){var n=this;this.context=e,this.Wbb=function(e,t){n.context.eventHandler.fireError(new i.PlayerError(r.ErrorCode.DRM_FAILED_LICENSE_REQUEST,{statusCode:e.status,statusText:e.statusText,serverResponse:e.body},"Failed to load the PrimeTime DRM license: ".concat(e.status," ").concat(e.statusText,"."),n.Tbb))},this.Tbb=e.sourceContext.sourceIdentifier,this.Ubb=t,this.Vbb=new s.DefaultContentLoader(e,{onFailure:this.Wbb,maxRetries:t.maxLicenseRequestRetries,retryDelay:t.licenseRequestRetryDelay,requestType:o.HttpRequestType.DRM_LICENSE_PRIMETIME})}return e.prototype.handleLicenseRequest=function(t){var n,r,i=t.message;switch(this.Ubb.headers&&Object.keys(this.Ubb.headers).length>0&&(n=this.Ubb.headers),t.messageType){case e.INDIVIDUALIZATION_REQUEST:r=this.Ubb.indivURL||this.Ubb.LA_URL;break;case e.LICENSE_REQUEST:case e.LICENSE_RELEASE:default:r=this.Ubb.LA_URL}return this.Vbb.load(r,o.HttpRequestMethod.POST,o.HttpResponseType.ARRAYBUFFER,i,n,this.Ubb.withCredentials,"application/json")},e.prototype.prepareLicense=function(e){return new Uint8Array(e)},e.prototype.getCDMData=function(){return null},e.prototype.getKeyUuidsFromInitData=function(e){return[]},e.prototype.getIdentifierFromInitData=function(e){return e},e.prototype.getMediaKeySystemConfiguration=function(){var e=this.Ubb.mediaKeySystemConfig;return"object"==typeof e?e:{}},e.prototype.dispose=function(){this.Ubb=null,this.Vbb.dispose(),this.Vbb=null},e.INDIVIDUALIZATION_REQUEST="individualization-request",e.LICENSE_REQUEST="license-request",e.LICENSE_RELEASE="license-release",e}();t.PrimeTime=a},31884:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.TVKey=void 0;var i=n(40306),s=n(3336),o=n(4129),a=n(29669),u=n(74853),c=n(67579),d=n(92378),l=function(){function e(e,t){var n=this;this.context=e,this.tvkeyConfig=t,this.Ybb=function(e,t){n.context.eventHandler.fireError(new s.PlayerError(i.ErrorCode.DRM_FAILED_LICENSE_REQUEST,{responseCode:e.status,responseText:e.statusText,serverResponse:e.body},"Failed to load the TVKey DRM license: ".concat(e.status," ").concat(e.statusText,"."),n.context.sourceContext.sourceIdentifier))},this.Xbb=new o.DefaultContentLoader(e,{onFailure:this.Ybb,maxRetries:t.maxLicenseRequestRetries,requestType:a.HttpRequestType.DRM_LICENSE_TVKEY})}return e.prototype.Zbb=function(e){if("function"==typeof this.tvkeyConfig.prepareMessage)return this.tvkeyConfig.prepareMessage(e);var t=new Uint8Array(e.message),n=u.ArrayHelper.convertBufferSourceToUTF8(t);return'{"OttLicenseRequestMessage":'.concat(n,"}")},e.prototype.abb=function(){var e=this.tvkeyConfig.headers||{};return r({"Content-Type":"application/json"},e)},e.prototype.handleLicenseRequest=function(e){if(!this.tvkeyConfig.LA_URL)return Promise.reject(new Error("No LA URL given"));var t=this.Zbb(e),n=this.abb();return this.Xbb.load(this.tvkeyConfig.LA_URL,a.HttpRequestMethod.POST,a.HttpResponseType.TEXT,t,n,this.tvkeyConfig.withCredentials,"application/json")},e.prototype.prepareLicense=function(e){return"function"==typeof this.tvkeyConfig.prepareLicense?this.tvkeyConfig.prepareLicense(e):"string"==typeof e?u.ArrayHelper.stringToArrayWithoutEncoding(e):new Uint8Array(e)},e.prototype.getCDMData=function(){return null},e.prototype.getKeyUuidsFromInitData=function(e){return(0,d.parseKidsFromTVKeyPssh)(e,this.context.logger)},e.prototype.getIdentifierFromInitData=function(e){try{var t=u.ArrayHelper.stringToArrayWithoutEncoding(e),n=(0,d.parseKidsFromTVKeyPssh)(t.buffer,this.context.logger);return n.length?n.join(";"):e}catch(t){return e}},e.prototype.getMediaKeySystemConfiguration=function(){var e;return r({persistentState:c.MediaKeySystemConfig.PersistentState.Optional,sessionTypes:[c.MediaKeySystemConfig.SessionType.Temporary]},null!==(e=this.tvkeyConfig.mediaKeySystemConfig)&&void 0!==e?e:{})},e.prototype.dispose=function(){this.Xbb.dispose()},e}();t.TVKey=l},81982:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Widevine=void 0;var i=n(40306),s=n(3336),o=n(25926),a=n(4224),u=n(3714),c=n(29669),d=n(48488),l=n(67579),p=n(46658),y=n(51063),f=function(){function e(e,t){var n=this;this.context=e,this.qcb=function(e,t){n.fbb(e.status)?n.context.eventHandler.dispatchEvent(u.PlayerEvent.Warning,new o.PlayerWarning(a.WarningCode.DRM_FAILED_LICENSE_REQUEST,"License request failed, retrying with other keys.",{responseCode:e.status,responseText:e.statusText,serverResponse:e.body})):n.context.eventHandler.fireError(new s.PlayerError(i.ErrorCode.DRM_FAILED_LICENSE_REQUEST,{responseCode:e.status,responseText:e.statusText,serverResponse:e.body},"Failed to load the Widevine DRM license: ".concat(e.status," ").concat(e.statusText,"."),n.bbb))},this.bbb=e.sourceContext.sourceIdentifier,this.cbb=t,this.ebb=new Map,this.dbb=new p.ParallelContentLoader(e,{onFailure:this.qcb,maxRetries:t.maxLicenseRequestRetries,retryDelay:t.licenseRequestRetryDelay,requestType:c.HttpRequestType.DRM_LICENSE_WIDEVINE})}return e.prototype.fbb=function(e){return this.cbb.retryOtherKeysOnHttpStatusCode?this.cbb.retryOtherKeysOnHttpStatusCode.includes(e):!(!this.cbb.retryOtherKeysOnForbiddenLicense||403!==e)},e.prototype.rcb=function(e){return"function"==typeof this.cbb.prepareMessage?this.cbb.prepareMessage(e):e.message},e.prototype.scb=function(){return this.cbb.headers&&Object.keys(this.cbb.headers).length>0?this.cbb.headers:void 0},e.prototype.tcb=function(e){var t=(0,y.parseWidevineLicenseRequestProtoBuf)(e);void 0!==t&&this.ebb.set(t.requestId,t.requestedKeyIds)},e.prototype.handleLicenseRequest=function(e){if(!this.cbb.LA_URL)return Promise.reject("no LA URL given");var t=this.rcb(e),n=this.scb();return this.tcb(t),this.dbb.load(this.cbb.LA_URL,c.HttpRequestMethod.POST,c.HttpResponseType.ARRAYBUFFER,t,n,this.cbb.withCredentials,"application/json")},e.prototype.ucb=function(e){var t;if("function"==typeof this.cbb.prepareLicense){var n=this.cbb.prepareLicense({license:e});return null!==(t=null==n?void 0:n.license)&&void 0!==t?t:void 0}},e.prototype.vcb=function(e){var t=new Uint8Array(e),n=this.ucb(t);return null!=n?n:t},e.prototype.wcb=function(e){this.context.store.dispatch((0,d.trackDrmKidError)(e))},e.prototype.xcb=function(e){var t,n=this,r=(0,y.parseWidevineLicenseResponseProtoBuf)(e);void 0!==r&&(null!==(t=this.ebb.get(r.requestId))&&void 0!==t?t:[]).filter(function(e){return!r.returnedKeyIds.includes(e)}).forEach(function(e){return n.wcb(e)})},e.prototype.prepareLicense=function(e){return this.xcb(e),this.vcb(e)},e.prototype.getCDMData=function(){return null},e.prototype.getKeyUuidsFromInitData=function(e){return(0,y.parseKidsFromWidevinePssh)(e)},e.prototype.getIdentifierFromInitData=function(e){return e},e.prototype.getMediaKeySystemConfiguration=function(){var e,t=this.cbb.mediaKeySystemConfig,n=null===(e=null==t?void 0:t.sessionTypes)||void 0===e?void 0:e.includes(l.MediaKeySystemConfig.SessionType.PersistentLicense),i={persistentState:l.MediaKeySystemConfig.PersistentState.Optional,sessionTypes:n?[l.MediaKeySystemConfig.SessionType.PersistentLicense]:[l.MediaKeySystemConfig.SessionType.Temporary]};return"object"==typeof t?r(r({},i),t):i},e.prototype.dispose=function(){this.cbb=null,this.dbb.dispose(),this.ebb.clear()},e}();t.Widevine=f},4358:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.getInitialLicenseState=void 0,t.addLicense=function(e){return(0,s.createAction)(a.LicenseActionType.AddLicense,e)},t.updateLicense=function(e){return(0,s.createAction)(a.LicenseActionType.UpdateLicense,e)},t.removeLicense=function(e){return(0,s.createAction)(a.LicenseActionType.RemoveLicense,e)},t.resetLicense=function(e){return(0,s.createAction)(a.LicenseActionType.ResetLicense,e)},t.resetLicenses=function(){return(0,s.createAction)(a.LicenseActionType.ResetLicenses)},t.clearLicenseStorage=function(){return(0,s.createAction)(a.LicenseActionType.ClearLicenseStorage)},t.initializeLicenseStorage=function(e){return(0,s.createAction)(a.LicenseActionType.InitializeLicenseStorage,{storageHandler:e})},t.setPersistentState=function(e){return(0,s.createAction)(a.LicenseActionType.SetPersistentState,e)},t.setMediaKeyStatus=function(e,t,n,r){return(0,s.createAction)(a.LicenseActionType.SetMediaKeyStatus,{keySystemKind:e,keyUuid:t,status:n,initDataStr:r})},t.loadLicences=d,t.maybeStoreLicences=function(e,t){e&&((0,o.clearTimeoutIfDefined)(c),c=window.setTimeout(function(){return function(e,t){try{var n=e.drmData,s={};Object.keys(n).forEach(function(e){s[e]={},Object.entries(n[e]).forEach(function(t){var n=t[0],o=t[1],u=void 0===o?{}:o,c=(u.license,u.initData,i(u,["license","initData"]));delete c.publicId,s[e][n]=r(r({},c),{hasLicense:!1,isPending:!1,wasRequested:!1,mediaKeyStatus:a.MediaKeyStatus.Unknown})})});var o=JSON.stringify(r(r({},e),{drmData:s}));t.set(u,o)}catch(e){}}(e,t)}))},t.getLicenseInfoKey=function(e){return btoa(e)};var s=n(35267),o=n(88844),a=n(56068),u="bitmovinplayer_licenseStorage",c=-1;function d(e){try{var t=e.get(u);return JSON.parse(t)||{}}catch(e){return{}}}t.getInitialLicenseState=function(e){var t=d(e);return r({inPersistentState:!1,drmData:{}},t)}},91921:function(e,t,n){var r,i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.LicenseReducer=void 0;var s=n(33468),o=n(3793),a=n(4358),u=n(56068),c={drmData:{},inPersistentState:!1};function d(e,t,n){var r,s=(0,a.getLicenseInfoKey)(t),o=i(i({},e),{drmData:i({},e.drmData)});return n?(e.drmData[n]?o.drmData[n]=i(i({},e.drmData[n]),((r={})[s]=i({},e.drmData[n][s]),r)):o.drmData[n]={},o):o}function l(e,t){var n,r=t.initDataStr,s=t.licenseInfo,o=t.systemName,u=d(e,r,o),c=(0,a.getLicenseInfoKey)(r),l=e.drmData[o]&&e.drmData[o][c]||{};return u.drmData[o]=i(i({},e.drmData[o]),((n={})[c]=i(i({},l),s),n)),u}t.LicenseReducer=(0,o.default)(c,((r={})[u.LicenseActionType.AddLicense]=function(e,t){return l(e,t.payload)},r[u.LicenseActionType.UpdateLicense]=function(e,t){return l(e,t.payload)},r[u.LicenseActionType.RemoveLicense]=function(e,t){return function(e,t){var n=t.initDataStr,r=null,i=(0,a.getLicenseInfoKey)(n);return Object.keys(e.drmData).forEach(function(t){if(t){var o=(r=d(r||e,n,s.KeySystemKind[t])).drmData[t];r.drmData[t]=o?Object.keys(o).filter(function(e){return i!==e}).reduce(function(e,t){return e[t]=o[t],e},{}):{}}}),r||e}(e,t.payload)},r[u.LicenseActionType.ResetLicense]=function(e,t){return l(e,t.payload)},r[u.LicenseActionType.ResetLicenses]=function(e){return function(e){var t={};return Object.keys(e.drmData).forEach(function(n){n&&(t[n]={},Object.entries(e.drmData[n]).forEach(function(e){var r=e[0],s=e[1];t[n][r]=i(i({},s),{keyIds:[],license:null,hasLicense:!1,isPending:!1,wasRequested:!1,initData:null,usedByPlayerId:void 0})}))}),{inPersistentState:e.inPersistentState,drmData:t}}(e)},r[u.LicenseActionType.SetPersistentState]=function(e,t){var n=t.payload;return i(i({},e),{inPersistentState:n})},r[u.LicenseActionType.ClearLicenseStorage]=function(){return c},r[u.LicenseActionType.InitializeLicenseStorage]=function(e,t){var n=t.payload;return(0,a.getInitialLicenseState)(n.storageHandler)},r[u.LicenseActionType.SetMediaKeyStatus]=function(e,t){var n,r=t.payload,s=r.keySystemKind,o=r.keyUuid,a=r.status,u=r.initDataStr,c=e.drmData[s];if(!(null==c?void 0:c[u]))return e;var d=i({},c),l=d[u];return l.keyIds.includes(o)&&(d[u]=i(i({},l),{mediaKeyStatus:a})),i(i({},e),{drmData:i(i({},e.drmData),(n={},n[s]=d,n))})},r))},55327:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getLicenseState=void 0,t.verifyKeysAreUsableOrPendingOnAnyLicense=function(e,t,n){var i=(0,r.getAllLicensesForKeySystem)(t,n).flatMap(function(e){return e.keyIds});return e.filter(function(e){return i.includes(e)}).map(function(e){return(0,r.hasMatchingLicenseInfoForKeySystem)(e,(0,r.getKeySystemMap)(n,t),r.isMediaKeyStatusUnknownOrPendingOrUsable)}).every(function(e){return!0===e})};var r=n(58857);t.getLicenseState=function(e){return e.drmLicenses}},56068:function(e,t){var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.MediaKeyStatus=t.LicenseActionType=void 0,function(e){e.AddLicense="@instance/license/add",e.UpdateLicense="@instance/license/update",e.RemoveLicense="@instance/license/remove",e.ResetLicense="@instance/license/reset",e.ResetLicenses="@instance/license/reset-all",e.SetMediaKeyStatus="@instance/license/setMediaKeyStatus",e.SetPersistentState="@instance/license/setPersistentState",e.ClearLicenseStorage="@instance/license/clearLicenseStorage",e.InitializeLicenseStorage="@instance/license/initializeLicenseStorage"}(n||(t.LicenseActionType=n={})),function(e){e.Unknown="unknown",e.Usable="usable",e.Expired="expired",e.Released="released",e.Pending="status-pending",e.OutputRestricted="output-restricted",e.OutputDownscaled="output-downscaled",e.InternalError="internal-error"}(r||(t.MediaKeyStatus=r={}))},78763:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.DRMDetectorService=void 0;var s=n(33468),o=n(74853),a=n(15487),u=n(35987),c=n(24273),d=function(){function e(){this.Ir=new c.EMEWrapper}return e.prototype.isSupported=function(e){return this.Ir?this.Ir.isSupported(e):Promise.reject("No supported EME available")},e.prototype.getSupported=function(){var e=this,t=Object.keys(s.KeySystemMap).flatMap(function(e){return s.KeySystemMap[e]});return(0,u.allSettledPromises)(t.map(function(t){return e.isSupported(t).catch(function(){return""})})).then(function(e){return e.filter(function(e){return e})})},e.prototype.getSupportedCapabilities=function(e,t,n){var s;if(p(t)){var a=l(t).map(function(e){return r(r({},e),{contentType:e.contentType.replace("ac-3","ec-3")})});a=a.filter(function(e){return!(0,o.contains)(t,e)}),s=i(i([],t,!0),a,!0)}else s=t;return this.Ir.getSupportedCapabilities(e,s,n).then(function(e){if(p(t)){var n=e.audioCapabilities;e.audioCapabilities=function(e){var t=e.filter(function(e){var t;return null===(t=e.contentType)||void 0===t?void 0:t.includes("ec-3")}).map(function(e){return r(r({},e),{contentType:e.contentType.replace("ec-3","ac-3")})}).filter(function(t){return!(0,o.contains)(e,t)});return i(i([],e,!0),t,!0)}(n),e.audioCapabilities=e.audioCapabilities.filter(function(e){return(0,o.contains)(t,e,function(e,t){return e.contentType===t.contentType})})}return e})},e.prototype.dispose=function(){this.Ir.dispose()},e}();function l(e){return e.filter(function(e){var t;return null===(t=e.contentType)||void 0===t?void 0:t.includes("ac-3")})}function p(e){return l(e).length>0&&(0,a.isTizen)()&&(0,a.getTizenVersion)().major>=a.TIZEN_2018_MAJOR_VERSION}t.DRMDetectorService=d},24273:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.EMEWrapper=void 0;var r=n(57387),i=n(84568),s="DOMException: Unsupported keySystem",o=[{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.4d401e"'}]},{initDataTypes:["cenc"],videoCapabilities:void 0,audioCapabilities:void 0}],a=function(){function e(){this.eS=document.createElement("video"),this.fS=(0,i.memoize)(this.kS.bind(this),function(e,t,n){return String((0,r.calcHash)(JSON.stringify({keySystem:e,audioCapabilities:t,videoCapabilities:n})))})}return e.prototype.isSupported=function(e){var t;return"function"==typeof window.WebKitMediaKeys?this.gS(e):"function"==typeof window.navigator.requestMediaKeySystemAccess?this.hS(e).then(function(e){return e.keySystem}):"function"==typeof window.MSMediaKeys?this.iS(e):"function"==typeof(null===(t=this.eS)||void 0===t?void 0:t.webkitGenerateKeyRequest)?this.jS(e):Promise.reject(s)},e.prototype.gS=function(e){var t,n;return(null===(n=(t=window.WebKitMediaKeys).isTypeSupported)||void 0===n?void 0:n.call(t,e))?Promise.resolve(e):Promise.reject(s)},e.prototype.hS=function(e,t){void 0===t&&(t=o);try{return window.navigator.requestMediaKeySystemAccess(e,t)}catch(e){return Promise.reject(e)}},e.prototype.iS=function(e){var t,n;return(null===(n=(t=window.MSMediaKeys).isTypeSupported)||void 0===n?void 0:n.call(t,e))?Promise.resolve(e):Promise.reject(s)},e.prototype.jS=function(e){var t;return(null===(t=this.eS)||void 0===t?void 0:t.canPlayType("video/mp4",e))?Promise.resolve(e):Promise.reject(s)},e.prototype.getSupportedCapabilities=function(e,t,n){return this.fS(e,t,n)},e.prototype.kS=function(e,t,n){if("function"==typeof window.navigator.requestMediaKeySystemAccess){var r=[{initDataTypes:["cenc"],audioCapabilities:t,videoCapabilities:n},{initDataTypes:["cenc"],videoCapabilities:void 0,audioCapabilities:void 0}];return window.navigator.requestMediaKeySystemAccess(e,r).then(function(e){var r,i,s=e.getConfiguration();return{audioCapabilities:null!==(r=null==s?void 0:s.audioCapabilities)&&void 0!==r?r:t,videoCapabilities:null!==(i=null==s?void 0:s.videoCapabilities)&&void 0!==i?i:n}}).catch(function(){return{audioCapabilities:t,videoCapabilities:n}})}return Promise.resolve({audioCapabilities:t,videoCapabilities:n})},e.prototype.dispose=function(){this.eS=null,this.fS.invalidate()},e}();t.EMEWrapper=a},84344:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.mergeKeySystemPriorities=t.resolveDRMSystem=t.instantiateDRMSystem=void 0,t.resolveUsedDRMSystem=b;var s=n(80813),o=n(33468),a=n(70962),u=n(67579),c=n(92656),d=n(25271),l=n(31884),p=n(81982),y=n(99921),f=n(30665),h=function(e,t){var n=function(e){return"boolean"==typeof e},s=function(e){return"number"==typeof e&&e!==1/0&&e!==-1/0&&!isNaN(e)},u=Object.keys(t).filter(function(n){return!!t[n]&&n in e}).reduce(function(e,i){return e[i]=r(r({},t[i]),{licenseRequestRetryDelay:s(t[i].licenseRequestRetryDelay)?Math.max(0,t[i].licenseRequestRetryDelay):a.DefaultSettings.DRM_RETRY_DELAY,maxLicenseRequestRetries:s(t[i].maxLicenseRequestRetries)?Math.floor(Math.max(0,t[i].maxLicenseRequestRetries)):a.DefaultSettings.DRM_MAX_RETRIES,withCredentials:n(t[i].withCredentials)?t[i].withCredentials:a.DefaultSettings.DRM_WITH_CREDENTIALS}),e},Object.create(null)),c=function(e){var t=[o.KeySystemKind.FAIRPLAY,o.KeySystemKind.PLAYREADY,o.KeySystemKind.PRIMETIME,o.KeySystemKind.WIDEVINE,o.KeySystemKind.TVKEY],n=(Array.isArray(e)?e.filter(function(e){return t.includes(e)}):[]).reduce(function(e,t){return e.includes(t)||e.push(t),e},[]),r=[o.KeySystemKind.PLAYREADY,o.KeySystemKind.FAIRPLAY,o.KeySystemKind.TVKEY,o.KeySystemKind.WIDEVINE,o.KeySystemKind.PRIMETIME].filter(function(e){return!n.includes(e)});return i(i([],n,!0),r,!0)}(t.preferredKeySystems);return r(r({},u),{preferredKeySystems:c})},v=function(e,t){var n=Object.keys(e).flatMap(function(t){return e[t].map(function(e){return{kind:t,uid:e}})});return t.flatMap(function(e){var t=e.kind;return n.map(function(e){return{emeHandler:{kind:t},keySystem:e}})})},m=function(e,t){var n,r,i,s=(0,f.or)(function(e){return e.keySystem.kind===o.KeySystemKind.FAIRPLAY},function(e){return!!t.playready&&!!t.playready.customData&&e.keySystem.kind===o.KeySystemKind.PLAYREADY&&e.emeHandler.kind===y.EMEHandlerKind.UNPREFIXED}),a=(0,f.or)(function(e){return!!t.playready&&e.keySystem.kind===o.KeySystemKind.PLAYREADY},function(e){return!!t.primetime&&e.keySystem.kind===o.KeySystemKind.PRIMETIME},function(e){return!!t.widevine&&e.keySystem.kind===o.KeySystemKind.WIDEVINE},function(e){return!!t.tvkey&&e.keySystem.kind===o.KeySystemKind.TVKEY}),c=e.filter((0,f.and)((0,f.not)(s),a));return(null===(i=null===(r=null===(n=t.playready)||void 0===n?void 0:n.mediaKeySystemConfig)||void 0===r?void 0:r.sessionTypes)||void 0===i?void 0:i.includes(u.MediaKeySystemConfig.SessionType.PersistentLicense))?c.filter(function(e){return e.keySystem.uid!==o.KeySystemMap[o.KeySystemKind.PLAYREADY][1]}):c},S=function(e,t){var n=function(e,t){return t.weight-e.weight},r=function(e){return e.wrapped},i=function(e,t){return function(n){var r=t(n),i=e.findIndex(function(e){return e===r});return{weight:-1!==i?e.length-i:i,wrapped:n}}},s=i([y.EMEHandlerKind.WEBOS_2017_UNPREFIXED,y.EMEHandlerKind.WEBOS_UNPREFIXED,y.EMEHandlerKind.WEBOS_WEBKIT_PREFIXED,y.EMEHandlerKind.PLAYSTATION_4,y.EMEHandlerKind.UNPREFIXED,y.EMEHandlerKind.TIZEN,y.EMEHandlerKind.WEBKIT_PREFIXED,y.EMEHandlerKind.MS_PREFIXED],function(e){return e.emeHandler.kind}),o=i(e,function(e){return e.keySystem.kind});return t.map(o).sort(n).map(r).reduce(function(e,t){var n=e[e.length-1];return void 0!==n&&n[n.length-1].keySystem.kind===t.keySystem.kind?n.push(t):e.push([t]),e},[]).flatMap(function(e){return e.map(s).sort(n).map(r)})},E=function(e,t,n){switch(e){case o.KeySystemKind.FAIRPLAY:throw new Error("Can not create Fairplay instance");case o.KeySystemKind.PLAYREADY:return new c.PlayReady(n,t.playready);case o.KeySystemKind.PRIMETIME:return new d.PrimeTime(n,t.primetime);case o.KeySystemKind.WIDEVINE:return new p.Widevine(n,t.widevine);case o.KeySystemKind.TVKEY:return new l.TVKey(n,t.tvkey);default:throw new Error("Could not create KeySystem ".concat(e))}};function b(e,n,r){var i=h(e,n),s=(0,y.allEMEHandlers)(r).filter(function(e){return e.isAvailable}),a=(0,t.mergeKeySystemPriorities)(e,n),u=v(a,s),c=m(u,i),d=S(i.preferredKeySystems,c),l=function(e){if(0===e.length){var t=Object.keys(n).filter(function(e){return Object.values(o.KeySystemKind).includes(e)}).join(", ");return Promise.reject("Unable to find a valid DRM key system! The provided DRM key system configurations [".concat(t,"] are not supported."))}var r=e[0],i=e.slice(1),a=s.find(function(e){return e.kind===r.emeHandler.kind});return a?a.isSupported(r.keySystem.uid).then(function(){return r}).catch(function(){return l(i)}):l(i)};return l(d)}t.instantiateDRMSystem=function(e,t,n){return r(r({},e),{config:t,emeHandler:r(r({},e.emeHandler),{instance:(0,y.createEMEHandlerInstance)(e.emeHandler.kind,n)}),keySystem:r(r({},e.keySystem),{instance:E(e.keySystem.kind,t,n)})})},t.resolveDRMSystem=function(e,n,r){var i=h(e,n),a=r.serviceManager.get(s.ServiceName.DrmService);return(a?a.getResolvedKeySystemFromSourceConfig():Promise.resolve(null)).then(function(s){return s&&0===Object.values(o.KeySystemKind).filter(function(e){return!(e in s.config)&&e in i}).length?(0,t.instantiateDRMSystem)(s,i,r):b(e,n,r).then(function(e){return(0,t.instantiateDRMSystem)(e,i,r)})})},t.mergeKeySystemPriorities=function(e,t){for(var n,r,i={fairplay:[],playready:[],primetime:[],widevine:[],tvkey:[]},s=function(e,s){if(!e||!Object.values(o.KeySystemKind).some(function(t){return t===e}))return"continue";var a=e,u=null!==(r=null===(n=null==t?void 0:t[a])||void 0===n?void 0:n.keySystemPriority)&&void 0!==r?r:[];i[a]=u;var c=s.filter(function(e){return!u.includes(e)});i[a]=i[a].concat(c)},a=0,u=Object.entries(e);a<u.length;a++){var c=u[a];s(c[0],c[1])}return i}},99921:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createEMEHandlerInstance=t.allEMEHandlers=t.EMEHandlerKind=void 0;var r,i=n(21513),s=n(15487),o=n(88052),a=n(62756),u=n(86558),c=n(70581),d=n(80680);!function(e){e.MS_PREFIXED="MS_PREFIXED",e.WEBOS_UNPREFIXED="WEBOS_UNPREFIXED",e.WEBOS_WEBKIT_PREFIXED="WEBOS_WEBKIT_PREFIXED",e.WEBOS_2017_UNPREFIXED="WEBOS_2017_UNPREFIXED",e.UNPREFIXED="UNPREFIXED",e.PLAYSTATION_4="PLAYSTATION_4",e.TIZEN="TIZEN",e.WEBKIT_PREFIXED="WEBKIT_PREFIXED"}(r||(t.EMEHandlerKind=r={}));var l=function(e){return(0,c.isUnprefixedEmeHandlerSupported)(e)},p=function(e){return(0,u.isMsPrefixedEmeHandlerSupported)(e)},y=function(e){return function(t){return(0,d.isWebkitPrefixedEmeHandlerSupported)(e.videoElement,t)}};t.allEMEHandlers=function(e){return[{kind:r.UNPREFIXED,isAvailable:!0,isSupported:l},{kind:r.WEBOS_UNPREFIXED,isAvailable:(0,i.getCapabilities)().isWebOS&&o.ModuleManager.has(a.ModuleName.Webos),isSupported:l},{kind:r.WEBOS_2017_UNPREFIXED,isAvailable:(0,i.getCapabilities)().isWebOS&&(0,s.isWebOs2017)()&&o.ModuleManager.has(a.ModuleName.Webos),isSupported:l},{kind:r.WEBOS_WEBKIT_PREFIXED,isAvailable:(0,i.getCapabilities)().isWebOS&&o.ModuleManager.has(a.ModuleName.Webos),isSupported:y(e)},{kind:r.MS_PREFIXED,isAvailable:!0,isSupported:p},{kind:r.PLAYSTATION_4,isAvailable:(0,i.getCapabilities)().isPlayStation4&&o.ModuleManager.has(a.ModuleName.PlayStation4),isSupported:l},{kind:r.TIZEN,isAvailable:(0,i.getCapabilities)().isTizen&&o.ModuleManager.has(a.ModuleName.Tizen),isSupported:y(e)},{kind:r.WEBKIT_PREFIXED,isAvailable:!0,isSupported:y(e)}]},t.createEMEHandlerInstance=function(e,t){switch(e){case r.MS_PREFIXED:return new u.MSPrefixedEMEHandler(t);case r.WEBOS_UNPREFIXED:return new(o.ModuleManager.get(a.ModuleName.Webos).getWebosUnprefixedEmeHandlerConstructor())(t);case r.WEBOS_2017_UNPREFIXED:return new(o.ModuleManager.get(a.ModuleName.Webos).getWebos2017UnprefixedEmeHandlerConstructor())(t);case r.WEBOS_WEBKIT_PREFIXED:return new(o.ModuleManager.get(a.ModuleName.Webos).getWebosWebkitPrefixedEmeHandlerConstructor())(t);case r.TIZEN:return new(o.ModuleManager.get(a.ModuleName.Tizen).getTizenEMEHandlerConstructor())(t);case r.PLAYSTATION_4:return new(o.ModuleManager.get(a.ModuleName.PlayStation4).getPlayStation4EMEHandlerConstructor())(t);case r.UNPREFIXED:return new c.UnprefixedEMEHandler(t);case r.WEBKIT_PREFIXED:return new d.WebKitPrefixedEMEHandler(t);default:throw new Error("Could not create EMEHandler")}}},30665:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeFromObject=t.memoOne=t.not=t.or=t.and=void 0,t.and=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.reduce(function(e,n){return e&&n.apply(void 0,t)},!0)}},t.or=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.reduce(function(e,n){return e||n.apply(void 0,t)},!1)}},t.not=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return!e.apply(void 0,t)}};var n=function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0};t.memoOne=function(e,t){var r,i=null,s=void 0!==t?t:n;return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return null!==i&&s(t,i)||(r=e.apply(void 0,t),i=t),r}},t.removeFromObject=function(e,t){return Object.keys(e).filter(function(e){return!t.includes(e)}).reduce(function(t,n){return t[n]=e[n],t},Object.create(null))}},6234:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseInitData=function(e){if(!e||e.byteLength<i.ISOBMFFConstants.BOX_SIZE_LENGTH+i.ISOBMFFConstants.BOX_TYPE_LENGTH)return[];var t=0,n=e instanceof Uint8Array?e.buffer:e,r=new DataView(n),s=[];do{var o=r.getUint32(t),u=n.slice(t,t+o);t+=o;var c=a(u);c&&s.push(c)}while(t<e.byteLength);return s};var r=n(25811),i=n(51682),s=n(74853),o=n(70233);function a(e){var t={},n=new DataView(e),a=i.ISOBMFFConstants.BOX_SIZE_LENGTH,u=s.ArrayHelper.extractAsciiString(n,a,i.ISOBMFFConstants.BOX_TYPE_LENGTH);if(a+=i.ISOBMFFConstants.BOX_TYPE_LENGTH,"pssh"!==u)return null;var c=n.getUint8(a);a+=i.ISOBMFFConstants.FULL_BOX_VERSION_LENGTH+i.ISOBMFFConstants.FULL_BOX_FLAGS_LENGTH;var d=s.ArrayHelper.extractHexString(n,a,i.ISOBMFFConstants.PSSH_SYSTEM_ID_LENGTH);if(a+=i.ISOBMFFConstants.PSSH_SYSTEM_ID_LENGTH,t.systemIDraw=d,t.systemID="urn:uuid:".concat(o.FormatHelper.beautifyUUID(d)),r.DRMSchemeIDURIs.hasOwnProperty(t.systemID)&&(t.systemName=r.DRMSchemeIDURIs[t.systemID]),c>0){var l=n.getUint32(a);a+=i.ISOBMFFConstants.PSSH_KID_COUNT_LENGTH,t.kid=[];for(var p=0;p<l;p++)t.kid.push(s.ArrayHelper.extractHexString(n,a,i.ISOBMFFConstants.PSSH_KID_LEN)),a+=i.ISOBMFFConstants.PSSH_KID_LEN}return t.initData=e,t.initDataStr=s.ArrayHelper.arrayBufferToAsciiString(e,!0),t}},35987:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.allSettledPromises=function(e){if(!e||!Array.isArray(e))return Promise.reject("The passed argument is not an array");var t=[],n=e.length>0,r=Promise.resolve(null);return e.forEach(function(e,i){r=r.then(function(){return e}).then(function(e){t[i]=e,n=!1}).catch(function(){t[i]=void 0})}),r.then(function(){return n?Promise.reject(t):t})}},49988:function(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProtoBufWireType=void 0,t.parseProtoBufMessage=function(e){for(var t=h(e)?new Uint8Array(e).buffer:e,n=[],r=new l(t);r.hasNext();){var i=f(r);if(!i)break;var s=v(i,r);s&&n.push(s)}return n},t.getFieldsByFieldNumber=function(e,t){return e.filter(function(e){return e.fieldNumber===t})},t.findFieldByFieldNumber=function(e,t){return e.find(function(e){return e.fieldNumber===t})},t.isLengthLimitedProtoBufField=function(e){return void 0!==e&&e.wireType===r.LengthLimited&&h(e.value)};var r,i=127,s=128,o=7,a=7,u=3,c=8,d=4;!function(e){e[e.VarInt=0]="VarInt",e[e.Bit64=1]="Bit64",e[e.LengthLimited=2]="LengthLimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"}(r||(t.ProtoBufWireType=r={}));var l=function(){function e(e){this.rjb=0,this.sjb=new Uint8Array(e)}return e.prototype.hasNext=function(){return this.rjb<this.sjb.byteLength},e.prototype.getNext=function(){if(this.hasNext()){var e=this.sjb[this.rjb];return this.rjb++,e}},e.prototype.reset=function(){this.rjb=0},e}();function p(e){var t,n=[];do{if(void 0===(t=e.getNext()))break;n.push(t&i)}while(t&s);return n.reduce(function(e,t,n){return e+(t<<n*o)},0)}function y(e,t){for(var n=[],r=0;r<t;r++){var i=e.getNext();if(void 0===i)break;n.push(i)}return n}function f(e){var t=p(e);if(void 0!==t)return{wireType:t&a,fieldNumber:t>>u}}function h(e){return Array.isArray(e)&&e.every(function(e){return"number"==typeof e})}function v(e,t){switch(e.wireType){case r.VarInt:return n(n({},e),{value:p(t)});case r.Bit64:return n(n({},e),{value:y(t,c)});case r.LengthLimited:var i=p(t);if(!i)return;return n(n({},e),{value:y(t,i)});case r.Bit32:return n(n({},e),{value:y(t,d)});case r.StartGroup:case r.EndGroup:default:return}}},92378:function(e,t,n){var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.parseKidsFromTVKeyPssh=function(e,t){try{var n=(0,u.parseInitData)(e).flatMap(function(e){return function(e){var t,n=null!==(t=e.kid)&&void 0!==t?t:[],o=function(e){var t=e.initData,n=new DataView(t),r=function(e){var t=new DataView(e),n=i.ISOBMFFConstants.BOX_SIZE_LENGTH+i.ISOBMFFConstants.BOX_TYPE_LENGTH+i.ISOBMFFConstants.FULL_BOX_VERSION_LENGTH+i.ISOBMFFConstants.FULL_BOX_FLAGS_LENGTH+i.ISOBMFFConstants.PSSH_SYSTEM_ID_LENGTH;if(t.getUint8(i.ISOBMFFConstants.BOX_SIZE_LENGTH+i.ISOBMFFConstants.BOX_TYPE_LENGTH)>0){var r=t.getUint32(n);n+=i.ISOBMFFConstants.PSSH_KID_COUNT_LENGTH+r*i.ISOBMFFConstants.PSSH_KID_LEN}return n}(t),o=n.getUint32(r),a=r+i.ISOBMFFConstants.PSSH_DATA_SIZE;if(o<=0||a+o>t.byteLength)return[];var u=new Uint8Array(t,a,o),c=s.ArrayHelper.convertBufferSourceToUTF8(u),d=JSON.parse(atob(c));return"string"==typeof d.keyId?[d.keyId]:[]}(e);return r(r([],n,!0),o,!0)}(e)}).map(c);return(0,a.removeDuplicates)(n)}catch(e){return[]}};var i=n(51682),s=n(74853),o=n(70233),a=n(70850),u=n(6234),c=function(e){return e.includes("-")?e:o.FormatHelper.beautifyUUID(e)}},51063:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseWidevineLicenseRequestProtoBuf=function(e){var t=M(e,r.LicenseRequest);if(t){var n=(0,a.findFieldByFieldNumber)(t,d);if((0,a.isLengthLimitedProtoBufField)(n)){var i=(0,a.parseProtoBufMessage)(n.value),o=(0,a.findFieldByFieldNumber)(i,l);if((0,a.isLengthLimitedProtoBufField)(o)){var u=(0,a.parseProtoBufMessage)(o.value),c=(0,a.findFieldByFieldNumber)(u,p),f=(0,a.findFieldByFieldNumber)(u,y);if((0,a.isLengthLimitedProtoBufField)(f)&&(0,a.isLengthLimitedProtoBufField)(c)){var h=s.ArrayHelper.arrayBufferToBase64(new Uint8Array(f.value).buffer),v=R((0,a.parseProtoBufMessage)(c.value));if(v)return{requestId:h,requestedKeyIds:v}}}}}},t.parseWidevineLicenseResponseProtoBuf=function(e){var t=M(e,r.License);if(t){var n=(0,a.findFieldByFieldNumber)(t,h);if((0,a.isLengthLimitedProtoBufField)(n)){var i=(0,a.parseProtoBufMessage)(n.value),u=(0,a.findFieldByFieldNumber)(i,v);if((0,a.isLengthLimitedProtoBufField)(u)){var c=s.ArrayHelper.arrayBufferToBase64(new Uint8Array(u.value).buffer),d=function(e){return(0,a.getFieldsByFieldNumber)(e,m).filter(a.isLengthLimitedProtoBufField).map(function(e){return(0,a.parseProtoBufMessage)(e.value)}).filter(D)}(t);if(0!==d.length){var l=function(e){for(var t=[],n=0,r=e;n<r.length;n++){var i=r[n],s=(0,a.findFieldByFieldNumber)(i,S);if(!(0,a.isLengthLimitedProtoBufField)(s))return;t.push(o.FormatHelper.bytesToUUID(new Uint8Array(s.value).buffer))}return t}(d);if(l&&function(e){return e.every(function(e){return"string"==typeof e})}(l))return{requestId:c,returnedKeyIds:l}}}}}},t.parseKidsFromWidevinePssh=function(e){var t=function(e){var t=new DataView(e.buffer);if(!(t.byteLength<=g)){if(1===t.getUint8(g)&&t.byteLength>b){var n=t.getUint32(b);return e.buffer.slice(28+n*L)}return e.buffer.slice(28)}}(new Uint8Array(e));if(!t)return[];var n=R((0,a.parseProtoBufMessage)(t));return null!=n?n:[]};var r,i,s=n(74853),o=n(70233),a=n(49988),u=4,c=2,d=2,l=1,p=1,y=3,f=2,h=1,v=1,m=3,S=1,E=1,b=27,g=8,L=16,I=32;function D(e){var t=(0,a.findFieldByFieldNumber)(e,u);return(null==t?void 0:t.value)===i.Content}function M(e,t){var n=(0,a.parseProtoBufMessage)(e);if(function(e,t){return function(e){var t=(0,a.findFieldByFieldNumber)(e,E);if("number"==typeof(null==t?void 0:t.value))return null==t?void 0:t.value}(e)===t}(n,t))return function(e){var t=(0,a.findFieldByFieldNumber)(e,c);if((0,a.isLengthLimitedProtoBufField)(t))return(0,a.parseProtoBufMessage)(t.value)}(n)}function R(e){var t=(0,a.getFieldsByFieldNumber)(e,f).filter(a.isLengthLimitedProtoBufField).filter(function(e){return e.value.length===L||e.value.length===I}).map(function(e){return e.value.length===I?o.FormatHelper.beautifyUUID(String.fromCodePoint.apply(null,e.value)):o.FormatHelper.bytesToUUID(new Uint8Array(e.value).buffer)});return t.length>0?t:void 0}!function(e){e[e.LicenseRequest=1]="LicenseRequest",e[e.License=2]="License"}(r||(r={})),function(e){e[e.Content=2]="Content"}(i||(i={}))}},function(e){return function(){return e(47272)}()}])});
|
|
17
|
+
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.drm=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.drm=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[766],{67579:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MediaKeySystemConfig=void 0,function(e){!function(e){e.Required="required",e.Optional="optional"}(e.PersistentState||(e.PersistentState={})),function(e){e.Optional="optional",e.NotAllowed="not-allowed"}(e.DistinctiveIdentifier||(e.DistinctiveIdentifier={})),function(e){e.Temporary="temporary",e.PersistentLicense="persistent-license"}(e.SessionType||(e.SessionType={}))}(n||(t.MediaKeySystemConfig=n={}))},88559:function(e,t,n){var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentProtectionHelper=void 0;var i=n(25811),s=n(51682),o=n(33468),a=n(74853),u=n(70233),c=n(92656),d="_cenc:default_KID",l=function(){function e(){}return e.extractUint32FromString=function(e,t){return(e.charCodeAt(t)<<24)+(e.charCodeAt(t+1)<<16)+(e.charCodeAt(t+2)<<8)+e.charCodeAt(t+3)},e.parseKeyIds=function(e){var t=c.PlayReady.parseWrmHeader(e,4);if(!t||!t.length)return[];var n=c.PlayReady.extractKeyIdsFromPlayReadyHeaders(t);return n&&n.length?n.map(function(e){return function(e){var t=a.ArrayHelper.stringToArrayWithoutEncoding(atob(e));return c.PlayReady.kidToCENC(t),a.ArrayHelper.arrayBufferToAsciiString(t.buffer)}(e)}):[]},e.getFirstKeyId=function(e){if(!e||!e.length)return null;for(var t=0,n=e;t<n.length;t++){var r=p(n[t]);if(r&&r.length)return r[0]}return null},e.writeKeySystemId=function(e,t,n){return e.setUint32(t,parseInt(n.substring(0,8),16)),t+=4,e.setUint32(t,parseInt(n.substring(8,16),16)),t+=4,e.setUint32(t,parseInt(n.substring(16,24),16)),t+=4,e.setUint32(t,parseInt(n.substring(24,32),16)),t+4},e.writeKeyIds=function(t,n,r){return t.setUint32(n,r.length),n+=4,r.forEach(function(r){t.setUint32(n,e.extractUint32FromString(r,0)),n+=4,t.setUint32(n,e.extractUint32FromString(r,4)),n+=4,t.setUint32(n,e.extractUint32FromString(r,8)),n+=4,t.setUint32(n,e.extractUint32FromString(r,12)),n+=4}),n},e.extractKeySystemIdFromUri=function(e){return e.replace(/-/g,"").split(":")[2]},e.wrapInPsshBox=function(e,t){var n=a.ArrayHelper.stringToArrayWithoutEncoding(atob(e)),r=this.parseKeyIds(n),i=r.length>0,o=s.ISOBMFFConstants.BOX_SIZE_LENGTH+s.ISOBMFFConstants.BOX_TYPE_LENGTH+s.ISOBMFFConstants.FULL_BOX_VERSION_LENGTH+s.ISOBMFFConstants.FULL_BOX_FLAGS_LENGTH+s.ISOBMFFConstants.PSSH_SYSTEM_ID_LENGTH+s.ISOBMFFConstants.PSSH_DATA_SIZE;i&&(o+=s.ISOBMFFConstants.PSSH_KID_COUNT_LENGTH+r.length*s.ISOBMFFConstants.PSSH_KID_LEN);var u=this.extractKeySystemIdFromUri(t),c=o+n.byteLength,d=new Uint8Array(c),l=new DataView(d.buffer),y=0;if(l.setUint32(y,c),y+=4,l.setUint32(y,1886614376),y+=4,l.setUint8(y,i?1:0),y+=1,y+=3,!u||32!==u.length)return a.ArrayHelper.arrayBufferToAsciiString(n.buffer);y=this.writeKeySystemId(l,y,u),i&&(y=this.writeKeyIds(l,y,r)),l.setUint32(y,n.length),y+=4;for(var f=0;f<n.byteLength;f++)l.setUint8(y+f,n[f]);return btoa(a.ArrayHelper.arrayBufferToAsciiString(d.buffer))},e.parseBoxSize=function(e){return new DataView(e.buffer,0).getUint32(0)},e.parseBoxType=function(e){var t=new DataView(e.buffer,4);return String.fromCharCode(t.getUint8(0))+String.fromCharCode(t.getUint8(1))+String.fromCharCode(t.getUint8(2))+String.fromCharCode(t.getUint8(3))},e.isValidPsshBox=function(e){var t=a.ArrayHelper.stringToArrayWithoutEncoding(atob(e)),n=this.parseBoxSize(t),r=this.parseBoxType(t);return n===t.byteLength&&"pssh"===r},e.extractKidsFromPSSHBox=function(e){if(!e||e.byteLength<3)return[];var t=8,n=[],r=new DataView(e);if(r.getUint8(t)<=0)return[];t+=20;var i=r.getUint32(t);t+=4;for(var s=0;s<i;s++){for(var o="",a=t;a<t+16;a++)o+=("00"+r.getUint8(a).toString(16)).slice(-2);t+=16,n.push(u.FormatHelper.beautifyUUID(o))}return n},e.parseContentProtection=function(t,n){var r=function(e){if(i.DRMSchemeIDURIs[e])return e;var t=(0,o.keySystemUidToKind)(e);return(0,i.keySystemNameToSchemeUri)(t)}(t.keyformat);if(!r)return null;e.isValidPsshBox(n)||(n=e.wrapInPsshBox(n,r));var s={schemeIdUri:r,pssh:n};return t.keyid&&(s.defaultKid=t.keyid),s},e.parseContentProtectionDescriptors=function(e){return e.filter(y).map(f)},e}();function y(e){var t;return i.DRMSchemeIDURIs.hasOwnProperty(null===(t=null==e?void 0:e._schemeIdUri)||void 0===t?void 0:t.toLowerCase())}function f(e){var t,n={schemeIdUri:e._schemeIdUri.toLowerCase(),name:i.DRMSchemeIDURIs[e._schemeIdUri.toLowerCase()]};"cenc"===n.name&&"string"==typeof e[d]&&(n.defaultKid=e[d].toLowerCase());var s=(null===(t=e.pssh)||void 0===t?void 0:t.length)>0?e.pssh:function(e,t){return(null==e?void 0:e.length)>0?e.map(function(e){return{__text:l.wrapInPsshBox(e.__text,t)}}):[]}(e.pro,e._schemeIdUri);return s.length>0&&(n.pssh=[],n.kids=[],n.psshData=[]),s.forEach(function(e){var t=atob(e.__text),i=a.ArrayHelper.stringToArrayWithoutEncoding(t).buffer,s=l.extractKidsFromPSSHBox(i);n.pssh.push(t),n.psshData.push(i),n.kids=r(r([],n.kids,!0),s,!0)}),n}function p(e){var t=e._schemeIdUri.toLowerCase(),n=i.DRMSchemeIDURIs[t];return"cenc"===n&&"string"==typeof e[d]?[e[d].toLowerCase()]:"playready"===n&&e.pro&&e.pro.length?function(e){var t=h(e,"pro");return l.parseKeyIds(t).map(function(e){return u.FormatHelper.bytesToUUID(a.ArrayHelper.stringToArrayWithoutEncoding(e))})}(e):function(e){var t=h(e,"pssh");return l.extractKidsFromPSSHBox(t.buffer)}(e)}function h(e,t){var n=function(e,t){var n,r,i=null!==(n=e[t])&&void 0!==n?n:null;if(!i)return"";var s=null!==(r=i[0])&&void 0!==r?r:null;return s?s.__text:""}(e,t);return a.ArrayHelper.stringToArrayWithoutEncoding(atob(n))}t.ContentProtectionHelper=l},29173:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.DRMManager=void 0;var i=n(66790),s=n(40306),o=n(3336),a=n(20213),u=n(33468),c=n(48488),d=n(15971),l=n(74853),y=n(34841),f=n(49867),p=n(70581),h=n(92656),m=n(58857),v=n(84344),E=function(){function e(e){var t=this;this.zm=function(){return Promise.all([t.vm.promise,t.wm.promise]).then(t.Gm).then(function(){var e,n,r,i=t.usedKeySystem.kind===u.KeySystemKind.PLAYREADY,s=null!==(r=null===(n=null===(e=(0,d.getSourceState)(t.context))||void 0===e?void 0:e.drm)||void 0===n?void 0:n.keyIdsWithErrors)&&void 0!==r?r:[];i&&s.length>0&&t.ym.maybeScheduleRecovery(s)}).catch(function(){})},this.Am=function(e){return t.addInitData(e)},this.isLicenseRequestOngoing=function(){return!(!t.emeHandler||"function"!=typeof t.emeHandler.isLicenseRequestOngoing)&&t.emeHandler.isLicenseRequestOngoing()},this.Em=function(e,n){var r;if(e.response!==h.EMPTY_KEY_MESSAGE)if(e.hasOwnProperty("statusCode")&&"postponed"===e.statusCode)t.licenseStorage.resetLicense(t.usedKeySystem.kind,e.initDataStr);else if(t.usedKeySystem.kind){var i="object"==typeof e.response?e.response:null;((null===(r=null==i?void 0:i.failedKeyIds)||void 0===r?void 0:r.length)?i.failedKeyIds:n).forEach(function(e){t.context.store.dispatch((0,c.trackDrmKidError)(e))}),t.licenseStorage.addLicense(t.usedKeySystem.kind,{initDataStr:e.initDataStr})}},this.Fm=function(e){t.usedKeySystem.kind&&t.licenseStorage.addLicense(t.usedKeySystem.kind,e)},this.Gm=function(){Boolean(t.usedKeySystem.kind)&&!t.um&&t.context.eventHandler.fireError(new o.PlayerError(s.ErrorCode.DRM_INIT_DATA_MISSING,{drmKeySystem:t.usedKeySystem.kind},"No init data was found in the manifest or the segments for the used key system.",t.context.sourceContext.sourceIdentifier))},this.context=e,this.emeHandler=null,this.tm=!1,this.licenseStorage=new m.LicenseStorage(this.context),this.context.videoElement.drmHandler=this,this.um=!1,this.vm=new y.Deferred,this.vm.promise.catch(function(){}),this.wm=new y.Deferred,this.usedKeySystem={kind:null,uid:null},this.ym=new f.DrmStallRecovery(this.context)}return e.prototype.shutdown=function(){var e;return this.xm=!0,this.ym.dispose(),this.licenseStorage.dispose(),this.context.videoElement.drmHandler=null,this.tm=!1,this.usedKeySystem={kind:null,uid:null},this.um=!1,this.vm.reject(),null===(e=(0,d.getSourceStore)(this.context))||void 0===e||e.dispatch((0,c.resetUsedKeySystem)()),null===this.emeHandler?Promise.resolve():(this.emeHandler.setWaitingForKeyListener(null),this.emeHandler.unload())},e.prototype.Bm=function(){var e=this;this.licenseStorage.getEntriesWithoutLicense().filter(function(t){return t.systemName!==e.usedKeySystem.kind}).forEach(function(t){return e.licenseStorage.remove(t.initDataStr)})},e.prototype.Cm=function(){this.licenseStorage.getEntriesWithoutLicense().some(function(e){return e.initData})&&(this.um=!0)},e.prototype.Dm=function(){var e=this;this.licenseStorage.getEntriesWithoutLicense().filter(function(e){return e.initData&&!e.initDataStr}).forEach(function(t){var n=e.emeHandler.getIdentifierFromInitData(l.ArrayHelper.arrayBufferToAsciiString(t.initData));e.licenseStorage.updateInitData(r(r({},t),{initDataStr:n}))})},e.prototype.setConfig=function(e,t){var n=this,r=(0,u.getRelevantKeySystemMap)(e);return(0,v.resolveDRMSystem)(r,e,this.context).then(function(e){var r;if(n.xm)return Promise.reject(new Error(i.DrmSetupError.CANCELLED));n.usedKeySystem=e.keySystem,n.tm=!0,null===(r=(0,d.getSourceStore)(n.context))||void 0===r||r.dispatch((0,c.setUsedKeySystem)(n.usedKeySystem)),n.emeHandler=e.emeHandler.instance,n.emeHandler.setEncryptedListener(n.Am),n.emeHandler.setWaitingForKeyListener(n.zm);var s=n.emeHandler.load(e.keySystem.instance,e.keySystem.uid,e.config,t);return n.Bm(),n.Cm(),n.Dm(),n.requestMissingLicenses(),n.vm.resolve(),s.then(function(){return e.emeHandler.kind})}).catch(function(e){return null!==n.emeHandler&&n.emeHandler.unload(),n.vm.reject(),Promise.reject(e)})},e.prototype.requestMissingLicenses=function(){var e,t,n,r=this;if(this.tm&&this.usedKeySystem.kind){var i=this.licenseStorage.getEntriesWithoutLicense(),s=null!==(n=null===(t=null===(e=(0,d.getSourceState)(this.context))||void 0===e?void 0:e.drm)||void 0===t?void 0:t.keyIdsWithErrors)&&void 0!==n?n:[];i.forEach(function(e){var t=e.initData,n=e.initDataStr,i=e.sessionId,o=e.systemName,a=e.wasRequested,u=e.isPending;o===r.usedKeySystem.kind?t?a||e.keyIds.length>0&&e.keyIds.every(function(e){return s.includes(e)})||(r.licenseStorage.setRequested(n,o),r.emeHandler.requestLicense(t,n,i).then(r.Fm).catch(function(t){return r.Em(t,e.keyIds)})):u||r.licenseStorage.setPending(n,o):r.licenseStorage.remove(n)})}},e.prototype.preprocessInitDataStr=function(e){var t;return e.initDataStr?null===(t=this.emeHandler)||void 0===t?void 0:t.getIdentifierFromInitData(e.initDataStr):void 0},e.prototype.hasOngoingLicenseRequests=function(e){return this.licenseStorage.hasOngoingLicenseRequests(e)},e.prototype.hasUsableMediaKey=function(e){return this.emeHandler instanceof p.UnprefixedEMEHandler?this.licenseStorage.hasUsableOrPendingMediaKey(e,this.usedKeySystem.kind):this.licenseStorage.hasLicense(e,this.usedKeySystem.kind)},e.prototype.addInitData=function(e){var t,n;if(e&&(!this.usedKeySystem.kind||e.systemName===this.usedKeySystem.kind)){var i=this.preprocessInitDataStr(e),s=this.usedKeySystem.kind||e.systemName,o=i?this.licenseStorage.getLicense(i,s):void 0;(null==o?void 0:o.initData)||(e.initDataStr=i,e.kid=null!==(n=null===(t=this.emeHandler)||void 0===t?void 0:t.getKeyUuidsFromInitData(e.initData))&&void 0!==n?n:[],o?this.licenseStorage.updateInitData(r(r({},o),{systemName:s,initData:e.initData,initDataStr:e.initDataStr,keyIds:e.kid})):this.licenseStorage.add(e),this.um=this.um||Boolean(this.usedKeySystem.kind&&e.initData)),this.requestMissingLicenses()}},e.prototype.getUsedKeySystemKind=function(){return this.usedKeySystem.kind},e.prototype.getUsedKeySystemUid=function(){return this.usedKeySystem.uid},e.prototype.reInitializeEmeHandler=function(){var e;null===(e=this.emeHandler)||void 0===e||e.reInitialize()},e.prototype.signalInitDataShouldBeAvailable=function(){this.wm.resolve()},e.prototype.prepareForMseShutdown=function(){var e,t,n;return null!==(n=null===(t=null===(e=this.emeHandler)||void 0===e?void 0:e.prepareForMseShutdown)||void 0===t?void 0:t.call(e))&&void 0!==n?n:Promise.resolve()},e.prototype.suspend=function(){var e,t;return null!==(t=null===(e=this.emeHandler)||void 0===e?void 0:e.suspend())&&void 0!==t?t:Promise.resolve()},e.prototype.renewLicense=function(e){var t,n;if((null===(t=this.usedKeySystem)||void 0===t?void 0:t.kind)!==u.KeySystemKind.PLAYREADY)return Promise.reject(a.WarningCode.DRM_LICENSE_RENEWAL_FAILED);if(!(null===(n=this.emeHandler)||void 0===n?void 0:n.disposeSessionForInitData))return Promise.reject(a.WarningCode.DRM_LICENSE_RENEWAL_FAILED);var r=this.licenseStorage.findLicenseForPublicId(e,this.usedKeySystem.kind);return r?this.Hm(r.initDataStr):Promise.reject(a.WarningCode.DRM_LICENSE_RENEWAL_FAILED)},e.prototype.isUsingUnprefixedEmeHandler=function(){return!!this.emeHandler&&this.emeHandler instanceof p.UnprefixedEMEHandler},e.prototype.Hm=function(e){var t=this;return this.licenseStorage.resetLicense(this.usedKeySystem.kind,e),this.emeHandler.disposeSessionForInitData(e).then(function(){return t.requestMissingLicenses()}).catch(function(n){return t.context.eventHandler.dispatchEvent(a.PlayerEvent.Warning,new a.PlayerWarning(a.WarningCode.DRM_LICENSE_RENEWAL_FAILED,null,{keyIds:e.split(";"),error:n})),Promise.reject(n)})},e}();t.DRMManager=E},34079:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createDrmApi=function(e,t){return new(function(){function t(){}return t.prototype.renewLicense=function(t){var n=e();if(!n)return Promise.reject("NoSourceLoaded");var i=n.get(r.ServiceName.DrmService);return i?i.renewLicense(t):Promise.reject("NoDrmSource")},t}())};var r=n(80813)},97115:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createDrmManager=function(e){return(0,i.getCapabilities)()[r.CapabilityKey.isTizen]&&s.ModuleManager.has(o.ModuleName.Tizen)?s.ModuleManager.get(o.ModuleName.Tizen).createTizenDRMManager(e):(0,i.getCapabilities)()[r.CapabilityKey.isWebOS]&&s.ModuleManager.has(o.ModuleName.Webos)?new(s.ModuleManager.get(o.ModuleName.Webos).getWebosDrmManagerConstructor())(e):new a.DRMManager(e)};var r=n(7387),i=n(21513),s=n(88052),o=n(62756),a=n(29173)},93101:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.DrmService=void 0;var i=n(66790),s=n(33468),o=n(7387),a=n(15971),u=n(21513),c=n(93204),d=n(34841),l=n(46057),y=n(97115),f=n(55327),p=n(84344),h=n(99921),m=function(){function e(e){this.context=e,this.Km=new d.Deferred,this.Lm=!1,this.Om=Promise.resolve()}return e.prototype.Pm=function(){var e=this;this.Sm().then(function(){return e.Jm=(0,y.createDrmManager)(e.context)})},e.prototype.canReuseEmeHandler=function(){var e=this.Mm;return e===h.EMEHandlerKind.UNPREFIXED||e===h.EMEHandlerKind.MS_PREFIXED},e.prototype.reInitializeEmeHandler=function(){return this.Jm.reInitializeEmeHandler()},e.prototype.resolveDrmSystemFromSourceConfig=function(e){var t=this;if(!this.Nm){var n=(0,s.getRelevantKeySystemMap)(e);this.Nm=(0,l.yieldToMain)().then(function(){return(0,p.resolveUsedDRMSystem)(n,e,t.context)}).then(function(t){return r(r({},t),{config:e})}).catch(function(e){return null})}},e.prototype.setDrmConfig=function(e){this.Im=e,this.Km=new d.Deferred,this.Lm=!1,this.Pm()},e.prototype.updateDrmConfig=function(e,t){var n=this;return this.Lm?this.Km.promise:(this.Im=r(r({},this.Im),e),this.Lm=!0,this.Jm.setConfig(this.Im,t).then(function(e){n.Mm=e,n.Km.resolve()}).catch(function(e){n.Lm=!1,n.Km.reject(e)}).finally(function(){return n.Km.promise}))},e.prototype.addInitData=function(e){var t=this;this.Jm&&this.Km.promise.then(function(){var n;return null===(n=t.Jm)||void 0===n?void 0:n.addInitData(e)}).catch(function(e){null==e||e.message,i.DrmSetupError.CANCELLED})},e.prototype.renewLicense=function(e){var t,n;return null!==(n=null===(t=this.Jm)||void 0===t?void 0:t.renewLicense(e))&&void 0!==n?n:Promise.reject("No active drm manager")},e.prototype.getUsedKeySystemKind=function(){var e;return(null===(e=this.Jm)||void 0===e?void 0:e.getUsedKeySystemKind())||null},e.prototype.getUsedKeySystemUid=function(){var e;return(null===(e=this.Jm)||void 0===e?void 0:e.getUsedKeySystemUid())||null},e.prototype.getUsedOrEarlyResolvedKeySystemUid=function(){var e=this.getUsedKeySystemUid();return e?Promise.resolve(e):this.Nm?this.Nm.then(function(e){var t;return null!==(t=null==e?void 0:e.keySystem.uid)&&void 0!==t?t:null}):Promise.resolve(null)},e.prototype.getResolvedKeySystemFromSourceConfig=function(){return this.Nm||Promise.resolve(null)},e.prototype.waitForPendingLicenseRequests=function(e){var t=this,n=function(){var n,r;return null!==(r=null===(n=t.Jm)||void 0===n?void 0:n.hasOngoingLicenseRequests(e))&&void 0!==r&&r};if(!n())return Promise.resolve();var r=new d.Deferred,i=(0,c.subscribe)(this.context.store)(function(e){return f.getLicenseState(e)},function(){n()||(i(),r.resolve())});return r.promise},e.prototype.Qm=function(e){var t,n=this;if(null===(t=this.Jm)||void 0===t?void 0:t.hasUsableMediaKey(e))return Promise.resolve();var r=new d.Deferred,i=(0,c.subscribe)(this.context.store)(function(e){return f.getLicenseState(e)},function(){var t,s,o,u;if(null===(t=n.Jm)||void 0===t?void 0:t.hasUsableMediaKey(e))return i(),void r.resolve();(null!==(u=null===(o=null===(s=(0,a.getSourceState)(n.context))||void 0===s?void 0:s.drm)||void 0===o?void 0:o.keyIdsWithErrors)&&void 0!==u?u:[]).includes(e)&&(i(),r.reject(new Error("DRM key ID ".concat(e," failed"))))});return this.Jm&&this.Jm.requestMissingLicenses(),r.promise},e.prototype.Rm=function(e){var t,n,r,i=this.getUsedKeySystemKind()===s.KeySystemKind.PLAYREADY,a=(0,u.getCapabilities)()[o.CapabilityKey.isEdge],c=null!==(n=null===(t=this.Jm)||void 0===t?void 0:t.isUsingUnprefixedEmeHandler())&&void 0!==n&&n,d=i&&a&&c,l=e.hasDrmKid()?e.getDrmKid():void 0;return!(!this.Lm||void 0===l||!d||(null===(r=this.Jm)||void 0===r?void 0:r.hasUsableMediaKey(l)))},e.prototype.maybeWaitForDrmLicense=function(e,t){var n=this,r=!e.isInit()||e.isSelfInit(),i=this.Rm(e),s=void 0!==t&&Object.keys(t).length>0,o=e.hasDrmKid()?e.getDrmKid():void 0;return s&&i&&r&&void 0!==o?(null==t?void 0:t.keyIdsWithErrors.includes(o))?Promise.reject(new Error("DRM key ID ".concat(o," failed"))):(e.getDrmInitData().forEach(function(e){return n.addInitData(e)}),this.Qm(o)):Promise.resolve()},e.prototype.preprocessInitDataStr=function(e){return this.Jm.preprocessInitDataStr(e)},e.prototype.signalInitDataShouldBeAvailable=function(){this.Jm.signalInitDataShouldBeAvailable()},Object.defineProperty(e.prototype,"shutdownPromise",{get:function(){return this.Om},enumerable:!1,configurable:!0}),e.prototype.Sm=function(){var e=this;return this.Jm&&(this.Om=this.Om.then(function(){var t;return null===(t=e.Jm)||void 0===t?void 0:t.shutdown().catch(function(e){})})),this.Om},e.prototype.shutdownIfNeeded=function(e){return e&&this.canReuseEmeHandler()?Promise.resolve():this.release()},e.prototype.release=function(){var e=this;return this.Im=null,this.Sm().then(function(){e.Jm=void 0})},e.prototype.prepareForMseShutdown=function(){var e,t;return null!==(t=null===(e=this.Jm)||void 0===e?void 0:e.prepareForMseShutdown())&&void 0!==t?t:Promise.resolve()},e.prototype.suspend=function(){var e,t;return null!==(t=null===(e=this.Jm)||void 0===e?void 0:e.suspend())&&void 0!==t?t:Promise.resolve()},e.prototype.dispose=function(){this.release()},e.prototype.isDrmConfigSet=function(){return Boolean(this.Im)},e}();t.DrmService=m},49867:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.DrmStallRecovery=void 0;var r=n(80813),i=n(93204),s=n(55327),o=function(){function e(t){var n=this;this.context=t,this.PR=null,this.QR=null,this.RR=0,this.SR=0,this.TR=[],this.UR=null,this.VR=null,this.ZR=function(){var t=n.context.videoElement;if(t){var r=n.QR,i=t.currentTime>n.RR+e.PROGRESS_EPSILON_S,s=n.SR-n.XR,o=null!==n.UR&&n.UR>=s;n.PR=null,n.QR=null,i||("initial"===r&&o?n.YR("extended"):n.aR())}},this.WR=this.context.settings.DRM_STALL_RECOVERY_SETTLE_TIMEOUT_MS,this.XR=this.context.settings.DRM_STALL_RECOVERY_LICENSE_ACTIVITY_LOOKBACK_MS,this.VR=(0,i.subscribe)(this.context.store)(s.getLicenseState,function(){n.UR=Date.now()})}return e.prototype.maybeScheduleRecovery=function(e){this.QR||(this.TR=e,this.YR("initial"))},e.prototype.dispose=function(){null!==this.PR&&(clearTimeout(this.PR),this.PR=null),null!==this.VR&&(this.VR(),this.VR=null),this.QR=null},e.prototype.YR=function(e){var t=this.context.videoElement;t&&(this.QR=e,this.RR=t.currentTime,this.SR=Date.now(),this.PR=setTimeout(this.ZR,this.WR))},e.prototype.aR=function(){var e=this.context.serviceManager.get(r.ServiceName.RecoveryService);e&&e.recover("DRM stall: waitingforkey persisted with permanently-failed KIDs").catch(function(e){})},e.PROGRESS_EPSILON_S=.05,e}();t.DrmStallRecovery=o},24109:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.FairplayHandler=t.SupportedFairplayKeySystems=void 0;var i,s,o=n(40306),a=n(3336),u=n(4129),c=n(91523),d=n(57456),l=n(29669),y=n(74853),f=n(88844),p=n(19274);!function(e){e[e.MEDIA_KEYERR_DOMAIN=6]="MEDIA_KEYERR_DOMAIN"}(i||(i={})),function(e){e.FPS_1="com.apple.fps.1_0"}(s||(t.SupportedFairplayKeySystems=s={}));var h=function(){function e(t,n,r){var s=this;this.mm=function(e){if(s.Xm){s.Ym=!0;var t=e.initData,n=s.Bn(t);if(s.im(t),s.dm)s.pm(n,t);else{var r=s.Xm.serverCertificate;if(r)return r instanceof ArrayBuffer==0?void s.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_CERTIFICATE_ERROR,void 0,"The provided `AppleFairplayDRMConfig.serverCertificate` is not of type `ArrayBuffer`.",s.Tm.sourceContext.sourceIdentifier)):(s.dm=s.om(r),void s.pm(n,t));s.lm().then(function(e){s.dm=s.om(e.body),s.pm(n,t)}).catch(function(e){}),s.gm()}}else s.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_MISSING_CONFIGURATION,void 0,"A FairPlay DRM config is required to play this source, but none was provided.",s.Tm.sourceContext.sourceIdentifier))},this.An=function(e,t){s.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.NETWORK_FAILED_CERTIFICATE_REQUEST,{responseCode:e.status,responseText:e.statusText,serverResponse:e.body,reason:t.message},"Failed to load the FairPlay certificate: ".concat(e.status," ").concat(e.statusText,"."),s.Tm.sourceContext.sourceIdentifier))},this.En=function(){(0,f.clearTimeoutIfDefined)(s.em)},this.Fn=function(t,n){s.Ym=!0;var r=t.message,i=t.target,c=s.Xm,y=c.withCredentials,f=void 0!==y&&y,p=c.licenseResponseType,h=void 0===p?l.HttpResponseType.TEXT:p,m=c.maxLicenseRequestRetries,v=c.headers,E=c.prepareMessage,g=d.XhrHelper.mergeHeaders({"Content-Type":"application/x-www-form-urlencoded"},v),S=s.jm(m),b=new u.DefaultContentLoader(s.Tm,{maxRetries:S,requestType:l.HttpRequestType.DRM_LICENSE_FAIRPLAY});t.messageBase64Encoded=e.base64EncodeUint8Array(r);var R="function"==typeof E?E(t,i):"spc=".concat(encodeURIComponent(t.messageBase64Encoded),"&assetId=").concat(i.contentId),L=s.nm(n);L&&"string"==typeof L?b.load(L,l.HttpRequestMethod.POST,h,R,g,f).then(function(e){s.Gn(e,i)}).catch(s.Hn):(s.Ym=!1,s.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_NO_LICENSE_SERVER_URL_PROVIDED,{licenseServer:L},"No valid license server URL was provided through the FairPlay DRM config.",s.Tm.sourceContext.sourceIdentifier)))},this.Gn=function(t,n){if(s.Ym=!1,"function"!=typeof s.Xm.prepareLicenseAsync){var r=t.body;"function"==typeof s.Xm.prepareLicense?r=s.Xm.prepareLicense(r):(r=r.trim()).startsWith("<ckc>")&&r.endsWith("</ckc>")&&(r=r.slice(5,-6));var i=r;"string"==typeof r&&(i=e.base64DecodeUint8Array(r)),n.update(i)}else s.Xm.prepareLicenseAsync(t.body).then(function(e){n.update(e)}).catch(function(e){s.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_CERTIFICATE_ERROR,{reason:e},"Unable to parse the certificate: `AppleFairplayDRMConfig.prepareLicenseAsync` failed.",s.Tm.sourceContext.sourceIdentifier))})},this.Hn=function(e){s.Ym=!1,s.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_FAILED_LICENSE_REQUEST,{responseCode:e.status,responseText:e.statusText,serverResponse:e.body},void 0,s.Um))},this.In=function(e){s.Ym=!1;var t=e.target,n=t?t.error:{},r=n.code,u=n.systemCode,c=s.am&&s.Tm.settings.FAIRPLAY_IGNORE_DUPLICATE_INIT_DATA_KEY_ERRORS;r===i.MEDIA_KEYERR_DOMAIN&&1212433232===u?s.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_RESTRICTED_OUTPUT,void 0,void 0,s.Um)):c||s.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_KEY_ERROR,{code:r,systemCode:u},void 0,s.Um))},this.Jn=function(){},this.isLicenseRequestOngoing=function(){return s.Ym},this.Tm=t,this.Um=t.sourceContext.sourceIdentifier,this.Vm=t.settings,this.Wm=n,this.Xm=r,this.Ym=!1,this.Zm=[],this.am=!1,this.cm=null,this.bm=null,r&&r.hasOwnProperty("certificateURL")&&(this.fm=r.certificateURL),this.Wm.drmHandler=this,this.Wm.addEventListener(p.MediaElementEvent.webkitneedkey,this.mm),this.Wm.addEventListener(p.MediaElementEvent.error,this.En)}return e.prototype.gm=function(){var e=this;(0,f.clearTimeoutIfDefined)(this.em);var t=(0,c.getRequestTimeout)(this.Tm,l.HttpRequestType.DRM_CERTIFICATE_FAIRPLAY);this.em=window.setTimeout(function(){e.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_CERTIFICATE_ERROR,void 0,"The FairPlay certificate request was not completed within the timeout of ".concat(t," ms."),e.Tm.sourceContext.sourceIdentifier))},t)},e.stringToArray=function(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint16Array(t),r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return n},e.base64DecodeUint8Array=function(e){for(var t=window.atob(e),n=t.length,r=new Uint8Array(new ArrayBuffer(n)),i=0;i<n;i++)r[i]=t.charCodeAt(i);return r},e.base64EncodeUint8Array=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="",r=0;r<e.length;){var i=e[r++],s=r<e.length?e[r++]:Number.NaN,o=r<e.length?e[r++]:Number.NaN,a=i>>2,u=(3&i)<<4|s>>4,c=(15&s)<<2|o>>6,d=63&o;isNaN(s)?c=d=64:isNaN(o)&&(d=64),n+=t.charAt(a)+t.charAt(u)+t.charAt(c)+t.charAt(d)}return n},e.prototype.hm=function(e,t,n,r){void 0===r&&(r=null),n.addEventListener(e,function(e){return t(e,r)},!1)},e.prototype.im=function(e){var t=y.ArrayHelper.arrayBufferToAsciiString(e.buffer,!1);this.Zm.includes(t)?this.am=!0:this.Zm.push(t)},e.prototype.jm=function(e){var t=parseInt("".concat(e));return isFinite(t)?t:3},e.prototype.km=function(){var e=this.Xm.maxCertificateRequestRetries;return new u.DefaultContentLoader(this.Tm,{onFailure:this.An,maxRetries:this.jm(e),requestType:l.HttpRequestType.DRM_CERTIFICATE_FAIRPLAY})},e.prototype.lm=function(){var e=this,t=this.Xm,n=t.withCredentials,i=void 0!==n&&n,s=t.certificateHeaders,o=r({},s);return this.bm=this.km(),new Promise(function(t,n){e.bm.load(e.fm,l.HttpRequestMethod.GET,l.HttpResponseType.ARRAYBUFFER,null,o,i).then(function(e){return t(e)}).catch(function(e){return n(e)}).finally(function(){e.bm=null})})},e.prototype.nm=function(e){var t=y.ArrayHelper.arrayBufferToAsciiString(e.buffer,!1);return this.Xm&&this.Xm.hasOwnProperty("LA_URL")?this.Xm.LA_URL:/skd:\/\//.test(t)?"function"==typeof this.Xm.getLicenseServerUrl?this.Xm.getLicenseServerUrl(t.substring(t.indexOf("skd:"))):t.substring(t.indexOf("skd:")+4):null},e.prototype.om=function(e){var t="function"==typeof this.Xm.prepareCertificate;try{return t?new Uint8Array(this.Xm.prepareCertificate(e)):new Uint8Array(e)}catch(e){return void this.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_CERTIFICATE_ERROR,{reason:e},"There was an error during the processing of the certificate: ".concat(t?"`AppleFairplayDRMConfig.prepareCertificate` failed":"the obtained certificate is invalid","."),this.Tm.sourceContext.sourceIdentifier))}},e.prototype.pm=function(e,t){(0,f.clearTimeoutIfDefined)(this.em);var n=this.Cn(t,e,this.dm);if(this.cm||this.Dn(),this.Wm.webkitKeys||this.Wm.webkitSetMediaKeys(new WebKitMediaKeys(this.cm)),this.Wm.webkitKeys){var r=this.Wm.webkitKeys.createSession("video/mp4",n);r?(r.contentId=e,this.hm("webkitkeymessage",this.Fn,r,t),this.hm("webkitkeyadded",this.Jn,r),this.hm("webkitkeyerror",this.In,r)):this.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_KEY_SESSION_INITIALIZATION_FAILED,void 0,"Unable to initialize DRM key session: `webkitKeys.createSession` failed.",this.Tm.sourceContext.sourceIdentifier))}else this.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_MEDIA_KEY_INITIALIZATION_FAILED,void 0,"Unable to initialize the DRM media keys: the video element does not support WebKit keys.",this.Tm.sourceContext.sourceIdentifier))},e.prototype.Bn=function(e){var t=y.ArrayHelper.arrayBufferToAsciiString(e.buffer,!1);if("function"==typeof this.Xm.prepareContentId)t=this.Xm.prepareContentId(t);else{var n=t.indexOf("?");t=n<0?"":t.substring(n+1)}return t},e.prototype.Cn=function(t,n,r){var i="string"==typeof n?e.stringToArray(n):n,s=0,o=new ArrayBuffer(t.byteLength+4+i.byteLength+4+r.byteLength),a=new DataView(o);new Uint8Array(o,s,t.byteLength).set(t),s+=t.byteLength,a.setUint32(s,i.byteLength,!0),s+=4;var u=this.Xm.useUint16InitData?new Uint16Array(o,s,i.length):new Uint8Array(o,s,i.byteLength);return u.set(i),s+=u.byteLength,a.setUint32(s,r.byteLength,!0),s+=4,new Uint8Array(o,s,r.byteLength).set(r),new Uint8Array(o,0,o.byteLength)},e.prototype.Dn=function(){var e=Object.keys(s).map(function(e){return s[e]});this.cm=e.find(function(e){return WebKitMediaKeys.isTypeSupported(e,"video/mp4")})||null,this.cm||this.Tm.eventHandler.fireError(new a.PlayerError(o.ErrorCode.DRM_KEY_SYSTEM_NOT_SUPPORTED,{supportedKeySystem:e},"FairPlay DRM is not supported on this platform.",this.Tm.sourceContext.sourceIdentifier))},e.prototype.destroy=function(){this.Wm.drmHandler=null,this.Wm.removeEventListener(p.MediaElementEvent.webkitneedkey,this.mm),this.Wm.removeEventListener(p.MediaElementEvent.error,this.En),this.cm=null,this.dm=null,this.Zm=[],this.fm=null,this.am=!1},e.prototype.dispose=function(){var e;this.destroy(),(0,f.clearTimeoutIfDefined)(this.em),null===(e=this.bm)||void 0===e||e.cancel(),this.Vm=null,this.cm=null,this.dm=null,this.fm=null},e}();t.FairplayHandler=h},58857:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasMatchingLicenseInfoForKeySystem=t.LicenseStorage=void 0,t.isMediaKeyStatusUnknownOrPendingOrUsable=function(e){return e.mediaKeyStatus===c.MediaKeyStatus.Usable||e.mediaKeyStatus===c.MediaKeyStatus.Pending||e.mediaKeyStatus===c.MediaKeyStatus.Unknown},t.getKeySystemMap=f,t.getAllLicensesForKeySystem=p;var i=n(3714),s=n(93204),o=n(4358),a=n(91921),u=n(55327),c=n(56068),d=function(){function e(e){var t=this;this.dR=1,this.eR=function(e){t.bR.store.dispatch((0,o.resetLicenses)())},this.hR=function(){return u.getLicenseState(t.bR.store.getState())},this.iR=function(e){t.bR.store.dispatch(e)},this.bR=e,this.bR.store.hasReducer("drmLicenses")||(this.bR.store.addReducer("drmLicenses",a.LicenseReducer),this.bR.store.dispatch((0,o.initializeLicenseStorage)(e.storedConfig))),this.fR(),this.eR=this.eR.bind(this),window.addEventListener("beforeunload",this.eR)}return e.prototype.fR=function(){var e=this;this.cR=(0,s.subscribe)(this.bR.store)(function(e){return u.getLicenseState(e)},function(t){return e.gR(t)})},e.prototype.gR=function(e){(0,o.maybeStoreLicences)(e,this.bR.storedConfig)},e.prototype.add=function(e){var t=e.systemName,n=e.initData,r=e.initDataStr;if(!t||!r||this.getLicense(r,t))return!1;var i={hasLicense:!1,initData:n,initDataStr:r,license:null,isPending:!1,systemName:t,wasRequested:!1,keyIds:e.kid,mediaKeyStatus:c.MediaKeyStatus.Unknown,usedByPlayerId:this.bR.internalPlayerID};return this.iR((0,o.addLicense)({systemName:t,licenseInfo:i,initDataStr:r})),!0},e.prototype.addLicense=function(e,t){var n=t.initDataStr,s=t.license,a=t.response,u=t.sessionInfo,c=void 0===u?{}:u;if(s||a||t.restoredFromPersistentLicense){var d=this.getLicense(n,e),l=r(r(r({},d||{}),c),{isPending:!1,hasLicense:!0,license:s||null,usedByPlayerId:this.bR.internalPlayerID});l.publicId||(l.publicId=String(this.dR++)),this.bR.eventHandler.dispatchEvent(i.PlayerEvent.DrmLicenseAdded,{license:{id:l.publicId,keyIds:l.initDataStr.split(";"),keySystemString:e}});var y={licenseInfo:l,initDataStr:n,systemName:e};return this.iR(d?(0,o.updateLicense)(y):(0,o.addLicense)(y))}this.iR((0,o.removeLicense)({initDataStr:n,systemName:e}))},e.prototype.findLicenseForPublicId=function(e,t){var n,r=this.hR().drmData[t];return Object.keys(r).forEach(function(t){r[t].publicId===e&&(n=r[t])}),n},e.prototype.getEntriesWithoutLicense=function(){var e=this.hR().drmData;return Object.values(e).flatMap(function(e){return Object.values(e)}).filter(function(e){return!e.hasLicense&&!e.wasRequested})},e.prototype.getLicense=function(e,t){var n=this.hR(),r=(0,o.getLicenseInfoKey)(e);return n.drmData[t]&&n.drmData[t][r]},e.prototype.getAllLicensesForKeySystem=function(e){return p(e,this.hR())},e.prototype.jR=function(e,t,n){var i=this.getLicense(e,t);i&&this.iR((0,o.updateLicense)({initDataStr:e,licenseInfo:n(r({},i)),systemName:t}))},e.prototype.setRequested=function(e,t){this.jR(e,t,function(e){return r(r({},e),{wasRequested:!0})})},e.prototype.hasLicense=function(e,n){return(0,t.hasMatchingLicenseInfoForKeySystem)(e,f(this.hR(),n),l)},e.prototype.hasUsableOrPendingMediaKey=function(e,n){return(0,t.hasMatchingLicenseInfoForKeySystem)(e,f(this.hR(),n),y)},e.prototype.hasOngoingLicenseRequests=function(e){return this.getAllLicensesForKeySystem(e).some(function(e){return!e.hasLicense&&e.wasRequested})},e.prototype.setKeyIds=function(e,t,n){this.jR(e,t,function(e){return r(r({},e),{keyIds:n})})},e.prototype.setPending=function(e,t){this.jR(e,t,function(e){return r(r({},e),{isPending:!0})})},e.prototype.resetLicense=function(e,t){var n=this.getLicense(t,e)||{},i=r(r({},n),{keyIds:[],isPending:!1,hasLicense:!1,license:null,expiration:null,sessionId:null,wasRequested:!1});this.iR((0,o.resetLicense)({systemName:e,initDataStr:t,licenseInfo:i}))},e.prototype.remove=function(e){this.iR((0,o.removeLicense)({initDataStr:e}))},e.prototype.updateInitData=function(e){var t=e.initDataStr,n=e.systemName;this.iR((0,o.updateLicense)({initDataStr:t,licenseInfo:e,systemName:n}))},e.prototype.dispose=function(){this.bR.store.getState().drmLicenses&&!this.bR.store.getState().drmLicenses.inPersistentState?this.bR.store.dispatch((0,o.clearLicenseStorage)()):this.bR.store.dispatch((0,o.resetLicenses)()),this.cR&&this.cR(),window.removeEventListener("beforeunload",this.eR)},e}();function l(e){return e.hasLicense}function y(e){return e.mediaKeyStatus===c.MediaKeyStatus.Usable||e.mediaKeyStatus===c.MediaKeyStatus.Pending}function f(e,t){var n;return null!==(n=null==e?void 0:e.drmData[t])&&void 0!==n?n:{}}function p(e,t){var n=t.drmData[e];return n?Object.values(n):[]}t.LicenseStorage=d,t.hasMatchingLicenseInfoForKeySystem=function(e,t,n){return Object.values(t).some(function(t){return t.keyIds.includes(e)&&n(t)})}},47272:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.DRMModuleDefinition=void 0;var r=n(62756),i=n(67579),s=n(88559),o=n(34079),a=n(29173),u=n(93101),c=n(70581),d=n(80680),l=n(24109),y=n(92656),f=n(4358),p=n(55327),h=n(78763),m=n(6234);t.DRMModuleDefinition={name:r.ModuleName.DRM,module:{DrmService:u.DrmService,DRMManager:a.DRMManager,FairplayHandler:l.FairplayHandler,PlayReady:y.PlayReady,DRMDetectorService:h.DRMDetectorService,WebKitPrefixedEMEHandler:d.WebKitPrefixedEMEHandler,UnprefixedEMEHandler:c.UnprefixedEMEHandler,parseInitData:m.parseInitData,getLicenseState:p.getLicenseState,getLicenseInfoKey:f.getLicenseInfoKey,createDrmApi:o.createDrmApi,ContentProtectionHelper:s.ContentProtectionHelper},exports:{MediaKeySystemConfig:i.MediaKeySystemConfig}},t.default=t.DRMModuleDefinition},46658:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ParallelContentLoader=void 0;var r=n(4129),i=function(){function e(e,t){this.mR=[],this.kR=e,this.lR=t}return e.prototype.load=function(e,t,n,i,s,o,a,u){var c=this,d=new r.DefaultContentLoader(this.kR,this.lR);return this.mR.push(d),d.load(e,t,n,i,s,o,a,u).finally(function(){c.mR=c.mR.filter(function(e){return e!==d}),d.dispose()})},e.prototype.cancel=function(){this.mR.forEach(function(e){return e.cancel()})},e.prototype.isLoading=function(){return this.mR.some(function(e){return e.isLoading()})},e.prototype.isRetrying=function(){return this.mR.some(function(e){return e.isRetrying()})},e.prototype.dispose=function(){this.mR.forEach(function(e){return e.dispose()}),this.mR=[]},e}();t.ParallelContentLoader=i},86558:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.MSPrefixedEMEHandler=void 0,t.isMsPrefixedEmeHandlerSupported=function(e){return window.MSMediaKeys&&"function"==typeof MSMediaKeys.isTypeSupported&&MSMediaKeys.isTypeSupported(e)?Promise.resolve({keySystem:e}):Promise.reject("DOMException: Unsupported keySystem")};var r,i=n(40306),s=n(3336),o=n(34841),a=n(70850),u=n(19274),c=n(6234);!function(e){e.KeyMessage="mskeymessage",e.KeyAdded="mskeyadded",e.KeyError="mskeyerror"}(r||(r={}));var d=function(){function e(e){var t=this;this.kbb=function(){if(t.Mab)return Promise.reject("EME handler destroyed");if(t.ibb.readyState===HTMLMediaElement.HAVE_NOTHING)return a.Util.delay(250,t.kbb);if(t.ibb.msKeys)return Promise.resolve();try{t.hbb=new MSMediaKeys(t.Oab),t.ibb.msSetMediaKeys(t.hbb)}catch(e){return t.Pab.fireError(new s.PlayerError(i.ErrorCode.DRM_MEDIA_KEY_INITIALIZATION_FAILED,{keySystem:t.Oab,eme:"msPrefixed",error:e},"Unable to initialize the DRM media keys: `msSetMediaKeys` failed.",t.Nab.sourceContext.sourceIdentifier)),Promise.reject(e)}return Promise.resolve()},this.lbb=function(e){if(t.Rab&&t.Rab(),e){var n=(0,c.parseInitData)(e.initData);n&&n.length&&t.Uab&&n.forEach(function(e){return t.Uab(e)})}},this.Nab=e,this.Mab=!1,this.Tab=[],this.Qab=!1,this.Pab=this.Nab.eventHandler}return Object.defineProperty(e.prototype,"ibb",{get:function(){return this.Nab.videoElement},enumerable:!1,configurable:!0}),e.getVideoErrorNameFromError=function(e,t){for(var n in e)if((n.indexOf("MEDIA_ERR_")>-1||n.indexOf("MEDIA_KEYERR_")>-1)&&e[n]===t)return n;return"UNKNOWN"},e.getHexFromCode=function(e){return isFinite(e)?(e<0&&(e=4294967295+e+1),"0x"+e.toString(16).toUpperCase()):null},e.prototype.jbb=function(t,n){if(this.Qab=!1,null!==t&&t.deferred.reject(),n&&n.target&&n.target.error){this.ibb.removeEventListener(u.MediaElementEvent.error,this.Vab);var r=n.target.error,o=Number(r.code),a=Number(r.systemCode),c=Number(r.msExtendedCode),d=e.getVideoErrorNameFromError(r,o),l=e.getHexFromCode(a),y=e.getHexFromCode(c)||l,f=i.ErrorCode[i.ErrorCode.DRM_KEY_ERROR]+" - "+d+" (code: "+o+"), "+y;this.Pab.fireError(new s.PlayerError(i.ErrorCode.DRM_KEY_ERROR,{code:o,systemCode:a},f,this.Nab.sourceContext.sourceIdentifier))}},e.prototype.mbb=function(e,t){var n=this,r=t.target.sessionId;this.gbb[r]=t.target,this.Qab=!0,this.Lab.handleLicenseRequest(t).then(function(t){n.qbb(t.body,r,e.id),e.license=t,n.Qab=!1}).catch(function(t){e.deferred.reject(t),n.Qab=!1})},e.prototype.nbb=function(e,t){Boolean(e)&&Boolean(e.license)?e.deferred.resolve(e.license):e.deferred.resolve({response:"automatically added by EME",licenseRequestId:e.id}),this.Qab=!1},e.prototype.obb=function(e){var t=this.Lab.getCDMData();return t?this.ibb.msKeys.createSession("video/mp4",e,new Uint8Array(t)):this.ibb.msKeys.createSession("video/mp4",e)},e.prototype.pbb=function(e){var t=this,n={deferred:new o.Deferred,id:a.Util.generateUniqueId()};return e?(this.Sab.then(function(){t.ibb.msKeys&&(t.Qab?n.deferred.reject({status:"postponed",licenseRequestId:n.id}):(e.byteLength,t.Qab=!0,n.onKeyError=t.jbb.bind(t,n),n.onKeyAdded=t.nbb.bind(t,n),n.onKeyMessage=t.mbb.bind(t,n),n.session=t.obb(new Uint8Array(e)),n.session.addEventListener(r.KeyError,n.onKeyError,!1),n.session.addEventListener(r.KeyAdded,n.onKeyAdded,!1),n.session.addEventListener(r.KeyMessage,n.onKeyMessage,!1),t.Tab.push(n)))}),n.deferred.promise):Promise.reject("no init data ("+n.id+")")},e.prototype.qbb=function(e,t,n){this.Qab=!1,e&&this.gbb[t].update(this.Lab.prepareLicense(e))},e.prototype.setWaitingForKeyListener=function(e){this.Rab=e},e.prototype.setEncryptedListener=function(e){this.Uab=e},e.prototype.load=function(e,t){var n=this;return this.Lab=e,this.Oab=t,this.Mab=!1,this.gbb={},this.Sab=this.kbb(),this.Sab.then(function(){n.Vab&&n.ibb.removeEventListener(u.MediaElementEvent.error,n.Vab),n.Vab=n.jbb.bind(n,null),n.ibb.addEventListener(u.MediaElementEvent.error,n.Vab)}).catch(function(){}),this.ibb.addEventListener(u.MediaElementEvent.msneedkey,this.lbb),this.Sab},e.prototype.reInitialize=function(){this.ibb.eventHandler.hasEventHandler(u.MediaElementEvent.msneedkey,this.lbb)||this.ibb.addEventListener(u.MediaElementEvent.msneedkey,this.lbb),null==this.ibb.msKeys&&this.ibb.msSetMediaKeys(this.hbb)},e.prototype.rbb=function(e){var t=e.getElementsByTagName("KID");if(!t)return null;for(var n="",r=0;r<t.length;r++){var i=t[r];i&&i.childNodes&&i.childNodes.length>0?n+=i.childNodes[0].nodeValue+";":i&&i.hasAttribute("value")?n+=i.getAttribute("value")+";":i&&i.hasAttribute("VALUE")&&(n+=i.getAttribute("VALUE")+";")}return n.split(";")[0]||null},e.prototype.sbb=function(e){var t=new RegExp("p[\0]+l[\0]+a[\0]+y[\0]+r[\0]+e[\0]+a[\0]+d[\0]+y","gi"),n=new RegExp("w[\0]+r[\0]+m[\0]+h[\0]+e[\0]+a[\0]+d[\0]+e[\0]+r","gi"),r=t.test(e)||n.test(e);if(!e.includes("<")||!r)return e;for(var i=e.slice(e.indexOf("<")),s="",o=0;o<i.length;o+=2)s+=i[o];try{var a=new DOMParser;return this.rbb(a.parseFromString(s,"application/xml"))||e}catch(t){return e}},e.prototype.getKeyUuidsFromInitData=function(e){var t,n;return null!==(n=null===(t=this.Lab)||void 0===t?void 0:t.getKeyUuidsFromInitData(e))&&void 0!==n?n:[]},e.prototype.getIdentifierFromInitData=function(e){return this.Lab?this.Lab.getIdentifierFromInitData(e):this.sbb(e)},e.prototype.requestLicense=function(e,t){var n=this;return this.Sab.then(function(){return n.pbb(e).then(function(e){return{initDataStr:t,license:e.body,response:e.response,licenseRequestId:e.licenseRequestId}}).catch(function(e){return Promise.reject({initDataStr:t,statusCode:e.status,licenseRequestId:e.licenseRequestId,response:e})})}).catch(function(e){return Promise.reject(e)})},e.prototype.isLicenseRequestOngoing=function(){return this.Qab},e.prototype.unload=function(){var e=this;this.Mab=!0,this.ibb.removeEventListener(u.MediaElementEvent.msneedkey,this.lbb),this.ibb.removeEventListener(u.MediaElementEvent.error,this.Vab),this.Tab.forEach(function(e){try{var t=e.session;t.removeEventListener(r.KeyError,e.onKeyError),t.removeEventListener(r.KeyAdded,e.onKeyAdded),t.removeEventListener(r.KeyMessage,e.onKeyMessage)}catch(e){}});var t=Object.keys(this.gbb||{}).map(function(t){return Promise.resolve(e.gbb[t].close())});return this.gbb={},this.Lab=null,this.Oab=null,this.Tab=[],this.Sab=null,this.Rab=null,this.hbb=null,Promise.all(t).catch(function(e){return Promise.resolve(null)})},e.prototype.suspend=function(){return Promise.resolve()},e}();t.MSPrefixedEMEHandler=d},70581:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.UnprefixedEMEHandler=void 0,t.isUnprefixedEmeHandlerSupported=function(e){return window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess(e,[{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.4d401e"'}]},{initDataTypes:["cenc"],videoCapabilities:void 0,audioCapabilities:void 0}]):Promise.reject("no requestMediaKeySystemAccess call available")};var s,o=n(66790),a=n(40306),u=n(3336),c=n(25926),d=n(4224),l=n(3714),y=n(33468),f=n(48488),p=n(21513),h=n(74853),m=n(34841),v=n(70233),E=n(15487),g=n(19274),S=n(67579),b=n(92656),R=n(4358),L=n(55327),I=n(56068),M=n(6234);!function(e){e.KeyMessage="message",e.KeyStatusChange="keystatuseschange"}(s||(s={}));var D=function(){function e(e){var t=this;this.Zn=function(e,n){if(!t.Sn)return t.closeSession(e),Promise.resolve(n);var r=t.On.get(e);return r&&(r.loaded=!0),t.hn(n.body,e).then(function(){return n}).catch(function(e){return Promise.reject(e)})},this.encryptedEventHandler=function(e){e&&t.processMediaEncryptedEvent(e)},this.jn=function(e){t.Rn&&t.Rn()},this.nn=function(e,t){switch(e){case I.MediaKeyStatus.Usable:case I.MediaKeyStatus.Expired:case I.MediaKeyStatus.Pending:case I.MediaKeyStatus.OutputRestricted:}},this.on=function(e){var n,r=e.target,i=t.On.get(r),s=t.mn(r.keyStatuses),o=Object.values(s),a=Object.keys(s);if(i){var u=i.initDataStr;t.qn(s,btoa(u)),t.hasExpiredKeys(o)&&(t.closeSession(r),t.On.delete(r),null===(n=t.context.store)||void 0===n||n.dispatch((0,R.removeLicense)({initDataStr:u})));var c=!(!t.context.settings.CHECK_ALL_DRM_LICENSES_FOR_KID||!t.Vn)&&(0,L.verifyKeysAreUsableOrPendingOnAnyLicense)(a,(0,y.keySystemUidToKind)(t.Nn),(0,L.getLicenseState)(t.Vn));if(!(a.length>0&&c)&&o.includes(I.MediaKeyStatus.OutputRestricted)){var d=Object.keys(s).filter(function(e){return s[e]===I.MediaKeyStatus.OutputRestricted});t.pn(d,r,u)}}},this.context=e,this.Ln=e.sourceContext.sourceIdentifier,this.On=new Map,this.Pn=[],this.Qn=!1,this.Mn=null}return Object.defineProperty(e.prototype,"video",{get:function(){return this.context.videoElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Vn",{get:function(){return this.context.store.getState()},enumerable:!1,configurable:!0}),e.prototype.Wn=function(e,t){var n=this,r=[],i=[];return t&&2===t.length&&(r=t[0]||[],i=t[1]||[]),e.hasOwnProperty("initDataTypes")||(e.initDataTypes=["cenc"]),e.hasOwnProperty("distinctiveIdentifier")||(e.distinctiveIdentifier="optional"),e.videoCapabilities&&e.videoCapabilities.length<1&&delete e.videoCapabilities,e.audioCapabilities&&e.audioCapabilities.length<1&&delete e.audioCapabilities,r&&r.length>0&&(e.audioCapabilities=e.audioCapabilities||[],e.audioCapabilities=e.audioCapabilities.concat(r),(this.Tn.audioRobustness||""===this.Tn.audioRobustness)&&e.audioCapabilities.forEach(function(e){e.robustness=n.Tn.audioRobustness})),i&&i.length>0&&(e.videoCapabilities=e.videoCapabilities||[],e.videoCapabilities=e.videoCapabilities.concat(i),(this.Tn.videoRobustness||""===this.Tn.videoRobustness)&&e.videoCapabilities.forEach(function(e){e.robustness=n.Tn.videoRobustness})),e},e.prototype.Xn=function(e,t){void 0===t&&(t=!1);var n=r({},this.Wn(this.Kn.getMediaKeySystemConfiguration(),e));return(t||(0,p.default)().getState().capabilities.isTizen)&&(n.sessionTypes=[S.MediaKeySystemConfig.SessionType.Temporary]),[n,{initDataTypes:["cenc"],videoCapabilities:void 0,audioCapabilities:void 0,distinctiveIdentifier:n.distinctiveIdentifier,persistentState:n.persistentState,sessionTypes:n.sessionTypes}]},e.prototype.Yn=function(e){var t=this,n=this.Xn(e);return window.navigator.requestMediaKeySystemAccess(this.Nn,n).catch(function(){var n=t.Xn(e,!0);return window.navigator.requestMediaKeySystemAccess(t.Nn,n)}).then(function(e){var n=e.getConfiguration();return t.context.store.dispatch((0,R.setPersistentState)(t.bn(n))),t.Mn=n,e.createMediaKeys()})},e.prototype.an=function(e,t){var n=this;if(this.Kn){this.Qn=!0;var i=t.message,s=t.target,o=this.On.get(s);o&&(o.expiration=s.expiration);var a=2===i.byteLength;btoa(h.ArrayHelper.arrayBufferToAsciiString(i,!0)),this.Kn.handleLicenseRequest(t).then(this.Zn.bind(this,s)).then(function(t){!a&&e.resolve(r(r({},t),{session:s,wasLicenseRestored:!1}))}).catch(function(t){n.closeSession(s),n.On.delete(s),e.reject(t)})}else e.reject("session destroyed")},e.prototype.bn=function(e){var t=e||this.Mn||{},n=t.persistentState,r=t.sessionTypes,i=void 0===r?[]:r;return n===S.MediaKeySystemConfig.PersistentState.Required&&i.includes(S.MediaKeySystemConfig.SessionType.PersistentLicense)},e.prototype.cn=function(e,t,n){var r=this.video.mediaKeysObject,i=this.bn()?r.createSession(S.MediaKeySystemConfig.SessionType.PersistentLicense):r.createSession(),s={expiration:null,initData:e,initDataStr:t,loaded:!1,onKeyMessage:n};return this.On.set(i,s),i},e.prototype.dn=function(e,t,n,r){var i=this,o=this.an.bind(this,r),a=this.cn(e,t,o);return a.addEventListener(s.KeyStatusChange,this.on),a.addEventListener(s.KeyMessage,o),a.load(n).then(function(e){e?r.resolve({session:a,wasLicenseRestored:!0}):i.On.delete(a)}).catch(function(e){r.reject(e),i.On.delete(a)}),r.promise},e.prototype.en=function(e,t,n){var r=this,i=this.an.bind(this,n),o=this.cn(e,t,i);return o.addEventListener(s.KeyStatusChange,this.on),o.addEventListener(s.KeyMessage,i),o.generateRequest("cenc",e).catch(function(e){r.On.delete(o),n.reject(e),r.context.eventHandler.fireError(new u.PlayerError(a.ErrorCode.DRM_KEY_SESSION_INITIALIZATION_FAILED,{reason:e,licenseInitDataString:t},"Unable to initialize DRM key session: `MediaKeySession.generateRequest` failed.",r.Ln))}),n.promise},e.prototype.setMediaKeys=function(e){var t=this,n=new m.Deferred;return this.video.mediaKeysPromise=(this.video.mediaKeysPromise||Promise.resolve()).then(function(){var r=t.video.setMediaKeys(e)||Promise.resolve();return n.resolve(r),r.then(function(){}).catch(function(e){return Promise.reject(e)})}),n.promise},e.prototype.fn=function(e){e||this.context.eventHandler.dispatchEvent(l.PlayerEvent.Warning,new c.PlayerWarning(d.WarningCode.DRM_SERVER_CERTIFICATE_NOT_SUPPORTED))},e.prototype.onServerCertificateSetFailed=function(e,t,n){n.reason=t instanceof Error?t.message:"unknown error",this.context.eventHandler.fireError(new u.PlayerError(a.ErrorCode.DRM_CERTIFICATE_ERROR,n,"Unable to setup the key system: `MediaKeys.setServerCertificate` failed.",this.Ln))},e.prototype.gn=function(e,t){var n=this;this.Tn.serverCertificate&&e&&e.setServerCertificate(this.Tn.serverCertificate).then(function(e){return n.fn(e)}).catch(function(r){return n.onServerCertificateSetFailed(e,r,t)})},e.prototype.setupKeySystem=function(e){var t=this,n={drmCapabilities:e,keySystem:this.Nn,eme:"unprefixed"};return this.Yn(e).then(function(e){return n.createdMediaKeys=e,null===t.Nn?Promise.reject(new Error(o.DrmSetupError.CANCELLED)):(t.video.mediaKeysObject=e,t.gn(e,n),t.setMediaKeys(e))}).catch(function(e){var r;return(null==e?void 0:e.message)!==o.DrmSetupError.CANCELLED&&(n.reason=null!==(r=null==e?void 0:e.message)&&void 0!==r?r:e,t.context.eventHandler.fireError(new u.PlayerError(a.ErrorCode.DRM_MEDIA_KEY_INITIALIZATION_FAILED,n,"Unable to initialize the DRM key system with the specified combinations.",t.Ln))),Promise.reject(e)})},e.prototype.hn=function(e,t){return this.Qn=!1,e&&this.Kn?(this.Pn.includes(t)||this.Pn.push(t),t.update(this.Kn.prepareLicense(e))):Promise.reject()},e.prototype.processMediaEncryptedEvent=function(e){var t=this,n=(0,M.parseInitData)(e.initData);n&&n.length&&this.Un&&n.forEach(function(e){return t.Un(e)})},e.prototype.hasExpiredKeys=function(e){return e.some(function(e){return e===I.MediaKeyStatus.Expired})},e.prototype.kn=function(e){var t=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer);return(0,y.keySystemUidToKind)(this.Nn)===y.KeySystemKind.PLAYREADY&&(0,E.isEdge)()&&b.PlayReady.kidToCENC(t),v.FormatHelper.bytesToUUID(t)},e.prototype.ln=function(e,t){var n="",r="";return"string"==typeof e?(n=this.kn(t),r=String(e)):"string"==typeof t&&(n=this.kn(e),r=String(t)),[n,r]},e.prototype.mn=function(e){var t=this,n={};return e.forEach(function(e,r){var i=t.ln(e,r),s=i[0],o=i[1];n[s]=o}),n},e.prototype.pn=function(e,t,n){var r,i=this;this.context.eventHandler.dispatchEvent(l.PlayerEvent.Warning,new c.PlayerWarning(d.WarningCode.DRM_RESTRICTED_OUTPUT,"Output restricted for "+e.join(", "))),e.forEach(function(e){var t;return null===(t=i.context.store)||void 0===t?void 0:t.dispatch((0,f.trackDrmKidError)(e))}),this.closeSession(t),this.On.delete(t),null===(r=this.context.store)||void 0===r||r.dispatch((0,R.removeLicense)({initDataStr:n}))},e.prototype.qn=function(e,t){var n=this;Object.keys(e).forEach(function(r){var i,s,o=e[r];null===(i=n.context.store)||void 0===i||i.dispatch((0,R.setMediaKeyStatus)((0,y.keySystemUidToKind)(n.Nn),r,o,t)),o===I.MediaKeyStatus.InternalError&&(null===(s=n.context.store)||void 0===s||s.dispatch((0,f.trackDrmKidError)(r))),n.nn(o,r)})},e.prototype.unload=function(){var e,t=this,n=[];this.On.forEach(function(e,t){return n.push(t)}),this.video.removeEventListener(g.MediaElementEvent.waitingforkey,this.jn),this.video.removeEventListener(g.MediaElementEvent.encrypted,this.encryptedEventHandler);var r=n.map(function(e){var n=t.closeSession(e);return t.Pn.includes(e)?n:Promise.resolve()});this.Kn=null,this.On=new Map,this.Pn=[],this.Nn=null,this.Rn=null,this.video.mediaKeysObject=null;var s=null===(e=this.Sn)||void 0===e?void 0:e.catch(function(e){}).finally(function(){return t.Sn=void 0});return Promise.all(i(i([],r,!0),[s],!1)).then(function(){return t.setMediaKeys(null).catch(function(e){})}).catch(function(e){})},e.prototype.closeSession=function(e){var t=this.On.get(e);return t&&(e.removeEventListener(s.KeyStatusChange,this.on),e.removeEventListener(s.KeyMessage,t.onKeyMessage)),Promise.race([e.closed,e.close()]).catch(function(e){})},e.prototype.load=function(e,t,n,r){return this.Kn=e,this.Nn=t,this.Tn=n[(0,y.keySystemUidToKind)(t)],this.video.addEventListener(g.MediaElementEvent.encrypted,this.encryptedEventHandler),this.video.addEventListener(g.MediaElementEvent.waitingforkey,this.jn),this.Sn=this.setupKeySystem(r),this.Sn},e.prototype.rn=function(e){var t=!1;return this.On.forEach(function(n){return t=t||n.initData===e}),t},e.prototype.reInitialize=function(){this.video.eventHandler.hasEventHandler(g.MediaElementEvent.encrypted,this.encryptedEventHandler)||this.video.addEventListener(g.MediaElementEvent.encrypted,this.encryptedEventHandler),this.video.eventHandler.hasEventHandler(g.MediaElementEvent.waitingforkey,this.jn)||this.video.addEventListener(g.MediaElementEvent.waitingforkey,this.jn)},e.prototype.sn=function(e){if(!this.Vn)return!1;for(var t=(0,y.keySystemUidToKind)(this.Nn),n=(0,L.getLicenseState)(this.Vn).drmData[t],r=0,i=Object.keys(n);r<i.length;r++){var s=n[i[r]];if(s.sessionId===e)return void 0===s.usedByPlayerId||s.usedByPlayerId===this.context.internalPlayerID}return!1},e.prototype.tn=function(e,t,n,r){return e?this.rn(e)?(r.reject({message:"session for requested initData already present"}),r.promise):n&&this.bn()&&this.sn(n)?this.dn(e,t,n,r):this.en(e,t,r):(r.reject({message:"no initData provided for license request"}),r.promise)},e.prototype.un=function(){return new m.Deferred},e.prototype.requestLicense=function(e,t,n){var r=this;this.Qn=!0;var i=this.un();return this.Sn.then(function(){return null===r.video.mediaKeysObject?Promise.reject(new Error(o.DrmSetupError.CANCELLED)):r.tn(e,t,n,i)}).then(function(e){r.Qn=!1;var n=e.session,i=void 0===n?{}:n;return{initDataStr:t,license:e.wasLicenseRestored?null:e.body,sessionInfo:{sessionId:i.sessionId,expiration:i.expiration},restoredFromPersistentLicense:e.wasLicenseRestored}}).catch(function(e){return r.Qn=!1,Promise.reject({response:e,initDataStr:t})})},e.prototype.getKeyUuidsFromInitData=function(e){var t,n;return null!==(n=null===(t=this.Kn)||void 0===t?void 0:t.getKeyUuidsFromInitData(e))&&void 0!==n?n:[]},e.prototype.getIdentifierFromInitData=function(e){return this.Kn?this.Kn.getIdentifierFromInitData(e):e},e.prototype.isLicenseRequestOngoing=function(){return this.Qn},e.prototype.setWaitingForKeyListener=function(e){this.Rn=e},e.prototype.setEncryptedListener=function(e){this.Un=e},e.prototype.suspend=function(){return Promise.resolve()},e.prototype.disposeSessionForInitData=function(e){var t=this,n=[];return this.On.forEach(function(r,i){r.initDataStr===e&&(n.push(t.closeSession(i).then(function(){})),t.Pn=t.Pn.filter(function(e){return e.sessionId!==i.sessionId}),t.On.delete(i))}),n.length<1?Promise.reject("Unable to find an existing drm session for "+e):Promise.all(n)},e}();t.UnprefixedEMEHandler=D},80680:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebKitPrefixedEMEHandler=void 0,t.isWebkitPrefixedEmeHandlerSupported=function(e,t){return"function"==typeof e.getWrappedElement().webkitGenerateKeyRequest&&"function"==typeof e.canPlayType&&e.canPlayType("video/mp4",t)?Promise.resolve({keySystem:t}):Promise.reject("DOMException: Unsupported keySystem")};var r,i,s=n(40306),o=n(3336),a=n(34841),u=n(19274),c=n(6234);!function(e){e[e.Domain=6]="Domain"}(r||(r={})),function(e){e[e.HDCP=1212433232]="HDCP"}(i||(i={}));var d=function(){function e(e){var t=this;this.Mo=function(e){if(t.wn&&t.wn(),e){var n=(0,c.parseInitData)(e.initData);n&&n.length&&t.zn&&t.invokeEncryptedListener(e.initData,n)}},this.context=e,this.xn=e.sourceContext.sourceIdentifier,this.video=e.videoElement,this.yn=[],this.Lo=[]}return e.prototype.invokeEncryptedListener=function(e,t){var n=this;t.forEach(function(e){return n.zn(e)})},e.prototype.No=function(e,t,n){this.yn.includes(n)&&this.yn.splice(this.yn.indexOf(n)),this.video.webkitAddKey(this.selectedKeySystem,e,t,n)},e.prototype.Oo=function(e,t,n){this.vn=!1,null!==e&&this.No(this.keySystem.prepareLicense(e),t,n)},e.prototype.Po=function(e,t){null!==e&&e.deferred.reject();var n=t.target||{},a=n.error||n.errorCode||{},u=a.code,c=a.systemCode;u===r.Domain&&c===i.HDCP?this.context.eventHandler.fireError(new o.PlayerError(s.ErrorCode.DRM_RESTRICTED_OUTPUT,void 0,void 0,this.xn)):this.context.eventHandler.fireError(new o.PlayerError(s.ErrorCode.DRM_KEY_ERROR,{code:u,systemCode:c},void 0,this.xn))},e.prototype.Qo=function(e,t){Boolean(e)&&Boolean(e.license)&&e.deferred.resolve(e.license),Boolean(e)&&Boolean(e.onKeyError)&&this.video.removeEventListener(u.MediaElementEvent.webkitkeyerror,e.onKeyError)},e.prototype.Ro=function(e,t){var n=this,r=t.sessionId;t.kid=e.kid,this.yn.includes(r)||(this.yn.push(r),this.vn=!0,this.keySystem.handleLicenseRequest(t).then(function(t){n.Oo(t.body,t.kid||e.initData,r),e.license=t}).catch(function(t){return e.deferred.reject(t)}))},e.prototype.So=function(e,t){var n=this,r={kid:t,initData:e,deferred:new a.Deferred};return this.Lo.push(r.deferred),r.onKeyError=this.Po.bind(this,r),r.onKeyAdded=this.Qo.bind(this,r),r.onKeyMessage=this.Ro.bind(this,r),this.video.addEventListener(u.MediaElementEvent.webkitkeyerror,r.onKeyError),this.video.addEventListener(u.MediaElementEvent.webkitkeyadded,r.onKeyAdded),this.video.addEventListener(u.MediaElementEvent.webkitkeymessage,r.onKeyMessage),this.video.webkitGenerateKeyRequest(this.selectedKeySystem,new Uint8Array(e)),r.deferred.promise.finally(function(){n.video.removeEventListener(u.MediaElementEvent.webkitkeyerror,r.onKeyError),n.video.removeEventListener(u.MediaElementEvent.webkitkeyadded,r.onKeyAdded),n.video.removeEventListener(u.MediaElementEvent.webkitkeymessage,r.onKeyMessage),n.To(r.deferred)}),r.deferred.promise},e.prototype.To=function(e){var t=this.Lo.findIndex(function(t){return t===e});this.Lo.splice(t,1)},e.prototype.unload=function(){var e;return this.Ko&&this.video.removeEventListener(u.MediaElementEvent.webkitkeyerror,this.Ko),this.Lo.forEach(function(e){e.reject("unloading the WebKITPrefixedEMEHandler")}),this.Lo=[],this.video.removeEventListener(u.MediaElementEvent.webkitneedkey,this.Mo),this.selectedKeySystem=null,null===(e=this.keySystem)||void 0===e||e.dispose(),this.keySystem=null,this.wn=null,Promise.resolve()},e.prototype.load=function(e,t){return this.keySystem=e,this.selectedKeySystem=t,this.Ko&&this.video.removeEventListener(u.MediaElementEvent.webkitkeyerror,this.Ko),this.Ko=this.Po.bind(this,null),this.video.addEventListener(u.MediaElementEvent.webkitneedkey,this.Mo),this.video.addEventListener(u.MediaElementEvent.webkitkeyerror,this.Ko),Promise.resolve()},e.prototype.reInitialize=function(){},e.prototype.requestLicense=function(e,t){var n=this;return this.vn=!0,this.So(e).then(function(e){return n.vn=!1,{initDataStr:t,license:e.body}}).catch(function(e){return n.vn=!1,Promise.reject({initDataStr:t,statusCode:e.status,response:e})})},e.prototype.getKeyUuidsFromInitData=function(e){var t,n;return null!==(n=null===(t=this.keySystem)||void 0===t?void 0:t.getKeyUuidsFromInitData(e))&&void 0!==n?n:[]},e.prototype.getIdentifierFromInitData=function(e){return this.keySystem?this.keySystem.getIdentifierFromInitData(e):e},e.prototype.isLicenseRequestOngoing=function(){return this.vn},e.prototype.setWaitingForKeyListener=function(e){this.wn=e},e.prototype.setEncryptedListener=function(e){this.zn=e},e.prototype.suspend=function(){return Promise.resolve()},e}();t.WebKitPrefixedEMEHandler=d},92656:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.PlayReady=t.EMPTY_KEY_MESSAGE=void 0;var i=n(40306),s=n(3336),o=n(25926),a=n(4224),u=n(3714),c=n(57456),d=n(29669),l=n(51682),y=n(74853),f=n(70233),p=n(67579),h=n(46658),m="<WRMHEADER";function v(e){var t="string"==typeof e?(new DOMParser).parseFromString(e,"application/xml"):e;if(!t)return null;var n=t.getElementsByTagName("LA_URL");return n.length>0?n.item(0).textContent:null}t.EMPTY_KEY_MESSAGE="KeyMessageWasEmpty";var E=function(){function e(e,t){var n=this;this.context=e,this.Zo=function(e,t){null!==e&&(n.Xo(null==e?void 0:e.status)?n.context.eventHandler.dispatchEvent(u.PlayerEvent.Warning,new o.PlayerWarning(a.WarningCode.DRM_FAILED_LICENSE_REQUEST,"License request failed, retrying with other keys.",{responseCode:null==e?void 0:e.status,responseText:null==e?void 0:e.statusText,serverResponse:null==e?void 0:e.body})):n.context.eventHandler.fireError(new s.PlayerError(i.ErrorCode.DRM_FAILED_LICENSE_REQUEST,{statusCode:null==e?void 0:e.status,statusText:null==e?void 0:e.statusText,serverResponse:null==e?void 0:e.body},"Failed to load the PlayReady DRM license: ".concat(null==e?void 0:e.status," ").concat(null==e?void 0:e.statusText,"."),n.Uo)))},this.Uo=e.sourceContext.sourceIdentifier,this.Vo=t,this.Wo=new h.ParallelContentLoader(e,{onFailure:this.Zo,maxRetries:t.maxLicenseRequestRetries,retryDelay:t.licenseRequestRetryDelay,requestType:d.HttpRequestType.DRM_LICENSE_PLAYREADY})}return e.getPlaintextChallengeText=function(e,t){var n=e.getElementsByTagName("Challenge")[0];if(n.hasOwnProperty("innerHTML"))return'<Challenge xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols/messages">'+n.innerHTML+"</Challenge>";var r=t.indexOf("<Challenge"),i=t.indexOf("</Challenge>")+12;return t.substring(r,i)},e.prototype.Xo=function(e){return!!this.Vo.retryOtherKeysOnHttpStatusCode&&this.Vo.retryOtherKeysOnHttpStatusCode.includes(e)},e.prototype.Yo=function(t){var n=(new DOMParser).parseFromString(t,"application/xml");return n.getElementsByTagName("parsererror").length>0?[]:e.extractKeyIdsFromPlayReadyHeaders([n],this.context).map(e.base64KidToUuid)},e.prototype.ao=function(n){var r,o=n.message.buffer||n.message,a=this.Vo.hasOwnProperty("utf8message")&&this.Vo.utf8message,u=y.ArrayHelper.arrayBufferToAsciiString(o,a);if(0===u.length)return t.EMPTY_KEY_MESSAGE;var c=(new DOMParser).parseFromString(u,"application/xml");if(c.getElementsByTagName("Challenge")[0])if(this.Vo.hasOwnProperty("plaintextChallenge")&&this.Vo.plaintextChallenge)r='<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><AcquireLicense xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols"><challenge>'+e.getPlaintextChallengeText(c,u)+"</challenge></AcquireLicense></soap:Body></soap:Envelope>";else{var d=c.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;d&&(r=window.atob(d))}var l={},f=u.match(/<HttpHeaders>.*<\/HttpHeaders>/);if(f&&1===f.length){var p=f[0].match(/<name>([^<]+?)<\/name>/g),h=f[0].match(/<value>([^<]+?)<\/value>/g);if(null===p||null===h||p.length!==h.length)return this.context.eventHandler.fireError(new s.PlayerError(i.ErrorCode.DRM_PLAYREADY_INVALID_HEADER_KEY_VALUE_PAIR,{headerNameListEmpty:null===p,headerValueListEmpty:null===h,headerPairLengthMismatch:(null==p?void 0:p.length)!==(null==h?void 0:h.length)},"An invalid key/value pair was encountered while parsing the PlayReady license request headers.",this.Uo)),null;for(var m=0;m<p.length;m++)l[p[m].replace(/<\/?name>/g,"")]=h[m].replace(/<\/?value>/g,"")}return{challenge:r,laURL:this.Vo.LA_URL||n.destinationURL||n.defaultURL||v(c)||v(r),headers:l}},e.prototype.handleLicenseRequest=function(e){var n=this,r=this.ao(e);if(r===t.EMPTY_KEY_MESSAGE)return Promise.reject(t.EMPTY_KEY_MESSAGE);if(!r||!r.laURL)return Promise.reject("no LA URL given");if(!("forceSSL"in this.Vo)||this.Vo.forceSSL){var i=document.createElement("a");i.href=r.laURL,i.protocol="https:",r.laURL=i.href}return r.headers=c.XhrHelper.mergeHeaders(r.headers,this.Vo.headers||{}),this.Wo.load(r.laURL,d.HttpRequestMethod.POST,d.HttpResponseType.ARRAYBUFFER,r.challenge,r.headers,this.Vo.withCredentials).catch(function(e){if(n.Xo(null==e?void 0:e.status)){var t=n.Yo(r.challenge);e.failedKeyIds=t}throw e})},e.prototype.prepareLicense=function(e){try{return new Uint8Array(e)}catch(e){return this.context.eventHandler.fireError(new s.PlayerError(i.ErrorCode.DRM_KEY_ERROR,{reason:"Unable to construct a Uint8Array from the license response"},void 0,this.Uo)),null}},e.prototype.getCDMData=function(){if(this.Vo&&this.Vo.customData){for(var t=[],n=0;n<this.Vo.customData.length;++n)t.push(this.Vo.customData.charCodeAt(n)),t.push(0);var r=String.fromCharCode.apply(null,t);r=btoa(r);var i=e.PRCDMData.replace("%PROACTIVE%",Boolean(this.Vo.proactiveLicense)+"").replace("%CUSTOMDATA%",r),s=[];for(n=0;n<i.length;++n)s.push(i.charCodeAt(n)),s.push(0);return new Uint8Array(s).buffer}return null},e.getPlayreadyRecordsFromWrmHeader=function(e,t){for(var n=0,r=[],i=y.ArrayHelper.sparseArrayBufferToAsciiString(e.buffer,2,t);n<i.length;){var s=i.indexOf(m,n),o=i.indexOf("WRMHEADER>",s);if(s>=0&&o>s&&n<o){var a=t+2*s,u=t+2*o+20;r.push({type:1,value:e.buffer.slice(a,u)}),n=o}else n=i.length}return r},e.getPlayReadyRecordsFromPlayreadyObject=function(e,t){var n=t+4,r=[],i=new DataView(e.buffer),s=i.getUint16(n,!0);n+=2;for(var o=0;o<s;o++){var a=i.getUint16(n,!0);n+=2;var u=i.getUint16(n,!0);n+=2;var c={type:a,value:e.buffer.slice(n,n+u)};r.push(c),n+=u}return r},e.isValidPlayReadyObject=function(e,t){var n=new DataView(e.buffer,t);return!(n.getUint32(0,!0)>n.byteLength)&&m.split("").map(function(e){return e.charCodeAt(0)}).some(function(e,t){return n.getUint16(t,!0)!==e})},e.getPlayReadyRecords=function(e,t){return this.isValidPlayReadyObject(e,t)?this.getPlayReadyRecordsFromPlayreadyObject(e,t):this.getPlayreadyRecordsFromWrmHeader(e,t)},e.parsePlayReadyRecord=function(e,t){if(1!==e.type)return null;try{return(new DOMParser).parseFromString(y.ArrayHelper.sparseArrayBufferToAsciiString(e.value),"application/xml")}catch(e){return null}},e.parseWrmHeader=function(e,t,n){var r=this;return void 0===n&&(n=null),this.getPlayReadyRecords(e,t).map(function(e){return r.parsePlayReadyRecord(e,n)}).filter(function(e){return null!==e})},e.prototype.bo=function(e){var t=y.ArrayHelper.stringToArrayWithoutEncoding(e);return this.parsePlayReadyInitDataBuffer(t.buffer)},e.prototype.parsePlayReadyInitDataBuffer=function(t){for(var n=new DataView(t),r="",i=l.ISOBMFFConstants.BOX_SIZE_LENGTH,s=0;s<l.ISOBMFFConstants.BOX_TYPE_LENGTH;s++){var o=n.getInt8(i+s);r+=String.fromCharCode(o)}if("pssh"===r){i+=l.ISOBMFFConstants.BOX_TYPE_LENGTH;var a=n.getUint8(i);i+=l.ISOBMFFConstants.FULL_BOX_VERSION_LENGTH+l.ISOBMFFConstants.FULL_BOX_FLAGS_LENGTH+l.ISOBMFFConstants.PSSH_SYSTEM_ID_LENGTH,a>0&&(i+=4+n.getUint32(i)*l.ISOBMFFConstants.PSSH_KID_LEN),i+=4}return e.parseWrmHeader(new Uint8Array(t),i,this.context)},e.extractKeyIdsFromPlayReadyHeaders=function(e,t){for(var n,r,i,s=[],o=0;o<e.length;o++){var a=e[o].getElementsByTagName("KID");if(a&&a.length>0)for(var u=0;u<a.length;u++){var c=a[u],d=null===(n=c.textContent)||void 0===n?void 0:n.trim(),l=(null===(r=c.getAttribute("VALUE"))||void 0===r?void 0:r.trim())||(null===(i=c.getAttribute("value"))||void 0===i?void 0:i.trim()),y=d||l;y&&s.push(y)}}return s},e.prototype.getKeyUuidsFromInitData=function(t){return e.extractKeyIdsFromPlayReadyHeaders(this.parsePlayReadyInitDataBuffer(t),this.context).map(e.base64KidToUuid)},e.base64KidToUuid=function(t){var n=new Uint8Array(y.ArrayHelper.stringToArrayWithoutEncoding(atob(t)));return e.kidToCENC(n),f.FormatHelper.bytesToUUID(n)},e.prototype.getIdentifierFromInitData=function(t){if(!t.includes("<"))return t;var n=this.bo(t),r=e.extractKeyIdsFromPlayReadyHeaders(n,this.context);return r&&r.length>0?r.join(";"):t},e.prototype.getMediaKeySystemConfiguration=function(){var e=this.Vo.mediaKeySystemConfig,t={persistentState:p.MediaKeySystemConfig.PersistentState.Optional,sessionTypes:[p.MediaKeySystemConfig.SessionType.Temporary]};return"object"==typeof e?r(r({},t),e):t},e.swapBytes=function(e,t,n){var r=e[n];e[n]=e[t],e[t]=r},e.kidToCENC=function(t){e.swapBytes(t,0,3),e.swapBytes(t,1,2),e.swapBytes(t,4,5),e.swapBytes(t,6,7)},e.prototype.dispose=function(){this.Vo=null,this.Wo.dispose()},e.PRCDMData='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="%PROACTIVE%"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>',e}();t.PlayReady=E},25271:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.PrimeTime=void 0;var r=n(40306),i=n(3336),s=n(4129),o=n(29669),a=function(){function e(e,t){var n=this;this.context=e,this.tab=function(e,t){n.context.eventHandler.fireError(new i.PlayerError(r.ErrorCode.DRM_FAILED_LICENSE_REQUEST,{statusCode:e.status,statusText:e.statusText,serverResponse:e.body},"Failed to load the PrimeTime DRM license: ".concat(e.status," ").concat(e.statusText,"."),n.qab))},this.qab=e.sourceContext.sourceIdentifier,this.rab=t,this.sab=new s.DefaultContentLoader(e,{onFailure:this.tab,maxRetries:t.maxLicenseRequestRetries,retryDelay:t.licenseRequestRetryDelay,requestType:o.HttpRequestType.DRM_LICENSE_PRIMETIME})}return e.prototype.handleLicenseRequest=function(t){var n,r,i=t.message;switch(this.rab.headers&&Object.keys(this.rab.headers).length>0&&(n=this.rab.headers),t.messageType){case e.INDIVIDUALIZATION_REQUEST:r=this.rab.indivURL||this.rab.LA_URL;break;case e.LICENSE_REQUEST:case e.LICENSE_RELEASE:default:r=this.rab.LA_URL}return this.sab.load(r,o.HttpRequestMethod.POST,o.HttpResponseType.ARRAYBUFFER,i,n,this.rab.withCredentials,"application/json")},e.prototype.prepareLicense=function(e){return new Uint8Array(e)},e.prototype.getCDMData=function(){return null},e.prototype.getKeyUuidsFromInitData=function(e){return[]},e.prototype.getIdentifierFromInitData=function(e){return e},e.prototype.getMediaKeySystemConfiguration=function(){var e=this.rab.mediaKeySystemConfig;return"object"==typeof e?e:{}},e.prototype.dispose=function(){this.rab=null,this.sab.dispose(),this.sab=null},e.INDIVIDUALIZATION_REQUEST="individualization-request",e.LICENSE_REQUEST="license-request",e.LICENSE_RELEASE="license-release",e}();t.PrimeTime=a},31884:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.TVKey=void 0;var i=n(40306),s=n(3336),o=n(4129),a=n(29669),u=n(74853),c=n(67579),d=n(92378),l=function(){function e(e,t){var n=this;this.context=e,this.tvkeyConfig=t,this.vab=function(e,t){n.context.eventHandler.fireError(new s.PlayerError(i.ErrorCode.DRM_FAILED_LICENSE_REQUEST,{responseCode:e.status,responseText:e.statusText,serverResponse:e.body},"Failed to load the TVKey DRM license: ".concat(e.status," ").concat(e.statusText,"."),n.context.sourceContext.sourceIdentifier))},this.uab=new o.DefaultContentLoader(e,{onFailure:this.vab,maxRetries:t.maxLicenseRequestRetries,requestType:a.HttpRequestType.DRM_LICENSE_TVKEY})}return e.prototype.wab=function(e){if("function"==typeof this.tvkeyConfig.prepareMessage)return this.tvkeyConfig.prepareMessage(e);var t=new Uint8Array(e.message),n=u.ArrayHelper.convertBufferSourceToUTF8(t);return'{"OttLicenseRequestMessage":'.concat(n,"}")},e.prototype.xab=function(){var e=this.tvkeyConfig.headers||{};return r({"Content-Type":"application/json"},e)},e.prototype.handleLicenseRequest=function(e){if(!this.tvkeyConfig.LA_URL)return Promise.reject(new Error("No LA URL given"));var t=this.wab(e),n=this.xab();return this.uab.load(this.tvkeyConfig.LA_URL,a.HttpRequestMethod.POST,a.HttpResponseType.TEXT,t,n,this.tvkeyConfig.withCredentials,"application/json")},e.prototype.prepareLicense=function(e){return"function"==typeof this.tvkeyConfig.prepareLicense?this.tvkeyConfig.prepareLicense(e):"string"==typeof e?u.ArrayHelper.stringToArrayWithoutEncoding(e):new Uint8Array(e)},e.prototype.getCDMData=function(){return null},e.prototype.getKeyUuidsFromInitData=function(e){return(0,d.parseKidsFromTVKeyPssh)(e,this.context.logger)},e.prototype.getIdentifierFromInitData=function(e){try{var t=u.ArrayHelper.stringToArrayWithoutEncoding(e),n=(0,d.parseKidsFromTVKeyPssh)(t.buffer,this.context.logger);return n.length?n.join(";"):e}catch(t){return e}},e.prototype.getMediaKeySystemConfiguration=function(){var e;return r({persistentState:c.MediaKeySystemConfig.PersistentState.Optional,sessionTypes:[c.MediaKeySystemConfig.SessionType.Temporary]},null!==(e=this.tvkeyConfig.mediaKeySystemConfig)&&void 0!==e?e:{})},e.prototype.dispose=function(){this.uab.dispose()},e}();t.TVKey=l},81982:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Widevine=void 0;var i=n(40306),s=n(3336),o=n(25926),a=n(4224),u=n(3714),c=n(29669),d=n(48488),l=n(67579),y=n(46658),f=n(51063),p=function(){function e(e,t){var n=this;this.context=e,this.Dab=function(e,t){n.Cab(e.status)?n.context.eventHandler.dispatchEvent(u.PlayerEvent.Warning,new o.PlayerWarning(a.WarningCode.DRM_FAILED_LICENSE_REQUEST,"License request failed, retrying with other keys.",{responseCode:e.status,responseText:e.statusText,serverResponse:e.body})):n.context.eventHandler.fireError(new s.PlayerError(i.ErrorCode.DRM_FAILED_LICENSE_REQUEST,{responseCode:e.status,responseText:e.statusText,serverResponse:e.body},"Failed to load the Widevine DRM license: ".concat(e.status," ").concat(e.statusText,"."),n.yab))},this.yab=e.sourceContext.sourceIdentifier,this.zab=t,this.Bab=new Map,this.Aab=new y.ParallelContentLoader(e,{onFailure:this.Dab,maxRetries:t.maxLicenseRequestRetries,retryDelay:t.licenseRequestRetryDelay,requestType:c.HttpRequestType.DRM_LICENSE_WIDEVINE})}return e.prototype.Cab=function(e){return this.zab.retryOtherKeysOnHttpStatusCode?this.zab.retryOtherKeysOnHttpStatusCode.includes(e):!(!this.zab.retryOtherKeysOnForbiddenLicense||403!==e)},e.prototype.Eab=function(e){return"function"==typeof this.zab.prepareMessage?this.zab.prepareMessage(e):e.message},e.prototype.Fab=function(){return this.zab.headers&&Object.keys(this.zab.headers).length>0?this.zab.headers:void 0},e.prototype.Gab=function(e){var t=(0,f.parseWidevineLicenseRequestProtoBuf)(e);void 0!==t&&this.Bab.set(t.requestId,t.requestedKeyIds)},e.prototype.handleLicenseRequest=function(e){if(!this.zab.LA_URL)return Promise.reject("no LA URL given");var t=this.Eab(e),n=this.Fab();return this.Gab(t),this.Aab.load(this.zab.LA_URL,c.HttpRequestMethod.POST,c.HttpResponseType.ARRAYBUFFER,t,n,this.zab.withCredentials,"application/json")},e.prototype.Hab=function(e){var t;if("function"==typeof this.zab.prepareLicense){var n=this.zab.prepareLicense({license:e});return null!==(t=null==n?void 0:n.license)&&void 0!==t?t:void 0}},e.prototype.Iab=function(e){var t=new Uint8Array(e),n=this.Hab(t);return null!=n?n:t},e.prototype.Jab=function(e){this.context.store.dispatch((0,d.trackDrmKidError)(e))},e.prototype.Kab=function(e){var t,n=this,r=(0,f.parseWidevineLicenseResponseProtoBuf)(e);void 0!==r&&(null!==(t=this.Bab.get(r.requestId))&&void 0!==t?t:[]).filter(function(e){return!r.returnedKeyIds.includes(e)}).forEach(function(e){return n.Jab(e)})},e.prototype.prepareLicense=function(e){return this.Kab(e),this.Iab(e)},e.prototype.getCDMData=function(){return null},e.prototype.getKeyUuidsFromInitData=function(e){return(0,f.parseKidsFromWidevinePssh)(e)},e.prototype.getIdentifierFromInitData=function(e){return e},e.prototype.getMediaKeySystemConfiguration=function(){var e,t=this.zab.mediaKeySystemConfig,n=null===(e=null==t?void 0:t.sessionTypes)||void 0===e?void 0:e.includes(l.MediaKeySystemConfig.SessionType.PersistentLicense),i={persistentState:l.MediaKeySystemConfig.PersistentState.Optional,sessionTypes:n?[l.MediaKeySystemConfig.SessionType.PersistentLicense]:[l.MediaKeySystemConfig.SessionType.Temporary]};return"object"==typeof t?r(r({},i),t):i},e.prototype.dispose=function(){this.zab=null,this.Aab.dispose(),this.Bab.clear()},e}();t.Widevine=p},4358:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.getInitialLicenseState=void 0,t.addLicense=function(e){return(0,s.createAction)(a.LicenseActionType.AddLicense,e)},t.updateLicense=function(e){return(0,s.createAction)(a.LicenseActionType.UpdateLicense,e)},t.removeLicense=function(e){return(0,s.createAction)(a.LicenseActionType.RemoveLicense,e)},t.resetLicense=function(e){return(0,s.createAction)(a.LicenseActionType.ResetLicense,e)},t.resetLicenses=function(){return(0,s.createAction)(a.LicenseActionType.ResetLicenses)},t.clearLicenseStorage=function(){return(0,s.createAction)(a.LicenseActionType.ClearLicenseStorage)},t.initializeLicenseStorage=function(e){return(0,s.createAction)(a.LicenseActionType.InitializeLicenseStorage,{storageHandler:e})},t.setPersistentState=function(e){return(0,s.createAction)(a.LicenseActionType.SetPersistentState,e)},t.setMediaKeyStatus=function(e,t,n,r){return(0,s.createAction)(a.LicenseActionType.SetMediaKeyStatus,{keySystemKind:e,keyUuid:t,status:n,initDataStr:r})},t.loadLicences=d,t.maybeStoreLicences=function(e,t){e&&((0,o.clearTimeoutIfDefined)(c),c=window.setTimeout(function(){return function(e,t){try{var n=e.drmData,s={};Object.keys(n).forEach(function(e){s[e]={},Object.entries(n[e]).forEach(function(t){var n=t[0],o=t[1],u=void 0===o?{}:o,c=(u.license,u.initData,i(u,["license","initData"]));delete c.publicId,s[e][n]=r(r({},c),{hasLicense:!1,isPending:!1,wasRequested:!1,mediaKeyStatus:a.MediaKeyStatus.Unknown})})});var o=JSON.stringify(r(r({},e),{drmData:s}));t.set(u,o)}catch(e){}}(e,t)}))},t.getLicenseInfoKey=function(e){return btoa(e)};var s=n(35267),o=n(88844),a=n(56068),u="bitmovinplayer_licenseStorage",c=-1;function d(e){try{var t=e.get(u);return JSON.parse(t)||{}}catch(e){return{}}}t.getInitialLicenseState=function(e){var t=d(e);return r({inPersistentState:!1,drmData:{}},t)}},91921:function(e,t,n){var r,i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.LicenseReducer=void 0;var s=n(33468),o=n(3793),a=n(4358),u=n(56068),c={drmData:{},inPersistentState:!1};function d(e,t,n){var r,s=(0,a.getLicenseInfoKey)(t),o=i(i({},e),{drmData:i({},e.drmData)});return n?(e.drmData[n]?o.drmData[n]=i(i({},e.drmData[n]),((r={})[s]=i({},e.drmData[n][s]),r)):o.drmData[n]={},o):o}function l(e,t){var n,r=t.initDataStr,s=t.licenseInfo,o=t.systemName,u=d(e,r,o),c=(0,a.getLicenseInfoKey)(r),l=e.drmData[o]&&e.drmData[o][c]||{};return u.drmData[o]=i(i({},e.drmData[o]),((n={})[c]=i(i({},l),s),n)),u}t.LicenseReducer=(0,o.default)(c,((r={})[u.LicenseActionType.AddLicense]=function(e,t){return l(e,t.payload)},r[u.LicenseActionType.UpdateLicense]=function(e,t){return l(e,t.payload)},r[u.LicenseActionType.RemoveLicense]=function(e,t){return function(e,t){var n=t.initDataStr,r=null,i=(0,a.getLicenseInfoKey)(n);return Object.keys(e.drmData).forEach(function(t){if(t){var o=(r=d(r||e,n,s.KeySystemKind[t])).drmData[t];r.drmData[t]=o?Object.keys(o).filter(function(e){return i!==e}).reduce(function(e,t){return e[t]=o[t],e},{}):{}}}),r||e}(e,t.payload)},r[u.LicenseActionType.ResetLicense]=function(e,t){return l(e,t.payload)},r[u.LicenseActionType.ResetLicenses]=function(e){return function(e){var t={};return Object.keys(e.drmData).forEach(function(n){n&&(t[n]={},Object.entries(e.drmData[n]).forEach(function(e){var r=e[0],s=e[1];t[n][r]=i(i({},s),{keyIds:[],license:null,hasLicense:!1,isPending:!1,wasRequested:!1,initData:null,usedByPlayerId:void 0})}))}),{inPersistentState:e.inPersistentState,drmData:t}}(e)},r[u.LicenseActionType.SetPersistentState]=function(e,t){var n=t.payload;return i(i({},e),{inPersistentState:n})},r[u.LicenseActionType.ClearLicenseStorage]=function(){return c},r[u.LicenseActionType.InitializeLicenseStorage]=function(e,t){var n=t.payload;return(0,a.getInitialLicenseState)(n.storageHandler)},r[u.LicenseActionType.SetMediaKeyStatus]=function(e,t){var n,r=t.payload,s=r.keySystemKind,o=r.keyUuid,a=r.status,u=r.initDataStr,c=e.drmData[s];if(!(null==c?void 0:c[u]))return e;var d=i({},c),l=d[u];return l.keyIds.includes(o)&&(d[u]=i(i({},l),{mediaKeyStatus:a})),i(i({},e),{drmData:i(i({},e.drmData),(n={},n[s]=d,n))})},r))},55327:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getLicenseState=void 0,t.verifyKeysAreUsableOrPendingOnAnyLicense=function(e,t,n){var i=(0,r.getAllLicensesForKeySystem)(t,n).flatMap(function(e){return e.keyIds});return e.filter(function(e){return i.includes(e)}).map(function(e){return(0,r.hasMatchingLicenseInfoForKeySystem)(e,(0,r.getKeySystemMap)(n,t),r.isMediaKeyStatusUnknownOrPendingOrUsable)}).every(function(e){return!0===e})};var r=n(58857);t.getLicenseState=function(e){return e.drmLicenses}},56068:function(e,t){var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.MediaKeyStatus=t.LicenseActionType=void 0,function(e){e.AddLicense="@instance/license/add",e.UpdateLicense="@instance/license/update",e.RemoveLicense="@instance/license/remove",e.ResetLicense="@instance/license/reset",e.ResetLicenses="@instance/license/reset-all",e.SetMediaKeyStatus="@instance/license/setMediaKeyStatus",e.SetPersistentState="@instance/license/setPersistentState",e.ClearLicenseStorage="@instance/license/clearLicenseStorage",e.InitializeLicenseStorage="@instance/license/initializeLicenseStorage"}(n||(t.LicenseActionType=n={})),function(e){e.Unknown="unknown",e.Usable="usable",e.Expired="expired",e.Released="released",e.Pending="status-pending",e.OutputRestricted="output-restricted",e.OutputDownscaled="output-downscaled",e.InternalError="internal-error"}(r||(t.MediaKeyStatus=r={}))},78763:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.DRMDetectorService=void 0;var s=n(33468),o=n(74853),a=n(15487),u=n(35987),c=n(24273),d=function(){function e(){this.co=new c.EMEWrapper}return e.prototype.isSupported=function(e){return this.co?this.co.isSupported(e):Promise.reject("No supported EME available")},e.prototype.getSupported=function(){var e=this,t=Object.keys(s.KeySystemMap).flatMap(function(e){return s.KeySystemMap[e]});return(0,u.allSettledPromises)(t.map(function(t){return e.isSupported(t).catch(function(){return""})})).then(function(e){return e.filter(function(e){return e})})},e.prototype.getSupportedCapabilities=function(e,t,n){var s;if(y(t)){var a=l(t).map(function(e){return r(r({},e),{contentType:e.contentType.replace("ac-3","ec-3")})});a=a.filter(function(e){return!(0,o.contains)(t,e)}),s=i(i([],t,!0),a,!0)}else s=t;return this.co.getSupportedCapabilities(e,s,n).then(function(e){if(y(t)){var n=e.audioCapabilities;e.audioCapabilities=function(e){var t=e.filter(function(e){var t;return null===(t=e.contentType)||void 0===t?void 0:t.includes("ec-3")}).map(function(e){return r(r({},e),{contentType:e.contentType.replace("ec-3","ac-3")})}).filter(function(t){return!(0,o.contains)(e,t)});return i(i([],e,!0),t,!0)}(n),e.audioCapabilities=e.audioCapabilities.filter(function(e){return(0,o.contains)(t,e,function(e,t){return e.contentType===t.contentType})})}return e})},e.prototype.dispose=function(){this.co.dispose()},e}();function l(e){return e.filter(function(e){var t;return null===(t=e.contentType)||void 0===t?void 0:t.includes("ac-3")})}function y(e){return l(e).length>0&&(0,a.isTizen)()&&(0,a.getTizenVersion)().major>=a.TIZEN_2018_MAJOR_VERSION}t.DRMDetectorService=d},24273:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.EMEWrapper=void 0;var r=n(57387),i=n(84568),s="DOMException: Unsupported keySystem",o=[{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.4d401e"'}]},{initDataTypes:["cenc"],videoCapabilities:void 0,audioCapabilities:void 0}],a=function(){function e(){this.nR=document.createElement("video"),this.yS=(0,i.memoize)(this.DS.bind(this),function(e,t,n){return String((0,r.calcHash)(JSON.stringify({keySystem:e,audioCapabilities:t,videoCapabilities:n})))})}return e.prototype.isSupported=function(e){var t;return"function"==typeof window.WebKitMediaKeys?this.zS(e):"function"==typeof window.navigator.requestMediaKeySystemAccess?this.AS(e).then(function(e){return e.keySystem}):"function"==typeof window.MSMediaKeys?this.BS(e):"function"==typeof(null===(t=this.nR)||void 0===t?void 0:t.webkitGenerateKeyRequest)?this.CS(e):Promise.reject(s)},e.prototype.zS=function(e){var t,n;return(null===(n=(t=window.WebKitMediaKeys).isTypeSupported)||void 0===n?void 0:n.call(t,e))?Promise.resolve(e):Promise.reject(s)},e.prototype.AS=function(e,t){void 0===t&&(t=o);try{return window.navigator.requestMediaKeySystemAccess(e,t)}catch(e){return Promise.reject(e)}},e.prototype.BS=function(e){var t,n;return(null===(n=(t=window.MSMediaKeys).isTypeSupported)||void 0===n?void 0:n.call(t,e))?Promise.resolve(e):Promise.reject(s)},e.prototype.CS=function(e){var t;return(null===(t=this.nR)||void 0===t?void 0:t.canPlayType("video/mp4",e))?Promise.resolve(e):Promise.reject(s)},e.prototype.getSupportedCapabilities=function(e,t,n){return this.yS(e,t,n)},e.prototype.DS=function(e,t,n){if("function"==typeof window.navigator.requestMediaKeySystemAccess){var r=[{initDataTypes:["cenc"],audioCapabilities:t,videoCapabilities:n},{initDataTypes:["cenc"],videoCapabilities:void 0,audioCapabilities:void 0}];return window.navigator.requestMediaKeySystemAccess(e,r).then(function(e){var r,i,s=e.getConfiguration();return{audioCapabilities:null!==(r=null==s?void 0:s.audioCapabilities)&&void 0!==r?r:t,videoCapabilities:null!==(i=null==s?void 0:s.videoCapabilities)&&void 0!==i?i:n}}).catch(function(){return{audioCapabilities:t,videoCapabilities:n}})}return Promise.resolve({audioCapabilities:t,videoCapabilities:n})},e.prototype.dispose=function(){this.nR=null,this.yS.invalidate()},e}();t.EMEWrapper=a},84344:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.mergeKeySystemPriorities=t.resolveDRMSystem=t.instantiateDRMSystem=void 0,t.resolveUsedDRMSystem=S;var s=n(80813),o=n(33468),a=n(70962),u=n(67579),c=n(92656),d=n(25271),l=n(31884),y=n(81982),f=n(99921),p=n(30665),h=function(e,t){var n=function(e){return"boolean"==typeof e},s=function(e){return"number"==typeof e&&e!==1/0&&e!==-1/0&&!isNaN(e)},u=Object.keys(t).filter(function(n){return!!t[n]&&n in e}).reduce(function(e,i){return e[i]=r(r({},t[i]),{licenseRequestRetryDelay:s(t[i].licenseRequestRetryDelay)?Math.max(0,t[i].licenseRequestRetryDelay):a.DefaultSettings.DRM_RETRY_DELAY,maxLicenseRequestRetries:s(t[i].maxLicenseRequestRetries)?Math.floor(Math.max(0,t[i].maxLicenseRequestRetries)):a.DefaultSettings.DRM_MAX_RETRIES,withCredentials:n(t[i].withCredentials)?t[i].withCredentials:a.DefaultSettings.DRM_WITH_CREDENTIALS}),e},Object.create(null)),c=function(e){var t=[o.KeySystemKind.FAIRPLAY,o.KeySystemKind.PLAYREADY,o.KeySystemKind.PRIMETIME,o.KeySystemKind.WIDEVINE,o.KeySystemKind.TVKEY],n=(Array.isArray(e)?e.filter(function(e){return t.includes(e)}):[]).reduce(function(e,t){return e.includes(t)||e.push(t),e},[]),r=[o.KeySystemKind.PLAYREADY,o.KeySystemKind.FAIRPLAY,o.KeySystemKind.TVKEY,o.KeySystemKind.WIDEVINE,o.KeySystemKind.PRIMETIME].filter(function(e){return!n.includes(e)});return i(i([],n,!0),r,!0)}(t.preferredKeySystems);return r(r({},u),{preferredKeySystems:c})},m=function(e,t){var n=Object.keys(e).flatMap(function(t){return e[t].map(function(e){return{kind:t,uid:e}})});return t.flatMap(function(e){var t=e.kind;return n.map(function(e){return{emeHandler:{kind:t},keySystem:e}})})},v=function(e,t){var n,r,i,s=(0,p.or)(function(e){return e.keySystem.kind===o.KeySystemKind.FAIRPLAY},function(e){return!!t.playready&&!!t.playready.customData&&e.keySystem.kind===o.KeySystemKind.PLAYREADY&&e.emeHandler.kind===f.EMEHandlerKind.UNPREFIXED}),a=(0,p.or)(function(e){return!!t.playready&&e.keySystem.kind===o.KeySystemKind.PLAYREADY},function(e){return!!t.primetime&&e.keySystem.kind===o.KeySystemKind.PRIMETIME},function(e){return!!t.widevine&&e.keySystem.kind===o.KeySystemKind.WIDEVINE},function(e){return!!t.tvkey&&e.keySystem.kind===o.KeySystemKind.TVKEY}),c=e.filter((0,p.and)((0,p.not)(s),a));return(null===(i=null===(r=null===(n=t.playready)||void 0===n?void 0:n.mediaKeySystemConfig)||void 0===r?void 0:r.sessionTypes)||void 0===i?void 0:i.includes(u.MediaKeySystemConfig.SessionType.PersistentLicense))?c.filter(function(e){return e.keySystem.uid!==o.KeySystemMap[o.KeySystemKind.PLAYREADY][1]}):c},E=function(e,t){var n=function(e,t){return t.weight-e.weight},r=function(e){return e.wrapped},i=function(e,t){return function(n){var r=t(n),i=e.findIndex(function(e){return e===r});return{weight:-1!==i?e.length-i:i,wrapped:n}}},s=i([f.EMEHandlerKind.WEBOS_2017_UNPREFIXED,f.EMEHandlerKind.WEBOS_UNPREFIXED,f.EMEHandlerKind.WEBOS_WEBKIT_PREFIXED,f.EMEHandlerKind.PLAYSTATION_4,f.EMEHandlerKind.UNPREFIXED,f.EMEHandlerKind.TIZEN,f.EMEHandlerKind.WEBKIT_PREFIXED,f.EMEHandlerKind.MS_PREFIXED],function(e){return e.emeHandler.kind}),o=i(e,function(e){return e.keySystem.kind});return t.map(o).sort(n).map(r).reduce(function(e,t){var n=e[e.length-1];return void 0!==n&&n[n.length-1].keySystem.kind===t.keySystem.kind?n.push(t):e.push([t]),e},[]).flatMap(function(e){return e.map(s).sort(n).map(r)})},g=function(e,t,n){switch(e){case o.KeySystemKind.FAIRPLAY:throw new Error("Can not create Fairplay instance");case o.KeySystemKind.PLAYREADY:return new c.PlayReady(n,t.playready);case o.KeySystemKind.PRIMETIME:return new d.PrimeTime(n,t.primetime);case o.KeySystemKind.WIDEVINE:return new y.Widevine(n,t.widevine);case o.KeySystemKind.TVKEY:return new l.TVKey(n,t.tvkey);default:throw new Error("Could not create KeySystem ".concat(e))}};function S(e,n,r){var i=h(e,n),s=(0,f.allEMEHandlers)(r).filter(function(e){return e.isAvailable}),a=(0,t.mergeKeySystemPriorities)(e,n),u=m(a,s),c=v(u,i),d=E(i.preferredKeySystems,c),l=function(e){if(0===e.length){var t=Object.keys(n).filter(function(e){return Object.values(o.KeySystemKind).includes(e)}).join(", ");return Promise.reject("Unable to find a valid DRM key system! The provided DRM key system configurations [".concat(t,"] are not supported."))}var r=e[0],i=e.slice(1),a=s.find(function(e){return e.kind===r.emeHandler.kind});return a?a.isSupported(r.keySystem.uid).then(function(){return r}).catch(function(){return l(i)}):l(i)};return l(d)}t.instantiateDRMSystem=function(e,t,n){return r(r({},e),{config:t,emeHandler:r(r({},e.emeHandler),{instance:(0,f.createEMEHandlerInstance)(e.emeHandler.kind,n)}),keySystem:r(r({},e.keySystem),{instance:g(e.keySystem.kind,t,n)})})},t.resolveDRMSystem=function(e,n,r){var i=h(e,n),a=r.serviceManager.get(s.ServiceName.DrmService);return(a?a.getResolvedKeySystemFromSourceConfig():Promise.resolve(null)).then(function(s){return s&&0===Object.values(o.KeySystemKind).filter(function(e){return!(e in s.config)&&e in i}).length?(0,t.instantiateDRMSystem)(s,i,r):S(e,n,r).then(function(e){return(0,t.instantiateDRMSystem)(e,i,r)})})},t.mergeKeySystemPriorities=function(e,t){for(var n,r,i={fairplay:[],playready:[],primetime:[],widevine:[],tvkey:[]},s=function(e,s){if(!e||!Object.values(o.KeySystemKind).some(function(t){return t===e}))return"continue";var a=e,u=null!==(r=null===(n=null==t?void 0:t[a])||void 0===n?void 0:n.keySystemPriority)&&void 0!==r?r:[];i[a]=u;var c=s.filter(function(e){return!u.includes(e)});i[a]=i[a].concat(c)},a=0,u=Object.entries(e);a<u.length;a++){var c=u[a];s(c[0],c[1])}return i}},99921:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createEMEHandlerInstance=t.allEMEHandlers=t.EMEHandlerKind=void 0;var r,i=n(21513),s=n(15487),o=n(88052),a=n(62756),u=n(86558),c=n(70581),d=n(80680);!function(e){e.MS_PREFIXED="MS_PREFIXED",e.WEBOS_UNPREFIXED="WEBOS_UNPREFIXED",e.WEBOS_WEBKIT_PREFIXED="WEBOS_WEBKIT_PREFIXED",e.WEBOS_2017_UNPREFIXED="WEBOS_2017_UNPREFIXED",e.UNPREFIXED="UNPREFIXED",e.PLAYSTATION_4="PLAYSTATION_4",e.TIZEN="TIZEN",e.WEBKIT_PREFIXED="WEBKIT_PREFIXED"}(r||(t.EMEHandlerKind=r={}));var l=function(e){return(0,c.isUnprefixedEmeHandlerSupported)(e)},y=function(e){return(0,u.isMsPrefixedEmeHandlerSupported)(e)},f=function(e){return function(t){return(0,d.isWebkitPrefixedEmeHandlerSupported)(e.videoElement,t)}};t.allEMEHandlers=function(e){return[{kind:r.UNPREFIXED,isAvailable:!0,isSupported:l},{kind:r.WEBOS_UNPREFIXED,isAvailable:(0,i.getCapabilities)().isWebOS&&o.ModuleManager.has(a.ModuleName.Webos),isSupported:l},{kind:r.WEBOS_2017_UNPREFIXED,isAvailable:(0,i.getCapabilities)().isWebOS&&(0,s.isWebOs2017)()&&o.ModuleManager.has(a.ModuleName.Webos),isSupported:l},{kind:r.WEBOS_WEBKIT_PREFIXED,isAvailable:(0,i.getCapabilities)().isWebOS&&o.ModuleManager.has(a.ModuleName.Webos),isSupported:f(e)},{kind:r.MS_PREFIXED,isAvailable:!0,isSupported:y},{kind:r.PLAYSTATION_4,isAvailable:(0,i.getCapabilities)().isPlayStation4&&o.ModuleManager.has(a.ModuleName.PlayStation4),isSupported:l},{kind:r.TIZEN,isAvailable:(0,i.getCapabilities)().isTizen&&o.ModuleManager.has(a.ModuleName.Tizen),isSupported:f(e)},{kind:r.WEBKIT_PREFIXED,isAvailable:!0,isSupported:f(e)}]},t.createEMEHandlerInstance=function(e,t){switch(e){case r.MS_PREFIXED:return new u.MSPrefixedEMEHandler(t);case r.WEBOS_UNPREFIXED:return new(o.ModuleManager.get(a.ModuleName.Webos).getWebosUnprefixedEmeHandlerConstructor())(t);case r.WEBOS_2017_UNPREFIXED:return new(o.ModuleManager.get(a.ModuleName.Webos).getWebos2017UnprefixedEmeHandlerConstructor())(t);case r.WEBOS_WEBKIT_PREFIXED:return new(o.ModuleManager.get(a.ModuleName.Webos).getWebosWebkitPrefixedEmeHandlerConstructor())(t);case r.TIZEN:return new(o.ModuleManager.get(a.ModuleName.Tizen).getTizenEMEHandlerConstructor())(t);case r.PLAYSTATION_4:return new(o.ModuleManager.get(a.ModuleName.PlayStation4).getPlayStation4EMEHandlerConstructor())(t);case r.UNPREFIXED:return new c.UnprefixedEMEHandler(t);case r.WEBKIT_PREFIXED:return new d.WebKitPrefixedEMEHandler(t);default:throw new Error("Could not create EMEHandler")}}},30665:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeFromObject=t.memoOne=t.not=t.or=t.and=void 0,t.and=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.reduce(function(e,n){return e&&n.apply(void 0,t)},!0)}},t.or=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.reduce(function(e,n){return e||n.apply(void 0,t)},!1)}},t.not=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return!e.apply(void 0,t)}};var n=function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0};t.memoOne=function(e,t){var r,i=null,s=void 0!==t?t:n;return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return null!==i&&s(t,i)||(r=e.apply(void 0,t),i=t),r}},t.removeFromObject=function(e,t){return Object.keys(e).filter(function(e){return!t.includes(e)}).reduce(function(t,n){return t[n]=e[n],t},Object.create(null))}},6234:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseInitData=function(e){if(!e||e.byteLength<i.ISOBMFFConstants.BOX_SIZE_LENGTH+i.ISOBMFFConstants.BOX_TYPE_LENGTH)return[];var t=0,n=e instanceof Uint8Array?e.buffer:e,r=new DataView(n),s=[];do{var o=r.getUint32(t),u=n.slice(t,t+o);t+=o;var c=a(u);c&&s.push(c)}while(t<e.byteLength);return s};var r=n(25811),i=n(51682),s=n(74853),o=n(70233);function a(e){var t={},n=new DataView(e),a=i.ISOBMFFConstants.BOX_SIZE_LENGTH,u=s.ArrayHelper.extractAsciiString(n,a,i.ISOBMFFConstants.BOX_TYPE_LENGTH);if(a+=i.ISOBMFFConstants.BOX_TYPE_LENGTH,"pssh"!==u)return null;var c=n.getUint8(a);a+=i.ISOBMFFConstants.FULL_BOX_VERSION_LENGTH+i.ISOBMFFConstants.FULL_BOX_FLAGS_LENGTH;var d=s.ArrayHelper.extractHexString(n,a,i.ISOBMFFConstants.PSSH_SYSTEM_ID_LENGTH);if(a+=i.ISOBMFFConstants.PSSH_SYSTEM_ID_LENGTH,t.systemIDraw=d,t.systemID="urn:uuid:".concat(o.FormatHelper.beautifyUUID(d)),r.DRMSchemeIDURIs.hasOwnProperty(t.systemID)&&(t.systemName=r.DRMSchemeIDURIs[t.systemID]),c>0){var l=n.getUint32(a);a+=i.ISOBMFFConstants.PSSH_KID_COUNT_LENGTH,t.kid=[];for(var y=0;y<l;y++)t.kid.push(s.ArrayHelper.extractHexString(n,a,i.ISOBMFFConstants.PSSH_KID_LEN)),a+=i.ISOBMFFConstants.PSSH_KID_LEN}return t.initData=e,t.initDataStr=s.ArrayHelper.arrayBufferToAsciiString(e,!0),t}},35987:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.allSettledPromises=function(e){if(!e||!Array.isArray(e))return Promise.reject("The passed argument is not an array");var t=[],n=e.length>0,r=Promise.resolve(null);return e.forEach(function(e,i){r=r.then(function(){return e}).then(function(e){t[i]=e,n=!1}).catch(function(){t[i]=void 0})}),r.then(function(){return n?Promise.reject(t):t})}},49988:function(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProtoBufWireType=void 0,t.parseProtoBufMessage=function(e){for(var t=h(e)?new Uint8Array(e).buffer:e,n=[],r=new l(t);r.hasNext();){var i=p(r);if(!i)break;var s=m(i,r);s&&n.push(s)}return n},t.getFieldsByFieldNumber=function(e,t){return e.filter(function(e){return e.fieldNumber===t})},t.findFieldByFieldNumber=function(e,t){return e.find(function(e){return e.fieldNumber===t})},t.isLengthLimitedProtoBufField=function(e){return void 0!==e&&e.wireType===r.LengthLimited&&h(e.value)};var r,i=127,s=128,o=7,a=7,u=3,c=8,d=4;!function(e){e[e.VarInt=0]="VarInt",e[e.Bit64=1]="Bit64",e[e.LengthLimited=2]="LengthLimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"}(r||(t.ProtoBufWireType=r={}));var l=function(){function e(e){this.qjb=0,this.rjb=new Uint8Array(e)}return e.prototype.hasNext=function(){return this.qjb<this.rjb.byteLength},e.prototype.getNext=function(){if(this.hasNext()){var e=this.rjb[this.qjb];return this.qjb++,e}},e.prototype.reset=function(){this.qjb=0},e}();function y(e){var t,n=[];do{if(void 0===(t=e.getNext()))break;n.push(t&i)}while(t&s);return n.reduce(function(e,t,n){return e+(t<<n*o)},0)}function f(e,t){for(var n=[],r=0;r<t;r++){var i=e.getNext();if(void 0===i)break;n.push(i)}return n}function p(e){var t=y(e);if(void 0!==t)return{wireType:t&a,fieldNumber:t>>u}}function h(e){return Array.isArray(e)&&e.every(function(e){return"number"==typeof e})}function m(e,t){switch(e.wireType){case r.VarInt:return n(n({},e),{value:y(t)});case r.Bit64:return n(n({},e),{value:f(t,c)});case r.LengthLimited:var i=y(t);if(!i)return;return n(n({},e),{value:f(t,i)});case r.Bit32:return n(n({},e),{value:f(t,d)});case r.StartGroup:case r.EndGroup:default:return}}},92378:function(e,t,n){var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.parseKidsFromTVKeyPssh=function(e,t){try{var n=(0,u.parseInitData)(e).flatMap(function(e){return function(e){var t,n=null!==(t=e.kid)&&void 0!==t?t:[],o=function(e){var t=e.initData,n=new DataView(t),r=function(e){var t=new DataView(e),n=i.ISOBMFFConstants.BOX_SIZE_LENGTH+i.ISOBMFFConstants.BOX_TYPE_LENGTH+i.ISOBMFFConstants.FULL_BOX_VERSION_LENGTH+i.ISOBMFFConstants.FULL_BOX_FLAGS_LENGTH+i.ISOBMFFConstants.PSSH_SYSTEM_ID_LENGTH;if(t.getUint8(i.ISOBMFFConstants.BOX_SIZE_LENGTH+i.ISOBMFFConstants.BOX_TYPE_LENGTH)>0){var r=t.getUint32(n);n+=i.ISOBMFFConstants.PSSH_KID_COUNT_LENGTH+r*i.ISOBMFFConstants.PSSH_KID_LEN}return n}(t),o=n.getUint32(r),a=r+i.ISOBMFFConstants.PSSH_DATA_SIZE;if(o<=0||a+o>t.byteLength)return[];var u=new Uint8Array(t,a,o),c=s.ArrayHelper.convertBufferSourceToUTF8(u),d=JSON.parse(atob(c));return"string"==typeof d.keyId?[d.keyId]:[]}(e);return r(r([],n,!0),o,!0)}(e)}).map(c);return(0,a.removeDuplicates)(n)}catch(e){return[]}};var i=n(51682),s=n(74853),o=n(70233),a=n(70850),u=n(6234),c=function(e){return e.includes("-")?e:o.FormatHelper.beautifyUUID(e)}},51063:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseWidevineLicenseRequestProtoBuf=function(e){var t=M(e,r.LicenseRequest);if(t){var n=(0,a.findFieldByFieldNumber)(t,d);if((0,a.isLengthLimitedProtoBufField)(n)){var i=(0,a.parseProtoBufMessage)(n.value),o=(0,a.findFieldByFieldNumber)(i,l);if((0,a.isLengthLimitedProtoBufField)(o)){var u=(0,a.parseProtoBufMessage)(o.value),c=(0,a.findFieldByFieldNumber)(u,y),p=(0,a.findFieldByFieldNumber)(u,f);if((0,a.isLengthLimitedProtoBufField)(p)&&(0,a.isLengthLimitedProtoBufField)(c)){var h=s.ArrayHelper.arrayBufferToBase64(new Uint8Array(p.value).buffer),m=D((0,a.parseProtoBufMessage)(c.value));if(m)return{requestId:h,requestedKeyIds:m}}}}}},t.parseWidevineLicenseResponseProtoBuf=function(e){var t=M(e,r.License);if(t){var n=(0,a.findFieldByFieldNumber)(t,h);if((0,a.isLengthLimitedProtoBufField)(n)){var i=(0,a.parseProtoBufMessage)(n.value),u=(0,a.findFieldByFieldNumber)(i,m);if((0,a.isLengthLimitedProtoBufField)(u)){var c=s.ArrayHelper.arrayBufferToBase64(new Uint8Array(u.value).buffer),d=function(e){return(0,a.getFieldsByFieldNumber)(e,v).filter(a.isLengthLimitedProtoBufField).map(function(e){return(0,a.parseProtoBufMessage)(e.value)}).filter(I)}(t);if(0!==d.length){var l=function(e){for(var t=[],n=0,r=e;n<r.length;n++){var i=r[n],s=(0,a.findFieldByFieldNumber)(i,E);if(!(0,a.isLengthLimitedProtoBufField)(s))return;t.push(o.FormatHelper.bytesToUUID(new Uint8Array(s.value).buffer))}return t}(d);if(l&&function(e){return e.every(function(e){return"string"==typeof e})}(l))return{requestId:c,returnedKeyIds:l}}}}}},t.parseKidsFromWidevinePssh=function(e){var t=function(e){var t=new DataView(e.buffer);if(!(t.byteLength<=b)){if(1===t.getUint8(b)&&t.byteLength>S){var n=t.getUint32(S);return e.buffer.slice(28+n*R)}return e.buffer.slice(28)}}(new Uint8Array(e));if(!t)return[];var n=D((0,a.parseProtoBufMessage)(t));return null!=n?n:[]};var r,i,s=n(74853),o=n(70233),a=n(49988),u=4,c=2,d=2,l=1,y=1,f=3,p=2,h=1,m=1,v=3,E=1,g=1,S=27,b=8,R=16,L=32;function I(e){var t=(0,a.findFieldByFieldNumber)(e,u);return(null==t?void 0:t.value)===i.Content}function M(e,t){var n=(0,a.parseProtoBufMessage)(e);if(function(e,t){return function(e){var t=(0,a.findFieldByFieldNumber)(e,g);if("number"==typeof(null==t?void 0:t.value))return null==t?void 0:t.value}(e)===t}(n,t))return function(e){var t=(0,a.findFieldByFieldNumber)(e,c);if((0,a.isLengthLimitedProtoBufField)(t))return(0,a.parseProtoBufMessage)(t.value)}(n)}function D(e){var t=(0,a.getFieldsByFieldNumber)(e,p).filter(a.isLengthLimitedProtoBufField).filter(function(e){return e.value.length===R||e.value.length===L}).map(function(e){return e.value.length===L?o.FormatHelper.beautifyUUID(String.fromCodePoint.apply(null,e.value)):o.FormatHelper.bytesToUUID(new Uint8Array(e.value).buffer)});return t.length>0?t:void 0}!function(e){e[e.LicenseRequest=1]="LicenseRequest",e[e.License=2]="License"}(r||(r={})),function(e){e[e.Content=2]="Content"}(i||(i={}))}},function(e){return function(){return e(47272)}()}])});
|
|
18
18
|
})();
|