douxiaoyun.js/profiles/douyin-profile/Default/Cache/Cache_Data/f_00036d
2026-07-17 22:23:39 +08:00

2 lines
120 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see player-0.ecefa5fd.js.LICENSE.txt */
"use strict";!function(e,t){"object"==typeof module&&"object"==typeof module.exports?t():"function"==typeof define&&define.amd?define([],t):(e="undefined"!=typeof globalThis?globalThis:e||self)&&t()}(this,function(){"use strict";"object"==typeof window&&(window.openRedirect={version:"1.2.20",webpackPluginVersion:"3.4.22",reportOnly:!1})}),!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).xss={})}(this,function(e){"use strict";var t=function(){return(t=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}).apply(this,arguments)};function n(e,t,n){if(n||2==arguments.length)for(var r,i=0,a=t.length;i<a;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))}var r=/[^a-zA-Z0-9\\_:.-]/gim,i=/</g,a=/>/g,o=/&#([a-zA-Z0-9]*);?/gim,s=/&quot;/g,c=/&colon;?/gim,u=/&newline;?/gim,l=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,d=/u\s*r\s*l\s*\(.*/gi,f=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,h=/"/g,g=function(e){return e.replace(i,"&lt;").replace(a,"&gt;")},p={indexOf:function(e,t){var n,r;for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return -1},forEach:function(e,t,n){var r,i;for(r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e)},some:function(e,t,n){var r,i;for(r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e))return!0;return!1},trim:function(e){return e.replace(/(^\s*)|(\s*$)/g,"")},includes:function(e,t){if("string"==typeof e)return -1!==e.indexOf(t);for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},spaceIndex:function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1},uniq:function(e){for(var t={},n=[],r=0;r<e.length;r++)t[e[r]]||(n.push(e[r]),t[e[r]]=!0);return n},from:function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},keys:function(e){var t=[];for(var n in e)t.push(n);return t}};function v(e){return null==e}function y(e){var t;return'"'===(t=e)[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]?e.substr(1,e.length-2):e}function m(e){var t,n,r,i,a,o,s,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",l=0;for(e=function(e){e=e.replace(/rn/g,"n");for(var t="",n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=String.fromCharCode(r):r>127&&r<2048?t+=String.fromCharCode(r>>6|192)+String.fromCharCode(63&r|128):t+=String.fromCharCode(r>>12|224)+String.fromCharCode(r>>6&63|128)+String.fromCharCode(63&r|128)}return t}(e);l<e.length;)i=(t=e.charCodeAt(l++))>>2,a=(3&t)<<4|(n=e.charCodeAt(l++))>>4,o=(15&n)<<2|(r=e.charCodeAt(l++))>>6,s=63&r,isNaN(n)?o=s=64:isNaN(r)&&(s=64),u=u+c.charAt(i)+c.charAt(a)+c.charAt(o)+c.charAt(s);return u}function b(e){var t,n,r,i,a,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=s.indexOf(e.charAt(u++))<<2|(i=s.indexOf(e.charAt(u++)))>>4,n=(15&i)<<4|(a=s.indexOf(e.charAt(u++)))>>2,r=(3&a)<<6|(o=s.indexOf(e.charAt(u++))),c+=String.fromCharCode(t),64!==a&&(c+=String.fromCharCode(n)),64!==o&&(c+=String.fromCharCode(r));return function(e){for(var t="",n=0,r=0,i=0,a=0;n<e.length;)(r=e.charCodeAt(n))<128?(t+=String.fromCharCode(r),n++):r>191&&r<224?(t+=String.fromCharCode((31&r)<<6|63&(a=e.charCodeAt(n+1))),n+=2):(a=e.charCodeAt(n+1),t+=String.fromCharCode((15&r)<<12|(63&a)<<6|63&(i=e.charCodeAt(n+2))),n+=3);return t}(c)}function C(e,t,n){var r="",i=0,a=!1,o=!1,s=0,c=e.length,u="",l="";e:for(s=0;s<c;s++){var d=e.charAt(s);if(!1===a){if("<"===d){a=s;continue}}else if(!1===o){if("<"===d){r+=n(e.slice(i,s)),a=s,i=s;continue}if(">"===d||s===c-1){r+=n(e.slice(i,a)),u=function(e){var t,n=p.spaceIndex(e);return t=-1===n?e.slice(1,-1):e.slice(1,n+1),"/"===(t=p.trim(t).toLowerCase()).slice(0,1)&&(t=t.slice(1)),"/"===t.slice(-1)&&(t=t.slice(0,-1)),t}(l=e.slice(a,s+1)),r+=t(a,r.length,u,l,"</"===l.slice(0,2)),i=s+1,a=!1;continue}if('"'===d||"'"===d)for(var f=1,h=e.charAt(s-f);""===h.trim()||"="===h;){if("="===h){o=d;continue e}h=e.charAt(s-++f)}}else if(d===o){o=!1;continue}}return i<c&&(r+=n(e.substr(i))),r}function x(e,t){var n=0,i=0,a=[],o=!1,s=e.length;function c(e,n){if(!((e=(e=p.trim(e)).replace(r,"").toLowerCase()).length<1)){var i=t(e,n||"");i&&a.push(i)}}for(var u=0;u<s;u++){var l=e.charAt(u),d=void 0;if(!1!==o||"="!==l){if(!1===o||u!==i){if(/\s|\n|\t/.test(l)){if(e=e.replace(/\s|\n|\t/g," "),!1===o){if(-1===(d=function(e,t){for(;t<e.length;t++){var n=e[t];if(" "!==n)return"="===n?t:-1}return -1}(e,u))){c(p.trim(e.slice(n,u))),o=!1,n=u+1;continue}u=d-1;continue}if(-1===(d=function(e,t){for(;t>0;t--){var n=e[t];if(" "!==n)return"="===n?t:-1}return -1}(e,u-1))){c(o,y(p.trim(e.slice(n,u)))),o=!1,n=u+1;continue}}}else{if(-1===(d=e.indexOf(l,u+1)))break;c(o,p.trim(e.slice(i+1,d))),o=!1,n=(u=d)+1}}else o=e.slice(n,u),n=u+1,i='"'===e.charAt(n)||"'"===e.charAt(n)?n:function(e,t){for(;t<e.length;t++){var n=e[t];if(" "!==n)return"'"===n||'"'===n?t:-1}return -1}(e,u+1)}return n<e.length&&(!1===o?c(e.slice(n)):c(o,y(p.trim(e.slice(n))))),p.trim(a.join(" "))}function I(e,t,n){if(n=function(e){return e=function(e){for(var t="",n=0,r=e.length;n<r;n++)t+=32>e.charCodeAt(n)?" ":e.charAt(n);return p.trim(t)}(e=(e=(e=e.replace(s,'"')).replace(o,function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))})).replace(c,":").replace(u," "))}(n),"href"===t||"src"===t){if("#"===(n=p.trim(n)))return"#";if("http://"!==n.substr(0,7)&&"https://"!==n.substr(0,8)&&"mailto:"!==n.substr(0,7)&&"tel:"!==n.substr(0,4)&&"data:image/"!==n.substr(0,11)&&"ftp://"!==n.substr(0,6)&&"./"!==n.substr(0,2)&&"../"!==n.substr(0,3)&&"#"!==n[0]&&"/"!==n[0])return""}else if("background"===t){if(l.lastIndex=0,l.test(n))return""}else if("style"===t&&(f.lastIndex=0,f.test(n)||(d.lastIndex=0,d.test(n)&&(l.lastIndex=0,l.test(n)))))return"";return n=function(e){return e=g(e=e.replace(h,"&quot;"))}(n)}var _=function(e){return"string"==typeof e?e.replace(/'/g,'"').replace('=""',"").replace(/\s+/g,"").toLowerCase():""},A=function(){function e(e){var t=function(e){var t={};for(var n in e)t[n]=e[n];return t}(e||{});t.stripIgnoreTag&&(t.onIgnoreTag,t.onIgnoreTag=function(){return""}),t.whiteList={},t.onTag=function(){},t.onTagAttr=function(){},t.onIgnoreTag=function(){},t.onIgnoreTagAttr=function(){},t.safeAttrValue=I,t.escapeHtml=g,this.options=Object.assign(t,e)}return e.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t,n,r,i,a,o,s=this.options,c=s.whiteList,u=s.onTag,l=s.onIgnoreTag,d=s.onTagAttr,f=s.onIgnoreTagAttr,h=s.safeAttrValue,g=s.escapeHtml;s.stripBlankChar&&(e=(t=(t=e.split("")).filter(function(e){var t=e.charCodeAt(0);return!(127===t||t<=31&&10!==t&&13!==t)})).join("")),s.allowCommentTag||(e=function(e){for(var t="",n=0;n<e.length;){var r=e.indexOf("\x3c!--",n);if(-1===r){t+=e.slice(n);break}t+=e.slice(n,r);var i=e.indexOf("--\x3e",r);if(-1===i)break;n=i+3}return t}(e));var v=!1;s.stripIgnoreTagBody&&(n=s.stripIgnoreTagBody,"function"!=typeof(r=l)&&(r=function(){}),i=!Array.isArray(n),a=[],o=!1,l=(v={onIgnoreTag:function(e,t,s){var c;if(c=e,i||-1!==p.indexOf(n,c)){if(s.isClosing){var u="[/removed]",l=s.position+u.length;return a.push([!1!==o?o:s.position,l]),o=!1,u}return o||(o=s.position),"[removed]"}return r(e,t,s)},remove:function(e){var t="",n=0;return p.forEach(a,function(r){t+=e.slice(n,r[0]),n=r[1]}),t+=e.slice(n)}}).onIgnoreTag);var y=C(e,function(e,t,n,r,i){var a={sourcePosition:e,position:t,isClosing:i,isWhite:Object.prototype.hasOwnProperty.call(c,n)},o=u(n,r,a);if(null!=o)return o;if(a.isWhite){if(a.isClosing)return"</".concat(n,">");var s=function(e){var t=p.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var n="/"===(e=p.trim(e.slice(t+1,-1)))[e.length-1];return n&&(e=p.trim(e.slice(0,-1))),{html:e,closing:n}}(r),v=c[n],y=x(s.html,function(e,t){var r=-1!==p.indexOf(v,e),i=d(n,e,t,r);return null==i?r?(t=h(n,e,t,null))?"".concat(e,'="').concat(t,'"'):e:null==(i=f(n,e,t,r))?void 0:i:i});return r="<".concat(n),y&&(r+=" ".concat(y)),s.closing&&(r+=" /"),r+=">"}return null==(o=l(n,r,a))?g(r):o},g);return v&&(y=v.remove(y)),y},e}(),k=Function("\nvar _checkXSS = function (it) {\n return it && it.Math == Math && it;\n};\nreturn _checkXSS(typeof globalThis === 'object' && globalThis) ||\n_checkXSS(typeof window === 'object' && window) ||\n_checkXSS(typeof self === 'object' && self) ||\n_checkXSS(typeof global === 'object' && global) ||\nFunction('return this')();\n")(),L=new(function(){function e(){var e=this;this.batchData=[],this.uniqKeys=new Set,this.timeout=2e3,this.lock=!1,this.getSlardarBid=function(){var t,n,r="douyin_web";if(!p.includes(r,"bid"))return r;if(e.config&&e.config.bid)return e.config.bid;if(k&&k._xssBid)return k._xssBid;if(k&&k.slardar&&"function"==typeof k.slardar.config){var i=(k.slardar.config()||{}).bid;if(i)return i}if(k&&k.Slardar&&"function"==typeof k.Slardar.config){var a=(k.Slardar.config()||{}).bid;if(a)return a}return(null===(n=null===(t=null==k?void 0:k.Slardar)||void 0===t?void 0:t._baseParams)||void 0===n?void 0:n.bid)||"argus"},this.getConfigRegion=function(){var t;return p.includes("cn","region")?e.config&&e.config.region?e.config.region:((null===(t=null==k?void 0:k.gfdatav1)||void 0===t?void 0:t.region)||"cn").toLowerCase():"cn"},this.gerReportUrl=function(){var t={cn:b("aHR0cHM6Ly9tb24uemlqaWVhcGkuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),boe:b("aHR0cHM6Ly9tb24uemlqaWVhcGkuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),ttp:b("aHR0cHM6Ly9tb24udXMudGlrdG9rdi5jb20vbW9uaXRvcl9icm93c2VyL2NvbGxlY3QvYmF0Y2gvc2VjdXJpdHkvP2JpZD0="),va:b("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),maliva:b("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),sg:b("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),boei18n:b("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9")}[e.getConfigRegion()];if(t)return t+e.getSlardarBid()}}return e.prototype.setConfig=function(e){this.config=e},e.prototype.upload=function(){var e=this,t=this.gerReportUrl();!this.lock&&t&&0!==this.batchData.length&&(this.lock=!0,setTimeout(function(){var n=e.batchData.slice(0,100);e.batchData=e.batchData.slice(100),k.fetch(t,{method:"post",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}).catch(function(e){}),e.lock=!1,e.upload()},this.timeout))},e.prototype.generateKey=function(e){return e.collectKey?[e.collectMode,e.collectKey].join("___"):""},e.prototype.push=function(e){this.batchData.push(e),this.upload()},e.prototype.report=function(e){var t=this.generateKey(e);if(k.fetch&&e.collectKey){var n="object"==typeof window?window.location.href:"SSR";e.documentUrl=n;var r={age:Math.floor(Date.now()),type:"xss",url:n,body:e,"user-agent":""};"enforce"===e.disposition&&"SSR"!==n||(r.url=t),"SSR"===n&&(r.url="SSR___".concat(r.url),r.body.ssr=!0),this.push(r)}},e}()),w=function(e){for(var t=0,n=function(n){Array.isArray(e[n])?0===e[n].length?delete e[n]:(e[n]=p.from(p.uniq(e[n])),t+=e[n].length):0===p.keys(e[n]).length?delete e[n]:p.keys(e[n]).forEach(function(r){e[n][r]=p.from(p.uniq(e[n][r])),t+=e[n][r].length})},r=0,i=p.keys(e);r<i.length;r++)n(i[r]);return{count:t,ret:e}};function S(e,t){return L.setConfig(t),new A(t).process(e)}function T(e){var t,n=(t=/\s|\n|\t/.exec(e))?t.index:-1;if(-1===n)return{html:"",closing:"/"===e[e.length-2]};var r="/"===(e=e.slice(n+1,-1).trim())[e.length-1];return r&&(e=e.slice(0,-1).trim()),{html:e,closing:r}}var P=function(e){return -1===(e=(e=(e=(e=e.replace(/&colon;/gi,":")).replace(/&tab;/gi,"")).replace(/&newline;/gi,"")).replace(/(\t|\n|\r)/g,"")).indexOf("&#")?e.trim().toLowerCase():e.trim().replace(/&#(?:(x)([0-9a-f]+)|([0-9]+));?/gi,function(e,t,n,r){return String.fromCharCode(t?parseInt(n,16):parseInt(r))}).replace(/(\t|\n|\r)/g,"").toLowerCase()};function O(e,t){if(void 0===e&&(e=""),"string"!=typeof e)return!0;if(e=P(e),p.includes(e,"base64")&&!function(e){if(""===e||""===e.trim())return!0;try{return!p.includes(e,"data:text/html;base64")}catch(e){return!0}}(e))return t&&t("data:text/html;base64"),!1;var n=["expression(","behavior:","view-source:"];if(p.some(n,function(t){return -1!==e.indexOf(t)}))return p.forEach(n,function(n){-1!==e.indexOf(n)&&t&&t(n)}),!1;var r=["data:application","data:javascript","data:text/html","data:texthtml"];if(p.some(r,function(t){return -1!==e.indexOf(t)}))return p.forEach(r,function(n){-1!==e.indexOf(n)&&t&&t(n)}),!1;if(e.indexOf("javascript:")>0)return t&&t("javascript:"),!1;if(/^javascript:/i.test(e)){var i=e.slice(11).replace(/\s/g,"").trim();return!!p.some(["void","void(0)","void0","false","undefined",";"],function(e){return e===i})||(t&&t("javascript:"),!1)}return!0}var B=function(e,t){var n,r,i="<%= isSaveValidUrl =>";if("string"!=typeof e||(r=Number("<%= urlLimit =>"),void 0!==n&&(r=n),"NaN"!==e.toString()&&-1!==r&&e.length>=r)||O(e,t))return e;try{if(!0===(i=JSON.parse(i))||"true"===i){var a=new URL(e);return a.origin+a.pathname}}catch(e){}return"#"};function D(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=[]),"string"!=typeof e)return!0;if(!O(e=P(e)))return!1;var i,a={url:(i=e.match(/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/)||[])[0],scheme:i[1],slash:i[2],host:i[3],port:i[4],path:i[5],query:i[6],hash:i[7]},o=a.scheme,s=a.host;return r?!!r(e):!(!o||!s)&&(!p.includes(["http","https","file"],o)||("object"==typeof window&&window&&(t=n(n([],t,!0),[location.host],!1)),p.some(t,function(e){return!!(e instanceof RegExp&&e.test(s))||e===s})))}var R={a:["target","title","spellcheck","rel"],canvas:[],abbr:["title"],address:[],area:["shape","coords","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:["dir"],dl:[],dt:[],em:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["alt","title","width","height","decoding"],ins:["datetime"],li:[],mark:[],nav:[],ol:["start"],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],sup:[],delete:[],form:[],strong:[],mask:["maskunits","x","y","width","height","fill"],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],wbr:[],video:["autoplay","controls","loop","preload","height","width"],svg:["viewBox","version","xmlns","fill","width","height","stroke","stroke-width","style"],path:["d","fill","opacity","stroke","p-id","fill-rule","clip-rule","stroke-width","stroke-linecap","stroke-linejoin","fill-opacity","mask"],rect:["x","y","width","height","fill","stroke","rx"],g:[]},Z={collect:null,initCollect:function(){this.collect={whiteList:{},filterProtocol:[]}},removeCollect:function(){var e=w(this.collect),t=e.count,n=e.ret;return this.collect=null,{collectKey:0===t?null:JSON.stringify(n),collectMode:"white"}},onIgnoreTagAttr:function(e,t,r){return e&&p.indexOf(["href","src"],t)>-1?Z.domainWhiteList&&Array.isArray(Z.domainWhiteList)&&Z.domainWhiteList.length>0&&!D(r,n([],Z.domainWhiteList,!0))?"":"".concat(t,'="').concat(B(r,function(e){var t;null===(t=Z.collect)||void 0===t||t.filterProtocol.push(e)}),'"'):e&&(p.indexOf(["style","class","id"],t)>-1||t.indexOf("data-")>-1)?"".concat(t,'="').concat(r,'"'):(Z.collect.whiteList[e]=Z.collect.whiteList[e]||[],void Z.collect.whiteList[e].push(t))},onIgnoreTag:function(e,t){if("style"===e)return t;C(t,function(e,t,n,r){x(T(r).html.replace("/",""),function(e){Z.collect.whiteList[n]=Z.collect.whiteList[n]||[],Z.collect.whiteList[n].push(e)})},g)},whiteList:R,mergeWhiteList:function(e){for(var t,n={},r=0,i=p.keys(R);r<i.length;r++)n[t=i[r]]=p.from(R[t]);for(var a=0,o=p.keys(e);a<o.length;a++)n[t=o[a]]=t in R?R[t].concat(e[t]):p.from(e[t]);return n},setWhiteList:function(e){for(var t=0,n=p.keys(e);t<n.length;t++){var r=n[t];this.whiteList[r]=r in R?R[r].concat(e[r]):p.from(e[r])}}};try{var E={},N="merge";p.includes(N,"override")&&(Z.whiteList=E.whiteList),p.includes(N,"merge")&&Z.setWhiteList(E.whiteList)}catch(e){}var M=function(e,t){for(var n={},r=0,i=p.keys(e);r<i.length;r++){var a=i[r];Array.isArray(e[a])?n[a]=p.from(e[a]):n[a]=M({},e[a])}for(var o=0,s=p.keys(t);o<s.length;o++)(a=s[o])in e?Array.isArray(e[a])?n[a]=e[a].concat(t[a]):n[a]=M(e[a],t[a]):Array.isArray(t[a])?n[a]=p.from(t[a]):n[a]=M({},t[a]);return n},z={blackList:{a:["folder"],meta:["content"],iframe:["srcdoc"],input:["pattern"],vmlframe:["xmlns"]},blackTags:["script","xml","embed","isindex","object","base","set","handler","animate","payload","import"],blackAttrs:["charset","ns","namespace","formaction","xlink:href","xmlns:xlink","handler","repeat","repeat-start","repeat-end"],blackAttrRegExps:[/^on/],filterList:{param:["value"],video:["poster"],form:["action"]},filterAttrs:["href","src","background","style","dynsrc","lowsrc","content"]};try{var W={};W.blackAttrRegExps&&(W.blackAttrRegExps=W.blackAttrRegExps.map(function(e){return new RegExp(e.toString().slice(1,e.toString().length-1))}));var U="merge";p.includes(U,"override")&&(z=W),p.includes(U,"merge")&&(z=M(z,W))}catch(e){}var j={mode:"black",whiteList:{},blackConfig:z,collect:null,initCollect:function(){j.collect={blackList:{},blackTags:[],blackAttrs:[],blackAttrRegExps:[],filterAttrs:[],filterList:{},filterProtocol:[]}},removeCollect:function(){var e=w(j.collect),t=e.count,n=e.ret;return j.collect=null,{collectKey:0===t?null:JSON.stringify(n),collectMode:"black"}},onIgnoreTag:function(e,t){var n;if(!p.includes(z.blackTags,e))return C(t,function(e,t,n,r,i){if(-1!==n.indexOf("/"))return g(r);if(i)return"</".concat(n,">");var a=T(r),o=x(a.html,function(e,t){var r,i=0;if(z.blackList[n]&&p.includes(z.blackList[n],e)&&(j.collect.blackList[n]=j.collect.blackList[n]||[],j.collect.blackList[n].push(e),i++),z.blackAttrRegExps.length&&z.blackAttrRegExps.some(function(t){return t.test(e)})&&p.forEach(z.blackAttrRegExps,function(t){t.test(e)&&(j.collect.blackAttrRegExps.push("".concat(t.toString(),"->").concat(e)),i++)}),z.blackAttrs.length&&p.includes(z.blackAttrs,e)&&(z.blackAttrs.push(e),i++),!i){if(z.filterList&&z.filterList[n]&&p.includes(z.filterList[n],e)){var a=B(t,function(e){var t;null===(t=j.collect)||void 0===t||t.filterProtocol.push(e)});return a!==t&&(j.collect.filterList[n]=j.collect.filterList[n]||[],j.collect.filterList[n].push(e)),t?"".concat(e,"='").concat(a,"'"):e}return z.filterAttrs&&p.includes(z.filterAttrs,e)?((a=B(t,function(e){var t;null===(t=j.collect)||void 0===t||t.filterProtocol.push(e)}))!==t&&(null===(r=j.collect)||void 0===r||r.filterAttrs.push(e)),t?"".concat(e,"='").concat(a,"'"):e):t?"".concat(e,"='").concat(t,"'"):e}});return r="<".concat(n),o&&(r+=" ".concat(o)),a.closing&&(r+=" /"),r+=">"},g);null===(n=j.collect)||void 0===n||n.blackTags.push(e)}},G=function(e){var t=e.reportOnly,n=void 0===t||t,r=e.block;return n&&"all"===n?"report":("string"==typeof n&&("true"===n&&(n=!0),"false"===n&&(n=!1)),r?"enforce":n?"report":"enforce")},V=function(e){return function(n,r,i){if(!n||"string"!=typeof n)return n;var a=r;e===S&&(a=Z).initCollect();var o=e(n,a);if(_(o)===_(n))return n;if(!i)return o;var s=i.logType,c=G(i),u=a.removeCollect();return L.report(t(t({type:s,disposition:c},u),{sourceText:m(n),filterText:m(o)})),"enforce"===c?o:n}},F=V(function(e,t){return void 0===t&&(t={}),t&&t.whiteList||(t.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}),new A(t).process(e)}),K=V(S),Y=function(e,t,n){var r=[],i=B(e,function(e){r.push(e)});if(i===e)return e;r=p.from(p.uniq(r));var a=t||n||{};if(!a)return i;var o=a.logType,s=G(n);return L.report({type:o,disposition:s,collectKey:r.join("___"),collectData:JSON.stringify(r),collectMode:"black",sourceText:m(e),filterText:m(i)}),"enforce"===s?i:e},H=k._xssProject||{},X=k.xssNamespace||{},J="3.0.26",q={FilterXSS:A,version:J,webpackPluginVersion:"<%= webpackPluginVersion =>",reportOnly:"<%= reportOnly =>",filterXSS:F,_filterXSS:K,filterUrl:Y,Config:Z,BlackConfig:j,project:H,setProjectName:function(e){H[e]=this,k._xssProjectName=e}};X.douyin_web=q,k.xssNamespace=X,k.Math&&!k.Math.xssNamespace&&(k.Math.xssNamespace=X),H[J]=q,k.globalThis=k,k.getFilterXss=function(){return void 0!==this._xssProjectName?this._xssProject[this._xssProjectName]:q},k.xss=q,k.isSafeUrl=D,k.isSafeDomain=D,k.isSafeProtocol=O,k._xssProject=H,k._xssProjectName&&(H[k._xssProjectName]=q);var Q=q.setProjectName.bind(q);e.BlackConfig=j,e.Config=Z,e.FilterXSS=A,e._filterXSS=K,e.filterUrl=Y,e.filterXSS=F,e.isSafeDomain=D,e.isSafeProtocol=O,e.isSafeUrl=D,e.project=H,e.setProjectName=Q,e.setXssNamespace=function(e){var t=e.appId,n=e.bid,r=e.region;X[t]=q;Z.bid=n,Z.region=r,Z.enabled=!0},e.xssNamespace=X,Object.defineProperty(e,"__esModule",{value:!0})}),(self.webpackChunkdouyin_web=self.webpackChunkdouyin_web||[]).push([["96284"],{437928:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(726949);n(346984),n(248385),n(663030);var i=n(167033),a="ProgressInfo",o=(0,r.qH)(function e(){(0,r.PA)(this,e),this._init()},[{key:"_init",value:function(){this.played=[],this.playedSize=0,this.cachedSize=0,this.pcdnCached=0,this.cachedVideoSize=0,this.pcdnVideoCached=0,this.file={audio:0,video:0},this.lastBitrate=null,this.curBitrate={vBitrate:0,aBitrate:0,cdnSize:0,pcdnSize:0,definition:"",fileid:""},this.nextBitrate={start:-1},this.currentTime=0,this.buffered=[],this.cachedTime=0,this.duration=0}},{key:"reset",value:function(){this._init()}},{key:"getFileSize",value:function(e){var t=this.curBitrate,n=t.vBitrate,r=t.aBitrate;return{audio:Math.round(e*r/8),video:Math.round(e*n/8),total:Math.round(e*(n+r)/8)}}},{key:"updatePlayed",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.played,r=n.length;if(0===t||r<1){var i=r>0?n[r-1]:null,a=this.curBitrate,o=a.vBitrate,s=a.aBitrate;i&&(i.end<0||i.end-i.start<1)?(i.end<0?i.start=e:i.end=e,i.vBitrate=o,i.aBitrate=s):n.push({start:e,end:-1,vBitrate:o,aBitrate:s})}else n[r-1].end=e}},{key:"calculatePlaySize",value:function(){var e=this.played,t=this.curBitrate,n=function(e){for(var t=0,n=0;n<e.length;n++){var r=e[n];if(!(r.end<0))t+=r.end-r.start}return t}(e),r=Math.round((t.aBitrate+t.vBitrate)*n/8);return this.playedSize+=r,(0,i.cM)(a,"calculatePlaySize","duration: ".concat(n," playedSize:").concat(this.playedSize),this.played),this.played=[],this.playedSize}},{key:"copyBitrateInfo",value:function(e,t){return["aBitrate","vBitrate","definition","fileid","cdnSize","pcdnSize"].forEach(function(n){e[n]&&(t[n]=e[n])}),t.cdnSize=e.cdnSize,t.pcdnSize=e.pcdnSize,t}},{key:"checkNextBitrate",value:function(e){var t=this.nextBitrate;if(t.start>-1&&e>=t.start){var n=this.curBitrate;this.calculatePlaySize(),(0,i.cM)(a,"checkNextBitrate",e,t.start,this.cachedSize),this.copyBitrateInfo(t,n),this.updatePlayed(e,0),t.start=-1,t.fileid="",["vBitrate","aBitrate","cdnSize","pcdnSize"].forEach(function(e){t[e]=0})}}},{key:"updateLastDefInfo",value:function(){var e=this.curBitrate;if(e.vBitrate>0){var t={};this.copyBitrateInfo(e,t),this.lastBitrate=t}}},{key:"updateDefInfo",value:function(e,t){(0,i.cM)(a,"updateDefInfo",t,this.curBitrate.vBitrate,e);var n=e.mediaType,r=e.start,o=e.bitrate,s=e.definition,c=e.fileid,u={cdnSize:0,pcdnSize:0};"audio"===n?u.aBitrate=o:(u.vBitrate=o,u.definition=s,u.fileid=c,this.updateLastDefInfo()),u.start=r,this.nextBitrate=u,this.checkNextBitrate(t)}},{key:"upDateDownload",value:function(e){var t=e.cdn_size,n=e.pcdn_size,r=e.mediaType,i=this.curBitrate,a=this.nextBitrate,o=0,s=0;n?(o=1,s=n):t&&(s=t),this.cachedSize+=s,"video"===r&&(this.cachedVideoSize+=s,o>0&&(this.pcdnVideoCached+=s)),o>0&&(this.pcdnCached+=s);var c=a.start>=0?a:i;c.cdnSize+=s,o>0&&(c.pcdnSize+=s)}},{key:"updateBuffered",value:function(e){var t=function(e){var t=[];if(!e||e.length<1)return t;for(var n=0;n<e.length;n++){var r=parseInt(1e3*e.start(n),10)/1e3,i=parseInt(1e3*e.end(n),10)/1e3;t.push({start:r,end:i})}return t}(e),n=0;t.forEach(function(e){var t;n+=(t=e.end,parseInt(1e3*t-1e3*e.start,10)/1e3)}),this.buffered=t,this.cachedTime=n}},{key:"isDefInfoFirstChange",value:function(){return!(this.curBitrate&&this.curBitrate.vBitrate>0)}}])},218398:function(e,t,n){n.d(t,{I:function(){return i}}),n(162093),n(503e3),n(497397),n(248385),n(759943),n(683656);var r=[];function i(e){var t={};try{e=e.replace(/^http:|^https:/,"");for(var n=r||[],i=function(r){if(n[r].name.replace(/^http:|^https:/,"")===e)return["domainLookupEnd","domainLookupStart","startTime","requestStart","responseEnd","responseStart","connectStart","connectEnd","fetchStart"].map(function(e){t[e]=Math.round(n[r][e])}),t.url=n[r].name,t.duration=Math.round(n[r].duration),t.domainDuration=t.domainLookupEnd-t.domainLookupStart,t.connectDuration=t.connectEnd-t.connectStart,1},a=n.length-1;a>=0&&!i(a);a--);return t}catch(e){return t}}"undefined"!=typeof window&&function(){try{new window.PerformanceObserver(function(e){var t=e.getEntriesByType("resource");r.length>30&&r.splice(0,r.length-30);for(var n=0;n<t.length;n++)r.push(t[n])}).observe({entryTypes:["resource"]})}catch(e){}}()},536347:function(e,t,n){n.d(t,{Dh:function(){return w}});var r,i=n("61072");n("346984"),n("941533"),n("451236"),n("124300"),n("162093"),n("9498"),n("173757"),n("232070"),n("932651"),n("2885"),n("248385"),n("679308"),n("832674"),n("905442"),n("446336"),n("808483"),n("840938"),n("118438"),n("325598"),n("92999"),n("611067"),n("273723"),n("724016"),n("803903"),n("214604"),n("901250"),n("755006"),n("437048"),n("488336"),n("825666"),n("177162"),n("286633"),n("943281"),n("810658"),n("82726"),n("224727"),n("663030");var a=n("44589"),o=n("196999"),s=n("75740"),c=n("924718"),u=n("495209"),l=n.n(u),d=n("596857"),f=n("403826"),h=n("524992"),g=n("861504"),p=n("84216"),v=n("614184"),y=n("374260"),m=n("588984");n("21979");var b=n("858985"),C=n("129674"),x=n("107093"),I=n("235154"),_=n("718828");var A=((r=A||{}).H264="h264",r.H265="h265",r.H266="h266",r);function k(){return{supportHevc:!1,preloadTime:5,preloadSize:0,segmentMinDuration:5,vtype:"MP4",preloadCacheType:1,preloadMaxCacheCount:5,globalKey:null,autoPreload:!1,reqOptions:null,getRequestOptionsCallback:null,minBufferLength:5,timeout:3e3,autoCheck:{enable:!0,interval:1e3},logCacheConfig:{logCacheLevel:2,logMaxSize:204800},pcdnConfig:{openPreloadPCDN:!1,enterMinBuffer:10,outMaxBuffer:5,pcdn_duration:2,pcdn_open:!0,openPCDN:!0,minDuration:25,trackerUrl:""},switchPCDNMaxCnt:2,retryCount:1,retryDelay:1e3,loaderType:"fetch"}}var L=0,w=function(e){var t,n,r,o,u,w,S,T,P,O;function B(e,t){(0,i.PA)(this,B),(a=(0,i.$w)(this,B,[e,t]))._pendingTask={resolve:void 0,data:void 0},a._nextPreloadCount=0,a._updateRealTimeSpeed=function(e){L=e.speed,a.emit(g.kW,e)};var n,r,a,o=k();Object.keys(t).forEach(function(e){o[e]=t[e]}),a.options=o,a.playerId=(null===(n=e.player)||void 0===n?void 0:n.playerId)||"default";var s=a.options.logCacheConfig,c=s.logCacheLevel,u=s.logMaxSize;return a.logger=new f.Y("[Mp4Preloader]",{logCacheLevel:c,logMaxSize:u}),void 0===t.supportHevc&&(0,I.G9)()&&(a.options.supportHevc=!0),a.loadRangeType=(null===(r=a.options)||void 0===r?void 0:r.loadRangeType)||g.TJ.GOP,a.log(f._.DEBUG,"[Preloader] new preloader, playerId",a.playerId),a}return(0,i.XW)(B,e),(0,i.qH)(B,[{key:"currentPreloadInst",get:function(){return this.preloadManager.currentPreloadInst}},{key:"allCachedKeys",get:function(){return this.preloadManager.getAllCachedDataKeys()}},{key:"cacheInst",get:function(){return this.preloadManager.cacheInst}},{key:"realTimeSpeed",get:function(){return L}},{key:"taskInProgress",get:function(){return!!this._pendingTask.resolve&&!!this._pendingTask.data}},{key:"log",value:function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];_.cM.apply(void 0,[this.logger,e,t].concat(r))}},{key:"getPreloadUnuseInfo",value:function(){return this.preloadManager.getPreloadUnuseInfo()}},{key:"generateUniqueKey",value:function(e){var t=e.vid,n=e.definition,r=e.mediaType,i=e.codecType,a=e.vtype;return B.generateUniqueKey({vid:t,mediaType:r,definition:n,codecType:i,vtype:a})}},{key:"_beforeStart",value:function(e,t){var n=e.payload||[];if(0===n.length)return this.log(f._.LOG,"preload_is_null"),null;var r=e.vid,a=e.steps,o=e.stepIdx,c=e.targetDefinition,u=e.vtype||s.l0.MP4,l=e.codecType||A.H264,d=this.getUserSelectDefinition(),h=this.checkCacheKey(r,n,d,u,l);if(this.log(f._.LOG,"".concat(this.playerId," ").concat(r),"codecType:".concat(l," vtype:").concat(u," hasCache:").concat(h)),h&&!this.stepwise||"MP3"===u)return this.log(f._.LOG,"vtype_".concat(u)),null;var g=c||this.getInitDefinition(n,t);if(this.log(f._.LOG," ".concat(this.playerId," ").concat(r," getInitDefinition"),null==g?void 0:g.definition),!g)return this.log(f._.WARN,"definition_error"),null;var p=g.definition,v=g.orgDefinition,y=this.stepwise?a[e.stepIdx]:e.preloadTime||this.options.preloadTime,m=this.stepwise?a[e.stepIdx]*Math.floor(g.bitrate/8):e.preloadSize||this.options.preloadSize||390624,b=this.generateUniqueKey({vid:r,definition:p,vtype:u,codecType:l});this._nextPreloadCount>0&&this._nextPreloadCount--,this.log(f._.LOG,"".concat(this.playerId," ").concat(r),"cacheKey:".concat(b," duration:").concat(g.duration," preloadTime:").concat(y));var C=(0,i.Zj)({vid:r,definition:p,orgDefinition:v,preloadTime:y,preloadSize:m,cacheKey:b,codecType:l,vtype:u,steps:a,stepIdx:o,payload:e},g);return e.reqOptions&&(C.reqOptions=e.reqOptions),this.log(f._.LOG,"start preload,".concat(r," playerId:").concat(this.playerId)),C}},{key:"start",value:(t=(0,i.x)((0,i.l5)().mark(function e(t,n){var r,a,o,s,u,l,d,f,h;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this._beforeStart(t,n)){e.next=3;break}return e.abrupt("return",{remove:!0});case 3:if(s=(o=Promise.withResolvers()).promise,u=o.resolve,l=a.codecType,this._pendingTask.resolve=u,this._pendingTask.data=a,null!==(r=this.options)&&void 0!==r&&null!==(r=r.pcdnConfig)&&void 0!==r&&r.openPreloadPCDN&&(d=Object.assign({},{productConfig:g.tE},this.options.pcdnConfig),this._pcdn=new c.e(d,void 0,void 0,void 0)),f=null,!this.stepwise){e.next=13;break}return e.next=12,this.getPreLoadData(a);case 12:f=e.sent;case 13:return h=t.loadRangeType||this.loadRangeType,(l!==A.H265||this.options.supportHevc)&&h!==g.TJ.UNMUX?h===g.TJ.GOP?this.loadByPreloadTime(a,f):h===g.TJ.SIZE?this.loadByChunkSize(a,f):h===g.TJ.ONLY_SIZE&&this.loadByChunkSizeOnly(a,f):this.loadByChunkSizeUnMux(a,f),e.next=17,s;case 17:return e.abrupt("return",{remove:!this.stepwise});case 18:case"end":return e.stop()}},e,this)})),function(e,n){return t.apply(this,arguments)})},{key:"_getRangeByOffsetMap",value:function(e,t){var n=this,r=null==e?void 0:e.find(function(e){var r;return(null==e?void 0:e.time)===((null===(r=n.options)||void 0===r?void 0:r.firstLoadTimePos)||t)});return null==r?void 0:r.offset}},{key:"_decideRequestRange",value:function(e){var t=e.pktOffsetMap,n=e.bitrate,r=e.size,i=e.duration,a=[0,8e5],o=this._getRangeByOffsetMap(t,g.he),s=0;if("number"==typeof o&&o>0)a[1]=o,s=g.he;else{var c=r||x.Z.getFileSize(n,i),u=(0,p.T)(i,8e5,c);a[1]=u,s=1}return{range:a,duration:s}}},{key:"loadByChunkSizeOnly",value:(n=(0,i.x)((0,i.l5)().mark(function e(t,n){var r,a,o,s,c,u,l,d,g,p,y,m,I,_,A,k,L,w,S,T,P,O,B,D,R,Z,E;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.vid,a=t.cacheKey,o=t.definition,s=t.orgDefinition,c=t.duration,u=t.bitrate,l=t.codecType,d=t.vtype,g=t.size,p=this._getLoadUrl(t)){e.next=5;break}return this._endLoadFragments(!1),e.abrupt("return");case 5:return p=x.Z.extUrl(p,{__vid:r}),m=(y=this._decideRequestRange({bitrate:u,size:g,duration:c,pktOffsetMap:t.pktOffsetMap})).range,I=y.duration,this.log(f._.LOG,"".concat(r," loadByChunkSize ").concat(m[0],"-").concat(m[1]),t.cacheKey,t.definition,I),_={vid:r,definition:o,orgDefinition:s,cacheKey:a,codecType:l,vtype:d,fileSize:g,bitrate:u||0,byteLength:0,preloadTime:I,buffer:new ArrayBuffer(0)},A=this.getRequestOption((0,i.Zj)((0,i.Zj)({},t),{},{url:p})),k=new h.mf({responseType:"arraybuffer",changeUrlRetry:this.options.changeUrlRetry,dynamicTimeoutIns:this.options.dynamicTimeoutIns,urlList:this._getLoadBackUrlList(t)}),L=x.Z.nowTime(),e.prev=12,e.next=15,k.load(p,(0,i.Zj)({range:m},A));case 15:S=e.sent,!_.fileSize&&(T=(0,C.Xz)(S.headers),_.fileSize=T),(null==S||null===(w=S.data)||void 0===w?void 0:w.byteLength)>0&&(D=(B=S.data).byteLength||0,(R={codecType:l,vtype:d,vid:r,definition:o,orgDefinition:s,cacheKey:a,bitrate:u,memory:0,byteLength:D,preloadSize:D,preloadTime:0,buffer:B,fileSize:_.fileSize}).preloadTime=I||0,R.buffer&&R.buffer.byteLength>0&&(R.memory+=(null==B?void 0:B.byteLength)||0,this.setItem(t,R)),Z=(null==S||null===(P=S.options)||void 0===P||null===(P=P.priOptions)||void 0===P?void 0:P.type)||v._R.CDN,E=(0,b.pl)(D,x.Z.nowTime()-L),this.bwEventEmit(r,Z,D,E,a,!0,(null==S||null===(O=S.options)||void 0===O||null===(O=O.priOptions)||void 0===O?void 0:O.rtt)||0)),e.next=23;break;case 20:e.prev=20,e.t0=e.catch(12);case 23:this._endLoadFragments(!1);case 24:case"end":return e.stop()}},e,this,[[12,20]])})),function(e,t){return n.apply(this,arguments)})},{key:"getInitDefinition",value:function(e,t){for(var n=null,r=0,i=0;i<e.length;i++)if(e[i].definition===t){r=i;break}return!(n=e[r])&&(n=e[0]),n}},{key:"getPreLoadData",value:function(e){var t=this,n=Promise.withResolvers(),r=n.promise,o=n.resolve,s=n.reject;return this.getItemSameVid(e).then(function(e){if(t.log(f._.DEBUG,"[Preloader] getPreLoadData",!!e.value),e.value){var n=e.value,r=n.mediaSegList,s=n.meta,c=n.type,u=n.buffer,l=n.preloadTime,d=n.vid,h=n.cacheKey,g=n.definition,p=n.orgDefinition,v=n.byteLength,y=n.duration,m=n.fileSize,b=n.from,C=n.vtype,x=n.codecType,I=n.initSeg,_=n.bitrate,A=n.adaptTimeRange,k=n.repeatData,L=n.repeatDataStartPos,w=n.memory;o((0,i.Zj)({generateBy:"preloader",vid:d,type:c,vtype:C,codecType:x,definition:g,orgDefinition:p,bitrate:_,cacheKey:h,duration:y||0,byteLength:v,from:b,adaptTimeRange:A,repeatData:k,repeatDataStartPos:L,memory:w,meta:s,preloadTime:l,fileSize:m||0},c===a.dJ.SIZE?{buffer:u}:{initSeg:I,mediaSegList:r}))}else o(null)}).catch(function(e){s(e)}),r}},{key:"setPreLoadData",value:(r=(0,i.x)((0,i.l5)().mark(function e(t,n){var r,o,s,c,u,l,d,h,g,p,v,y,m,b,C,x,I,_,A,k,L,w,S,T,P=this;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=n.mediaSegList,o=n.meta,s=n.vid,c=n.definition,u=n.orgDefinition,l=n.type,d=n.buffer,h=n.duration,g=n.byteLength,p=n.preloadTime,v=n.fileSize,y=n.from,m=n.vtype,b=n.codecType,C=n.initSeg,x=n.bitrate,I=n.adaptTimeRange,_=n.repeatData,A=n.repeatDataStartPos,L={codecType:b,vtype:m,vid:s,definition:c,orgDefinition:u,cacheKey:k=n.cacheKey,type:l,from:y,meta:o,fileSize:v,adaptTimeRange:I,repeatData:_,repeatDataStartPos:A,bitrate:x,memory:0},L.memory+=(null==_?void 0:_.byteLength)||0,l===a.dJ.SIZE?(L.buffer=d,L.byteLength=g||0,L.preloadSize=g||0,L.preloadTime=p||0,L.fileSize=v,L.buffer&&L.buffer.byteLength>0&&(L.memory+=(null==d?void 0:d.byteLength)||0,this.setItem(t,L))):(L.mediaSegList=[],L.duration=h,L.byteLength=g||0,L.preloadTime=p||0,L.initSeg=C,L.memory+=(null==C?void 0:C.byteLength)||0,L.fileSize=v,null==r||r.forEach(function(e){var t;L.memory+=(null==e||null===(t=e.buffer)||void 0===t?void 0:t.byteLength)||0,L.mediaSegList.push(e)}),o&&0===r.length?(this.log(f._.LOG,"[Preloader] meta setPreLoadData1 success",k,null==L||null===(w=L.mediaSegList)||void 0===w?void 0:w.length),this.setItem(t,L)):(T=r.every(function(e){return!!e.buffer&&e.state}),this.log(f._.LOG,"[Preloader] mediaSegList setPreLoadData1 success",k,null==L||null===(S=L.mediaSegList)||void 0===S?void 0:S.length,T),T&&this.setItem(t,L).then(function(){P.log(f._.LOG,"[Preloader] setPreLoadData1 success",k)})));case 4:case"end":return e.stop()}},e,this)})),function(e,t){return r.apply(this,arguments)})},{key:"getInitCacheData",value:function(e,t){var n={type:e,meta:null,byteLength:0,fileSize:0,bitrate:0,preloadTime:0};return e===a.dJ.DURATION?(n.mediaSegList=[],n.initSeg=null,n.duration=0):n.buffer=null,Object.keys(t).map(function(e){n[e]=t[e]}),n}},{key:"updatePreCacheData",value:function(e,t,n,r,i,o,s,c,u,d){var h,g=e.mediaSegList;if(e.type===a.dJ.SIZE||-1===i)return e.buffer=l()(Uint8Array,(null===(h=e.buffer)||void 0===h?void 0:h.buffer)||[],new Uint8Array(t)),e;var p=-1;if(g){for(var v=0;v<g.length;v++)if(g[v].index===i){p=v;break}}var y=o||[0,0];if(p>-1&&g)t&&(g[p].buffer=l()(Uint8Array,g[p].buffer||[],new Uint8Array(t))),n.length>1&&(g[p].range.length>1?g[p].range[1]=n[1]:g[p].range=n),s&&-1!==s[1]&&(r=g[p].range[1]>=s[1]),g[p].state=r;else{e.duration=y[1],g&&g.push({buffer:t,range:n||[],index:i,totalRange:s||[],timeRange:[y[0],y[1]],muxSampleIdxRange:c,unMuxPos:u,state:r});var m="".concat(null==t?void 0:t.byteLength,",").concat(JSON.stringify(n),",").concat(i,",").concat(JSON.stringify(s),",").concat(JSON.stringify(o));this.log(f._.DEBUG,"[Preloader] ".concat(e.cacheKey," mediaSegList set, dataLen"),m)}return r&&(e.byteLength+=n[1]-n[0],e.preloadTime+=d),r}},{key:"checkCacheKey",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.l0.MP4,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:s.u7.H264;if(n){var a=this.generateUniqueKey({vid:e,definition:n,vtype:r,codecType:i});return a&&this.hasItemSameVid(a)?a:null}for(var o=0;o<t.length;o++){var c=this.generateUniqueKey({vid:e,definition:t[o].definition,vtype:r,codecType:i});if(c&&this.hasItemSameVid(c))return c}return null}},{key:"getRangeStartPos",value:function(e){var t,n=this,r=null==e||null===(t=e.pktOffsetMap)||void 0===t?void 0:t.find(function(e){var t;return(null==e?void 0:e.time)===((null===(t=n.options)||void 0===t?void 0:t.firstLoadTimePos)||g.he)});return null==r?void 0:r.offset}},{key:"loadByChunkSizeUnMux",value:(o=(0,i.x)((0,i.l5)().mark(function e(t,n){var r,o,s,c,u,l,h,y,m,I,A,k,L,w,S,T,P,O,B,D,R,Z,E,N,M,z,W,U=this;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.vid,o=t.cacheKey,s=t.definition,c=t.orgDefinition,u=t.duration,l=t.bitrate,h=t.codecType,y=t.vtype,m=t.size,I=t.uri,A=t.file_id,k=this.options,L=this._getLoadUrl(t)){e.next=6;break}return this._endLoadFragments(!1),e.abrupt("return");case 6:if(L=x.Z.extUrl(L,{__vid:r}),w=m||x.Z.getFileSize(l,u),T=null==(S=null==t||null===(W=t.pktOffsetMap)||void 0===W?void 0:W.find(function(e){return(null==e?void 0:e.time)===((null==k?void 0:k.firstLoadTimePos)||g.he)}))?void 0:S.offset,P=(0,p.T)(u,8e5,w),this.log(f._.LOG,"".concat(r," loadByChunkSizeUnMux"),t.cacheKey,t.definition,T||P),O=this.getInitCacheData(a.dJ.SIZE,{vid:r,definition:s,orgDefinition:c,cacheKey:o,codecType:h,vtype:y,fileSize:m,bitrate:l||0}),B=this.getRequestOption((0,i.Zj)((0,i.Zj)({},t),{},{url:L})),this.startPCDN(L,I,r,l,A,y.toLowerCase()||"mp4",Math.floor(u),w),this.mp4Loader=new d.b({url:L,vid:"".concat(r,"-").concat(l),retry:k.retryCount||2,retryDelay:k.retryDelay||1e3,timeout:k.timeout||3e3,reqOptions:B,loaderType:k.loaderType,retryCheckFunc:b.Wp,openLog:(0,_.qw)(),memoryOpt:this.options.memoryOpt,audioGroupingStrategy:k.audioGroupingStrategy,fixEditListOffset:k.fixEditListOffset,fixEditListOffsetThreshold:k.fixEditListOffsetThreshold,changeUrlRetry:k.changeUrlRetry,dynamicTimeoutIns:k.dynamicTimeoutIns,urlList:this._getLoadBackUrlList(t)}),this.mp4Loader.on(g.kW,function(e){if((null==e?void 0:e.len)>0){var t,n,i=(null==e||null===(t=e.priOptions)||void 0===t?void 0:t.type)||v._R.CDN,a=(0,b.pl)(e.len,e.time),s=(null==e||null===(n=e.priOptions)||void 0===n?void 0:n.rtt)||0;U.bwEventEmit(r,i,e.len,a,o,0,s)}}),this.mp4Loader.on("networkError",function(e){var t;null===(t=U.preloadManager.player)||void 0===t||t.emit("networkError",e)}),e.prev=18,D=new Uint8Array(3145728),R=0,Z=0,E=-1,N=null,M=null,z=function(){var e=(0,i.x)((0,i.l5)().mark(function e(n,a,s,c,u){var l,d,h,g,p,y,m,b,I,_,A,k,w,S,T,P,B;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:!O.fileSize&&(O.fileSize=Number((0,C.Xz)(u.headers))),n&&(E>0?(l=D.slice(E-R,R+Z),(null==n?void 0:n.byteLength)+Z>D.byteLength?((d=x.Z.newUint8Array(D.byteLength+n.byteLength)).set(l,0),d.set(n,l.byteLength),D=d):(D.set(l,0),D.set(n,l.byteLength)),R=E,Z=l.byteLength+n.byteLength):((null==n?void 0:n.byteLength)>(null===(h=D)||void 0===h?void 0:h.byteLength)&&(D=x.Z.newUint8Array(D.byteLength+n.byteLength)),D.set(n,0),Z+=(null==n?void 0:n.byteLength)||0,R=s.range[0])),s.meta&&(y=(null==n||null===(g=n.priOptions)||void 0===g?void 0:g.type)||v._R.CDN,U.bwEventEmit(r,y,Z,null,o,0,(null==n||null===(p=n.priOptions)||void 0===p?void 0:p.rtt)||0),b=(m=s.meta).videoSegments,I=m.audioSegments,!O.fileSize&&(O.fileSize=x.Z.getEndFramePos(b,I)),E=x.Z.getFirstFrameStartRange(b,I),M=(0,i.Zj)((0,i.Zj)({},m.meta),{},{ext:{videoTrak:b,audioTrak:I}}),O.meta=M,N=x.Z.getFragRange(0,b,I),O.buffer=D.subarray(0,Z),O.byteLength=O.buffer.byteLength,_=x.Z.getFragRange(1,b,I),A=[],_[0]<_[1]&&N[1]>_[0]&&(A=[_[0],N[1]]),w=(k=(null==b?void 0:b.length)>0?b:I)[0].startTime,T={startTime:w,endTime:S=k[0].endTime,range:(0,i.u)(N),repeatRange:A,duration:S-w,downloaded:!1,isLoading:!1,timeRangeIdx:[0,1]},O.adaptTimeRange=[T],U.log(f._.LOG,"".concat(r," loadMetaProcess ret"),o,D.byteLength,JSON.stringify(N),O.buffer.byteLength,JSON.stringify(A)),U.setPreLoadData(t,O),B=[P=R+Z,N[1]],U.log(f._.LOG,"".concat(o," loadMetaProcess end, loadOneChunk start"),a,JSON.stringify(B),P,D.byteLength),U.loadOneChunk(O,B,L,T.duration,t));case 3:case"end":return e.stop()}},e)}));return function(t,n,r,i,a){return e.apply(this,arguments)}}(),!this.mp4Loader){e.next=29;break}return e.next=29,this.mp4Loader.loadMetaProcess(this.mp4Loader.cache,[0,T||P],z,{});case 29:e.next=35;break;case 31:e.prev=31,e.t0=e.catch(18),this._endLoadFragments(!1);case 35:case"end":return e.stop()}},e,this,[[18,31]])})),function(e,t){return o.apply(this,arguments)})},{key:"loadOneChunk",value:(u=(0,i.x)((0,i.l5)().mark(function e(t,n,r,a,o){var s,c,u,l,d,h,g,p,y,m,b;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!((null==n?void 0:n.length)>0&&n[0]>=n[1])){e.next=3;break}return this._endLoadFragments(),e.abrupt("return");case 3:return(c=(null===(s=this._pcdnNodeList)||void 0===s?void 0:s.length)>0?x.Z.extUrl(this._pcdnNodeList[0].url,{__vid:t.vid}):null)&&v.Yx.pcdn_download_request_cnt++,this.log(f._.LOG,"".concat(null==t?void 0:t.cacheKey," loadOneChunk start"),JSON.stringify(n),",loadType,",!!c),u=c||r,l=t.vid,d=t.cacheKey,h=t.buffer,e.prev=8,e.next=11,null===(g=this.mp4Loader)||void 0===g?void 0:g.loadData(n,this.mp4Loader.cache,{index:0,url:u,headers:c?{"X-Origin-Server-Host":x.Z.getHostFromUrl(r)}:null,priOptions:{type:c?v._R.PCDN:v._R.CDN}});case 11:p=e.sent,this.log(f._.LOG,"".concat(l," loadOneChunk"),JSON.stringify(n),d),y=p.response,(m=p.data)?(this._endLoadFragments(),y&&y.headers&&(b=Number((0,C.Xz)(y.headers)))&&(t.fileSize=b),t.buffer=x.Z.concatData(h,m),t.byteLength=t.buffer.byteLength,t.preloadTime+=a,this.log(f._.LOG,"".concat(l," loadOneChunk ret"),d,t.buffer.byteLength,null==m?void 0:m.byteLength),t.from=4,this.setPreLoadData(o,t)):(v.Yx.pcdn_download_failed_cnt++,this._endLoadFragments(!1)),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(8),this.log(f._.ERROR,"[Preloader] ".concat(l," loadByChunkSize error"),null===e.t0||void 0===e.t0?void 0:e.t0.message),this._endLoadFragments(!1);case 21:case"end":return e.stop()}},e,this,[[8,17]])})),function(e,t,n,r,i){return u.apply(this,arguments)})},{key:"loadByPreloadTime",value:(w=(0,i.x)((0,i.l5)().mark(function e(t,n){var r,o,s,c,u,l,d,h,g,p,m,b,C,I,_,A,k,L,w,S,T,P,O=this;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.vid,o=t.cacheKey,s=t.preloadTime,c=t.definition,u=t.orgDefinition,l=t.duration,d=t.bitrate,h=t.codecType,g=t.vtype,p=t.size,m=t.uri,b=t.file_id,C=this._getLoadUrl(t)){e.next=6;break}return this._endLoadFragments(!1),e.abrupt("return");case 6:return C=x.Z.extUrl(C,{__vid:r}),I=s>=this.options.segmentMinDuration?this.options.segmentMinDuration:s,_=this.getRequestOption((0,i.Zj)((0,i.Zj)({},t),{},{_url:C})),this.log(f._.DEBUG,"[Preloader] loadByPreloadTime","".concat(t.cacheKey,", definition:").concat(t.definition,",segmentMinDuration:").concat(I),_),A=p||x.Z.getFileSize(d,l),k=this.getRangeStartPos(t),L=this.createConfig(t,_,k,A,I),w=this._getLoadBackUrlList(t),this.mp4=new y.Z(C,d,L,w,"[Preloader]"),S=this.getInitCacheData(a.dJ.DURATION,{vid:r,definition:c,orgDefinition:u,cacheKey:o,codecType:h,vtype:g,bitrate:d||0}),this.startPCDN(C,m,r,d,b,g.toLowerCase()||"mp4",Math.floor(l),A),null!=n&&null!==(T=n.meta)&&void 0!==T&&T.ext?(this.uddatePreCacheInfoByCache(n,S),this.updateMP4InfoByCache(n)):this.mp4.once(v.kL.META_READY,function(){var e=(0,i.x)((0,i.l5)().mark(function e(n,r){var a;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!r||r.hasDestroyed)){e.next=2;break}return e.abrupt("return");case 2:return O.log(f._.DEBUG,"[Preloader] ".concat(t.vid," metaReady ").concat(null==S||null===(a=S.mediaSegList)||void 0===a?void 0:a.length)),S.meta=n,S.from=2,S.fileSize=r.size,e.next=8,r.cancelLoading();case 8:if(!r.hasDestroyed){e.next=10;break}return e.abrupt("return");case 10:return r.metaLoading=!1,e.next=13,O.setPreLoadData(t,S);case 13:if(!r.hasDestroyed){e.next=15;break}return e.abrupt("return");case 15:O.startLoadByFragments(S,t);case 16:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}()),this.mp4EventAdd(t.vid,S.cacheKey),e.next=21,this.mp4.init(n);case 21:if(this.mp4){e.next=23;break}return e.abrupt("return");case 23:null!=n&&null!==(P=n.meta)&&void 0!==P&&P.ext&&this.startLoadByFragments(S,t);case 24:case"end":return e.stop()}},e,this)})),function(e,t){return w.apply(this,arguments)})},{key:"bwEventEmit",value:function(e,t,n,r,i,a,o){var c,u,l=(null===(c=this._pendingTask.data)||void 0===c?void 0:c.duration)||0,d=(null===(u=this._pendingTask.data)||void 0===u?void 0:u.bitrate)||0;this.preloadManager.bwEventEmit({vid:e,loadType:t,size:n,speed:r,cacheKey:i,vtype:s.l0.MP4,duration:l,bitrate:d,isV2Player:a,rtt:o})}},{key:"startPCDN",value:function(e,t,n,r,i,a,o,s){var c=this;if(this._pcdn){if(null===(u=this.mp4)||void 0===u||u.updatePCDNState(v.oy.OPEN),!(0,b.Pj)(e)){;e=document.location.protocol+e}this.curPCDNReqId=(l=t||n,d=r,l.slice(-20)+d);var u,l,d,h={vid:t,cdn_url:e,sfid:i,file_type:a,bitrate:r,duration:Math.floor(o),size:s};this.log(f._.DEBUG,"[Preloader] ".concat(n," get peer start")),this._pcdn.fetchPCDNNode(null,h,this.curPCDNReqId).then(function(e){var t;if(null!=e&&e.req_id&&e.req_id!==c.curPCDNReqId){c.log(f._.LOG,",[Preloader] fetchPCDNNode not match reqId",c.curPCDNReqId,", pcdnRet.req_id",e.req_id);return}c.log(f._.LOG,"[Preloader] ".concat(n," get peer end,pcdn node update,"),null==e||null===(t=e.nodes)||void 0===t?void 0:t.length),c.mp4?c.mp4.updateNode(null==e?void 0:e.nodes):c._pcdnNodeList=(null==e?void 0:e.nodes)||null}).catch(function(t){var n,r,i,a=x.Z.checkUrlIsExpired(e);1===a&&c._pcdn&&(c._pcdn=void 0);var o=(null==t||null===(n=t.response)||void 0===n?void 0:n.url)||(null===(r=c.options)||void 0===r||null===(r=r.pcdnConfig)||void 0===r?void 0:r.trackerUrl);c.emit("source_error",{host:x.Z.getHostFromUrl(o),src:o,errorCode:null==t||null===(i=t.response)||void 0===i?void 0:i.status,message:"".concat(null==t?void 0:t.message,"-").concat(a,"_preload")})})}}},{key:"_getLoadUrl",value:function(e){var t="Array"===x.Z.typeOf(e.url)?e.url[0].src:e.url;return this.preloadManager.preProcessUrl&&(t=this.preloadManager.preProcessUrl(t).url),t}},{key:"_getLoadBackUrlList",value:function(e){var t,n=this,r="Array"===x.Z.typeOf(e.url)&&(null===(t=e.url)||void 0===t?void 0:t.length)>1?e.url.slice(1).map(function(e){return String(e.src)}):[];return this.preloadManager.preProcessUrl&&r.length>0&&(r=r.map(function(e){return n.preloadManager.preProcessUrl(e).url})),r}},{key:"mp4EventAdd",value:function(e,t){var n,r,i=this;this.mp4.on(v.kL.ERROR,function(t){i.log(f._.ERROR,"[Preloader] ".concat(e," load error ").concat(null==t?void 0:t.errorCode,", ").concat((null==t?void 0:t.errorMessage)||(null==t?void 0:t.message)," ")),i._endLoadFragments(!1)}),this.mp4.on(v.kL.REMOVE_PCDN_NODE,function(e){i._pcdn&&e&&i._pcdn.removePCDNNode(e.vid,e.bitrate,e.url)}),this.mp4.on(v.kL.CANCEL_LOADED_LEN,function(n){i.bwEventEmit(e,n.load_type,n.len,null,t)}),null===(n=this.mp4.MP4Loader)||void 0===n||n.on("networkError",function(e){var t;null===(t=i.preloadManager.player)||void 0===t||t.emit("networkError",e)}),null===(r=this.mp4.MP4Loader)||void 0===r||r.on(g.kW,function(n){if((null==n?void 0:n.len)>0){var r,a,o=(null==n||null===(r=n.priOptions)||void 0===r?void 0:r.type)||v._R.CDN,s=(0,b.pl)(n.len,n.time);i.bwEventEmit(e,o,n.len,s,t,0,(null==n||null===(a=n.priOptions)||void 0===a?void 0:a.rtt)||0)}})}},{key:"createConfig",value:function(e,t,n,r,i){var a=e.vid,o=e.duration,s=this.options,c=s.preloadSize,u=s.memoryOpt,l=s.supportHevc,d=s.emitMediaListControl,f=s.audioGroupingStrategy,h=s.fixEditListOffsetThreshold,g=s.fixEditListOffset,p=s.segmentMinDuration,v=s.enableFixPreloadRepatLoad,y=s.changeUrlRetry,m=s.dynamicTimeoutIns,C=s.timeout;return{segmentDuration:i||p,codecType:this.codecType,chunkSize:c,firstLoadSize:n,duration:o,fileSize:r,playerId:this.playerId,vid:a,useUrlRange:!1,timeout:C,retryCount:1,retryDelay:1e3,supportHevc:l,retryCheckFunc:b.Wp,switchPCDNMaxCnt:Number.MAX_VALUE,logger:this.logger,reqOptions:t,memoryOpt:u,emitMediaListControl:d,audioGroupingStrategy:f,fixEditListOffset:g,fixEditListOffsetThreshold:h,enableFixPreloadRepatLoad:v,changeUrlRetry:y,dynamicTimeoutIns:m,loadRangeType:this.loadRangeType}}},{key:"uddatePreCacheInfoByCache",value:function(e,t){t.meta=e.meta,t.from=5,t.fileSize=e.fileSize,t.mediaSegList=e.mediaSegList||t.mediaSegList||[],t.repeatData=e.repeatData,t.repeatDataStartPos=e.repeatDataStartPos,t.initSeg=e.initSeg,t.adaptTimeRange=e.adaptTimeRange,t.byteLength=e.byteLength}},{key:"updateMP4InfoByCache",value:function(e){var t;if(e.initSeg&&(this.mp4._needInitSegment=!1),e.adaptTimeRange&&(this.mp4.adaptTimeRange=e.adaptTimeRange),(null===(t=e.mediaSegList)||void 0===t?void 0:t.length)>0){var n=e.mediaSegList,r=n[n.length-1].muxSampleIdxRange,i=r.video,a=r.audio;this.mp4.lastDemuxSampleIdxRange.video=i,this.mp4.lastDemuxSampleIdxRange.audio=a}}},{key:"loadByChunkSize",value:(S=(0,i.x)((0,i.l5)().mark(function e(t,n){var r,o,s,c,u,l,d,h,g,y,b,C,I,_,A,k,L,w,S,T,P=this;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.vid,o=t.cacheKey,s=t.definition,c=t.orgDefinition,u=t.duration,l=t.bitrate,d=t.codecType,h=t.vtype,g=t.size,y=t.uri,b=t.file_id,this.options,C=this._getLoadUrl(t)){e.next=6;break}return this._endLoadFragments(!1),e.abrupt("return");case 6:if(C=x.Z.extUrl(C,{__vid:r}),I=g||x.Z.getFileSize(l,u),_=this.getRangeStartPos(t),A=(0,p.T)(u,8e5,I),this.log(f._.LOG,"".concat(r," loadByChunkSize"),t.cacheKey,t.definition,_||A),k=this.getInitCacheData(a.dJ.DURATION,{vid:r,definition:s,orgDefinition:c,cacheKey:o,codecType:d,vtype:h,fileSize:g,bitrate:l||0}),L=this.getRequestOption((0,i.Zj)((0,i.Zj)({},t),{},{url:C})),this.startPCDN(C,y,r,l,b,h.toLowerCase()||"mp4",Math.floor(u),I),w=this.createConfig(t,L,_||A,I,null),S=this._getLoadBackUrlList(t),this.mp4=new m.Z(C,l,w,S,"[Preloader]"),this.mp4EventAdd(t.vid,k.cacheKey),T=-1,!(null!=n&&n.meta)){e.next=27;break}return this.uddatePreCacheInfoByCache(n,k),this.updateMP4InfoByCache(n),e.next=24,this.mp4.init(n);case 24:this.startLoadBySize(k,t),e.next=30;break;case 27:this.mp4.once(v.kL.META_READY,function(){var e=(0,i.x)((0,i.l5)().mark(function e(n,r){return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!r||r.hasDestroyed)){e.next=2;break}return e.abrupt("return");case 2:return P.log(f._.DEBUG,"[Preloader] ".concat(t.vid," metaReady, metaReq, ").concat(T)),k.meta=n,k.from=2,k.fileSize=r.size,e.next=8,P.setPreLoadData(t,k);case 8:if(!r.hasDestroyed){e.next=10;break}return e.abrupt("return");case 10:1===T&&(T=2,P.startLoadBySize(k,t));case 11:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}()),this.mp4.once(v.kL.META_REQ_DONE,function(e){if(!!e&&!e.hasDestroyed){P.log(f._.DEBUG,"[Preloader] ".concat(t.vid," metaReq done,meta: ").concat(!!e.meta));var n=e.repeatInfo,r=n.curDataPos,i=n.startPos,a=n.data;r>0&&(k.repeatData=a.subarray(0,r),k.repeatDataStartPos=i),e.meta?(T=2,P.startLoadBySize(k,t)):T=1}}),this.mp4.init(n);case 30:case"end":return e.stop()}},e,this)})),function(e,t){return S.apply(this,arguments)})},{key:"findLoadAdaptTimeRangeIdx",value:function(e){var t,n,r=this,i=e.steps,a=e.stepIdx,o=e.preloadTime,c=0,u=null===(t=this.mp4)||void 0===t?void 0:t.adaptTimeRange,l=!(null!==(n=this.options)&&void 0!==n&&n.openStepwiseType)||this.options.openStepwiseType.toUpperCase()===s.l0.MP4;if(this.stepwise&&l&&Array.isArray(i)&&i.length>0&&"number"==typeof a){var d,f=i[a];if((!u||(null==u?void 0:u.length)<(null==i?void 0:i.length))&&i.map(function(e,t,n){return e-(0===t?0:n[t-1])}).forEach(function(e){if(!Array.isArray(u)||0===u.length||u[u.length-1].endTime<i[i.length-1]){var t;null===(t=r.mp4)||void 0===t||t.updateAdaptTimeRange(null,e||o||5)}}),u)for(var h=0;h<u.length;h++)if(u[h].startTime<=f)c=h;else break;null===(d=this.mp4)||void 0===d||d.getFragRange(c)}else if(!u||(null==u?void 0:u.length)===0){var g,p,v=null===(g=this.mp4)||void 0===g?void 0:g.updateAdaptTimeRange(null,o||5);null===(p=this.mp4)||void 0===p||p.getFragRange(v),c=v}return c}},{key:"updateAdaptTimeRangeState",value:function(e,t){var n=e.mediaSegList;if(!!n&&!((null==n?void 0:n.length)<=0))n.forEach(function(e,n){var r;e.state&&(null==e||null===(r=e.buffer)||void 0===r?void 0:r.byteLength)>0&&n<(null==t?void 0:t.length)&&(t[n].downloaded=!0)})}},{key:"startLoadBySize",value:(T=(0,i.x)((0,i.l5)().mark(function e(t,n){var r,a,o,s,c,u,l,d,h,g,p,v,y=this;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.vid,a=this.mp4,o=this.findLoadAdaptTimeRangeIdx(n),!(!(s=null==a?void 0:a.adaptTimeRange)||!(null!=s&&s.length))){e.next=8;break}return this.log(f._.ERROR,"[Preloader] ".concat(r," adaptTimeRange is null")),this._endLoadFragments(!1),e.abrupt("return");case 8:if(this.updateAdaptTimeRangeState(t,s),(c=s.findIndex(function(e){return!e.downloaded}))>=0&&(o=Math.min(c,o)),u=s[o].range,this.log(f._.LOG,"[Preloader] ".concat(r,"$ startLoadBySize, loading ").concat(o),s?s[o].downloaded:"",s),!(s&&s[o].downloaded)){e.next=16;break}return this._endLoadFragments(),e.abrupt("return");case 16:if(e.prev=16,l=function(e){y.log(f._.ERROR,"[Preloader] ".concat(r," failedCallback error"),null==e?void 0:e.message),y._endLoadFragments(!1)},d=function(){var e=(0,i.x)((0,i.l5)().mark(function e(r){var a,o,c,u,h,g,p,m,b,C,x,I,_;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!(null!=r&&r.mp4)||null!=r&&r.mp4.hasDestroyed)){e.next=2;break}return e.abrupt("return");case 2:if(o=r.mp4,c=r.buffer,u=r.state,h=r.context,g=r.initSeg,p=r.lastRemainBufferInfo,m=o.adaptTimeRange,b=h.fragIndex,C=h.timeRange,x=null===(a=m[b])||void 0===a?void 0:a.range,!t.initSeg&&g&&(t.initSeg=g,t.adaptTimeRange=m),I=o.lastDemuxSampleIdxRange,t.repeatData=p.data,t.repeatDataStartPos=p.pos,y.log(f._.LOG,"[Preloader] ".concat(t.cacheKey," lastUnMuxData, ").concat(b,", \n appendLastUnMuxData start: ").concat(t.repeatDataStartPos," \n end: ").concat(t.repeatDataStartPos+t.repeatData.byteLength)),_=y.updatePreCacheData(t,c,x,u,b,C,x,I,p.pos,m[b].duration),y.log(f._.LOG,"[Preloader] ".concat(t.cacheKey," successCallback"),h.fragIndex,u,_),t.from=3,!_){e.next=27;break}return e.next=18,y.setPreLoadData(n,t);case 18:if(!(s&&b>=s.length-1||y.stepwise)){e.next=24;break}return y.log(f._.LOG,"[Preloader] ".concat(t.cacheKey," mp4.load end"),b),y._endLoadFragments(!0),e.abrupt("return");case 24:return y.appendLastUnMuxData(b+1,t),e.next=27,o.loadAllFragmentData(b+1,d,l,!1,v);case 27:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),h=t.repeatData,g=t.repeatDataStartPos,!this.checkCacheIsHasAllData(u,t)){e.next=26;break}return this.log(f._.LOG,"[Preloader] ".concat(r," startLoadBySize loadIdx:").concat(o," , cache has all data,loadIdx:").concat(o," range:").concat(u)),this.mp4._loadSuccessCallBack=d,this.mp4._mux(h.subarray(u[0]-g),u[0],o,!0),e.abrupt("return");case 26:return p=!this.options.enableFixPreloadRepatLoad||g+h.byteLength>=u[0],v=[(null==h?void 0:h.byteLength)>0&&g<=u[0]&&p&&g+h.byteLength<u[1]?g+h.byteLength:u[0],s[o].range[1]],this.appendLastUnMuxData(o,t),e.next=32,this.mp4.loadAllFragmentData(o,d,l,!1,v);case 32:e.next=38;break;case 34:e.prev=34,e.t0=e.catch(16),this.log(f._.ERROR,"[Preloader] ".concat(t.cacheKey," mp4.load error"),o),this._endLoadFragments(!1);case 38:case"end":return e.stop()}},e,this,[[16,34]])})),function(e,t){return T.apply(this,arguments)})},{key:"checkCacheIsHasAllData",value:function(e,t){var n=t.repeatData,r=t.repeatDataStartPos;return!!((null==n?void 0:n.byteLength)>0)&&!!((null==e?void 0:e[0])>=r)&&!!((null==e?void 0:e[1])<=r+(null==n?void 0:n.byteLength))||!1}},{key:"appendLastUnMuxData",value:function(e,t){var n;(null===(n=t.repeatData)||void 0===n?void 0:n.byteLength)>0&&(this.log(f._.LOG,"[Preloader] ".concat(t.cacheKey," appendLastUnMuxData, ").concat(e,", \n appendLastUnMuxData start: ").concat(t.repeatDataStartPos," \n end: ").concat(t.repeatDataStartPos+t.repeatData.byteLength)),this.mp4.setLastMuxRemainBufferInfo(t.repeatData,t.repeatDataStartPos))}},{key:"startLoadByFragments",value:(P=(0,i.x)((0,i.l5)().mark(function e(t,n){var r,a,o,s,c,u,l,d=this;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.vid,this.log(f._.LOG,"[Preloader] ".concat(r," startLoadByFragments"),n),a=this.findLoadAdaptTimeRangeIdx(n),!(!(o=null===(l=this.mp4)||void 0===l?void 0:l.adaptTimeRange)||!(null!=o&&o.length))){e.next=8;break}return this.log(f._.ERROR,"[Preloader] ".concat(r," adaptTimeRange is null")),this._endLoadFragments(!1),e.abrupt("return");case 8:if(this.updateAdaptTimeRangeState(t,o),(s=o.findIndex(function(e){return!e.downloaded}))>=0&&(a=Math.min(s,a)),this.log(f._.LOG,"[Preloader] loading ".concat(a),o?o[a].downloaded:"",o),!(o&&o[a].downloaded)){e.next=15;break}return this._endLoadFragments(),e.abrupt("return");case 15:if(c=function(e){d.log(f._.ERROR,"[Preloader] ".concat(r," failedCallback error"),null==e?void 0:e.message),d._endLoadFragments(!1)},u=function(){var e=(0,i.x)((0,i.l5)().mark(function e(r){var a,s,l,h,g,p,v,y,m,b,C,x,I,_,A,k;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!(null!=r&&r.mp4)||null!=r&&null!==(a=r.mp4)&&void 0!==a&&a.hasDestroyed)){e.next=2;break}return e.abrupt("return");case 2:if(h=r.mp4,g=r.buffer,p=r.context,v=r.state,y=r.initSeg,m=p.fragIndex,b=p.range,C=p.timeRange,x=h.repeatInfo,_=null===(s=(I=h.adaptTimeRange)[m])||void 0===s?void 0:s.range,!t.initSeg&&y&&(t.initSeg=y,t.adaptTimeRange=I),A=h.lastDemuxSampleIdxRange,t.repeatData=(null===(l=x.data)||void 0===l?void 0:l.slice(0,x.curDataPos))||[],k=d.updatePreCacheData(t,g,b,v,m,C,_,A,-1,I[m].duration),d.log(f._.LOG,"[Preloader] ".concat(t.cacheKey," successCallback"),m,v,k),t.from=3,!k){e.next=25;break}return e.next=16,d.setPreLoadData(n,t);case 16:if(!(o&&m>=o.length-1||d.stepwise)){e.next=22;break}return d.log(f._.LOG,"[Preloader] ".concat(t.cacheKey," mp4.load end"),m),d._endLoadFragments(!0),e.abrupt("return");case 22:return d.log(f._.LOG,"[Preloader] ".concat(t.cacheKey," mp4.load start"),m+1),e.next=25,h.loadAllFragmentData(m+1,u,c);case 25:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),!this.mp4){e.next=20;break}return e.next=20,this.mp4.loadAllFragmentData(a,u,c);case 20:case"end":return e.stop()}},e,this)})),function(e,t){return P.apply(this,arguments)})},{key:"_endLoadFragments",value:function(e){this.log(f._.LOG,"[Preloader] _endLoadFragments ".concat(this.playerId)),null!==(t=this._pendingTask)&&void 0!==t&&t.resolve&&(null===(i=this._pendingTask)||void 0===i||i.resolve(),this._pendingTask.resolve=void 0);var t,n,r,i,a=!(null!==(n=this.options)&&void 0!==n&&n.openStepwiseType)||this.options.openStepwiseType.toUpperCase()===s.l0.MP4;null!==(r=this._pendingTask)&&void 0!==r&&r.data&&(this.stepwise&&(!1===e||!a)&&this._pendingTask.data.payload&&(this._pendingTask.data.payload.stepIdx=1/0),this._pendingTask.data=void 0),this.mp4&&(this.mp4.destroy(),this.mp4.cancelLoading(),this.mp4=void 0),this.mp4Loader&&(this.mp4Loader.cancel(),this.mp4Loader.destroy(),this.mp4Loader=void 0)}},{key:"hasItemSameVid",value:function(e){if(!e)return null;for(var t=e.split("#"),n=this.allCachedKeys,r=0;r<n.length;r++){var i=n[r];if(i===e)return i;var a=i.split("#");if(a.length>=4&&t.length>=4&&a[0]===t[0]){if(0===a[2].indexOf("pretime")&&0===t[2].indexOf("pretime"))return i;var o=[parseInt(a[2]),parseInt(a[3])],s=[parseInt(t[2]),parseInt(t[3])];if(s[0]>=o[0]&&s[1]>s[0]&&s[1]<=o[1])return i}}return null}},{key:"getItemSameVid",value:(O=(0,i.x)((0,i.l5)().mark(function e(t){var n,r,a;return(0,i.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(n=B.generateUniqueKey(t))&&this.hasItemSameVid(n),this.log(f._.DEBUG,"getItemSameVid: key:".concat(n," checkResult:").concat(r)),r){e.next=5;break}return e.abrupt("return",{});case 5:return e.next=7,this.preloadManager.getItem(t);case 7:return a=e.sent,e.abrupt("return",{value:a,key:r});case 9:case"end":return e.stop()}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"setItem",value:function(e,t){return this.preloadManager.setItem(e,t,!1)}},{key:"clearPreloaderList",value:function(){(0,i.Vx)(B,"clearPreloaderList",this,3)([])}},{key:"setUserSelectDefinition",value:function(e){this.preloadManager&&this.preloadManager.setUserSelectDefinition(e)}},{key:"getUserSelectDefinition",value:function(){return this.preloadManager.getUserSelectDefinition()}},{key:"cancel",value:function(){this.log(f._.LOG,"cancelLoading"),this._endLoadFragments()}},{key:"destroy",value:function(){this.cancel()}},{key:"on",value:function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];(0,i.Vx)(B,"on",this,3)([e,t].concat(r))}},{key:"off",value:function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];(0,i.Vx)(B,"off",this,3)([e,t].concat(r))}}],[{key:"vtype",get:function(){return s.l0.MP4}},{key:"PRELOAD_TYPES",get:function(){return a.dJ}},{key:"getDefaultConfig",value:function(){return k()}},{key:"getInfoByUniqueKey",value:function(e){var t=e.split("#"),n=["vid","mediaType","codecType","vtype","definition"],r={};return t.forEach(function(e,t){r[n[t]]=e}),r}},{key:"generateUniqueKey",value:function(e){var t=e.vid,n=e.mediaType,r=e.definition,i=e.codecType,a=e.vtype,o=e.bitrate;return(n=n||"video",r=r||"-1",i=i||s.u7.H264,a=a||s.l0.MP4,o=o||0,t)?"".concat(t,"#").concat(n,"#").concat(i,"#").concat(a,"#").concat(r,"#").concat(o):null}}])}(o.d)},204961:function(e,t,n){n.d(t,{$V:function(){return o},Ww:function(){return s},d0:function(){return a}});var r=n(648955);n(2885);var i=(0,r.qH)(function e(t,n,i,a,o,s){(0,r.PA)(this,e),this.type=t,this.codecs=n,this.visualEntryBox=i,this.configurationBox=a,this.types=o,this.logCodeType=s}),a={AVC:"avc",AV1:"av1",HEVC:"hevc",H265:"h265",H264:"h264",BYTEVC1:"bytevc1",H266:"h266",BYTEVC2:"bytevc2",BVC2:"bvc2"},o=(0,r._x)((0,r._x)((0,r._x)((0,r._x)((0,r._x)((0,r._x)({},a.AVC,new i("avc","avc1.64001E","avc1","avcC",["h264"],"h264")),a.AV1,new i("av1","av01.0.08M.08","av01","av1C",["av1"],"av1")),a.HEVC,new i("hevc","hev1.1.6.L120.90","hvc1","hvcC",["h265"],"h265")),a.BYTEVC1,new i("hevc","hev1.1.6.L120.90","hvc1","hvcC",["bytevc1","h265"],"h265")),a.BVC2,new i("bvc2","bvc2.1.6.L93.B0","bvc2","bvc2",["h266"],"h266")),a.BYTEVC2,new i("bvc2","bvc2.1.6.L93.B0","bvc2","bvc2",["bytevc2","h266"],"h266"));function s(e){for(var t=Object.keys(o),n=0;n<t.length;n++){var r=t[n];if(o[r].codecs===e)return r}return null}},965883:function(e,t,n){n.r(t),n.d(t,{AV1MimeTypes:function(){return d},checkWebAssemblySupport:function(){return u},getDrmServerUrl:function(){return y},isAV1Supported:function(){return h},isCodecSupported:function(){return f},isEMESupported:function(){return g},isEncryptSupported:function(){return v},isSupported:function(){return p}});var r=n(648955);n(124300),n(173757),n(248385),n(679308),n(759943),n(112459),n(832674),n(905442),n(446336),n(808483),n(840938),n(118438),n(325598),n(92999),n(611067),n(273723),n(724016),n(803903),n(214604),n(901250),n(318922),n(755006),n(437048),n(488336),n(825666),n(177162),n(286633),n(943281),n(810658),n(82726),n(224727);var i=n(298757);function a(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),n=e.indexOf("Trident/");return t>0||n>0}function o(){return window.navigator.userAgent.toLowerCase().indexOf("qqbrowser")>-1}function s(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function c(){return navigator.userAgent.indexOf("Edge")>0}function u(){try{if(("undefined"==typeof WebAssembly?"undefined":(0,r.Ac)(WebAssembly))==="object"&&"function"==typeof WebAssembly.instantiate){var e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e) instanceof WebAssembly.Instance}}catch(e){}return!1}function l(){var e=window.MediaSource=window.MediaSource||window.WebKitMediaSource;return e&&"function"==typeof e.isTypeSupported}var d=['video/mp4; codecs="av01.0.01M.08,mp4a.40.5"'];function f(e){if(!l())return!1;for(var t=0;t<e.length;t++){var n=e[t];if(MediaSource.isTypeSupported(n))return!0}return!1}function h(){return f(d)}function g(){var e,t,n,r,o;return!!navigator.requestMediaKeySystemAccess&&(e=s(),t=a(),r=(n=window.navigator.userAgent,!(window.location.search.indexOf("firefox_dash=true")>-1||i.Xb.getItem("firefox_dash"))&&n.toLowerCase().indexOf("firefox")>-1),o=c(),!e&&!t&&!r&&!o)}function p(){return u()&&l()&&!a()}function v(){return u()&&l()&&!a()&&!o()}function y(e){return new Promise(function(t){(!u()||!l()||!navigator.requestMediaKeySystemAccess)&&t(void 0);var n=s(),r=navigator.userAgent.toLowerCase().indexOf("chrome")>-1,i=c();r&&!o()?navigator.requestMediaKeySystemAccess("com.widevine.alpha",[{initDataTypes:["keyids","webm"],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42c01e"'}]}]).then(function(){t("https://".concat(e,"/video/drm/v1/widevine?aid=32&kid="))},function(){t(void 0)}):i?t("https://".concat(e,"/video/drm/v1/playready?aid=32&kid=")):t(void 0)})}},648711:function(e,t,n){n.d(t,{Gb:function(){return a},HR:function(){return c},lE:function(){return u},rP:function(){return o}});var r=n(236699),i=["webgl2"];function a(){return function(){try{if(("undefined"==typeof WebAssembly?"undefined":(0,r.Ac)(WebAssembly))==="object"&&"function"==typeof WebAssembly.instantiate){var e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e) instanceof WebAssembly.Instance}}catch(e){}return!1}()&&c()}function o(){return!!HTMLVideoElement.prototype.getVideoPlaybackQuality}var s="xgplayer-webgl-hard-supported";function c(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=sessionStorage&&sessionStorage.getItem(s);if(!e&&null!==t)return 1===parseInt(t);var n=!1,r=null;try{r=document.createElement("canvas");for(var a=0;a<i.length;a++){var o=r.getContext(i[a],{failIfMajorPerformanceCaveat:!0});if(o){o=null,r=null,n=!0;break}}}catch(e){n=!1}finally{r=null}return sessionStorage&&sessionStorage.setItem(s,n?1:0),n}function u(){return"requestVideoFrameCallback"in HTMLVideoElement.prototype||!1}},614088:function(e,t,n){n.d(t,{_:function(){return u}});var r=n(261825),i=n(96703),a=n(78346),o=n(150630),s=n(790900),c=("undefined"==typeof window?"undefined":(0,r.Ac)(window))==="object"&&window.playerBitrateSelectorRuler?window.playerBitrateSelectorRuler:new s.$;("undefined"==typeof window?"undefined":(0,r.Ac)(window))==="object"&&!window.playerBitrateSelectorRuler&&(window.playerBitrateSelectorRuler=c);var u=(0,r.qH)(function e(t,n){var i=this;(0,r.PA)(this,e),(0,r._x)(this,"analysis",void 0),(0,r._x)(this,"_onEnded",function(){i._updateInfo()}),(0,r._x)(this,"_onPlayNext",function(){i._updateInfo()}),this._rule=c,this._player=t,t&&(this._playingInfo=new o.m(t.video)),this._bindEvent(),c.setConfig(n),this._selectAlgType=n.selectAlgType},[{key:"updateConfig",value:function(e){this._selectAlgType=e.selectAlgType,this._rule.setConfig(e)}},{key:"select",value:function(e,t,n){var r,o=n.degFactor;if(!!e.length){var s=e[0].duration||0;1===e.length&&(r=e[0],this.analysis&&(this.analysis.type=i.A.BUFFER_INFO_ONLY_ONE_ITEM));var u=0;return!r&&((u=this.getTargetBitrate(s,e,o))?(r=(0,a.v2)(e,u,this._selectAlgType),this.analysis&&(this.analysis.type=i.A.BUFFER_INFO_FIND_ADAPT_BITRATE,this.analysis.reason=JSON.stringify({selectAlgType:this._selectAlgType,targetBitRate:u}))):(r=e[0],this.analysis&&(this.analysis.type=i.A.BUFFER_INFO_TARGET_NOT_FOUND,this.analysis.reason=JSON.stringify({duration:s,itemsLen:e.length,ruleQueueLen:c.queue.length}))),r._targetBitrate=u),c.resetCurrent(),c.setCurrent({bitrate:r.bitrate,_xgOrgBitrate:r._xgOrgBitrate,duration:s}),this._playingInfo&&this._playingInfo.enable(),r}}},{key:"_bindEvent",value:function(){if(!this._player)return this._player;this._player.on("ended",this._onEnded),this._player.on("playnext",this._onPlayNext)}},{key:"getTargetBitrate",value:function(e,t,n){var r=c.getTargetBitrate(e,t);return n&&"factor"===n.degradeBitrateType&&"bitrate"===n.factorType&&(r*=n.value),r}},{key:"destroy",value:function(){if(this._endPlay(),!!this._player)this._playingInfo.destroy(),this._player.off("ended",this._onEnded),this._player.off("playnext",this._onPlayNext)}},{key:"_updateInfo",value:function(){this._playingInfo.endPlay();var e=this._playingInfo.getInfo();this._playingInfo.resetInfo(),c.setCurrent({downloadDuration:e.downloadDuration||c.getCurrent().duration,startBufferTime:e.startBufferTime,endBufferTime:e.endBufferTime,pausedTime:e.pausedTime,stalledTime:e.stalledTime,leaveWithBlock:e.leaveWithBlock}),this._prevPlayInfo=c.getCurrent(),c.calcAndReset()}},{key:"_endPlay",value:function(){this._updateInfo(),this._playingInfo.disable()}}])},28295:function(e,t,n){n.d(t,{Z:function(){return r}});let r=function(){try{if("undefined"!=typeof indexedDB)return indexedDB}catch(e){}}()},449782:function(e,t,n){n.d(t,{Z:function(){return i}});var r=n(730210);n(162093),n(2885),n(248385);var i=(0,r.qH)(function e(t,n,i,a){var o=this;(0,r.PA)(this,e),this.config=e.getDefaultConfig(),Object.keys(a).map(function(e){void 0!==a[e]&&null!==a[e]&&(o.config[e]=a[e])}),this.duration=i,this.player=t,this.updateBitrate(n),this.curPCDNInBuffer=this.config.maxPCDNInBuffer,this.curPCDNOutBuffer=this.config.maxPCDNOutBuffer,this.PCDNChangeCnt=0},[{key:"updateBitrate",value:function(e){this.bitrate=e,!this.bitrate&&(this.bitrate=this.config.minBandwidth)}},{key:"getPCDNInBuffer",value:function(){var e=this.config,t=this.player,n=this.bitrate;if(!e.PCDNBufferControl)return null;var r=e.estPlayTime,i=r;e.estPTcontrol&&(i=Math.min(r,Math.max(0,this.duration-((null==t?void 0:t.currentTime)||0))));var a=e.safePCDNInFactor,o=e.minBandwidth,s=e.maxPCDNInBuffer,c=e.minPCDNInBuffer,u=a*Math.max((null==t?void 0:t.avgSpeedPCDN)*1024||0,o),l=n>0?(1-u/n)*i:0;return this.curPCDNInBuffer=Math.min(s,Math.max(c,l)),this.curPCDNInBuffer}},{key:"getPCDNOutBuffer",value:function(){var e=this.config,t=this.player,n=this.bitrate;if(!e.PCDNBufferControl)return null;var r=e.estPlayTime,i=r;e.estPTcontrol&&(i=Math.min(r,Math.max(0,this.duration-((null==t?void 0:t.currentTime)||0))));var a=e.safePCDNOutFactor,o=e.minBandwidth,s=e.maxPCDNOutBuffer,c=e.minPCDNOutBuffer,u=a*Math.max((null==t?void 0:t.avgSpeedPCDN)*1024||0,o),l=n>0?(1-u/n)*i:0;return this.curPCDNOutBuffer=Math.min(s,Math.max(c,l)),this.curPCDNOutBuffer}},{key:"getPCDNChangeCnt",value:function(){var e=this.config,t=e.PCDNCntControl,n=e.alpha,r=this.curPCDNInBuffer,i=this.player,a=(null==i?void 0:i.bufferedPoint)||null,o=a&&a.end?a.end-i.currentTime:0;return t?o>r+(this.PCDNChangeCnt-1)*n&&this.PCDNChangeCnt++:o>=r&&this.PCDNChangeCnt<2&&this.PCDNChangeCnt++,this.PCDNChangeCnt}}],[{key:"getDefaultConfig",value:function(){return{PCDNBufferControl:!1,PCDNCntControl:!1,estPTcontrol:!1,minPCDNInBuffer:8,maxPCDNInBuffer:12,minPCDNOutBuffer:3,maxPCDNOutBuffer:6,safePCDNInFactor:.1,safePCDNOutFactor:.4,alpha:.5,estPlayTime:12,minBandwidth:1e6}}}])},106140:function(e,t,n){n.d(t,{J:function(){return i}});var r,i=((r=i||{}).CHANGE_FLYING_PLUGIN_CONFIG="CHANGE_FLYING_PLUGIN_CONFIG",r)},284771:function(e,t,n){n.d(t,{Z:function(){return r}});var r=(0,n(227346).p)("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgdmFyIGRlY29kZXIgPSBudWxsOwoKICB2YXIgZnJhbWVRdWV1ZSA9IFtdOwoKICB2YXIgcmVjZWl2ZUZyYW1lVGltZXIgPSAwOwoKICB2YXIgaGFzUmVjZWl2ZUZyYW1lID0gZmFsc2U7CgogIHNlbGYuYWRkRXZlbnRMaXN0ZW5lcignbWVzc2FnZScsIGZ1bmN0aW9uIChlKSB7CiAgICBzd2l0Y2ggKGUuZGF0YS5tc2cpIHsKICAgICAgY2FzZSAnY29uZmlndXJhdGlvbic6CiAgICAgICAgZGVjb2RlciA9IG5ldyBzZWxmLlZpZGVvRGVjb2Rlcih7CiAgICAgICAgICBvdXRwdXQ6IGZ1bmN0aW9uIChmcmFtZSkgewogICAgICAgICAgICAvLyBjb25zb2xlLmxvZygnZGVjb2RlZCEnLCBkZWNvZGVyLmRlY29kZVF1ZXVlU2l6ZSwgZnJhbWVRdWV1ZS5sZW5ndGgpCgogICAgICAgICAgICBoYXNSZWNlaXZlRnJhbWUgPSB0cnVlOwoKICAgICAgICAgICAgaWYgKHJlY2VpdmVGcmFtZVRpbWVyKSB7CiAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHJlY2VpdmVGcmFtZVRpbWVyKTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgY29uc3QgZiA9IGZyYW1lUXVldWUuc2hpZnQoKTsKICAgICAgICAgICAgaWYgKCFmKSB7CiAgICAgICAgICAgICAgZnJhbWUuY2xvc2UoKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgIHR5cGU6ICdERUNPREVEJywKICAgICAgICAgICAgICAgIHdpZHRoOiBmcmFtZS5kaXNwbGF5V2lkdGgsCiAgICAgICAgICAgICAgICBoZWlnaHQ6IGZyYW1lLmRpc3BsYXlIZWlnaHQsCiAgICAgICAgICAgICAgICBpbmZvOiBmLAogICAgICAgICAgICAgICAgYnVmZmVyOiBmcmFtZQogICAgICAgICAgICAgIH0sIFtmcmFtZV0pOwogICAgICAgICAgICB9CgogICAgICAgICAgICBpZiAoZGVjb2Rlci5kZWNvZGVRdWV1ZVNpemUgPT09IGZyYW1lUXVldWUubGVuZ3RoKSB7CiAgICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICB0eXBlOiAnQkFUQ0hfRklOSVNIX0ZMQUcnCiAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0sCiAgICAgICAgICBlcnJvcjogZnVuY3Rpb24gKGUpIHsKICAgICAgICAgICAgY29uc29sZS5sb2coJ1tXZWJjb2RlY1dvcmtlcl06JywgZSk7CiAgICAgICAgICAgIGlmIChlLm1lc3NhZ2UgPT09ICdDb2RlYyByZWNsYWltZWQgZHVlIHRvIGluYWN0aXZpdHkuJykgcmV0dXJuCiAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoewogICAgICAgICAgICAgIHR5cGU6ICdGQUlMRUQnLAogICAgICAgICAgICAgIG1lc3NhZ2U6IGUgJiYgZS5tZXNzYWdlCiAgICAgICAgICAgIH0pOwogICAgICAgICAgfQogICAgICAgIH0pOwogICAgICAgIHNlbGYuVmlkZW9EZWNvZGVyLmlzQ29uZmlnU3VwcG9ydGVkKGUuZGF0YS5kYXRhKQogICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKHN0YXR1cykgewogICAgICAgICAgICBpZiAoc3RhdHVzLnN1cHBvcnRlZCkgewogICAgICAgICAgICAgIGRlY29kZXIuY29uZmlndXJlKGUuZGF0YS5kYXRhKTsKICAgICAgICAgICAgICBjb25zb2xlLmxvZygnW1dlYmNvZGVjV29ya2VyXTonLCAnaXNDb25maWdTdXBwb3J0ZWQnLCBzdGF0dXMpOwogICAgICAgICAgICB9CiAgICAgICAgICB9KQogICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKCkgewogICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdHlwZTogJ0RFQ09ERVJfUkVBRFknIH0pOwoKICAgICAgICAgICAgLy8g5o6i5rWL6ZW/5pe26Ze05peg6Kej56CB5bin6L6T5Ye6LOmZjee6p+WIsHdhc20KICAgICAgICAgICAgcmVjZWl2ZUZyYW1lVGltZXIgPSBzZXRUaW1lb3V0KCgpID0+IHsKICAgICAgICAgICAgICBpZiAoaGFzUmVjZWl2ZUZyYW1lKSByZXR1cm4KICAgICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdHlwZTogJ0ZBSUxFRCcsIG1lc3NhZ2U6ICdubyBmcmFtZSBvdXRwdXQnIH0pOwogICAgICAgICAgICB9LCAyMDAwKTsKICAgICAgICAgIH0pCiAgICAgICAgICAuY2F0Y2goZnVuY3Rpb24gKGUpIHsKICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgdHlwZTogJ0ZBSUxFRCcsCiAgICAgICAgICAgICAgbWVzc2FnZTogZSAmJiBlLm1lc3NhZ2UKICAgICAgICAgICAgfSk7CiAgICAgICAgICB9KTsKICAgICAgICBicmVhawogICAgICBjYXNlICdkZWNvZGUnOgogICAgICAgIHZhciBkID0gZS5kYXRhLmRhdGE7CgogICAgICAgIHZhciBzYW1wbGVJbmZvID0gZS5kYXRhLmluZm87CgogICAgICAgIGZyYW1lUXVldWUucHVzaChzYW1wbGVJbmZvKTsKCiAgICAgICAgdmFyIGZyYW1lU2l6ZSA9IGQuYnl0ZUxlbmd0aCAtIDQ7CgogICAgICAgIHZhciBkdiA9IG5ldyBEYXRhVmlldyhuZXcgQXJyYXlCdWZmZXIoNCkpOwoKICAgICAgICBkdi5zZXRVaW50MzIoMCwgZnJhbWVTaXplLCBmYWxzZSk7CgogICAgICAgIGQuc2V0KG5ldyBVaW50OEFycmF5KGR2LmJ1ZmZlciksIDApOwoKICAgICAgICBpZiAoc2FtcGxlSW5mby5rZXlmcmFtZSkgewogICAgICAgICAgZGVjb2Rlci5mbHVzaCgpOwogICAgICAgIH0KCiAgICAgICAgdmFyIGNodW5rID0gbmV3IHNlbGYuRW5jb2RlZFZpZGVvQ2h1bmsoewogICAgICAgICAgdHlwZTogc2FtcGxlSW5mby5rZXlmcmFtZSA/ICdrZXknIDogJ2RlbHRhJywKICAgICAgICAgIHRpbWVzdGFtcDogc2FtcGxlSW5mby5wdHMsCiAgICAgICAgICBkYXRhOiBkCiAgICAgICAgfSk7CiAgICAgICAgZGVjb2Rlci5kZWNvZGUoY2h1bmspOwogICAgICAgIGJyZWFrCiAgICAgIGNhc2UgJ2Rlc3Ryb3knOgogICAgICAgIGlmIChkZWNvZGVyKSB7CiAgICAgICAgICBkZWNvZGVyLmZsdXNoKCk7CiAgICAgICAgICBkZWNvZGVyLmNsb3NlKCk7CiAgICAgICAgfQogICAgICAgIGNsZWFyVGltZW91dChyZWNlaXZlRnJhbWVUaW1lcik7CiAgICAgICAgYnJlYWsKICAgICAgY2FzZSAnY2hlY2tEZWNvZGUnOgogICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoewogICAgICAgICAgdHlwZTogJ0NIRUNLX1RPX0RFQ09ERScsCiAgICAgICAgICBkYXRhOiBNYXRoLmFicyhkZWNvZGVyLmRlY29kZVF1ZXVlU2l6ZSAtIGZyYW1lUXVldWUubGVuZ3RoKSA9PT0gMAogICAgICAgIH0pOwogICAgICAgIGJyZWFrCiAgICB9CiAgfSk7Cgp9KCkpOwoK",null,!1)},596857:function(e,t,n){n.d(t,{b:function(){return v}});var r=n(548814),i=n(403826),a=n(524992),o=n(637961),s=n(416556),c=n(500395),u=n(771098),l=n(264288),d=n(368166),f=n(43832),h=n(942155),g=n.n(h),p=["vid","cache"],v=function(e){(0,r.XW)(A,e);var t,n,h,g,v,y,m,b,C,x,I,_=(0,r.WY)(A);function A(e){(0,r.PA)(this,A),t=_.call(this),(0,r._x)((0,r.Lc)(t),"vid",""),(0,r._x)((0,r.Lc)(t),"url",""),(0,r._x)((0,r.Lc)(t),"meta",{}),(0,r._x)((0,r.Lc)(t),"downloadInfo",[]),(0,r._x)((0,r.Lc)(t),"videoSegments",[]),(0,r._x)((0,r.Lc)(t),"audioSegments",[]),(0,r._x)((0,r.Lc)(t),"cache",null),(0,r._x)((0,r.Lc)(t),"_currentSegmentIndex",-1),(0,r._x)((0,r.Lc)(t),"_currentLoadingSegmentIndex",-1),(0,r._x)((0,r.Lc)(t),"buffer",void 0),(0,r._x)((0,r.Lc)(t),"bufferDataLen",0),(0,r._x)((0,r.Lc)(t),"_error",void 0),(0,r._x)((0,r.Lc)(t),"_transformError",function(e){return e}),t._config=(0,u.i)(e);var t,n=t._config,s=n.vid,c=n.cache,l=(0,r.Kd)(n,p);return t.cache=c||new d.C,t.vid=s||l.url,t.url=l.url,l.transformError=t._transformError,t.logger=new i.Y("MP4Loader_"+t.vid),e.openLog&&i.Y.enable(),l.logger=t.logger,t.filesize=0,t._loader=new a.mf(l),t._loader.on(o.K.REAL_TIME_SPEED,function(e){t.emit(o.K.REAL_TIME_SPEED,e)}),t._loader.on("networkError",function(e){t.emit("networkError",e)}),t}return(0,r.qH)(A,[{key:"isMetaLoaded",get:function(){return this.videoSegments.length||this.audioSegments.length}},{key:"setCurrentSegment",value:function(e){(0,f.hj)(e)&&(this._currentSegmentIndex=e)}},{key:"isLastSegment",value:function(e){if((0,f.hj)(e)){var t,n;return e>=((null===(t=this.videoSegments[this.videoSegments.length-1])||void 0===t?void 0:t.index)||(null===(n=this.audioSegments[this.audioSegments.length-1])||void 0===n?void 0:n.index)||0)}return!1}},{key:"isSegmentLoading",value:function(e){return e===this._currentLoadingSegmentIndex}},{key:"changeUrl",value:(t=(0,r.x)((0,r.l5)().mark(function e(t){var n,i,a,o=arguments;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:t,i=o.length>2?o[2]:void 0,a=o.length>3?o[3]:void 0,e.next=5,this.reset(a);case 5:t&&(this.url=t),n&&(this.vid=n),i&&(this._config.moovEnd=i);case 8:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"getOrLoadMeta",value:(n=(0,r.x)((0,r.l5)().mark(function e(t){return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMetaLoaded){e.next=3;break}return e.next=3,this.loadMeta(t);case 3:return e.abrupt("return",this.meta);case 4:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"newBufferArray",value:function(e,t){var n;if(this.buffer){if(t||(null===(n=this.buffer)||void 0===n?void 0:n.byteLength)<e){var r,i=this.buffer.subarray(0,this.bufferDataLen),a=(0,s.xf)(((null===(r=this.buffer)||void 0===r?void 0:r.byteLength)||0)+e);a.set(i,0),delete this.buffer,this.buffer=a}}else this.buffer=(0,s.xf)(e),this.bufferDataLen=0}},{key:"loadMetaProcess",value:(h=(0,r.x)((0,r.l5)().mark(function e(t,n,i){var a,o=this,u,d,h,g,p,v=arguments;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d=(u=(0,r.ZQ)(n,2))[0],h=u[1],g=v.length>3&&void 0!==v[3]?v[3]:{},this._error=!1,this.filesize=0,this.logger.debug("[loadMetaProcess start], range,",[d,h]),null!==(a=this._config)&&void 0!==a&&a.memoryOpt&&(!this.buffer||null!=g&&g.isExp))try{this.newBufferArray(h-d+1,null==g?void 0:g.isExp)}catch(e){i(null,!0,{},new l.c(null==e?void 0:e.message),{})}return p=function(){var e=(0,r.x)((0,r.l5)().mark(function e(n,a,u,p){var v,y,m,b,C,x,I,_,A,k,L,w,S,T,P,O,B,D,R,Z;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.filesize&&null!=p&&p.headers&&(m=null===(v=(y=p.headers).get)||void 0===v?void 0:v.call(y,"content-range"))&&Array.isArray(b=m.split("/"))&&2===b.length&&(o.filesize=parseInt(b[1]),o.filesize>0&&h>o.filesize&&(h=o.filesize,o.logger.debug("[loadMetaProcess] moovEnd changed by content-range in header, [".concat(d,"-").concat(h,"]")))),!a&&o.meta&&null!=u&&u.range&&u.range.length>0&&u.range[1]>=h&&(a=!0,o.logger.debug("[loadMetaProcess],data done,setstate true,[",d,h,"]")),a&&null!=u&&u.range&&u.range.length>0&&u.range[1]<h&&(a=!1,o.logger.debug("[loadMetaProcess],data not done,setstate false,[",d,h,"]")),o.logger.debug("[loadMetaProcess],task,[",d,h,"], range,",u.range,",dataLen,",n?n.byteLength:void 0,", state,",a,",err,",o._error),!o._error&&n&&n.byteLength>0&&i(n,a,u,null,p),!(o.meta.moov||o._error)){e.next=7;break}return e.abrupt("return");case 7:if(!(n&&n.byteLength>0)){e.next=60;break}e.prev=8,null!==(x=o._config)&&void 0!==x&&x.memoryOpt?(o.buffer.set(n,o.bufferDataLen),o.bufferDataLen+=(null==n?void 0:n.byteLength)||0,C=o.buffer.subarray(0,o.bufferDataLen)):(o.buffer=(0,s.gJ)(o.buffer,n),C=o.buffer),e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(8),i(null,a,u,new l.c(null===e.t0||void 0===e.t0?void 0:e.t0.message),p),e.abrupt("return");case 16:if(I=c.I.findBox(C,["moov"])[0]){e.next=31;break}if(_=c.I.findBox(C,["mdat"])[0],!a){e.next=31;break}if(_){e.next=26;break}return o._error=!0,i(null,a,u,new l.c("cannot find moov or mdat box"),p),e.abrupt("return");case 26:return A=_.start+_.size,e.next=29,o.loadData([A,""],t,g);case 29:(k=e.sent)&&(I=c.I.findBox(k.data,["moov"])[0]);case 31:if(!(I&&a&&I.size>I.data.length)){e.next=35;break}return o.logger.debug("[loadMetaProcess],moov not all, range,",u.range[1],",dataLen,",o.bufferDataLen,", state,",a),e.next=35,o.loadMetaProcess(t,[u.range[1],I.start+I.size-1],i,{isExp:!0});case 35:if(!(I&&I.size<=I.data.length&&!o.meta.moov)){e.next=60;break}if(w=c.I.moov(I)){e.next=41;break}return o._error=!0,i(null,a,u,new l.c("cannot parse moov box"),p),e.abrupt("return");case 41:if(S=(0,f._H)(w,o._config),T=function(){var e=(0,r.x)((0,r.l5)().mark(function e(n){var i,a;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=c.I.findBox(o.buffer,[n])[0])){e.next=11;break}if(!(i.size>i.data.length)){e.next=10;break}return e.next=5,o.loadData([i.start,i.start+i.size-1],t,g);case 5:if(!(a=e.sent)){e.next=8;break}return e.abrupt("return",c.I.findBox(a.data,[n])[0]);case 8:e.next=11;break;case 10:return e.abrupt("return",i);case 11:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),P=!1,(0,f.d0)(S)){e.next=49;break}return e.next=47,T("sidx");case 47:(O=e.sent)&&(B=c.I.sidx(O))&&(S=(0,f.mt)(w,B),P=!0);case 49:if((0,f.d0)(S)){e.next=53;break}return o._error=!0,i(null,a,u,new l.c("cannot parse segments"),p),e.abrupt("return");case 53:o.meta=(0,f.$Z)(w,P),R=(D=S).videoSegments,Z=D.audioSegments,o.videoSegments=R,o.audioSegments=Z,null!==(L=o._config)&&void 0!==L&&L.memoryOpt&&(delete o.buffer,o.bufferDataLen=0),o.logger.debug("[loadMetaProcess] moov ok"),i(void 0,a,{meta:{meta:o.meta,videoSegments:R,audioSegments:Z}},null,p);case 60:case"end":return e.stop()}},e,null,[[8,12]])}));return function(t,n,r,i){return e.apply(this,arguments)}}(),e.next=9,this.loadData([d,h||this._config.moovEnd],t,(0,r.Zj)({onProgress:p},g));case 9:case"end":return e.stop()}},e,this)})),function(e,t,n){return h.apply(this,arguments)})},{key:"loadMeta",value:(g=(0,r.x)((0,r.l5)().mark(function e(t,n){var i=this,a,o,u,d,h,g,p,v,y,m,b,C,x,I,_,A=arguments;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=A.length>2&&void 0!==A[2]?A[2]:{},o=[],this.logger.debug("[loadMeta start]"),e.next=5,this.loadData([0,n||this._config.moovEnd],t,a);case 5:if(u=e.sent){e.next=8;break}return e.abrupt("return");case 8:if(o.push(u),d=c.I.findBox(u.data,["moov"])[0]){e.next=24;break}if(h=c.I.findBox(u.data,["mdat"])[0]){e.next=14;break}throw new l.c("cannot find moov or mdat box",u.data);case 14:return g=h.start+h.size,e.next=17,this.loadData([g],t,a);case 17:if(u=e.sent){e.next=20;break}return e.abrupt("return");case 20:if(o.push(u),d=c.I.findBox(u.data,["moov"],g)[0]){e.next=24;break}throw new l.c("cannot find moov box",u.data);case 24:if(!(d.size>d.data.length)){e.next=32;break}return e.next=27,this.loadData([u.data.length,d.start+d.size-1],t,a);case 27:if(u=e.sent){e.next=30;break}return e.abrupt("return");case 30:o.push(u),d.data=(0,s.gJ)(d.data,u.data);case 32:if(p=c.I.moov(d)){e.next=35;break}throw new l.c("cannot parse moov box",d.data);case 35:if(v=(0,f._H)(p,this._config),(0,f.d0)(v)){e.next=42;break}return b=function(){var e=(0,r.x)((0,r.l5)().mark(function e(n,s){var u,l;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=c.I.findBox(n,[s])[0]){e.next=3;break}return e.abrupt("return");case 3:if(!(u.size>u.data.length)){e.next=10;break}return e.next=6,i.loadData([u.start,u.start+u.size-1],t,a);case 6:if(!(l=e.sent)){e.next=10;break}return o.push(l),e.abrupt("return",c.I.findBox(l.data,[s],u.start)[0]);case 10:return e.abrupt("return",u);case 11:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),e.next=40,b(null===(m=o[0])||void 0===m?void 0:m.data,"sidx");case 40:(C=e.sent)&&(y=c.I.sidx(C))&&(v=(0,f.mt)(p,y));case 42:if((0,f.d0)(v)){e.next=44;break}throw new l.c("cannot parse segments",d.data);case 44:return this.meta=(0,f.$Z)(p,!!y),I=(x=v).videoSegments,_=x.audioSegments,this.videoSegments=I,this.audioSegments=_,delete this.buffer,this.bufferDataLen=0,this.logger.debug("[load moov end!!!!!]"),e.abrupt("return",{meta:this.meta,videoSegments:I,audioSegments:_,responses:o});case 52:case"end":return e.stop()}},e,this)})),function(e,t){return g.apply(this,arguments)})},{key:"loadCacheMeta",value:function(e,t){var n=e.moov,r=(0,f._H)(n,this._config),i=r.videoSegments,a=r.audioSegments;this.videoSegments=i,this.audioSegments=a,this._currentSegmentIndex=t,this.meta=e}},{key:"getSegmentByTime",value:function(e){var t,n;return this.videoSegments.length?(t=this.videoSegments.find(function(t){return t.startTime<=e&&t.endTime>e}))&&(n=this.audioSegments[t.index]):n=this.audioSegments.find(function(t){return t.startTime<=e&&t.endTime>e}),{video:t,audio:n}}},{key:"loadSegmentByTime",value:(v=(0,r.x)((0,r.l5)().mark(function e(t,n){var i,a,o,s,c,u=arguments;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=!(u.length>2)||void 0===u[2]||u[2],a=u.length>3&&void 0!==u[3]?u[3]:{},this.isMetaLoaded){e.next=5;break}return e.next=5,this.loadMeta(n);case 5:return s=(o=this.getSegmentByTime(t)).video,c=o.audio,e.abrupt("return",this._loadSegment(s,c,n,i,a));case 7:case"end":return e.stop()}},e,this)})),function(e,t){return v.apply(this,arguments)})},{key:"loadNextSegment",value:(y=(0,r.x)((0,r.l5)().mark(function e(t){var n,i,a,o,s=arguments;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(s.length>1)||void 0===s[1]||s[1],i=s.length>2&&void 0!==s[2]?s[2]:{},this.isMetaLoaded){e.next=5;break}return e.next=5,this.loadMeta();case 5:return a=this.videoSegments[this._currentSegmentIndex+1],o=this.audioSegments[this._currentSegmentIndex+1],e.abrupt("return",this._loadSegment(a,o,t,n,i));case 8:case"end":return e.stop()}},e,this)})),function(e){return y.apply(this,arguments)})},{key:"preload",value:(m=(0,r.x)((0,r.l5)().mark(function e(t){var n,i,a,o,s,c,u,l=this;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMetaLoaded){e.next=3;break}return e.next=3,this.loadMeta(!0);case 3:if(!(!t||t<0)){e.next=5;break}return e.abrupt("return");case 5:if(i=(n=this.getSegmentByTime(t)).video,a=n.audio,o=Math.max((null==i?void 0:i.index)||0,(null==a?void 0:a.index)||0)){e.next=9;break}return e.abrupt("return");case 9:return s=this.videoSegments.slice(0,o),c=this.audioSegments.slice(0,o),u=function(){var e=(0,r.x)((0,r.l5)().mark(function e(t){return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>o)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,l._loadSegment(s[t],c[t],!0,!1);case 4:return e.next=6,u(t+1);case 6:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),e.next=14,u(0);case 14:case"end":return e.stop()}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"cancel",value:function(){return this._loader.cancel()}},{key:"reset",value:(b=(0,r.x)((0,r.l5)().mark(function e(){var t,n=arguments;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n.length>0&&void 0!==n[0]&&n[0]){e.next=5;break}return this.logger.debug("[MP4loader reset func call loader.cancel]"),e.next=5,this._loader.cancel();case 5:this.vid=this.url="",this.meta={},this.downloadInfo=[],this.videoSegments=[],this.audioSegments=[],this._currentSegmentIndex=-1,this._currentLoadingSegmentIndex=-1,null!==(t=this._config)&&void 0!==t&&t.memoryOpt&&(delete this.buffer,this.bufferDataLen=0);case 13:case"end":return e.stop()}},e,this)})),function(){return b.apply(this,arguments)})},{key:"destroy",value:(C=(0,r.x)((0,r.l5)().mark(function e(){return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.reset();case 2:this.cache.clear();case 3:case"end":return e.stop()}},e,this)})),function(){return C.apply(this,arguments)})},{key:"_loadSegment",value:(x=(0,r.x)((0,r.l5)().mark(function e(t,n,i,a,o){var s,c;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!t&&!n)){e.next=2;break}return e.abrupt("return");case 2:return s=(null==t?void 0:t.index)||(null==n?void 0:n.index)||0,this._currentLoadingSegmentIndex=s,e.prev=4,e.next=7,this.loadData([Math.min((null==t?void 0:t.range[0])||1/0,(null==n?void 0:n.range[0])||1/0),Math.max((null==t?void 0:t.range[1])||0,(null==n?void 0:n.range[1])||0)],i,o);case 7:c=e.sent;case 8:return e.prev=8,this._currentLoadingSegmentIndex=-1,e.finish(8);case 11:if(c){e.next=13;break}return e.abrupt("return");case 13:return a&&(this._currentSegmentIndex=s),c.video=t,c.audio=n,e.abrupt("return",c);case 17:case"end":return e.stop()}},e,this,[[4,,8,11]])})),function(e,t,n,r,i){return x.apply(this,arguments)})},{key:"loadData",value:(I=(0,r.x)((0,r.l5)().mark(function e(t,n){var i,a,o,s,c,u=arguments;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=u.length>2&&void 0!==u[2]?u[2]:{},a=this._getCacheKey(t),e.next=4,this.cache.get(a);case 4:if(o=e.sent){e.next=12;break}return c=null!=i&&i.url?i.url:this.url,e.next=9,this._loader.load(c,(0,r.Zj)({range:t,vid:this.vid},i));case 9:s=e.sent,e.next=13;break;case 12:s={data:o,state:!0,options:{fromCache:!0,range:t,vid:this.vid}};case 13:if(s){e.next=15;break}return e.abrupt("return");case 15:return!o&&(s.data&&this.downloadInfo.push({startTime:s.startTime,endTime:s.endTime,size:s.data.byteLength,range:t}),this.downloadInfo&&this.downloadInfo.length>this._config.maxDownloadInfoSize&&(this.downloadInfo=this.downloadInfo.slice(-this._config.maxDownloadInfoSize))),e.abrupt("return",s);case 18:case"end":return e.stop()}},e,this)})),function(e,t){return I.apply(this,arguments)})},{key:"_getCacheKey",value:function(e){return(this.vid||this.url)+":"+e}}]),A}(g())},210359:function(e,t,n){n.d(t,{j:function(){return l}});var r=n(182432),i=n(801700),a=n(587220),o=n(275764),s=n(654175),c=n(942155),u=n.n(c),l=function(e){(0,r.XW)(c,e);var t,n=(0,r.WY)(c);function c(){var e;return(0,r.PA)(this,c),e=n.call(this),(0,r._x)((0,r.Lc)(e),"_abortController",null),(0,r._x)((0,r.Lc)(e),"_timeoutTimer",null),(0,r._x)((0,r.Lc)(e),"_reader",null),(0,r._x)((0,r.Lc)(e),"_response",null),(0,r._x)((0,r.Lc)(e),"_aborted",!1),(0,r._x)((0,r.Lc)(e),"_index",-1),(0,r._x)((0,r.Lc)(e),"_range",null),(0,r._x)((0,r.Lc)(e),"_receivedLength",0),(0,r._x)((0,r.Lc)(e),"_running",!1),(0,r._x)((0,r.Lc)(e),"_logger",null),(0,r._x)((0,r.Lc)(e),"_vid",""),(0,r._x)((0,r.Lc)(e),"_onProcessMinLen",0),(0,r._x)((0,r.Lc)(e),"_onCancel",null),(0,r._x)((0,r.Lc)(e),"_priOptions",null),e}return(0,r.qH)(c,[{key:"load",value:function(e){var t,n=this,c=e.url,u=e.vid,l=e.timeout,d=e.responseType,f=e.onProgress,h=e.index,g=e.onTimeout,p=e.onCancel,v=e.range,y=e.transformResponse,m=e.request,b=e.params,C=e.logger,x=e.method,I=e.headers,_=e.body,A=e.mode,k=e.credentials,L=e.cache,w=e.redirect,S=e.referrer,T=e.referrerPolicy,P=e.onProcessMinLen,O=e.priOptions;this._logger=C,this._aborted=!1,this._onProcessMinLen=P,this._onCancel=p,this._abortController="undefined"!=typeof AbortController&&new AbortController,this._running=!0,this._index=h,this._range=v||[0,0],this._vid=u||c,this._priOptions=O||{};var B={method:x,headers:I,body:_,mode:A,credentials:k,cache:L,redirect:w,referrer:S,referrerPolicy:T,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},D=!1;clearTimeout(this._timeoutTimer),c=(0,a.G7)(c,b);var R=(0,a.Gu)(v);R&&(I=m?m.headers:B.headers=B.headers||(Headers?new Headers:{}),Headers&&I instanceof Headers?I.append("Range",R):I.Range=R),l&&(this._timeoutTimer=setTimeout(function(){if(D=!0,n.cancel(),g){var e=new i.C(c,B,null,"timeout");e.isTimeout=!0,g(e,{index:n._index,range:n._range,vid:n._vid,priOptions:n._priOptions})}},l));var Z=Date.now();return this._logger.debug("[fetch load start], index,",h,",range,",v),new Promise(function(e,t){var u;fetch(m||c,m?void 0:B).then((u=(0,r.x)((0,r.l5)().mark(function u(l){var g,p,m,b;return(0,r.l5)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(clearTimeout(n._timeoutTimer),n._response=l,!(n._aborted||!n._running)){r.next=4;break}return r.abrupt("return");case 4:if(y&&(l=y(l,c)||l),l.ok){r.next=7;break}throw new i.C(c,B,l,"bad network response");case 7:if(g=Date.now(),d!==o.U.TEXT){r.next=15;break}return r.next=11,l.text();case 11:case 18:p=r.sent,n._running=!1,r.next=37;break;case 15:if(d!==o.U.JSON){r.next=22;break}return r.next=18,l.json();case 22:if(!f){r.next=29;break}return n.resolve=e,n.reject=t,n._loadChunk(l,f,Z,g),r.abrupt("return");case 29:return r.next=31,l.arrayBuffer();case 31:p=new Uint8Array(p=r.sent),n._running=!1,m=Date.now()-Z,b=(0,a.pl)(p.byteLength,m),n.emit(s.K.REAL_TIME_SPEED,{speed:b,len:p.byteLength,time:m,vid:n._vid,index:n._index,range:n._range,priOptions:n._priOptions});case 37:n._logger.debug("[fetch load end], index,",h,",range,",v),e((0,a.rO)(p,!0,l,l.headers.get("Content-Length"),l.headers.get("age"),Z,g,h,v,n._vid,n._priOptions));case 39:case"end":return r.stop()}},u)})),function(e){return u.apply(this,arguments)})).catch(function(e){var r;clearTimeout(n._timeoutTimer),n._running=!1,(!n._aborted||D)&&((e=e instanceof i.C?e:new i.C(c,B,null,null===(r=e)||void 0===r?void 0:r.message)).startTime=Z,e.endTime=Date.now(),e.isTimeout=D,e.options={index:n._index,range:n._range,vid:n._vid,priOptions:n._priOptions},t(e))})})}},{key:"cancel",value:(t=(0,r.x)((0,r.l5)().mark(function e(){return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._aborted){e.next=2;break}return e.abrupt("return");case 2:if(this._aborted=!0,this._running=!1,!this._response){e.next=14;break}if(e.prev=5,!this._reader){e.next=9;break}return e.next=9,this._reader.cancel();case 9:e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:this._response=this._reader=null;case 14:if(this._abortController){try{this._abortController.abort()}catch(e){}this._abortController=null}this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions});case 16:case"end":return e.stop()}},e,this,[[5,11]])})),function(){return t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t,n,o){var c,u,l,d,f=this;if(!e.body||!e.body.getReader){this._running=!1;var h=new i.C(e.url,"",e,"onProgress of bad response.body.getReader");h.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this.reject(h);return}this._onProcessMinLen>0&&(this._cache=new Uint8Array(2097152),this._writeIdx=0);var g=this._reader=e.body.getReader();var p=(c=(0,r.x)((0,r.l5)().mark(function i(){var c,h,v,y,m,b,C,x;return(0,r.l5)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return l=Date.now(),r.prev=1,r.next=4,g.read();case 4:u=r.sent,d=Date.now(),r.next=13;break;case 8:return r.prev=8,r.t0=r.catch(1),d=Date.now(),!f._aborted&&(f._running=!1,r.t0.options={index:f._index,range:f._range,vid:f._vid,priOptions:f._priOptions},f.reject(r.t0)),r.abrupt("return");case 13:if(v=(h=(null===(c=f._range)||void 0===c?void 0:c.length)>0?f._range[0]:0)+f._receivedLength,!f._aborted){r.next=19;break}return f._running=!1,t(void 0,!1,{range:[v,v],vid:f._vid,index:f._index,startTime:l,endTime:d,st:n,firstByteTime:o,priOptions:f._priOptions},e),r.abrupt("return");case 19:y=u.value?u.value.byteLength:0,f._receivedLength+=y,f._logger.debug("【fetchLoader,onProgress call】,task,",f._range,", start,",v,", end,",h+f._receivedLength,", done,",u.done),f._onProcessMinLen>0?f._writeIdx+y>=f._onProcessMinLen||u.done?((m=new Uint8Array(f._writeIdx+y)).set(f._cache.slice(0,f._writeIdx),0),y>0&&m.set(u.value,f._writeIdx),f._writeIdx=0,f._logger.debug("【fetchLoader,onProgress enough】,done,",u.done,",len,",m.byteLength,", writeIdx,",f._writeIdx)):y>0&&f._writeIdx+y<2097152?(f._cache.set(u.value,f._writeIdx),f._writeIdx+=y,f._logger.debug("【fetchLoader,onProgress cache】,len,",y,", writeIdx,",f._writeIdx)):y>0&&(b=new Uint8Array(f._writeIdx+y+2048),f._logger.debug("【fetchLoader,onProgress extra start】,size,",f._writeIdx+y+2048,", datalen,",y,", writeIdx,",f._writeIdx),b.set(f._cache.slice(0,f._writeIdx),0),y>0&&b.set(u.value,f._writeIdx),f._writeIdx+=y,delete f._cache,f._cache=b,f._logger.debug("【fetchLoader,onProgress extra end】,len,",y,", writeIdx,",f._writeIdx)):m=u.value,(m&&m.byteLength>0||u.done)&&t(m,u.done,{range:[f._range[0]+f._receivedLength-(m?m.byteLength:0),f._range[0]+f._receivedLength],vid:f._vid,index:f._index,startTime:l,endTime:d,st:n,firstByteTime:o,priOptions:f._priOptions},e),u.done?(C=Date.now()-n,x=(0,a.pl)(f._receivedLength,C),f.emit(s.K.REAL_TIME_SPEED,{speed:x,len:f._receivedLength,time:C,vid:f._vid,index:f._index,range:f._range,priOptions:f._priOptions}),f._running=!1,f._logger.debug("[fetchLoader onProgress end],task,",f._range,",done,",u.done),f.resolve((0,a.rO)(u,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),n,o,f._index,f._range,f._vid,f._priOptions))):p();case 25:case"end":return r.stop()}},i,null,[[1,8]])})),function(){return c.apply(this,arguments)});p()}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}}],[{key:"isSupported",value:function(){return"undefined"!=typeof fetch}}]),c}(u())},55743:function(e,t,n){n.d(t,{mf:function(){return f}});var r=n(182432),i=n(210359),a=n(275764),o=n(976290),s=n(656775),c=n(815839),u=n(234086),l=n(654175),d=n(942155),f=function(e){(0,r.XW)(d,e);var t,n=(0,r.WY)(d);function d(e){var t;return(0,r.PA)(this,d),t=n.call(this,e),(0,r._x)((0,r.Lc)(t),"type",a.t.FETCH),(0,r._x)((0,r.Lc)(t),"_queue",[]),(0,r._x)((0,r.Lc)(t),"_alive",[]),(0,r._x)((0,r.Lc)(t),"_currentTask",null),(0,r._x)((0,r.Lc)(t),"_finnalUrl",""),(0,r._x)((0,r.Lc)(t),"_config",void 0),t._config=(0,o.i)(e),(t._config.loaderType===a.t.XHR||!i.j.isSupported())&&(t.type=a.t.XHR),t.log=e.logger,t}return(0,r.qH)(d,[{key:"isFetch",value:function(){return this.type===a.t.FETCH}},{key:"load",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?n=e:n.url=e||n.url||this._config.url,(n=Object.assign({},this._config,n)).params&&(n.params=Object.assign({},n.params)),n.headers&&(0,c.PO)(n.headers)&&(n.headers=Object.assign({},n.headers)),n.body&&(0,c.PO)(n.body)&&(n.body=Object.assign({},n.body)),n.transformRequest&&(n=n.transformRequest(n)||n),n.logger=this.log;var r=new s.i(this.type,n);return r.loader.on(l.K.REAL_TIME_SPEED,function(e){t.emit(l.K.REAL_TIME_SPEED,e)}),this._queue.push(r),1===this._queue.length&&(!this._currentTask||!this._currentTask.running)&&this._processTask(),r.promise}},{key:"cancel",value:(t=(0,r.x)((0,r.l5)().mark(function e(){var t;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._queue.map(function(e){return e.cancel()}).concat(this._alive.map(function(e){return e.cancel()})),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,Promise.all(t);case 6:return e.next=8,(0,u._v)();case 8:case"end":return e.stop()}},e,this)})),function(){return t.apply(this,arguments)})},{key:"_processTask",value:function(){var e=this;if(this._currentTask=this._queue.shift(),!!this._currentTask){this._currentTask.alive&&this._alive.push(this._currentTask);var t=this._currentTask.exec().catch(function(e){});t&&"function"==typeof t.finally&&t.finally(function(){var t,n;null!==(t=e._currentTask)&&void 0!==t&&t.alive&&(null===(n=e._alive)||void 0===n?void 0:n.length)>0&&(e._alive=e._alive.filter(function(t){return t&&t!==e._currentTask})),e._processTask()})}}}],[{key:"isFetchSupport",value:function(){return i.j.isSupported()}}]),d}(n.n(d)())},70427:function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(){a=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,i){var a=Object.create((t&&t.prototype instanceof h?t:h).prototype);return r(a,"_invoke",{value:function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return L()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=function e(t,n){var r=n.method,i=t.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=void 0,e(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=TypeError("The iterator does not provide a '"+r+"' method")),f;var a=d(i,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,f;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,f):o:(n.method="throw",n.arg=TypeError("iterator result is not an object"),n.delegate=null,f)}(o,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=d(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,new A(i||[]))}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f={};function h(){}function g(){}function p(){}var v={};u(v,o,function(){return this});var y=Object.getPrototypeOf,m=y&&y(y(k([])));m&&m!==t&&n.call(m,o)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function C(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function x(e,t){var i;r(this,"_invoke",{value:function(r,a){function o(){return new t(function(i,o){!function r(i,a,o,s){var c=d(e[i],e,a);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then(function(e){r("next",e,o,s)},function(e){r("throw",e,o,s)}):t.resolve(l).then(function(e){u.value=e,o(u)},function(e){return r("throw",e,o,s)})}s(c.arg)}(r,a,i,o)})}return i=i?i.then(o,o):o()}})}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function k(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:L}}function L(){return{value:void 0,done:!0}}return g.prototype=p,r(b,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:g,configurable:!0}),g.displayName=u(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,u(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},C(x.prototype),u(x.prototype,s,function(){return this}),e.AsyncIterator=x,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new x(l(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then(function(e){return e.done?e.value:o.next()})},C(b),u(b,c,"Generator"),u(b,o,function(){return this}),u(b,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=k,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}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})(e)}function s(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){s(a,r,i,o,c,"next",e)}function c(e){s(a,r,i,o,c,"throw",e)}o(void 0)})}}function u(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function l(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,k(r.key),r)}}function d(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t,n){return(t=k(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function v(){if("undefined"==typeof Reflect||!Reflect.construct||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 y(e,t,n){return(y=v()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&p(i,n.prototype),i}).apply(null,arguments)}n.d(t,{Ac:function(){return o},IP:function(){return g},Kd:function(){return b},Lc:function(){return C},PA:function(){return u},U2:function(){return I},WY:function(){return x},XW:function(){return h},Zj:function(){return i},_x:function(){return f},l5:function(){return a},qH:function(){return d},sf:function(){return A},wm:function(){return m},x:function(){return c}});function m(e){var t="function"==typeof Map?new Map:void 0;return(m=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return y(e,arguments,g(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,e)})(e)}function b(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++){if(n=a[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}}return i}function C(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e){var t=v();return function(){var n,r=g(e);return n=t?Reflect.construct(r,arguments,g(this).constructor):r.apply(this,arguments),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return C(e)}(this,n)}}function I(){return(I="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=g(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}}).apply(this,arguments)}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function A(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{!o&&null!=n.return&&n.return()}finally{if(s)throw a}}}}function k(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}},908483:function(e,t,n){n.d(t,{j:function(){return r}});var r="undefined"!=typeof window},604165:function(e,t,n){n.d(t,{i:function(){return a}});var r=n(70427),i=n(265614);function a(e){return(0,r.Zj)({loaderType:i.t.FETCH,retry:0,retryDelay:0,timeout:0,request:null,onTimeout:void 0,onProgress:void 0,onRetryError:void 0,transformRequest:void 0,transformResponse:void 0,transformError:void 0,responseType:i.U.TEXT,range:void 0,url:"",params:void 0,method:"GET",headers:{},body:void 0,mode:void 0,credentials:void 0,cache:void 0,redirect:void 0,referrer:void 0,referrerPolicy:void 0,integrity:void 0,onProcessMinLen:0},e)}},699694:function(e,t,n){function r(){var e,t,n=new Promise(function(n,r){e=n,t=r});return n.used=!1,n.resolve=function(){return n.used=!0,e.apply(void 0,arguments)},n.reject=function(){return n.used=!0,t.apply(void 0,arguments)},n}function i(){try{return parseInt(performance.now(),10)}catch(e){return new Date().getTime()}}n.d(t,{Kp:function(){return a},Qo:function(){return r},je:function(){return i}});var a={stringify:function(e){try{return JSON.stringify(e)}catch(e){return""}},parse:function(e){try{return JSON.parse(e)}catch(e){return}}}},991372:function(e,t,n){n.d(t,{C:function(){return a}});var r=n(570783),i=n(65661),a=function(e){(0,r.XW)(n,e);var t=(0,r.WY)(n);function n(e,a,o,s){var c;return(0,r.PA)(this,n),c=t.call(this,s),(0,r._x)((0,r.Lc)(c),"retryCount",0),(0,r._x)((0,r.Lc)(c),"isTimeout",!1),(0,r._x)((0,r.Lc)(c),"loaderType",i.t.FETCH),(0,r._x)((0,r.Lc)(c),"startTime",0),(0,r._x)((0,r.Lc)(c),"endTime",0),(0,r._x)((0,r.Lc)(c),"options",{}),c.url=e,c.request=a,c.response=o,c}return(0,r.qH)(n)}((0,r.wm)(Error))},461449:function(e,t,n){n.d(t,{NI:function(){return h},YW:function(){return g},mA:function(){return f}});var r=n(697946),i=n(828792),a=n(745740),o=[],s=Object.create(null),c=Object.create(null),u=Object.create(null),l=[];function d(e){return(e||[]).filter(Boolean)}var f=new(function(){function e(){(0,r.PA)(this,e)}return(0,r.qH)(e,[{key:"register",value:function(e){if(!e||!e.id)throw Error("video codec id is required");var t,n=o.find(function(t){return t.id===e.id});return n&&this.unregister(n.id),o.push(e),d((t=e).sampleEntries).forEach(function(e){s[e]=t}),d(t.configBoxes).forEach(function(e){c[e]=t}),d(t.codecStringPrefixes).forEach(function(e){l.push({prefix:e,codec:t})}),t.codecType&&!u[t.codecType]&&(u[t.codecType]=t),e}},{key:"unregister",value:function(e){var t=o.findIndex(function(t){return t.id===e});if(!(t<0)){var n=o.splice(t,1),i=(0,r.ZQ)(n,1)[0];return!function(e){d(e.sampleEntries).forEach(function(t){s[t]===e&&delete s[t]}),d(e.configBoxes).forEach(function(t){c[t]===e&&delete c[t]}),e.codecType&&u[e.codecType]===e&&delete u[e.codecType];for(var t=l.length-1;t>=0;t--)l[t].codec===e&&l.splice(t,1)}(i),i}}},{key:"getBySampleEntry",value:function(e){return s[e]}},{key:"getByConfigBox",value:function(e){return c[e]}},{key:"getByCodecType",value:function(e){return u[e]}},{key:"getByCodecString",value:function(e){var t;if(e)return null===(t=l.find(function(t){return 0===e.indexOf(t.prefix)}))||void 0===t?void 0:t.codec}},{key:"getByTrack",value:function(e){if(e){var t=e.vvccSampleEntryType;if(t&&this.getBySampleEntry(t))return this.getBySampleEntry(t);var n=this.getByCodecString(e.codec);return n?n:this.getByCodecType(e.codecType)}}},{key:"list",value:function(){return o.slice()}}]),e}());function h(e){return f.register(e)}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.track?f.getByTrack(e.track):e.sampleEntry?f.getBySampleEntry(e.sampleEntry):e.configBox?f.getByConfigBox(e.configBox):e.codecType?f.getByCodecType(e.codecType):e.codec?f.getByCodecString(e.codec):void 0}h({id:"vvc",kind:"video",codecType:a._e.VVCC,sampleEntries:["vvc1","vvi1"],configBoxes:["vvcC"],codecStringPrefixes:["vvc1.","vvi1."],trackConfigKey:"vvcC",sampleEntryTrackKey:"vvccSampleEntryType",parseConfigBox:function(e){var t=e.data;e.box;var n=e.sampleEntryType;return i.i.parseVVCDecoderConfigurationRecord(t,n||"vvc1")},applyTrackConfig:function(e){var t,n,r,i,o,s,c;i=(t=e).track,o=t.entry,s=t.config,c=t.defaultSampleEntryType,i.codecType=a._e.VVCC,i.codec=s.codec,i.sps=s.sps,i.pps=s.pps,i.vps=s.vps,i.vvcC=s.data,s.nalUnitSize&&(i.nalUnitSize=s.nalUnitSize),i.vvccSampleEntryType="encv"===o.type?(null===(n=o.sinf)||void 0===n?void 0:null===(r=n.frma)||void 0===r?void 0:r.data_format)||s.sampleEntryType||(void 0===c?"vvc1":c):o.type},getSampleEntryType:function(e){return e.track.vvccSampleEntryType||"vvc1"},getConfigBoxType:function(e){return e.track,"vvcC"},buildConfigBox:function(e){var t,n,r,i,a=e.track;return n=(t={track:a,MP4:e.MP4,configBoxType:this.getConfigBoxType({track:a})}).track,r=t.MP4,i=t.configBoxType,r.box(r.type(void 0===i?"vvcC":i),new Uint8Array(n.vvcC))},buildFtyp:function(e){return e.track,e.MP4.FTYPVVC1},markSample:function(e){var t,n;t=e.sample,!(n=i.i.getNalInfo(t.units))||(t.sideData=(0,r.Zj)((0,r.Zj)({},t.sideData||{}),{},{vvcNalInfo:n}))}})},279781:function(e,t,n){n.d(t,{_:function(){return i}});var r=n(697946),i=function(){function e(t,n,i){(0,r.PA)(this,e),(0,r._x)(this,"flag",{}),(0,r._x)(this,"keyframe",!1),(0,r._x)(this,"gopId",0),(0,r._x)(this,"duration",0),(0,r._x)(this,"size",0),(0,r._x)(this,"units",[]),(0,r._x)(this,"chromaFormat",420),(0,r._x)(this,"sideData",null),this.originPts=this.pts=t,this.originDts=this.dts=n,i&&(this.units=i)}return(0,r.qH)(e,[{key:"cts",get:function(){return this.pts-this.dts}},{key:"setToKeyframe",value:function(){this.keyframe=!0,this.flag.dependsOn=2,this.flag.isNonSyncSample=0}}]),e}()},853906:function(e,t,n){n.d(t,{q:function(){return a}});var r=n(519357),i=n(258413),a=function(){function e(){(0,r.PA)(this,e),(0,r._x)(this,"id",1),(0,r._x)(this,"type",i.Vc.VIDEO),(0,r._x)(this,"codecType",i._e.AVC),(0,r._x)(this,"pid",-1),(0,r._x)(this,"hvcC",void 0),(0,r._x)(this,"codec",""),(0,r._x)(this,"timescale",0),(0,r._x)(this,"formatTimescale",0),(0,r._x)(this,"sequenceNumber",0),(0,r._x)(this,"baseMediaDecodeTime",0),(0,r._x)(this,"baseDts",0),(0,r._x)(this,"duration",0),(0,r._x)(this,"warnings",[]),(0,r._x)(this,"samples",[]),(0,r._x)(this,"pps",[]),(0,r._x)(this,"sps",[]),(0,r._x)(this,"vps",[]),(0,r._x)(this,"fpsNum",0),(0,r._x)(this,"fpsDen",0),(0,r._x)(this,"sarRatio",[]),(0,r._x)(this,"width",0),(0,r._x)(this,"height",0),(0,r._x)(this,"nalUnitSize",4),(0,r._x)(this,"present",!1),(0,r._x)(this,"isVideoEncryption",!1),(0,r._x)(this,"isAudioEncryption",!1),(0,r._x)(this,"isVideo",!0),(0,r._x)(this,"kid",null),(0,r._x)(this,"pssh",null),(0,r._x)(this,"ext",void 0)}return(0,r.qH)(e,[{key:"reset",value:function(){this.sequenceNumber=this.width=this.height=this.fpsDen=this.fpsNum=this.duration=this.baseMediaDecodeTime=this.timescale=0,this.codec="",this.present=!1,this.pid=-1,this.pps=[],this.sps=[],this.vps=[],this.sarRatio=[],this.samples=[],this.warnings=[],this.hvcC=null}},{key:"exist",value:function(){return!!(this.pps.length&&this.sps.length&&this.codec)}},{key:"hasSample",value:function(){return!!this.samples.length}},{key:"isEncryption",get:function(){return this.isVideoEncryption}}]),e}()}}]);