-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
dash.protection.min.js
2 lines (2 loc) · 82.7 KB
/
dash.protection.min.js
1
2
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dashjs=t():e.dashjs=t()}(self,(function(){return function(){var e={5448:function(e,t){"use strict";var n=function(){var e,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function s(e,t){return t[e]}function o(e,t,n){e in n&&(n[e]=t)}function a(t,n,r){var i,s=t.__dashjs_factory_name,o=n[s];if(o){var a=o.instance;if(!o.override)return a.apply({context:n,factory:e},r);for(var u in i=t.apply({context:n},r),a=a.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(u)&&(i[u]=a[u])}else i=t.apply({context:n},r);return i.getClassName=function(){return s},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var s=t[i];if(s.context===e&&s.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}))},getSingletonFactory:function(e){var r=s(e.__dashjs_factory_name,n);return r||(r=function(n){var r;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=a(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return s(e,n)},updateSingletonFactory:function(e,t){o(e,t,n)},getClassFactory:function(e){var t=s(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return a(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return s(e,r)},updateClassFactory:function(e,t){o(e,t,r)}},e}();t.Z=n},703:function(e,t,n){"use strict";var r=n(3875),i=n.n(r),s=n(1067);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,n=[{key:"mixin",value:function(t,n,r){var i,s={};if(t)for(var a in n)n.hasOwnProperty(a)&&(i=n[a],a in t&&(t[a]===i||a in s&&s[a]===i)||("object"===o(t[a])&&null!==t[a]?t[a]=e.mixin(t[a],i,r):t[a]=r(i)));return t}},{key:"clone",value:function(t){if(!t||"object"!==o(t))return t;var n;if(t instanceof Array){n=[];for(var r=0,i=t.length;r<i;++r)r in t&&n.push(e.clone(t[r]))}else n={};return e.mixin(n,t,e.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{if(!t||0===t.length)return e;var n=new URL(e);return t.forEach((function(e){e.key&&e.value&&n.searchParams.set(e.key,e.value)})),n.href}catch(t){return e}}},{key:"parseHttpHeaders",value:function(e){var t={};if(!e)return t;for(var n=e.trim().split("\r\n"),r=0,i=n.length;r<i;r++){var s=n[r],o=s.indexOf(": ");o>0&&(t[s.substring(0,o)]=s.substring(o+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}},{key:"getRelativeUrl",value:function(e,t){try{var n=new URL(e),r=new URL(t);if(n.protocol=r.protocol,n.origin!==r.origin)return t;var s=i().relative(n.pathname.substr(0,n.pathname.lastIndexOf("/")),r.pathname.substr(0,r.pathname.lastIndexOf("/"))),o=0===s.length?1:0;return s+=r.pathname.substr(r.pathname.lastIndexOf("/")+o,r.pathname.length-1),r.pathname.length<s.length?r.pathname:s}catch(e){return t}}},{key:"parseUserAgent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=null===e&&"undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"";return(0,s.UAParser)(t)}catch(e){return{}}}},{key:"stringHasProtocol",value:function(e){return/(http(s?)):\/\//i.test(e)}}],null&&a(t.prototype,null),n&&a(t,n),e}();t.Z=u},2230:function(e,t){"use strict";function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,(r=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&n(t.prototype,r),e}();t.Z=r},8342:function(e,t){"use strict";function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,(r=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&n(t.prototype,r),e}();t.Z=r},3393:function(e,t){"use strict";function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var r=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,r;return t=e,(r=[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.CONTENT_STEERING="contentSteering",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.ABR_FETCH_THROUGHPUT_CALCULATION_AAST="abrFetchThroughputCalculationAAST",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY="highestSelectionPriority",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.TEXT_DISABLED="disabled",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_DVB_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.FONT_DOWNLOAD_DVB_SCHEME="urn:dvb:dash:fontdownload:2014",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability",this.OFF_MIMETYPE="application/font-sfnt",this.WOFF_MIMETYPE="application/font-woff",this.VIDEO_ELEMENT_READY_STATES={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},this.FILE_LOADER_TYPES={FETCH:"fetch_loader",XHR:"xhr_loader"}}}])&&n(t.prototype,r),e}());t.Z=r},5459:function(e,t){"use strict";t.Z=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},7855:function(e,t,n){"use strict";n.d(t,{w:function(){return r}});var r=function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this.cmsd=null,this._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null};r.GET="GET",r.HEAD="HEAD",r.MPD_TYPE="MPD",r.XLINK_EXPANSION_TYPE="XLinkExpansion",r.INIT_SEGMENT_TYPE="InitializationSegment",r.INDEX_SEGMENT_TYPE="IndexSegment",r.MEDIA_SEGMENT_TYPE="MediaSegment",r.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",r.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",r.DVB_REPORTING_TYPE="DVBReporting",r.LICENSE="license",r.CONTENT_STEERING_TYPE="ContentSteering",r.OTHER_TYPE="other"},3875:function(e){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,s=-1,o=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(s===a-1||1===o);else if(s!==a-1&&2===o){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var u=r.lastIndexOf("/");if(u!==r.length-1){-1===u?(r="",i=0):i=(r=r.slice(0,u)).length-1-r.lastIndexOf("/"),s=a,o=0;continue}}else if(2===r.length||1===r.length){r="",i=0,s=a,o=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(s+1,a):r=e.slice(s+1,a),i=a-s-1;s=a,o=0}else 46===n&&-1!==o?++o:o=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,s=arguments.length-1;s>=-1&&!i;s--){var o;s>=0?o=arguments[s]:(void 0===e&&(e=process.cwd()),o=e),t(o),0!==o.length&&(r=o+"/"+r,i=47===o.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var s=e.length,o=s-i,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var u=n.length-a,c=o<u?o:u,l=-1,E=0;E<=c;++E){if(E===c){if(u>c){if(47===n.charCodeAt(a+E))return n.slice(a+E+1);if(0===E)return n.slice(a+E)}else o>c&&(47===e.charCodeAt(i+E)?l=E:0===E&&(l=0));break}var f=e.charCodeAt(i+E);if(f!==n.charCodeAt(a+E))break;47===f&&(l=E)}var d="";for(E=i+l+1;E<=s;++E)E!==s&&47!==e.charCodeAt(E)||(0===d.length?d+="..":d+="/..");return d.length>0?d+n.slice(a+l):(a+=l,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,s=!0,o=e.length-1;o>=1;--o)if(47===(n=e.charCodeAt(o))){if(!s){i=o;break}}else s=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,s=-1,o=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,u=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!o){i=r+1;break}}else-1===u&&(o=!1,u=r+1),a>=0&&(c===n.charCodeAt(a)?-1==--a&&(s=r):(a=-1,s=u))}return i===s?s=u:-1===s&&(s=e.length),e.slice(i,s)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!o){i=r+1;break}}else-1===s&&(o=!1,s=r+1);return-1===s?"":e.slice(i,s)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,s=!0,o=0,a=e.length-1;a>=0;--a){var u=e.charCodeAt(a);if(47!==u)-1===i&&(s=!1,i=a+1),46===u?-1===n?n=a:1!==o&&(o=1):-1!==n&&(o=-1);else if(!s){r=a+1;break}}return-1===n||-1===i||0===o||1===o&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),s=47===i;s?(n.root="/",r=1):r=0;for(var o=-1,a=0,u=-1,c=!0,l=e.length-1,E=0;l>=r;--l)if(47!==(i=e.charCodeAt(l)))-1===u&&(c=!1,u=l+1),46===i?-1===o?o=l:1!==E&&(E=1):-1!==o&&(E=-1);else if(!c){a=l+1;break}return-1===o||-1===u||0===E||1===E&&o===u-1&&o===a+1?-1!==u&&(n.base=n.name=0===a&&s?e.slice(1,u):e.slice(a,u)):(0===a&&s?(n.name=e.slice(1,o),n.base=e.slice(1,u)):(n.name=e.slice(a,o),n.base=e.slice(a,u)),n.ext=e.slice(o,u)),a>0?n.dir=e.slice(0,a-1):s&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},1067:function(e,t,n){var r;!function(i,s){"use strict";var o="function",a="undefined",u="object",c="string",l="major",E="model",f="name",d="type",g="vendor",y="version",h="architecture",_="console",S="mobile",p="tablet",m="smarttv",v="wearable",b="embedded",R="Amazon",w="Apple",A="ASUS",T="BlackBerry",C="Browser",D="Chrome",I="Firefox",M="Google",O="Huawei",k="LG",N="Microsoft",K="Motorola",L="Opera",P="Samsung",Y="Sharp",x="Sony",U="Xiaomi",G="Zebra",F="Facebook",H="Chromium OS",B="Mac OS",j=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},q=function(e,t){return typeof e===c&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===c)return e=e.replace(/^\s\s*/,""),typeof t===a?e:e.substring(0,500)},Z=function(e,t){for(var n,r,i,a,c,l,E=0;E<t.length&&!c;){var f=t[E],d=t[E+1];for(n=r=0;n<f.length&&!c&&f[n];)if(c=f[n++].exec(e))for(i=0;i<d.length;i++)l=c[++r],typeof(a=d[i])===u&&a.length>0?2===a.length?typeof a[1]==o?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3===a.length?typeof a[1]!==o||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):s:this[a[0]]=l?a[1].call(this,l,a[2]):s:4===a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):s):this[a]=l||s;E+=2}},z=function(e,t){for(var n in t)if(typeof t[n]===u&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(q(t[n][r],e))return"?"===n?s:n}else if(q(t[n],e))return"?"===n?s:n;return e},X={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,y],[/opios[\/ ]+([\w\.]+)/i],[y,[f,L+" Mini"]],[/\bopr\/([\w\.]+)/i],[y,[f,L]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[f,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,y],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[f,"UC"+C]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[f,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[f,"Smart Lenovo "+C]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+C],y],[/\bfocus\/([\w\.]+)/i],[y,[f,I+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[f,L+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[f,L+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[f,"MIUI "+C]],[/fxios\/([-\w\.]+)/i],[y,[f,I]],[/\bqihu|(qi?ho?o?|360)browser/i],[[f,"360 "+C]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1 "+C],y],[/samsungbrowser\/([\w\.]+)/i],[y,[f,P+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[f,/_/g," "],y],[/metasr[\/ ]?([\d\.]+)/i],[y,[f,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[f,y],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,F],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[f,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[f,D+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,D+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[f,"Android "+C]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[y,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[f,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[f,I+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[f,y],[/(cobalt)\/([\w\.]+)/i],[f,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,V]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[E,[g,P],[d,p]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[E,[g,P],[d,S]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[E,[g,w],[d,S]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[E,[g,w],[d,p]],[/(macintosh);/i],[E,[g,w]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[E,[g,Y],[d,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[E,[g,O],[d,p]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[E,[g,O],[d,S]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[E,/_/g," "],[g,U],[d,S]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[E,/_/g," "],[g,U],[d,p]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[E,[g,"OPPO"],[d,S]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[E,[g,"Vivo"],[d,S]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[E,[g,"Realme"],[d,S]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[E,[g,K],[d,S]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[E,[g,K],[d,p]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[E,[g,k],[d,p]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[E,[g,k],[d,S]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[E,[g,"Lenovo"],[d,p]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[E,/_/g," "],[g,"Nokia"],[d,S]],[/(pixel c)\b/i],[E,[g,M],[d,p]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[E,[g,M],[d,S]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[E,[g,x],[d,S]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[E,"Xperia Tablet"],[g,x],[d,p]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[E,[g,"OnePlus"],[d,S]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[E,[g,R],[d,p]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[E,/(.+)/g,"Fire Phone $1"],[g,R],[d,S]],[/(playbook);[-\w\),; ]+(rim)/i],[E,g,[d,p]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[E,[g,T],[d,S]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[E,[g,A],[d,p]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[E,[g,A],[d,S]],[/(nexus 9)/i],[E,[g,"HTC"],[d,p]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[E,/_/g," "],[d,S]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[E,[g,"Acer"],[d,p]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[E,[g,"Meizu"],[d,S]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[E,[g,"Ulefone"],[d,S]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[g,E,[d,S]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[g,E,[d,p]],[/(surface duo)/i],[E,[g,N],[d,p]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[E,[g,"Fairphone"],[d,S]],[/(u304aa)/i],[E,[g,"AT&T"],[d,S]],[/\bsie-(\w*)/i],[E,[g,"Siemens"],[d,S]],[/\b(rct\w+) b/i],[E,[g,"RCA"],[d,p]],[/\b(venue[\d ]{2,7}) b/i],[E,[g,"Dell"],[d,p]],[/\b(q(?:mv|ta)\w+) b/i],[E,[g,"Verizon"],[d,p]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[E,[g,"Barnes & Noble"],[d,p]],[/\b(tm\d{3}\w+) b/i],[E,[g,"NuVision"],[d,p]],[/\b(k88) b/i],[E,[g,"ZTE"],[d,p]],[/\b(nx\d{3}j) b/i],[E,[g,"ZTE"],[d,S]],[/\b(gen\d{3}) b.+49h/i],[E,[g,"Swiss"],[d,S]],[/\b(zur\d{3}) b/i],[E,[g,"Swiss"],[d,p]],[/\b((zeki)?tb.*\b) b/i],[E,[g,"Zeki"],[d,p]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],E,[d,p]],[/\b(ns-?\w{0,9}) b/i],[E,[g,"Insignia"],[d,p]],[/\b((nxa|next)-?\w{0,9}) b/i],[E,[g,"NextBook"],[d,p]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],E,[d,S]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],E,[d,S]],[/\b(ph-1) /i],[E,[g,"Essential"],[d,S]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[E,[g,"Envizen"],[d,p]],[/\b(trio[-\w\. ]+) b/i],[E,[g,"MachSpeed"],[d,p]],[/\btu_(1491) b/i],[E,[g,"Rotor"],[d,p]],[/(shield[\w ]+) b/i],[E,[g,"Nvidia"],[d,p]],[/(sprint) (\w+)/i],[g,E,[d,S]],[/(kin\.[onetw]{3})/i],[[E,/\./g," "],[g,N],[d,S]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[E,[g,G],[d,p]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[E,[g,G],[d,S]],[/smart-tv.+(samsung)/i],[g,[d,m]],[/hbbtv.+maple;(\d+)/i],[[E,/^/,"SmartTV"],[g,P],[d,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,k],[d,m]],[/(apple) ?tv/i],[g,[E,w+" TV"],[d,m]],[/crkey/i],[[E,D+"cast"],[g,M],[d,m]],[/droid.+aft(\w+)( bui|\))/i],[E,[g,R],[d,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[E,[g,Y],[d,m]],[/(bravia[\w ]+)( bui|\))/i],[E,[g,x],[d,m]],[/(mitv-\w{5}) bui/i],[E,[g,U],[d,m]],[/Hbbtv.*(technisat) (.*);/i],[g,E,[d,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,W],[E,W],[d,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,m]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,E,[d,_]],[/droid.+; (shield) bui/i],[E,[g,"Nvidia"],[d,_]],[/(playstation [345portablevi]+)/i],[E,[g,x],[d,_]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[E,[g,N],[d,_]],[/((pebble))app/i],[g,E,[d,v]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[E,[g,w],[d,v]],[/droid.+; (glass) \d/i],[E,[g,M],[d,v]],[/droid.+; (wt63?0{2,3})\)/i],[E,[g,G],[d,v]],[/(quest( 2| pro)?)/i],[E,[g,F],[d,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[d,b]],[/(aeobc)\b/i],[E,[g,R],[d,b]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[E,[d,S]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[E,[d,p]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,p]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,S]],[/(android[-\w\. ]{0,9});.+buil/i],[E,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[f,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,y],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[f,[y,z,X]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,z,X],[f,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,B],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,y],[/\(bb(10);/i],[y,[f,T]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[f,I+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[f,D+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,H],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,y],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,y]]},Q=function(e,t){if(typeof e===u&&(t=e,e=s),!(this instanceof Q))return new Q(e,t).getResult();var n=typeof i!==a&&i.navigator?i.navigator:s,r=e||(n&&n.userAgent?n.userAgent:""),_=n&&n.userAgentData?n.userAgentData:s,m=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(J,t):J,v=n&&n.userAgent==r;return this.getBrowser=function(){var e,t={};return t[f]=s,t[y]=s,Z.call(t,r,m.browser),t[l]=typeof(e=t[y])===c?e.replace(/[^\d\.]/g,"").split(".")[0]:s,v&&n&&n.brave&&typeof n.brave.isBrave==o&&(t[f]="Brave"),t},this.getCPU=function(){var e={};return e[h]=s,Z.call(e,r,m.cpu),e},this.getDevice=function(){var e={};return e[g]=s,e[E]=s,e[d]=s,Z.call(e,r,m.device),v&&!e[d]&&_&&_.mobile&&(e[d]=S),v&&"Macintosh"==e[E]&&n&&typeof n.standalone!==a&&n.maxTouchPoints&&n.maxTouchPoints>2&&(e[E]="iPad",e[d]=p),e},this.getEngine=function(){var e={};return e[f]=s,e[y]=s,Z.call(e,r,m.engine),e},this.getOS=function(){var e={};return e[f]=s,e[y]=s,Z.call(e,r,m.os),v&&!e[f]&&_&&"Unknown"!=_.platform&&(e[f]=_.platform.replace(/chrome os/i,H).replace(/macos/i,B)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===c&&e.length>500?W(e,500):e,this},this.setUA(r),this};Q.VERSION="1.0.37",Q.BROWSER=j([f,y,l]),Q.CPU=j([h]),Q.DEVICE=j([E,g,d,_,S,m,p,v,b]),Q.ENGINE=Q.OS=j([f,y]),typeof t!==a?(e.exports&&(t=e.exports=Q),t.UAParser=Q):n.amdO?(r=function(){return Q}.call(t,n,t,e))===s||(e.exports=r):typeof i!==a&&(i.UAParser=Q);var $=typeof i!==a&&(i.jQuery||i.Zepto);if($&&!$.ua){var ee=new Q;$.ua=ee.getResult(),$.ua.get=function(){return ee.getUA()},$.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var n in t)$.ua[n]=t[n]}}}("object"==typeof window?window:this)}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.amdO={},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(r,{default:function(){return be}});var t={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]},i=function(){function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n)}var r,i;return r=n,i=[{key:"findCencContentProtection",value:function(e){for(var t=null,n=0;n<e.length;++n){var r=e[n];"urn:mpeg:dash:mp4protection:2011"!==r.schemeIdUri.toLowerCase()||"cenc"!==r.value.toLowerCase()&&"cbcs"!==r.value.toLowerCase()||(t=r)}return t}},{key:"getPSSHData",value:function(e){var t=8,n=new DataView(e),r=n.getUint8(t);return t+=20,r>0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(e,t){var r=n.parsePSSHList(t);return e&&r.hasOwnProperty(e.uuid.toLowerCase())?r[e.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),n={},r=0;;){var i,s,o=void 0,a=r;if(r>=t.buffer.byteLength)break;if(i=r+t.getUint32(r),r+=4,1886614376===t.getUint32(r))if(r+=4,0===(s=t.getUint8(r))||1===s){r++,r+=3,o="";var u=void 0,c=void 0;for(u=0;u<4;u++)o+=1===(c=t.getUint8(r+u).toString(16)).length?"0"+c:c;for(r+=4,o+="-",u=0;u<2;u++)o+=1===(c=t.getUint8(r+u).toString(16)).length?"0"+c:c;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(c=t.getUint8(r+u).toString(16)).length?"0"+c:c;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(c=t.getUint8(r+u).toString(16)).length?"0"+c:c;for(r+=2,o+="-",u=0;u<6;u++)o+=1===(c=t.getUint8(r+u).toString(16)).length?"0"+c:c;r+=6,r+=4,n[o=o.toLowerCase()]=t.buffer.slice(a,i),r=i}else r=i;else r=i}return n}},{key:"getLicenseServerUrlFromMediaInfo",value:function(e,n){try{if(!e||0===e.length)return null;for(var r=0,i=null;r<e.length&&!i;){var s=e[r];if(s&&s.contentProtection&&s.contentProtection.length>0){var o=s.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===n}));if(o&&o.length>0)for(var a=0;a<o.length&&!i;){for(var u=o[a],c=0;c<t.attributes.length&&!i;){for(var l=0,E=t.attributes[c];l<t.prefixes.length&&!i;){var f=t.prefixes[l];u[E]&&u[E].__prefix&&u[E].__prefix===f&&u[E].__text&&(i=u[E].__text),l+=1}c+=1}a+=1}}r+=1}return i}catch(e){return null}}}],null&&e(r.prototype,null),i&&e(r,i),n}(),s=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=n},o=function e(t,n,r,i,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),n&&n.length&&(this.videoCapabilities=n),this.distinctiveIdentifier=r,this.persistentState=i,this.sessionTypes=s};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function c(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}var E=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=l(t);if(n){var i=l(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return c(this,e)});function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}return i}(n(2230).Z)),f=n(5459),d=function e(t,n,r,i,s,o,a,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=n,this.responseType=r,this.headers=i,this.withCredentials=s,this.messageType=o,this.sessionId=a,this.data=u},g=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.headers=n,this.data=r},y=n(7855),h=n(703),_=n(3393),S=n(5448);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function m(e){var t,n,r,a,u,c,l,S,m,v,b,R=(e=e||{}).protectionKeyController,w=e.protectionModel,A=e.eventBus,T=e.events,C=e.debug,D=e.BASE64,I=e.constants,M=[],O=e.cmcdModel,k=e.settings,N=e.customParametersModel;function K(){if(!(A&&A.hasOwnProperty("on")&&R&&R.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function L(e,t){S||m?S&&P():function(e,t){if(!m){m=!0;var r,i=[];e=e.sort((function(t,n){return(u&&u[t.ks.systemString]&&u[t.ks.systemString].priority>=0?u[t.ks.systemString].priority:e.length)-(u&&u[n.ks.systemString]&&u[n.ks.systemString].priority>=0?u[n.ks.systemString].priority:e.length)}));for(var s=0;s<e.length;s++){var o=B(e[s]);i.push({ks:e[s].ks,configs:[o],protData:e[s].protData})}w.requestKeySystemAccess(i).then((function(e){var t=(r=e.data).mksa&&r.mksa.selectedSystemString?r.mksa.selectedSystemString:r.keySystem.systemString;return n.info("DRM: KeySystem Access Granted for system string ("+t+")! Selecting key system..."),w.selectKeySystem(r)})).then((function(e){if(S=e,m=!1,w){A.trigger(T.KEY_SYSTEM_SELECTED,{data:r});var t=G(S);t&&t.serverCertificate&&t.serverCertificate.length>0&&w.setServerCertificate(D.decodeArray(t.serverCertificate).buffer),P()}})).catch((function(e){S=null,m=!1,t||A.trigger(T.KEY_SYSTEM_SELECTED,{data:null,error:new f.Z(E.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,E.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+e.error)})}))}}(e,t)}function P(){for(var e,t=0;t<r.length;t++)for(e=0;e<r[t].length;e++)if(S===r[t][e].ks){Y(r[t][e]);break}r=[]}function Y(e){if(R.isClearKey(S)&&e.protData&&e.protData.hasOwnProperty("clearkeys")&&0!==Object.keys(e.protData.clearkeys).length){var t={kids:Object.keys(e.protData.clearkeys)};e.initData=(new TextEncoder).encode(JSON.stringify(t))}e.sessionId?x(e):null!==e.initData&&U(e)}function x(e){K(),w.loadKeySession(e)}function U(e){var t=i.getPSSHForKeySystem(S,e?e.initData:null);if(t){if(function(e){if(!e)return!1;try{for(var t=w.getSessions(),n=0;n<t.length;n++)if(t[n].getKeyId()===e)return!0;return!1}catch(e){return!1}}(e.keyId))return;if(F(t))return;try{e.initData=t,w.createKeySession(e)}catch(e){A.trigger(T.KEY_SESSION_CREATED,{data:null,error:new f.Z(E.KEY_SESSION_CREATED_ERROR_CODE,E.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e&&e.initData?w.createKeySession(e):A.trigger(T.KEY_SESSION_CREATED,{data:null,error:new f.Z(E.KEY_SESSION_CREATED_ERROR_CODE,E.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(S?S.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function G(e){if(e){var t=e.systemString;if(u)return t in u?u[t]:null}return null}function F(e){if(!e)return!1;try{for(var t=w.getAllInitData(),r=0;r<t.length;r++)if(R.initDataEquals(e,t[r]))return n.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function H(e){K(),e?(w.setMediaElement(e),A.on(T.NEED_KEY,Q,t)):null===e&&(w.setMediaElement(e),A.off(T.NEED_KEY,Q,t))}function B(e){var t=e.protData,n=[],r=[],i=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:l,u=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:l,c=e.sessionType,E=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",f=t&&t.persistentState?t.persistentState:"temporary"===c?"optional":"required";return a.forEach((function(e){e.type===I.AUDIO?n.push(new s(e.codec,i)):e.type===I.VIDEO&&r.push(new s(e.codec,u))})),new o(n,r,E,f,[c])}function j(e){e.error?A.trigger(T.KEY_STATUSES_CHANGED,{data:null,error:e.error}):n.debug("DRM: key status = "+e.status)}function q(e){n.debug("DRM: onKeyMessage");var t=e.data;A.trigger(T.KEY_MESSAGE,{data:t});var r=t.messageType?t.messageType:"license-request",s=t.message,o=t.sessionToken,u=G(S),c=R.getLicenseServerModelInstance(S,u,r),l={sessionToken:o,messageType:r};if(s&&0!==s.byteLength){if(!c)return n.debug("DRM: License server request not required for this message (type = "+e.data.messageType+"). Session ID = "+o.getSessionId()),void V(l);if(R.isClearKey(S)){var _=R.processClearKeyLicenseRequest(S,u,s);if(_&&_.keyPairs&&_.keyPairs.length>0)return n.debug("DRM: ClearKey license request handled by application!"),V(l),void w.updateKeySession(o,_)}!function(e,t,n){var r=e.sessionToken,s=e.messageType?e.messageType:"license-request",o={sessionToken:r,messageType:s},u=S?S.systemString:null,c=function(e,t,n,r,s){var o=null,u=r.message;if(e&&e.serverURL){var c=e.serverURL;"string"==typeof c&&""!==c?o=c:"object"===p(c)&&c.hasOwnProperty(t)&&(o=c[t])}else if(e&&e.laURL&&""!==e.laURL)o=e.laURL;else if(!(o=i.getLicenseServerUrlFromMediaInfo(a,S.schemeIdURI))&&!R.isClearKey(S)){var l=i.getPSSHData(n.initData);(o=S.getLicenseServerURLFromInitData(l))||(o=r.laURL)}return o=s.getServerURLFromMessage(o,u,t)}(n,s,r,e,t);if(c){var l={},_=!1;n&&z(l,n.httpRequestHeaders);var m=e.message;z(l,S.getRequestHeadersFromMessage(m)),Object.keys(l).forEach((function(e){"authorization"===e.toLowerCase()&&(_=!0)})),n&&"boolean"==typeof n.withCredentials&&(_=n.withCredentials);var v=function(e){if(w)if(e.status>=200&&e.status<=299){var n=h.Z.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),i=new g(e.responseURL,n,e.response);J(N.getLicenseResponseFilters(),i).then((function(){var n=t.getLicenseMessage(i.data,u,s);null!==n?(V(o),w.updateKeySession(r,n)):X(e,o,u,s,t)}))}else X(e,o,u,s,t)},b=function(e){V(o,new f.Z(E.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,E.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+u+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},A=function(e){V(o,new f.Z(E.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,E.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+u+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},T=S.getLicenseRequestFromMessage(m),C=t.getHTTPMethod(s),D=t.getResponseType(u,s),I=n&&!isNaN(n.httpTimeout)?n.httpTimeout:8e3,M=r.getSessionId()||null,O=new d(c,C,D,l,_,s,M,T),K=isNaN(k.get().streaming.retryAttempts[y.w.LICENSE])?3:k.get().streaming.retryAttempts[y.w.LICENSE];J(N.getLicenseRequestFilters(),O).then((function(){W(O,K,I,v,b,A)}))}else V(o,new f.Z(E.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,E.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}(t,c,u)}else V(l,new f.Z(E.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,E.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function V(e,t){A.trigger(T.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function W(e,t,r,i,s,o){var a=new XMLHttpRequest;if(k.get().streaming.cmcd&&k.get().streaming.cmcd.enabled&&k.get().streaming.cmcd.mode===_.Z.CMCD_MODE_QUERY){var u=O.getQueryParameter({url:e.url,type:y.w.LICENSE});u&&(e.url=h.Z.addAditionalQueryParameterToUrl(e.url,[u]))}for(var c in a.open(e.method,e.url,!0),a.responseType=e.responseType,a.withCredentials=e.withCredentials,r>0&&(a.timeout=r),e.headers)a.setRequestHeader(c,e.headers[c]);if(k.get().streaming.cmcd&&k.get().streaming.cmcd.enabled&&k.get().streaming.cmcd.mode===_.Z.CMCD_MODE_HEADER){var l=O.getHeaderParameters({url:e.url,type:y.w.LICENSE});if(l)for(var E in l){var f=l[E];f&&a.setRequestHeader(E,f)}}var d=function(){t--;var n=isNaN(k.get().streaming.retryIntervals[y.w.LICENSE])?1e3:k.get().streaming.retryIntervals[y.w.LICENSE];b=setTimeout((function(){W(e,t,r,i,s,o)}),n)};a.onload=function(){v=null,this.status>=200&&this.status<=299||t<=0?i(this):(n.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+t),d())},a.ontimeout=a.onerror=function(){v=null,t<=0?o(this):(n.warn("License request network request failed . Retrying it... Pending retries: "+t),d())},a.onabort=function(){s(this)},A.trigger(T.LICENSE_REQUEST_SENDING,{url:e.url,headers:e.headers,payload:e.data,sessionId:e.sessionId}),v=a,a.send(e.data)}function Z(){v&&(v.onloadend=v.onerror=v.onprogress=void 0,v.abort(),v=null),b&&(clearTimeout(b),b=null)}function z(e,t){if(t)for(var n in t)e[n]=t[n]}function X(e,t,n,r,i){var s="NONE",o=null;e.response&&(s=i.getErrorResponse(e.response,n,r),o={serverResponse:e.response||null,responseCode:e.status||null,responseText:e.statusText||null}),V(t,new f.Z(E.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,E.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+". Response is "+s,o))}function J(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}function Q(e,t){if(!k.get().streaming.protection.ignoreEmeEncryptedEvent){if(n.debug("DRM: onNeedKey"),"cenc"!==e.key.initDataType)return void n.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType);if(0===a.length&&(n.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))return void M.push(setTimeout((function(){Q(e,t)}),500));var s=e.key.initData;if(ArrayBuffer.isView(s)&&(s=s.buffer),S){var o=i.getPSSHForKeySystem(S,s);if(o&&F(o))return}n.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(s)));var l=R.getSupportedKeySystemsFromSegmentPssh(s,u,c);if(0===l.length)return void n.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!");!function(e){r.push(e),L(e,!1)}(l)}}return t={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");K(),a.push(e)},clearMediaInfoArray:function(){a=[]},handleKeySystemFromManifest:function(){if(a&&0!==a.length){var e=[];a.forEach((function(t){var n=R.getSupportedKeySystemsFromContentProtection(t.contentProtection,u,c);n.length>0&&(0===e.length&&(e=n),r.push(n))})),e&&e.length>0&&L(e,!0)}},createKeySession:U,loadKeySession:x,removeKeySession:function(e){K(),w.removeKeySession(e)},closeKeySession:function(e){K(),w.closeKeySession(e)},setServerCertificate:function(e){K(),w.setServerCertificate(e)},setMediaElement:H,setSessionType:function(e){c=e},setRobustnessLevel:function(e){l=e},setProtectionData:function(e){u=e,R.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return K(),R.getSupportedKeySystemsFromContentProtection(e,u,c)},getKeySystems:function(){return R?R.getKeySystems():[]},setKeySystems:function(e){R&&R.setKeySystems(e)},stop:function(){Z(),w&&w.stop()},reset:function(){A.off(T.INTERNAL_KEY_MESSAGE,q,t),A.off(T.INTERNAL_KEY_STATUS_CHANGED,j,t),K(),Z(),H(null),S=null,m=!1,w&&(w.reset(),w=null),M.forEach((function(e){return clearTimeout(e)})),M=[],a=[],r=[]}},n=C.getLogger(t),r=[],a=[],c="temporary",l="",v=null,b=null,A.on(T.INTERNAL_KEY_MESSAGE,q,t),A.on(T.INTERNAL_KEY_STATUS_CHANGED,j,t),t}m.__dashjs_factory_name="ProtectionController";var v=S.Z.getClassFactory(m),b=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=n};function R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var w=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n&&"persistent"!==n&&"temporary"!==n)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=n}var t,n;return t=e,(n=[{key:"toJWK",value:function(){var e,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){var r={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(r)}this.type&&(n.type=this.type);var i=JSON.stringify(n),s=i.length,o=new ArrayBuffer(s),a=new Uint8Array(o);for(e=0;e<s;e++)a[e]=i.charCodeAt(e);return o}}])&&R(t.prototype,n),e}();function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var T=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n;return t=e,(n=[{key:"init",value:function(){this.CLEARKEY_KEYSTEM_STRING="org.w3.clearkey",this.WIDEVINE_KEYSTEM_STRING="com.widevine.alpha",this.PLAYREADY_KEYSTEM_STRING="com.microsoft.playready",this.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING="com.microsoft.playready.recommendation",this.INITIALIZATION_DATA_TYPE_CENC="cenc",this.INITIALIZATION_DATA_TYPE_KEYIDS="keyids",this.INITIALIZATION_DATA_TYPE_WEBM="webm"}}])&&A(t.prototype,n),e}()),C="e2719d58-a985-b3c9-781a-b030af78d30e",D=T.CLEARKEY_KEYSTEM_STRING,I="urn:uuid:"+C;function M(e){var t=(e=e||{}).BASE64;return{uuid:C,schemeIdURI:I,systemString:D,getInitData:function(e,n){try{var r=i.parseInitDataFromContentProtection(e,t);if(!r&&n){var s={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))).replace(/=/g,"").replace(/\//g,"_").replace(/\+/g,"-")}catch(e){return null}}(n["cenc:default_KID"])]};r=(new TextEncoder).encode(JSON.stringify(s))}return r}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var r=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),i=[],s=0;s<r.kids.length;s++){var o=r.kids[s],a=e.clearkeys&&e.clearkeys.hasOwnProperty(o)?e.clearkeys[o]:null;if(!a)throw new Error("DRM: ClearKey keyID ("+o+") is not known!");i.push(new b(o,a))}n=new w(i)}return n}}}M.__dashjs_factory_name="KeySystemClearKey";var O=dashjs.FactoryMaker.getSingletonFactory(M),k="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",N=T.CLEARKEY_KEYSTEM_STRING,K="urn:uuid:"+k;function L(e){var t,n=e.BASE64,r=e.debug.getLogger(t);return{uuid:k,schemeIdURI:K,systemString:N,getInitData:function(e){return i.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),s=[],o=0;o<i.kids.length;o++){var a=i.kids[o],u=e.clearkeys&&e.clearkeys.hasOwnProperty(a)?e.clearkeys[a]:null;if(!u)throw new Error("DRM: ClearKey keyID ("+a+") is not known!");s.push(new b(a,u))}n=new w(s),r.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return n}}}L.__dashjs_factory_name="KeySystemW3CClearKey";var P=dashjs.FactoryMaker.getSingletonFactory(L),Y="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",x=T.WIDEVINE_KEYSTEM_STRING,U="urn:uuid:"+Y;function G(e){var t=(e=e||{}).BASE64;return{uuid:Y,schemeIdURI:U,systemString:x,getInitData:function(e){return i.parseInitDataFromContentProtection(e,t)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}}}G.__dashjs_factory_name="KeySystemWidevine";var F=dashjs.FactoryMaker.getSingletonFactory(G),H="9a04f079-9840-4286-ab92-e65be0885f95",B=T.PLAYREADY_KEYSTEM_STRING,j="urn:uuid:"+H;function q(e){var t="utf-16",n=(e=e||{}).BASE64,r=e.settings;function s(){if(!n||!n.hasOwnProperty("decodeArray")||!n.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return{uuid:H,schemeIdURI:j,systemString:B,getInitData:function(e){var t,r,o,a,u,c=new Uint8Array([112,115,115,104,0,0,0,0]),l=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),E=0,f=null;if(s(),!e)return null;if("pssh"in e)return i.parseInitDataFromContentProtection(e,n);if("pro"in e)f=n.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;f=n.decodeArray(e.prheader.__text)}return t=f.length,r=4+c.length+l.length+4+t,o=new ArrayBuffer(r),a=new Uint8Array(o),(u=new DataView(o)).setUint32(E,r),E+=4,a.set(c,E),E+=c.length,a.set(l,E),E+=l.length,u.setUint32(E,t),E+=4,a.set(f,E),E+=t,a.buffer},getRequestHeadersFromMessage:function(e){var n,i,s={},o=new DOMParser;if(r&&r.get().streaming.protection.detectPlayreadyMessageFormat&&"utf-16"===t&&e&&e.byteLength%2==1)return s["Content-Type"]="text/xml; charset=utf-8",s;var a="utf-16"===t?new Uint16Array(e):new Uint8Array(e);n=String.fromCharCode.apply(null,a);for(var u=(i=o.parseFromString(n,"application/xml")).getElementsByTagName("name"),c=i.getElementsByTagName("value"),l=0;l<u.length;l++)s[u[l].childNodes[0].nodeValue]=c[l].childNodes[0].nodeValue;return s.hasOwnProperty("Content")&&(s["Content-Type"]=s.Content,delete s.Content),s.hasOwnProperty("Content-Type")||(s["Content-Type"]="text/xml; charset=utf-8"),s},getLicenseRequestFromMessage:function(e){var i=null,o=new DOMParser;if(r&&r.get().streaming.protection.detectPlayreadyMessageFormat&&"utf-16"===t&&e&&e.byteLength%2==1)return e;var a="utf-16"===t?new Uint16Array(e):new Uint8Array(e);s();var u=String.fromCharCode.apply(null,a),c=o.parseFromString(u,"application/xml");if(!c.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var l=c.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return l&&(i=n.decode(l)),i},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),n=t.getUint16(4,!0),r=6,i=new DOMParser,s=0;s<n;s++){var o=t.getUint16(r,!0);r+=2;var a=t.getUint16(r,!0);if(r+=2,1===o){var u=e.slice(r,r+a),c=String.fromCharCode.apply(null,new Uint16Array(u)),l=i.parseFromString(c,"application/xml");if(l.getElementsByTagName("LA_URL")[0]){var E=l.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(E)return E}if(l.getElementsByTagName("LUI_URL")[0]){var f=l.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(f)return f}}else r+=a}return null},getCDMData:function(e){var t,r,i,o;if(s(),!e)return null;for(t=[],o=0;o<e.length;++o)t.push(e.charCodeAt(o)),t.push(0);for(t=String.fromCharCode.apply(null,t),t=n.encode(t),r='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",t),i=[],o=0;o<r.length;++o)i.push(r.charCodeAt(o)),i.push(0);return new Uint8Array(i).buffer},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');t=e}}}q.__dashjs_factory_name="KeySystemPlayReady";var V=dashjs.FactoryMaker.getSingletonFactory(q);function W(e){var t=(e=e||{}).BASE64,n={};return n[T.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[T.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,r){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),n[r].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}}}W.__dashjs_factory_name="DRMToday";var Z=dashjs.FactoryMaker.getSingletonFactory(W);function z(){var e="http://schemas.xmlsoap.org/soap/envelope/";function t(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function n(n){if(window.DOMParser){var r=t(n),i=(new window.DOMParser).parseFromString(r,"text/xml"),s=i?i.getElementsByTagNameNS(e,"Envelope")[0]:null,o=s?s.getElementsByTagNameNS(e,"Body")[0]:null;if(o&&o.getElementsByTagNameNS(e,"Fault")[0])return null}return n}function r(n){var r="",i="",s="",o=-1,a=-1;if(window.DOMParser){var u=t(n),c=(new window.DOMParser).parseFromString(u,"text/xml"),l=c?c.getElementsByTagNameNS(e,"Envelope")[0]:null,E=l?l.getElementsByTagNameNS(e,"Body")[0]:null,f=E?E.getElementsByTagNameNS(e,"Fault")[0]:null,d=f?f.getElementsByTagName("detail")[0]:null,g=d?d.getElementsByTagName("Exception")[0]:null,y=null;if(null===f)return u;r=(y=f.getElementsByTagName("faultstring")[0].firstChild)?y.nodeValue:null,null!==g&&(i=(y=g.getElementsByTagName("StatusCode")[0])?y.firstChild.nodeValue:null,o=(s=(y=g.getElementsByTagName("Message")[0])?y.firstChild.nodeValue:null)?s.lastIndexOf("[")+1:-1,a=s?s.indexOf("]"):-1,s=s?s.substring(o,a):"")}var h="code: ".concat(i,", name: ").concat(r);return s&&(h+=", message: ".concat(s)),h}return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return n.call(this,e)},getErrorResponse:function(e){return r.call(this,e)}}}z.__dashjs_factory_name="PlayReady";var X=S.Z.getSingletonFactory(z);function J(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}J.__dashjs_factory_name="Widevine";var Q=dashjs.FactoryMaker.getSingletonFactory(J);function $(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],n=0;n<e.keys.length;n++){var r=e.keys[n],i=r.kid.replace(/=/g,""),s=r.k.replace(/=/g,"");t.push(new b(i,s))}return new w(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}$.__dashjs_factory_name="ClearKey";var ee=dashjs.FactoryMaker.getSingletonFactory($);function te(){var e,t,n,r,s,o,a,u,c=this.context;function l(e,t){return t&&e in t?t[e]:null}function E(e,t){return e&&e.sessionId?e.sessionId:t&&t.sessionId?t.sessionId:null}function f(e,t){return e&&e.sessionType?e.sessionType:t}return e={initialize:function(){var e;r=[],e=V(c).getInstance({BASE64:s,settings:o}),r.push(e),e=F(c).getInstance({BASE64:s}),r.push(e),e=O(c).getInstance({BASE64:s}),r.push(e),a=e,e=P(c).getInstance({BASE64:s,debug:t}),r.push(e),u=e},setProtectionData:function(e){for(var t,n,i=0;i<r.length;i++){var s=r[i];s.hasOwnProperty("init")&&s.init((t=s.systemString,n=void 0,n=null,e&&(n=t in e?e[t]:null),n))}},isClearKey:function(e){return e===a||e===u},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){for(var n=new Uint8Array(e),r=new Uint8Array(t),i=0;i<n.length;i++)if(n[i]!==r[i])return!1;return!0}return!1},getKeySystems:function(){return r},setKeySystems:function(e){r=e},getKeySystemBySystemString:function(e){for(var t=0;t<r.length;t++)if(r[t].systemString===e)return r[t];return null},getSupportedKeySystemsFromContentProtection:function(e,t,n){var s,o,a,u,c=[];if(e){var d=i.findCencContentProtection(e);for(a=0;a<r.length;++a){var g=l((o=r[a]).systemString,t);for(u=0;u<e.length;++u)if((s=e[u]).schemeIdUri.toLowerCase()===o.schemeIdURI){var y=o.getInitData(s,d);c.push({ks:r[a],keyId:s.keyId,initData:y,protData:g,cdmData:o.getCDMData(g?g.cdmData:null),sessionId:E(g,s),sessionType:f(g,n)})}}}return c},getSupportedKeySystemsFromSegmentPssh:function(e,t,n){for(var s,o=[],a=i.parsePSSHList(e),u=0;u<r.length;++u){var c=l((s=r[u]).systemString,t);s.uuid in a&&o.push({ks:s,initData:a[s.uuid],protData:c,cdmData:s.getCDMData(c?c.cdmData:null),sessionId:E(c),sessionType:f(c,n)})}return o},getLicenseServerModelInstance:function(e,t,n){if("license-release"===n||"individualization-request"===n)return null;var r=null;return t&&t.hasOwnProperty("drmtoday")?r=Z(c).getInstance({BASE64:s}):e.systemString===T.WIDEVINE_KEYSTEM_STRING?r=Q(c).getInstance():e.systemString===T.PLAYREADY_KEYSTEM_STRING?r=X(c).getInstance():e.systemString===T.CLEARKEY_KEYSTEM_STRING&&(r=ee(c).getInstance()),r},processClearKeyLicenseRequest:function(e,t,r){try{return e.getClearKeysFromProtectionData(t,r)}catch(e){return n.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(r){r&&(r.debug&&(t=r.debug,n=t.getLogger(e)),r.BASE64&&(s=r.BASE64),r.settings&&(o=r.settings))}},e}te.__dashjs_factory_name="ProtectionKeyController";var ne=dashjs.FactoryMaker.getSingletonFactory(te);function re(e){return re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},re(e)}function ie(e,t){return ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ie(e,t)}function se(e,t){return!t||"object"!==re(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function oe(e){return oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},oe(e)}var ae=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ie(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=oe(t);if(n){var i=oe(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return se(this,e)});function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).INTERNAL_KEY_MESSAGE="internalKeyMessage",e.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",e.KEY_ADDED="public_keyAdded",e.KEY_ERROR="public_keyError",e.KEY_MESSAGE="public_keyMessage",e.KEY_SESSION_CLOSED="public_keySessionClosed",e.KEY_SESSION_CREATED="public_keySessionCreated",e.KEY_SESSION_REMOVED="public_keySessionRemoved",e.KEY_STATUSES_CHANGED="public_keyStatusesChanged",e.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",e.KEY_SYSTEM_SELECTED="public_keySystemSelected",e.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",e.LICENSE_REQUEST_SENDING="public_licenseRequestSending",e.NEED_KEY="needkey",e.PROTECTION_CREATED="public_protectioncreated",e.PROTECTION_DESTROYED="public_protectiondestroyed",e.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",e.TEARDOWN_COMPLETE="protectionTeardownComplete",e.VIDEO_ELEMENT_SELECTED="videoElementSelected",e.KEY_SESSION_UPDATED="public_keySessionUpdated",e}return i}(n(8342).Z)),ue=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=n},ce=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=n,this.defaultURL=r,this.messageType=i||"license-request"},le=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=n},Ee={};function fe(e){e=e||{};var t,n,r,i,s,o,a,u,c=this.context,l=e.eventBus,d=e.events,g=e.debug;function y(e,t,n,r){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess){var i="Insecure origins are not allowed";return l.trigger(d.KEY_SYSTEM_ACCESS_COMPLETE,{error:i}),void r({error:i})}var s=e[t].protData&&e[t].protData.systemStringPriority?e[t].protData.systemStringPriority:null,o=e[t].configs,a=e[t].ks,u=a.systemString;(function(e,t){return new Promise((function(n,r){h(e,t,0,n,r)}))})(s||(Ee[u]?Ee[u]:[u]),o).then((function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,r=new le(a,t);r.mksa=e,l.trigger(d.KEY_SYSTEM_ACCESS_COMPLETE,{data:r}),n({data:r})})).catch((function(i){if(t+1<e.length)y(e,t+1,n,r);else{var s="Key system access denied! ";l.trigger(d.KEY_SYSTEM_ACCESS_COMPLETE,{error:s+i.message}),r({error:s+i.message})}}))}function h(e,t,r,i,s){var o=e[r];n.debug("Requesting key system access for system string ".concat(o)),navigator.requestMediaKeySystemAccess(o,t).then((function(e){e.selectedSystemString=o,i(e)})).catch((function(n){r+1<e.length?h(e,t,r+1,i,s):s(n)}))}function _(e){if(!e||!e.session)return Promise.resolve;var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function S(e){for(var t=0;t<o.length;t++)if(o[t]===e){o.splice(t,1);break}}function p(e){var t,n;return e&&e.length>0&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}function m(e,t){var r={session:e,keyId:t.keyId,initData:t.initData,sessionId:t.sessionId,sessionType:t.sessionType,handleEvent:function(e){switch(e.type){case"keystatuseschange":l.trigger(d.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=p(arguments);"expired"===e.status?l.trigger(d.INTERNAL_KEY_STATUS_CHANGED,{error:new f.Z(E.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,E.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)}):l.trigger(d.INTERNAL_KEY_STATUS_CHANGED,e)}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;l.trigger(d.INTERNAL_KEY_MESSAGE,{data:new ce(this,t,void 0,e.messageType)})}},getKeyId:function(){return this.keyId},getSessionId:function(){return e.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){var e=p(arguments);"usable"===e.status&&(t=!0)})),t}};return e.addEventListener("keystatuseschange",r),e.addEventListener("message",r),e.closed.then((function(){S(r),n.debug("DRM: Session closed. SessionID = "+r.getSessionId()),l.trigger(d.KEY_SESSION_CLOSED,{data:r.getSessionId()})})),o.push(r),r}return t={getAllInitData:function(){for(var e=[],t=0;t<o.length;t++)o[t].initData&&e.push(o[t].initData);return e},getSessions:function(){return o},requestKeySystemAccess:function(e){return new Promise((function(t,n){y(e,0,t,n)}))},selectKeySystem:function(e){return new Promise((function(t,n){e.mksa.createMediaKeys().then((function(t){return r=e.keySystem,s=t,i?i.setMediaKeys(s):Promise.resolve()})).then((function(){t(r)})).catch((function(){n({error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))}))},setMediaElement:function(e){i!==e&&(i&&(i.removeEventListener("encrypted",a),i.setMediaKeys&&i.setMediaKeys(null)),(i=e)&&(i.addEventListener("encrypted",a),i.setMediaKeys&&s&&i.setMediaKeys(s)))},setServerCertificate:function(e){if(!r||!s)throw new Error("Can not set server certificate until you have selected a key system");s.setServerCertificate(e).then((function(){n.info("DRM: License server certificate successfully updated."),l.trigger(d.SERVER_CERTIFICATE_UPDATED)})).catch((function(e){l.trigger(d.SERVER_CERTIFICATE_UPDATED,{error:new f.Z(E.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,E.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})}))},createKeySession:function(e){if(!r||!s)throw new Error("Can not create sessions until you have selected a key system");var t=s.createSession(e.sessionType),i=m(t,e),o=r.systemString===T.CLEARKEY_KEYSTEM_STRING&&(e.initData||e.protData&&e.protData.clearkeys)?T.INITIALIZATION_DATA_TYPE_KEYIDS:T.INITIALIZATION_DATA_TYPE_CENC;t.generateRequest(o,e.initData).then((function(){n.debug("DRM: Session created. SessionID = "+i.getSessionId()),l.trigger(d.KEY_SESSION_CREATED,{data:i})})).catch((function(e){S(i),l.trigger(d.KEY_SESSION_CREATED,{data:null,error:new f.Z(E.KEY_SESSION_CREATED_ERROR_CODE,E.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})}))},updateKeySession:function(e,t){var n=e.session;u.isClearKey(r)&&(t=t.toJWK()),n.update(t).then((function(){l.trigger(d.KEY_SESSION_UPDATED)})).catch((function(t){l.trigger(d.KEY_ERROR,{error:new f.Z(E.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})}))},loadKeySession:function(e){if(!r||!s)throw new Error("Can not load sessions until you have selected a key system");for(var t=e.sessionId,i=0;i<o.length;i++)if(t===o[i].sessionId)return void n.warn("DRM: Ignoring session ID because we have already seen it!");var a=s.createSession(e.sessionType),u=m(a,e);a.load(t).then((function(e){e?(n.debug("DRM: Session loaded. SessionID = "+u.getSessionId()),l.trigger(d.KEY_SESSION_CREATED,{data:u})):(S(u),l.trigger(d.KEY_SESSION_CREATED,{data:null,error:new f.Z(E.KEY_SESSION_CREATED_ERROR_CODE,E.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+t+")")}))})).catch((function(e){S(u),l.trigger(d.KEY_SESSION_CREATED,{data:null,error:new f.Z(E.KEY_SESSION_CREATED_ERROR_CODE,E.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+t+")! "+e.name)})}))},removeKeySession:function(e){e.session.remove().then((function(){n.debug("DRM: Session removed. SessionID = "+e.getSessionId()),l.trigger(d.KEY_SESSION_REMOVED,{data:e.getSessionId()})}),(function(t){l.trigger(d.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionId()+"). "+t.name})}))},closeKeySession:function(e){_(e).catch((function(t){S(e),l.trigger(d.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionId()+") "+t.name})}))},stop:function(){for(var e,t=0;t<o.length;t++)(e=o[t]).getUsable()||(_(e),S(e))},reset:function(){var e,t=o.length;0!==t?function(){for(var n,r=function(e){S(e),0===o.length&&(i?(i.removeEventListener("encrypted",a),i.setMediaKeys(null).then((function(){l.trigger(d.TEARDOWN_COMPLETE)}))):l.trigger(d.TEARDOWN_COMPLETE))},s=0;s<t;s++)n=e=o[s],_(e),r(n)}():l.trigger(d.TEARDOWN_COMPLETE)}},n=g.getLogger(t),r=null,i=null,s=null,o=[],u=ne(c).getInstance(),a={handleEvent:function(e){if("encrypted"===e.type&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;l.trigger(d.NEED_KEY,{key:new ue(t,e.initDataType)})}}},t}Ee[T.PLAYREADY_KEYSTEM_STRING]=[T.PLAYREADY_KEYSTEM_STRING,T.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING],Ee[T.WIDEVINE_KEYSTEM_STRING]=[T.WIDEVINE_KEYSTEM_STRING],Ee[T.CLEARKEY_KEYSTEM_STRING]=[T.CLEARKEY_KEYSTEM_STRING],fe.__dashjs_factory_name="ProtectionModel_21Jan2015";var de=dashjs.FactoryMaker.getClassFactory(fe);function ge(e){e=e||{};var t,n,r,i,s,a,u,c,l,d=this.context,g=e.eventBus,y=e.events,h=e.debug,_=e.api;function S(){try{for(var e=0;e<u.length;e++)p(u[e]);r&&r.removeEventListener(_.needkey,c),g.trigger(y.TEARDOWN_COMPLETE)}catch(e){g.trigger(y.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function p(e){var t=e.session;t.removeEventListener(_.error,e),t.removeEventListener(_.message,e),t.removeEventListener(_.ready,e),t.removeEventListener(_.close,e);for(var n=0;n<u.length;n++)if(u[n]===e){u.splice(n,1);break}t[_.release]()}function m(){var e=null,t=function(){r.removeEventListener("loadedmetadata",e),r[_.setMediaKeys](s),g.trigger(y.VIDEO_ELEMENT_SELECTED)};r.readyState>=1?t():(e=t.bind(this),r.addEventListener("loadedmetadata",e))}return t={getAllInitData:function(){for(var e=[],t=0;t<u.length;t++)e.push(u[t].initData);return e},getSessions:function(){return u},requestKeySystemAccess:function(e){return new Promise((function(t,n){for(var r=!1,i=0;i<e.length;i++)for(var s=e[i].ks.systemString,a=e[i].configs,u=null,c=null,E=0;E<a.length;E++){var f=a[E].audioCapabilities,d=a[E].videoCapabilities;if(f&&0!==f.length){u=[];for(var h=0;h<f.length;h++)window[_.MediaKeys].isTypeSupported(s,f[h].contentType)&&u.push(f[h])}if(d&&0!==d.length){c=[];for(var S=0;S<d.length;S++)window[_.MediaKeys].isTypeSupported(s,d[S].contentType)&&c.push(d[S])}if(!(!u&&!c||u&&0===u.length||c&&0===c.length)){r=!0;var p=new o(u,c),m=l.getKeySystemBySystemString(s),v=new le(m,p);g.trigger(y.KEY_SYSTEM_ACCESS_COMPLETE,{data:v}),t({data:v});break}}if(!r){var b="Key system access denied! -- No valid audio/video content configurations detected!";g.trigger(y.KEY_SYSTEM_ACCESS_COMPLETE,{error:b}),n({error:b})}}))},selectKeySystem:function(e){return new Promise((function(t,n){try{s=e.mediaKeys=new window[_.MediaKeys](e.keySystem.systemString),i=e.keySystem,a=e,r&&m(),t(i)}catch(e){n({error:"Error selecting keys system ("+i.systemString+")! Could not create MediaKeys -- TODO"})}}))},setMediaElement:function(e){r!==e&&(r&&r.removeEventListener(_.needkey,c),(r=e)&&(r.addEventListener(_.needkey,c),s&&m()))},createKeySession:function(e){if(!i||!s||!a)throw new Error("Can not create sessions until you have selected a key system");var t=null;if(a.ksConfiguration.videoCapabilities&&a.ksConfiguration.videoCapabilities.length>0&&(t=a.ksConfiguration.videoCapabilities[0]),null===t&&a.ksConfiguration.audioCapabilities&&a.ksConfiguration.audioCapabilities.length>0&&(t=a.ksConfiguration.audioCapabilities[0]),null===t)throw new Error("Can not create sessions for unknown content types.");var r=t.contentType,o=s.createSession(r,new Uint8Array(e.initData),e.cdmData?new Uint8Array(e.cdmData):null),c=function(e,t){return{session:e,keyId:t.keyId,initData:t.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case _.error:g.trigger(y.KEY_ERROR,{error:new f.Z(E.MEDIA_KEYERR_CODE,"KeyError",this)});break;case _.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;g.trigger(y.INTERNAL_KEY_MESSAGE,{data:new ce(this,t,e.destinationURL)});break;case _.ready:n.debug("DRM: Key added."),g.trigger(y.KEY_ADDED);break;case _.close:n.debug("DRM: Session closed. SessionID = "+this.getSessionId()),g.trigger(y.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(o,e);o.addEventListener(_.error,c),o.addEventListener(_.message,c),o.addEventListener(_.ready,c),o.addEventListener(_.close,c),u.push(c),n.debug("DRM: Session created. SessionID = "+c.getSessionId()),g.trigger(y.KEY_SESSION_CREATED,{data:c})},updateKeySession:function(e,t){var n=e.session;l.isClearKey(i)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t)),g.trigger(y.KEY_SESSION_UPDATED)},closeKeySession:p,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:S,reset:S},n=h.getLogger(t),r=null,i=null,s=null,a=null,u=[],l=ne(d).getInstance(),c={handleEvent:function(e){if(e.type===_.needkey&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;g.trigger(y.NEED_KEY,{key:new ue(t,"cenc")})}}},t}ge.__dashjs_factory_name="ProtectionModel_3Feb2014";var ye=dashjs.FactoryMaker.getClassFactory(ge);function he(e){e=e||{};var t,n,r,i,s,a,u,c,l,d=this.context,g=e.eventBus,y=e.events,h=e.debug,_=e.api,S=e.errHandler;function p(){r&&b();for(var e=0;e<u.length;e++)m(u[e]);g.trigger(y.TEARDOWN_COMPLETE)}function m(e){try{r[_.cancelKeyRequest](i.systemString,e.sessionId)}catch(t){g.trigger(y.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionId+") "+t.message})}}function v(e,t){if(t&&e){for(var n=e.length,r=0;r<n;r++)if(e[r].sessionId==t)return e[r];return null}return null}function b(){r.removeEventListener(_.keyerror,l),r.removeEventListener(_.needkey,l),r.removeEventListener(_.keymessage,l),r.removeEventListener(_.keyadded,l)}return t={getAllInitData:function(){for(var e=[],t=0;t<a.length;t++)e.push(a[t].initData);for(var n=0;n<u.length;n++)e.push(u[n].initData);return e},getSessions:function(){return u.concat(a)},requestKeySystemAccess:function(e){return new Promise((function(t,n){var i=r;i||(i=document.createElement("video"));for(var a=!1,u=0;u<e.length;u++)for(var c=e[u].ks.systemString,l=e[u].configs,E=null,f=0;f<l.length;f++){var d=l[f].videoCapabilities;if(d&&0!==d.length){E=[];for(var h=0;h<d.length;h++)""!==i.canPlayType(d[h].contentType,c)&&E.push(d[h])}if(E&&(!E||0!==E.length)){a=!0;var _=new o(null,E),S=s.getKeySystemBySystemString(c),p=new le(S,_);g.trigger(y.KEY_SYSTEM_ACCESS_COMPLETE,{data:p}),t({data:p});break}}if(!a){var m="Key system access denied! -- No valid audio/video content configurations detected!";g.trigger(y.KEY_SYSTEM_ACCESS_COMPLETE,{error:m}),n({error:m})}}))},selectKeySystem:function(e){return i=e.keySystem,Promise.resolve(i)},setMediaElement:function(e){if(r!==e){if(r){b();for(var t=0;t<u.length;t++)m(u[t]);u=[]}(r=e)&&(r.addEventListener(_.keyerror,l),r.addEventListener(_.needkey,l),r.addEventListener(_.keymessage,l),r.addEventListener(_.keyadded,l),g.trigger(y.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!i)throw new Error("Can not create sessions until you have selected a key system");if(c||0===u.length){var t={sessionId:null,keyId:e.keyId,initData:e.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return a.push(t),r[_.generateKeyRequest](i.systemString,new Uint8Array(e.initData)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var n=e.sessionId;if(s.isClearKey(i))for(var o=0;o<t.keyPairs.length;o++)r[_.addKey](i.systemString,t.keyPairs[o].key,t.keyPairs[o].keyID,n);else r[_.addKey](i.systemString,new Uint8Array(t),new Uint8Array(e.initData),n);g.trigger(y.KEY_SESSION_UPDATED)},closeKeySession:m,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:p,reset:p},n=h.getLogger(t),r=null,i=null,a=[],u=[],s=ne(d).getInstance(),l={handleEvent:function(e){var t=null;switch(e.type){case _.needkey:var r=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;g.trigger(y.NEED_KEY,{key:new ue(r,"cenc")});break;case _.keyerror:if((t=v(u,e.sessionId))||(t=v(a,e.sessionId)),t){var i=E.MEDIA_KEYERR_CODE,s="";switch(e.errorCode.code){case 1:i=E.MEDIA_KEYERR_UNKNOWN_CODE,s+="MEDIA_KEYERR_UNKNOWN - "+E.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:i=E.MEDIA_KEYERR_CLIENT_CODE,s+="MEDIA_KEYERR_CLIENT - "+E.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:i=E.MEDIA_KEYERR_SERVICE_CODE,s+="MEDIA_KEYERR_SERVICE - "+E.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:i=E.MEDIA_KEYERR_OUTPUT_CODE,s+="MEDIA_KEYERR_OUTPUT - "+E.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:i=E.MEDIA_KEYERR_HARDWARECHANGE_CODE,s+="MEDIA_KEYERR_HARDWARECHANGE - "+E.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:i=E.MEDIA_KEYERR_DOMAIN_CODE,s+="MEDIA_KEYERR_DOMAIN - "+E.MEDIA_KEYERR_DOMAIN_MESSAGE}s+=" System Code = "+e.systemCode,g.trigger(y.KEY_ERROR,{error:new f.Z(i,s,t)})}else n.error("No session token found for key error");break;case _.keyadded:(t=v(u,e.sessionId))||(t=v(a,e.sessionId)),t?(n.debug("DRM: Key added."),g.trigger(y.KEY_ADDED,{data:t})):n.debug("No session token found for key added");break;case _.keymessage:if((c=null!==e.sessionId&&void 0!==e.sessionId)?!(t=v(u,e.sessionId))&&a.length>0&&(t=a.shift(),u.push(t),t.sessionId=e.sessionId,g.trigger(y.KEY_SESSION_CREATED,{data:t})):a.length>0&&(t=a.shift(),u.push(t),0!==a.length&&S.error(new f.Z(E.MEDIA_KEY_MESSAGE_ERROR_CODE,E.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var o=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=o,g.trigger(y.INTERNAL_KEY_MESSAGE,{data:new ce(t,o,e.defaultURL)})}else n.warn("No session token found for key message")}}},t}he.__dashjs_factory_name="ProtectionModel_01b";var _e=dashjs.FactoryMaker.getClassFactory(he),Se=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],pe=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function me(){var e,t=this.context;function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];if("function"==typeof e[r[Object.keys(r)[0]]])return r}return null}return e={createProtectionSystem:function(r){var i=null,s=ne(t).getInstance();s.setConfig({debug:r.debug,BASE64:r.BASE64,settings:r.settings}),s.initialize();var o=function(r){var i=r.debug,s=i.getLogger(e),o=r.eventBus,a=r.errHandler,u=r.videoModel?r.videoModel.getElement():null;return u&&void 0===u.onencrypted||u&&void 0===u.mediaKeys?n(u,pe)?(s.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),ye(t).create({debug:i,eventBus:o,events:r.events,api:n(u,pe)})):n(u,Se)?(s.info("EME detected on this user agent! (ProtectionModel_01b)"),_e(t).create({debug:i,eventBus:o,errHandler:a,events:r.events,api:n(u,Se)})):(s.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(s.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),de(t).create({debug:i,eventBus:o,events:r.events}))}(r);return!i&&o&&(i=v(t).create({protectionModel:o,protectionKeyController:s,eventBus:r.eventBus,debug:r.debug,events:r.events,BASE64:r.BASE64,constants:r.constants,cmcdModel:r.cmcdModel,customParametersModel:r.customParametersModel,settings:r.settings}),r.capabilities.setEncryptedMediaSupported(!0)),i}}}me.__dashjs_factory_name="Protection";var ve=dashjs.FactoryMaker.getClassFactory(me);ve.events=ae,ve.errors=E,dashjs.FactoryMaker.updateClassFactory(me.__dashjs_factory_name,ve);var be=ve}(),r.default}()}));
//# sourceMappingURL=dash.protection.min.js.map